Logitech C260 UVC in ZoneMinder - Almost Works, Need Help

Post here to ask any questions about hardware suitability, configuration in ZoneMinder, or experiences. If you just want to know if something works with ZoneMinder or not, please check the Hardware Compatibility sections in the forum, and the Wiki first. Also search this topic as well.
Post Reply
brycenesbitt
Posts: 10
Joined: Sat May 07, 2011 11:10 pm

Logitech C260 UVC in ZoneMinder - Almost Works, Need Help

Post by brycenesbitt »

For this camera guvcview works perfectly. xawtv comes up immediately showing video. The device shows as supported over at the UVC support page at "ideasonboard".

With ZoneMinder I get a red device name and (at best) a black video square.

I'm running Ubuntu 10.04 LTS, set up via the Ubuntu page on the ZoneMinder wiki. Some basic info is:

Code: Select all

# lsusb -v
 Device ID:
 Bus 001 Device 004: ID 046d:081a Logitech, Inc. (C260 - USB Video Class)
 bDeviceClass          239 Miscellaneous Device
 bFunctionClass         14 Video

 # lsmod | grep uvc
 uvcvideo               57310  0 
 videodev               34361  1 uvcvideo
 v4l1 compat            13251  2 uvcvideo , videodev

# zmu -v -q
Error, failed to query crop /dev/video0: Invalid argument

# zmu -v -q -V1
Video Device: /dev/video0
Video Capabilities
  Name: UVC Camera (046d:081a)
  Type: 1
    Can capture
  Video Channels: 1
  Audio Channels: 0
  Maximum Width: 1280
  Maximum Height: 960
  Minimum Width: 48
  Minimum Height: 32
Window Attributes
  X Offset: 0
  Y Offset: 0
  Width: 352
  Height: 288
Picture Attributes
  Palette: 8 - YUYV
  Colour Depth: 16
  Brightness: 33924
  Hue: 0
  Colour :8224
  Contrast: 8224
  Whiteness: 0
Channel 0 Attributes
  Name: Camera 1
  Channel: 0
  Flags: 0
  Type: 2 - Camera
  Format: 0 - PAL
In the ZoneMinder web GUI Add new monitor probe results in "Unable to probe network cameras, status is '127'".

I'm following the Wiki documentation, but left unclear on how to set the Device Format and Capture Palette options: the zum output only hints at how settings should transfer (e.g. YUYV means YUYV422P?). The -V1 option was something I found in the forums but is not documented on the zum wiki page. Perhaps we should start there: how do I determine the proper values?

Using xawtv it works fine until the J or O key are pressed, then xawtv loops with error:
libv4l2: error setting pixformat: Input/output error
ioctl: VIDIOC_S_FMT(type=VIDEO_CAPTURE;fmt.pix.width=352;fmt.pix.height=288;fmt.pix.pixelformat=0x32315559 [YU12];fmt.pix.field=NONE;fmt.pix.bytesperline=352;fmt.pix.sizeimage=152064;fmt.pix.colorspace=SRGB;fmt.pix.priv=0): Input/output error
I can run additional tests and post them here. I will even offer to purchase a Logitech C260 for a person with the interest and ability to get it working well.
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by mastertheknife »

Create a new monitor:
Method: V4L2
Capture format: PAL
Capture palette: YUYV
Width: 320 (just for testing)
Height: 240 (just for testing)

You should get a picture with these settings. otherwise something is wrong.

mastertheknife.
Kfir Itzhak.
brycenesbitt
Posts: 10
Joined: Sat May 07, 2011 11:10 pm

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by brycenesbitt »

With those settings I get a black square.
The camera was purchased in the USA, but NTSC does the same.
Attachments
Black square using v4l2, YUYV, 320x240, PAL.
Black square using v4l2, YUYV, 320x240, PAL.
ZoneMinder.png (18.62 KiB) Viewed 5993 times
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by mastertheknife »

With the settings i gave you, what errors do you get in the system log?
Please paste it here using the code tags to keep things clean or to http://www.pastebin.com and link me.

