lkml.org 
[lkml]   [2012]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectUVC Video problem with various kernels.
Good morning,

I am attempting to use the video capture program 'motion' to capture video from a USB web-cam, however I am getting an error message from the uvcvideo module:  "Failed to resubmit video URB (-27)", which I note from a quick google search has been an issue for some people for what seems to be a couple of years.

The camera identifies as:


[    8.961099] usb 1-1: New USB device found, idVendor=045e, idProduct=0772
[    8.982632] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    9.004320] usb 1-1: Product: Microsoft® LifeCam Studio(TM)
[    9.026025] usb 1-1: Manufacturer: Microsoft

I have a dual-core i5-2330 based system, and the camera seems to work properly at full HD resolution on that system, even if the kernel does throttle the 4 cpus a little due to heating issues.

However, my "security system" is an old Dell Inspiron with a Pentium-M that is clocked at 1600 MHz.  motion is configured to capture at two frames per second at a resolution of 352x288.  The destination file is on an exported NFS volume which is at least capable of 10MB/s with the 'sync' mount option.

A trace of the motion process shows that it is hanging on one particular ioctl:

2040  ioctl(5, VIDIOC_QBUF or VT_SETACTIVATE, 0x9737d34) = 0
2040  ioctl(5, VIDIOC_DQBUF <unfinished ...>

Which is at the point where I have to kill -9 the process to terminate it, otherwise it just hangs forever.

One message on the linux-uvc-devel mailing list from April 12 suggests enabling debug messages, which I have done and attached the resulting messages for a typical session.  The last few lines are as follows:



...
    971 Aug 28 07:58:44 media kernel: [ 2064.697579] uvcvideo: USB isochronous frame lost (-18).
    972 Aug 28 07:58:44 media kernel: [ 2064.697585] uvcvideo: Failed to resubmit video URB (-27).
    973 Aug 28 07:58:44 media kernel: [ 2064.820266] uvcvideo: uvc_v4l2_ioctl(VIDIOC_S_CTRL)
    974 Aug 28 07:58:44 media kernel: [ 2064.828955] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QBUF)
    975 Aug 28 07:58:44 media kernel: [ 2064.828966] uvcvideo: uvc_v4l2_ioctl(VIDIOC_DQBUF)
    976 Aug 28 07:58:45 media kernel: [ 2065.253537] uvcvideo: uvc_v4l2_ioctl(VIDIOC_S_CTRL)
    977 Aug 28 07:58:45 media kernel: [ 2065.254622] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QBUF)
    978 Aug 28 07:58:45 media kernel: [ 2065.254634] uvcvideo: uvc_v4l2_ioctl(VIDIOC_DQBUF)
    979 Aug 28 07:58:45 media kernel: [ 2065.690157] uvcvideo: uvc_v4l2_ioctl(VIDIOC_S_CTRL)
    980 Aug 28 07:58:45 media kernel: [ 2065.691261] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QBUF)
    981 Aug 28 07:58:45 media kernel: [ 2065.691279] uvcvideo: uvc_v4l2_ioctl(VIDIOC_DQBUF)
    982 Aug 28 07:58:46 media kernel: [ 2066.129899] uvcvideo: uvc_v4l2_ioctl(VIDIOC_S_CTRL)
    983 Aug 28 07:58:46 media kernel: [ 2066.131005] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QBUF)
    984 Aug 28 07:58:46 media kernel: [ 2066.131022] uvcvideo: uvc_v4l2_ioctl(VIDIOC_DQBUF)
    985 Aug 28 07:59:16 media motion: [0] Thread 1 - Watchdog timeout, trying to do a graceful restart
    986 Aug 28 07:59:16 media motion: [0] httpd Closing
    987 Aug 28 07:59:16 media motion: [0] httpd thread exit


It seems that the issue causing this problem is related to USB synchronization, but I am otherwise at a loss as to what is really going on in the driver.  Another program identifies the camera as follows:

vgrabbj, Version 0.9.6
Videodevice name: /dev/video0 (Microsoft® LifeCam Studio(TM))
Capabilities
Type     : -1079656359  Values can be looked up at videodev.h
Channels : 1
Audio    : 0
MaxWidth : 1920
MaxHeight: 1080
MinWidth : 160
MinHeigth: 120

Current Settings:
Brightness: 29418
Hue       : 0
Color     : 32768
Contrast  : 32768
Whiteness : 0
Depth     : 24
Palette   : RGB24 (4)
Width     : 352
Height    : 288
Chromakey : -1079656392

Interestingly enough, the camera does have a microphone and I can monitor it with alsamixer.

Changing the capture resolution to its minimum (160x120) does not help, and in light of this I cannot blame the computer for being too slow.  motion still captures only several seconds of time-lapse video before locking-up at the same ioctl.

I've used the Ubuntu-supplied kernel verion 2.6.38-5-generic, as well as 3.4.4 and 3.4.9, all of which exhibit the same behaviour.  Finally, every program that I have tested triggers this bug, and produces the same symptoms.  I should note that my HP ProBook is running OpenSuse Linux, kernel version 3.4.4 (x86-64), and has no problem with the camera under 'cheese'.  On the Dell, cheese does not lock up hard, but otherwise stops capturing frames after a few seconds, as with everything else.

Since I've tossed out the packaging for the camera, I would prefer to make this thing work (even if it is sold by MS, the image quality is quite good).

So, any ideas?


Regards,

Steve
[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2012-08-28 15:41    [W:0.040 / U:1.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site