MUSB & uvcvideo driver issue with usb bandwidth & ca

Forum for questions and support relating to the 1.24.x releases only.
Locked
railgun
Posts: 2
Joined: Sun Oct 26, 2008 4:22 am

MUSB & uvcvideo driver issue with usb bandwidth & ca

Post by railgun »

This is just a note for anyone wondering why they are getting strange errors when trying to use ( well for me anyway ) more than 2 uvcvideo based cameras.

I have 3 different cameras plugged into one machine. Logitech S5500 , Logitech S3500 & a Microsoft VX-500. All 3 cameras use the uvcvideo driver. The bad news is that the microsoft one uses a new mode of usb transfer that has somewhat buggy support in the MUSB driver ( kernel 2.6.27-14 ) especially when it comes to allocating and reserving usb bandwidth.

The error in dmesg
"uvcvideo: Failed to submit URB 0 (-28)."
seems to be the MUSB driver refusing to allocate bandwidth to the 3rd camera, it also exceeds the overall available usb bandwidth, If i disable both logitech cams and restart ZM the camera works perfectly.

In syslog
May 18 07:51:57 zm zmdc[4319]: INF ['zmc -d /dev/video0' starting at 09/05/18 07:51:57, pid = 21738]
May 18 07:51:57 zm zmc_dvideo0[21738]: INF [Starting Capture]
May 18 07:51:57 zm kernel: [42633.095652] uvcvideo: Failed to submit URB 0 (-28).
May 18 07:51:57 zm zmc_dvideo0[21738]: FAT [Failed to start capture stream: No space left on device]
May 18 07:51:57 zm zmc_dvideo0[21738]: INF [Got signal 6 (Aborted), exiting and forcing backtrace]
May 18 07:51:57 zm zmc_dvideo0[21738]: ERR [Signal address is (nil), from 0xb7fa1424]
May 18 07:51:57 zm zmc_dvideo0[21738]: ERR [Backtrace: [0xb7fa1424]]
May 18 07:51:57 zm zmc_dvideo0[21738]: ERR [Backtrace: [0xb7fa1424]]
May 18 07:51:57 zm zmc_dvideo0[21738]: ERR [Backtrace: /lib/tls/i686/cmov/libc.so.6(gsignal+0x50) [0xb71818a0]]
May 18 07:51:57 zm zmc_dvideo0[21738]: ERR [Backtrace: /lib/tls/i686/cmov/libc.so.6(abort+0x188) [0xb7183268]]
May 18 07:51:57 zm zmc_dvideo0[21738]: ERR [Backtrace: /usr/local/bin/zmc [0x805629d]]
May 18 07:51:57 zm zmc_dvideo0[21738]: ERR [Backtrace: /usr/local/bin/zmc [0x806aa75]]
May 18 07:51:57 zm zmc_dvideo0[21738]: ERR [Backtrace: /usr/local/bin/zmc [0x804d063]]
May 18 07:51:57 zm zmc_dvideo0[21738]: ERR [Backtrace: /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb716c685]]
May 18 07:51:57 zm zmc_dvideo0[21738]: ERR [Backtrace: /usr/local/bin/zmc [0x804cbf1]]
May 18 07:51:57 zm zmc_dvideo0[21738]: INF [Backtrace complete, please execute the following command for more information]
May 18 07:51:57 zm zmc_dvideo0[21738]: INF [addr2line -e /usr/local/bin/zmc 0xb7fa1424 0xb7fa1424 0xb71818a0 0xb7183268 0x805629d 0x806aa75 0x804d063 0xb716c685 0x804cbf1]
May 18 07:51:57 zm zmdc[4319]: ERR ['zmc -d /dev/video0' exited abnormally, exit status 6]
Is the crash report that occurs when there is not enough usb bandwidth available to init the camera for either monitor or modect mode.

So don't blame Zoneminder if this occurs for you. Its all the kernel's fault !!!