mastertheknife.
Kfir Itzhak.
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by bb99 »

brycenesbitt
Posts: 10
Joined: Sat May 07, 2011 11:10 pm

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by brycenesbitt »

I've seen that, but it also implies ZM should be able to get UVC cameras working directly:
NOTE: As of July 21 2008 support for V4L2 drivers has been incorporated into Zoneminder 1.24.0 [1], rendering this method not required for most uvcvideo enabled cams.
brycenesbitt
Posts: 10
Joined: Sat May 07, 2011 11:10 pm

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by brycenesbitt »

With the above settings and the C260 camera, /var/log/zm is empty. But /var/log/messages has:
May 8 08:36:26 bnesbitt-desktop zma_m6[17621]: last message repeated 17 times
May 8 08:36:26 bnesbitt-desktop zmdc[2899]: INF [Starting pending process, zmc -d /dev/video0]
May 8 08:36:26 bnesbitt-desktop zmdc[2899]: INF ['zmc -d /dev/video0' starting at 11/05/08 08:36:26, pid = 17874]
May 8 08:36:26 bnesbitt-desktop zmdc[17874]: INF ['zmc -d /dev/video0' started at 11/05/08 08:36:26]
May 8 08:36:26 bnesbitt-desktop zma_m6[17621]: WAR [Waiting for capture daemon]
May 8 08:36:27 bnesbitt-desktop zmc_dvideo0[17874]: INF [Debug Level = 0, Debug Log = <none>]
May 8 08:36:27 bnesbitt-desktop zmc_dvideo0[17874]: INF [Starting Capture]
May 8 08:36:27 bnesbitt-desktop zmc_dvideo0[17874]: INF [Got signal 6 (Aborted), exiting and forcing backtrace]
May 8 08:36:27 bnesbitt-desktop zma_m6[17621]: WAR [Waiting for capture daemon]
May 8 08:37:28 bnesbitt-desktop zma_m6[17621]: last message repeated 61 times
May 8 08:38:29 bnesbitt-desktop zma_m6[17621]: last message repeated 61 times
May 8 08:39:30 bnesbitt-desktop zma_m6[17621]: last message repeated 61 times
May 8 08:40:31 bnesbitt-desktop zma_m6[17621]: last message repeated 61 times
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by bb99 »

Sorry, my post was intended to get you researching. So is this one: http://www.ideasonboard.org/uvc/. Sometimes the old way is the only way; don't forget about Vlc and it's streaming capabilities.
brycenesbitt
Posts: 10
Joined: Sat May 07, 2011 11:10 pm

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by brycenesbitt »

I'd rather get it fixed and fully supported, as opposed to hacking it out or working around it. I will donate hardware.
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by mastertheknife »

brycenesbitt wrote:I'd rather get it fixed and fully supported, as opposed to hacking it out or working around it. I will donate hardware.
I love that thinking!
OK. Enable debugging level 9 with the settings i gave you, start zoneminder and debugging logs should be created in /var/log/zm. Please upload the one for zmc to http://www.pastebin.com and link me.

mastertheknife.
Kfir Itzhak.
brycenesbitt
Posts: 10
Joined: Sat May 07, 2011 11:10 pm

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by brycenesbitt »

Enabling "Options->Debug" EXTRA_DEBUG at level 9 results in no files in /var/log/zm, and lot of files in /tmp

/tmp/zmdc.log has nothing useful:

Code: Select all