2.6.28 or 2.6.29 may be more successful which is what I will be trying next. There are also some reports of a patched 2.6.27 kernel with MUSB fixes i might take a look at,
mile10com
Posts: 1
Joined: Thu Nov 05, 2009 6:27 am

Re: MUSB & uvcvideo driver issue with usb bandwidth &

Post by mile10com »

railgun wrote:This is just a note for anyone wondering why they are getting strange errors when trying to use ( well for me anyway ) more than 2 uvcvideo based cameras.

I have 3 different cameras plugged into one machine. Logitech S5500 , Logitech S3500 & a Microsoft VX-500. All 3 cameras use the uvcvideo driver. The bad news is that the microsoft one uses a new mode of usb transfer that has somewhat buggy support in the MUSB driver ( kernel 2.6.27-14 ) especially when it comes to allocating and reserving usb bandwidth.



The error in dmesg
"uvcvideo: Failed to submit URB 0 (-28)."
seems to be the MUSB driver refusing to allocate bandwidth to the 3rd camera, it also exceeds the overall available usb bandwidth, If i disable both logitech cams and restart ZM the camera works perfectly.
I'm having this exact same issue. 2 Logitech C550's and a Logitech Quickcam 3000 Pro.

I'm probably asking for it, however.. I'm running one C550 and the 3000 at 640x480, and am basically complaining that I can't run the second C550 higher than 320x240. So this is probably my fault for trying.

However, if I bring the second C550 up in xatwv @640x480, it works fine with the other two also @640x480, online through zoneminder.. So I'm not exactly sure what the limit is here. Perhaps it is a ulimit or process limit of some sort, and not a hard limit in the kernel.

Does anybody know if there is a ulimit or software limit on the maximum USB BW to a userland process (i.e. without root priv) can have? I just feel like this is a software limit somewhere since I am able to bring up all three cams at the resolution I want using two different programs.
Nov 5 01:26:27 resurrection zmdc[6682]: INF [Starting pending process, zmc -d /dev/video0]
Nov 5 01:26:27 resurrection zmdc[6682]: INF ['zmc -d /dev/video0' starting at 09/11/05 01:26:27, pid = 7379]
Nov 5 01:26:27 resurrection zmdc[7379]: INF ['zmc -d /dev/video0' started at 09/11/05 01:26:27]
Nov 5 01:26:27 resurrection zmc_dvideo0[7379]: INF [Debug Level = 0, Debug Log = <none>]
Nov 5 01:26:27 resurrection zmc_dvideo0[7379]: INF [Starting Capture]
Nov 5 01:26:27 resurrection zmc_dvideo0[7379]: WAR [Hue control is not suppported]
Nov 5 01:26:27 resurrection zmc_dvideo0[7379]: INF [Got signal 6 (Aborted), exiting and forcing backtrace]
Nov 5 01:26:27 resurrection zmc_dvideo0[7379]: INF [Backtrace complete, please execute the following command for more information]
Nov 5 01:26:27 resurrection zmc_dvideo0[7379]: INF [addr2line -e /usr/local/bin/zmc 0x7fad912e1080 0x7fad901b2fb5 0x7fad901b4bc3 0x40f300 0x421bd1 0x406990 0x7fad9019e5a6 0x4065a9]
Nov 5 01:26:27 resurrection zma_m10[7364]: WAR [Waiting for capture daemon]
Nov 5 01:26:28 resurrection zma_m10[7364]: WAR [Waiting for capture daemon]
Nov 5 01:26:29 resurrection zmdc[6682]: INF [Command 'zmc -d /dev/video0' removed from pending list at 09/11/05 01:26:29]
dmesg:
[ 360.641402] pwc: Closing video device: 43 frames received, dumped 0 frames, 0 frames with errors.
[ 397.032357] uvcvideo: Failed to query (1) UVC control 2 (unit 2) : -32 (exp. 2).
[ 416.186862] uvcvideo: Failed to submit URB 0 (-28).
[ 416.324575] uvcvideo: Failed to submit URB 0 (-28).
[ 421.255159] uvcvideo: Failed to submit URB 0 (-28).
[ 431.260676] uvcvideo: Failed to submit URB 0 (-28).
[ 451.247545] uvcvideo: Failed to submit URB 0 (-28).
[ 491.257010] uvcvideo: Failed to submit URB 0 (-28).
[ 514.164531] usb 1-10: new high speed USB device using ehci_hcd and address 11
[ 514.303362] usb 1-10: configuration #1 chosen from 4 choices
[ 543.003715] uvcvideo: Failed to submit URB 0 (-28).
[ 543.152579] uvcvideo: Failed to submit URB 0 (-28).
[ 548.246897] uvcvideo: Failed to submit URB 0 (-28).
[ 558.334211] uvcvideo: Failed to submit URB 0 (-28).
[ 578.274824] uvcvideo: Failed to submit URB 0 (-28).
[ 589.882794] pwc: Closing video device: 828 frames received, dumped 167 frames, 0 frames with errors.
[ 620.598966] uvcvideo: Failed to query (1) UVC control 2 (unit 2) : -32 (exp. 2).
[ 643.446577] pwc: Closing video device: 216 frames received, dumped 43 frames, 0 frames with errors.
[ 662.405112] uvcvideo: Failed to submit URB 0 (-28).
djieno
Posts: 2
Joined: Thu Jun 24, 2010 3:49 pm