05/08/2011 22:35:14.086924 zmdc[3067].INF [Starting pending process, zmc -d /dev/video0]
05/08/2011 22:35:14.088415 zmdc[3067].INF ['zmc -d /dev/video0' starting at 11/05/08 22:35:14, pid = 3159]
05/08/2011 22:35:14.211598 zmdc[3067].ERR ['zmc -d /dev/video0' exited abnormally, exit status 6]
05/08/2011 22:35:54.076189 zmdc[3067].INF [Starting pending process, zmc -d /dev/video0]
05/08/2011 22:35:54.077676 zmdc[3067].INF ['zmc -d /dev/video0' starting at 11/05/08 22:35:54, pid = 3231]
05/08/2011 22:35:54.277375 zmdc[3067].ERR ['zmc -d /dev/video0' exited abnormally, exit status 6]
Zm creates approximately 20 new debug files in /tmp every minute. Though perhaps there is something of interest here:
05/08/11 22:34:33.174488 zmc_dvideo0[3054].DB1-zm_monitor.cpp/1814 [Loaded monitor 6(Monitor-6), 1 zones]
05/08/11 22:34:33.174513 zmc_dvideo0[3054].INF-zmc.cpp/188 [Starting Capture]
05/08/11 22:34:33.174811 zmc_dvideo0[3054].DB3-zm_local_camera.cpp/349 [Opening video device /dev/video0]
05/08/11 22:34:33.174881 zmc_dvideo0[3054].FAT-zm_local_camera.cpp/352 [Failed to open video device /dev/video0: Permission denied]
05/08/11 22:34:33.175067 zmc_dvideo0[3054].INF-zm_signal.cpp/64 [Got signal 6 (Aborted), exiting and forcing backtrace]
$ ls -la /dev/video0
crw-rw----+ 1 root video 81, 0 2011-05-08 20:34 /dev/video0
A bugfix (no features, just refinements) release to ZoneMinder would be great. If zm is smooth to set up, the userbase will grow quickly.
brycenesbitt
Posts: 10
Joined: Sat May 07, 2011 11:10 pm

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by brycenesbitt »

Curiously:
# zmc -d /dev/video0
Results in video, right in the same browser window that had black before! It captures about 1fps, or maybe a little less (half a frame per second). Though, the events look pretty messed up
Id Name Time Secs Frames Score
13 New Event 1969-12-31 16:00:00 16429971.74 2000/0 0/0 X
12 Event-12 1969-12-31 16:00:00 16429835.10 13/0 0/0 X
11 Event-11 1969-12-31 16:00:00 16429835.12 14/0 0/0 X
10 Event-10 2011-05-08 22:45:15 108.40 1409/0 0/0 X
9 Event-9 2011-05-08 22:45:15 108.40 1375/0 0/0 X
mastertheknife
Posts: 678
Joined: Wed Dec 16, 2009 4:32 pm
Location: Israel

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by mastertheknife »

Your problem is a permission problem that zmfix is supposed to workaround but it doesn't so don't rely on it.

Choose one of the following:
1) Add your apache user (www-data on debian\ubuntu) to the video group, like this:
gpasswd -a <user> video
You may need to relogin\restart apache before it takes effect

2) chmod a=rw /dev/video0
This one might not stick between restarts though.

Regarding the low fps, try disabling the extra debugging, it takes a lot of CPU and we already found the problem ;)

mastertheknife.
Kfir Itzhak.
brycenesbitt
Posts: 10
Joined: Sat May 07, 2011 11:10 pm

Re: Logitech C260 UVC in ZoneMinder - Almost Works, Need Hel

Post by brycenesbitt »

Wow, that was a lot of trouble for a simple problem.

Remember the part about making it better? I see I'm not the first with a similar issue:
http://www.zoneminder.com/forums/viewto ... =8&t=12089

I did edit the wiki to address the topic over at: http://www.zoneminder.com/wiki/index.ph ... n#Tutorial
Is there any other simple thing I can do to help?

My next challenge is my browser shows "Plug In Missing" when playing an event. But does not define which plugin is missing.

------------------------------------------------------------
And all that said, after all that trouble, I'm wondering if ZoneMinder is the right package for my need. I'd like:
  • Stamping of video with date/time/camera name
    Real-time montage of all cameras
    24/7 recording of video into a fixed size partition (e.g. 10Gib per camera)
    Playback by time search (e.g. 2pm on May 3rd).
    Jog/shuttle controls on playback.
    Export by time range (e.g. May 3rd 2pm-3pm).
Non-video triggers would be good too (e.g. panic button, or perimeter sensor fires even if there is not yet anything apparent on the video). Pretty much nothing else matters.
Post Reply