Also having trouble using 2+ uvcvideo devices (c200)

Post by djieno »

I 'm also having the same problem not being able to get more than two usb webcams working under Zoneminder 1.24 on ubuntu 10.04 32 bit.

Searching the forum/web I found that the driver (in my case uvcvideo) needs to know that there are more than 2 cams using that bandwidth for the usb bus. Some drivers have that option available to add to the driverloading (modprobe conf). I couldn't find it for this one.

So has anybody had more that two uvcvideo based usb webcams working simultaneously? Or ANY setup containing two+ usb webcams (pref. cheap ones) working? I thought I had seen one but can't find the link anymore. :shock:

Any suggestions would be very appreaciated!

Djieno
Amsterdam
magooslum
Posts: 7
Joined: Mon Jul 05, 2010 10:52 pm

Post by magooslum »

I have a similar problem: Fast dual core AMD processor, lots of ram, only using a fraction of the CPU horsepower at very low frame rate... and can run ANY two of my six uvcvideo usb cameras at 640x480 at any one time. If I set a third (or more) camera to the higher resolution it fails and I get the "Failed to submit URB 0 (- twenty eight) errors. So the other four work at 320x240 with two, or fewer, running at the higher res.

Seems like there must be a way to skin this cat! Probably will take someone knowledgeable in the details of USB. I suppose that if we knew where that error gets generated and worked our way back...
bb99
Posts: 943
Joined: Wed Apr 02, 2008 12:04 am

Post by bb99 »

However, if I bring the second C550 up in xatwv @640x480, it works fine with the other two also @640x480, online through zoneminder.. So I'm not exactly sure what the limit is here. Perhaps it is a ulimit or process limit of some sort, and not a hard limit in the kernel.
I smell the shared memory issue hear! Try increasing, I'll bet the issue goes away.
magooslum
Posts: 7
Joined: Mon Jul 05, 2010 10:52 pm

Post by magooslum »

I am trying. Increased it to 1GB !! No joy.

I did the following:

1) Stopped ZM from the Web interface
2) Did a command line: sudo sysctl kernel.shmall=1073741824
3) Did a command line: sudo sysctl kernel.shmmax=1073741824
4) Started ZM from the Web interface

Still only two of the six were amber monitors. The rest are red. That is with all of them set to 640x480 and frame rates around 1.0 fps now, but all varied slightly to prevent simultaneous access.
Locked