can't read uvcvideo (usb video / webcams) devices

Bug #1014749 reported by Patrick Welche
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Medium
Unassigned

Bug Description

Attempting to read /dev/video0 for USB video device gives:

libv4l2: error turning on stream: No space left on device

from the video4linux library, and the video4linux ioctl fail with e.g.

VIDIOC_STREAMON - Unable to start capture: Device or resource busy

I wrote a test program and find that "Control" ioctls such as VIDIOC_G_FMT are successful: I can query the format which the camera provides, so the "connection" with the camera seems OK.

Reading the frame, however seems impossible.

(cheese and guvcview are also unable to display an image, so it isn't just my programming - and my program does work on a laptop which runs NetBSD, so no ubuntu testing there)

I tested the following cameras
Bus 002 Device 003: ID 046d:09a1 Logitech, Inc. QuickCam Communicate MP/S5500
Bus 002 Device 004: ID 0471:2038 Philips (or NXP)
Bus 002 Device 006: ID 041e:406d Creative Technology, Ltd

(I also tried with ubuntu 10.04)

Most similar bugs have been "solved" in the past by installing new kernels - the above was tried with the most recent at the time of this report:
 3.2.0-25-generic #40-Ubuntu SMP Wed May 23 20:30:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

This computer has USB3 ports as well as USB2 ports - I have tried a variety - apport should show the Logitech plugged into a USB2 port.

These cameras work on other compurters running 10.04 - if I had to guess, this is the only computer I have with USB3 ports - so is it a USB controller driver issue?

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: linux-image-3.2.0-25-generic 3.2.0-25.40
ProcVersionSignature: Ubuntu 3.2.0-25.40-generic 3.2.18
Uname: Linux 3.2.0-25-generic x86_64
NonfreeKernelModules: fglrx
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 2.0.1-0ubuntu8
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC2: prlw1 2485 F.... pulseaudio
 /dev/snd/controlC0: prlw1 2485 F.... pulseaudio
 /dev/snd/controlC1: prlw1 2485 F.... pulseaudio
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info:
 Card hw:0 'PCH'/'HDA Intel PCH at 0xe0520000 irq 95'
   Mixer name : 'Realtek ALC892'
   Components : 'HDA:10ec0892,80862018,00100302'
   Controls : 41
   Simple ctrls : 20
Card1.Amixer.info:
 Card hw:1 'U0x46d0x9a1'/'USB Device 0x46d:0x9a1 at usb-0000:00:1d.0-1.8, full speed'
   Mixer name : 'USB Mixer'
   Components : 'USB046d:09a1'
   Controls : 2
   Simple ctrls : 1
Card1.Amixer.values:
 Simple mixer control 'Mic',0
   Capabilities: cvolume cvolume-joined cswitch cswitch-joined penum
   Capture channels: Mono
   Limits: Capture 0 - 3072
   Mono: Capture 1536 [50%] [24.00dB] [on]
Card2.Amixer.info:
 Card hw:2 'Generic'/'HD-Audio Generic at 0xe0320000 irq 96'
   Mixer name : 'ATI R6xx HDMI'
   Components : 'HDA:1002aa01,00aa0100,00100200'
   Controls : 6
   Simple ctrls : 1
Card2.Amixer.values:
 Simple mixer control 'IEC958',0
   Capabilities: pswitch pswitch-joined penum
   Playback channels: Mono
   Mono: Playback [on]
CurrentDmesg: Error: command ['sh', '-c', 'dmesg | comm -13 --nocheck-order /var/log/dmesg -'] failed with exit code 1: comm: /var/log/dmesg: Permission denied
Date: Mon Jun 18 17:50:12 2012
IwConfig: Error: [Errno 2] No such file or directory
ProcEnviron:
 LANGUAGE=en_GB:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
 SHELL=/bin/tcsh
ProcFB: 0 VESA VGA
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.2.0-25-generic root=UUID=69f474df-7e0b-4e6e-a210-904b21597280 ro quiet splash vt.handoff=7
RfKill: Error: [Errno 2] No such file or directory
SourcePackage: linux
UdevDb: Error: [Errno 2] No such file or directory
UpgradeStatus: No upgrade log present (probably fresh install)
WifiSyslog:

dmi.bios.date: 03/27/2012
dmi.bios.vendor: Intel Corp.
dmi.bios.version: SIX7910J.86A.0460.2012.0327.1627
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: DX79SI
dmi.board.vendor: Intel Corporation
dmi.board.version: AAG28808-600
dmi.chassis.type: 3
dmi.modalias: dmi:bvnIntelCorp.:bvrSIX7910J.86A.0460.2012.0327.1627:bd03/27/2012:svn:pn:pvr:rvnIntelCorporation:rnDX79SI:rvrAAG28808-600:cvn:ct3:cvr:

Revision history for this message
Patrick Welche (prlw1) wrote :
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v3.5kernel[0] (Not a kernel in the daily directory) and install both the linux-image and linux-image-extra .deb packages.

Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag(Only that one tag, please leave the other tags). This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text.

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.
Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.5-rc3-quantal/

Changed in linux (Ubuntu):
importance: Undecided → Medium
tags: added: needs-upstream-testing
Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Patrick Welche (prlw1) wrote :

Just tried with

3.5.0-030500rc3-generic #201206162135 SMP Sun Jun 17 01:36:04 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Same overall problem. cheese got a slightly more exciting X Windows System error. gucview gives (with the 3rd camera listed above):

video device: /dev/video0
Init. VF0560 Live! Cam Optia AF (location: usb-0000:00:1d.0-1.8)
{ pixelformat = 'MJPG', description = 'MJPEG' }
{ discrete: width = 640, height = 480 }
...
vid:041e
pid:406d
driver:uvcvideo
checking format: 1196444237
Requested Format unavailable: get width 176 height 144
VIDIOC_G_COMP:: Inappropriate ioctl for device
fps is set to 1/15
drawing controls

libv4l2: error turning on stream: No space left on device
VIDIOC_STREAMON - Unable to start capture: No space left on device
Checking video mode 176x144@32bpp : OK
libv4l2: error turning on stream: No space left on device
VIDIOC_STREAMON - Unable to start capture: No space left on device
libv4l2: error turning on stream: No space left on device
VIDIOC_STREAMON - Unable to start capture: No space left on device

tags: added: kernel-bug-exists-upstream
removed: needs-upstream-testing
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Patrick, see.. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1018020. It appears it might be a usb3/usb2 thing.

Revision history for this message
Patrick Welche (prlw1) wrote :

To quote from my original bug description above:

  "These cameras work on other computers running 10.04 - if I had to guess, this is the only computer I have with USB3 ports - so is it a USB controller driver issue?"

so I agree.

The other bug involves an Intel 6 series chipset, whereas this one is an X79 series chipset. I suspect that may be why your bug shows hope in a kernel regression for which some bissection can be done, whereas this box doesn't work with ubuntu 10.04 either.

Just for good measure I spent a week getting windows 7 running on it, and windows is capable of displaying a webcam image, so the hardware isn't at fault... (I think this again points at the USB controller driver...)

Revision history for this message
Ming Lei (tom-leiming) wrote : Re: [Bug 1014749] Re: can't read uvcvideo (usb video / webcams) devices

Recently, there were several similar reports about uvcvideo, and one
bug is found
in uvcvideo driver, see below link:

         http://marc.info/?l=linux-usb&m=134020455311063&w=2

I will prepare a kernel image with applying the patch for your test.

Revision history for this message
Ming Lei (tom-leiming) wrote :

On Thu, Jul 5, 2012 at 9:22 AM, Ming Lei <email address hidden> wrote:
> Recently, there were several similar reports about uvcvideo, and one
> bug is found
> in uvcvideo driver, see below link:
>
> http://marc.info/?l=linux-usb&m=134020455311063&w=2
>
> I will prepare a kernel image with applying the patch for your test.

Could you test the kernel image in the below link?

      http://kernel.ubuntu.com/~ming/bugs/1014749/

Thanks,
--
Ming Lei

Revision history for this message
Patrick Welche (prlw1) wrote :

Unfortunately

Linux flotta 3.2.0-27-generic #43 SMP Sat Jul 7 15:15:28 CST 2012 x86_64 x86_64 x86_64 GNU/Linux

didn't fix my bug. I still get libv4l2: error turning on stream: No space left on device

I haven't looked at the linux drivers. I have found a problem in another OS which may be similar in which a uvcvideo driver asks for a contiguous chunk of memory with which to transfer the frame. As kernel memory gets fragmented this becomes difficult until an EIO. The solution being investigated there (seems to work) is to teach ehci's usb_mem allocator about multiple extents (no longer need contiguous)... On the other hand it doesn't quite feel the same, as there the first few frames are always captured, but here I have never succeeded in capturing a single frame.

Thanks!

Revision history for this message
Ming Lei (tom-leiming) wrote :

On Sun, Jul 8, 2012 at 4:54 AM, Patrick Welche <email address hidden> wrote:
> Unfortunately

OK, could you provide the usbmon trace according to the guide in
Documentation/usb/usbmon.txt or the link[1]?

[1], http://www.mjmwired.net/kernel/Documentation/usb/usbmon.txt

thanks,
--
Ming Lei

Revision history for this message
Patrick Welche (prlw1) wrote :

I booted with your

  Linux flotta 3.2.0-27-generic #43 SMP Sat Jul 7 15:15:28 CST 2012 x86_64 x86_64 x86_64 GNU/Linux

and took a trace (quickcam.out) of just running "cheese" with

  Bus 002 Device 003: ID 046d:09a1 Logitech, Inc. QuickCam Communicate MP/S5500

as a camera.

Revision history for this message
Oleksij Rempel (olerem) wrote :

Just suggestion. Here is one part form kernel config:

  │ CONFIG_USB_EHCI_TT_NEWSCHED: │
  │ │
  │ This changes the periodic scheduling code to fill more of the low │
  │ and full speed bandwidth available from the Transaction Translator │
  │ (TT) in USB 2.0 hubs. Without this, only one transfer will be │
  │ issued in each microframe, significantly reducing the number of │
  │ periodic low/fullspeed transfers possible. │
  │ │
  │ If you have multiple periodic low/fullspeed devices connected to a │
  │ highspeed USB hub which is connected to a highspeed USB Host │
  │ Controller, and some of those devices will not work correctly │
  │ (possibly due to "ENOSPC" or "-28" errors), say Y. Conversely, if │
  │ you have only one such device and it doesn't work, you could try │
  │ saying N.

If in this issue, report this bag on uvc maeling list, may be we can help you.
http://www.ideasonboard.org/uvc/faq/

Revision history for this message
Patrick Welche (prlw1) wrote :

I bought a dirt cheap unbranded PCI USB card:

0a:00.0 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 50)
0a:00.1 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 50)
0a:00.2 USB controller: VIA Technologies, Inc. USB 2.0 (rev 51)

Connecting the camera to it gets me a 640x480 image with cheese and guvcview. Slightly odd:

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 046d:09a1 Logitech, Inc. QuickCam Communicate MP/S5500

Is the camera really a USB 1.1 device? (I doubt it)

So, the problem really is with the driver for Intel X79 series chipset USB.

Revision history for this message
Ming Lei (tom-leiming) wrote :

On Thu, Jul 12, 2012 at 8:47 PM, Patrick Welche <email address hidden> wrote:
> Connecting the camera to it gets me a 640x480 image with cheese and
> guvcview. Slightly odd:
>
> Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 004 Device 002: ID 046d:09a1 Logitech, Inc. QuickCam Communicate MP/S5500
>
> Is the camera really a USB 1.1 device? (I doubt it)

Maybe the enumeration on your uvc device is failed, then the port is handover
to 1.1 controller, but it is hard to say since you didn't post the 'dmesg' info.

From the usbmon, we can just find the below failure:

ffff88040ae0a000 1105599665 S Zi:2:003:1 -115:1:0 32 -18:0:944
-18:944:944 -18:1888:944 -18:2832:944 -18:3776:944 30208 <
ffff88040ae0a000 1105599691 E Zi:2:003:1 -28 0

You didn't post the 'lsusb -v' on your uvc device, it is a bit
difficult to conclude
what is wrong about the schedule without the device descriptor info.

Also you didn't post the dmesg info, we still don't know if your uvc
device is plugged
into USB3 or USB2 bus.

Thanks,

Revision history for this message
Patrick Welche (prlw1) wrote :

So you're saying that apport doesn't collect the information you need? ;-)
Sure enough, dmesg suggests usb1:

[100953.328121] usb 4-2: USB disconnect, device number 2
[100957.568275] usb 1-1.5: new full-speed USB device number 5 using ehci_hcd
[100957.755721] uvcvideo: Found UVC 1.00 device <unnamed> (046d:09a1)
[100957.789271] input: UVC Camera (046d:09a1) as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/input/input13

and lsusb -v info for the quickcam plugged into the intel USB attached... (Don't forget that I had the same problem with three
other cameras - and I can test with even more cameras if necessary...)

Revision history for this message
Ming Lei (tom-leiming) wrote :

From the 'dmesg' and 'lsusb', your problem may be related with split transaction
schedule in ehci host controller driver, which is still not good enough now.

I guess that the camera may work well after you run the below command
on the machine with intel chipsets.

            $sudo rmmod ehci-hcd

This also explained why you can use the 1.1 uvc camera on VIA UHCI host
controller.

The current uvc configuration may set max packet size as 944, and 1023
is the max
allowed in USB 1.1 spec, which may consume 69% frame bandwidth, so it is
a bit difficult to submit the urb successfully in full speed bus or
split transaction
in high speed bus.

Revision history for this message
Patrick Welche (prlw1) wrote :

Doesn't (lsusb -v)

Bus 001 Device 005: ID 046d:09a1 Logitech, Inc. QuickCam Communicate MP/S5500
Device Descriptor:
  bLength 18
  bDescriptorType 1
  bcdUSB 2.00

suggest that it really is a USB2 camera?

I booted the standard
  Linux flotta 3.2.0-26-generic #41-Ubuntu SMP Thu Jun 14 17:49:24 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
kernel with the camera connected to the X79 chipset usb, and:

flotta:~> sudo modprobe -l | grep ehci
flotta:~> sudo modprobe -l | grep hci
kernel/drivers/ata/acard-ahci.ko
kernel/drivers/ata/ahci_platform.ko
kernel/drivers/firewire/firewire-ohci.ko
kernel/drivers/usb/host/whci/whci-hcd.ko
kernel/drivers/mmc/host/sdhci.ko
kernel/drivers/mmc/host/sdhci-pci.ko
kernel/drivers/mmc/host/sdhci-pltfm.ko
kernel/drivers/staging/usbip/vhci-hcd.ko
kernel/drivers/uwb/whci.ko
kernel/drivers/bluetooth/hci_vhci.ko
kernel/drivers/bluetooth/hci_uart.ko

so no ehci-hcd...

Revision history for this message
Ming Lei (tom-leiming) wrote :

On Mon, Jul 23, 2012 at 9:45 PM, Patrick Welche <email address hidden> wrote:

>
> so no ehci-hcd...

ehci-hcd may be built into kernel, you can check the 'dmesg' to confirm it.

Revision history for this message
Jeff Silverman (jeffsilverm) wrote :
Download full text (3.6 KiB)

I am running into the same problem. I have a Microsoft/2000 web cam, USB ID 045e:0761. I am running Ubuntu 12.04 LTS with the 3.2.0-30-generic #48-Ubuntu SMP kernel. May I help with this problem?

jeffs@jeffs-desktop:~$ dmesg | grep ehci
[ 1.411372] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.411385] ehci_hcd 0000:00:1a.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[ 1.411398] ehci_hcd 0000:00:1a.0: setting latency timer to 64
[ 1.411401] ehci_hcd 0000:00:1a.0: EHCI Host Controller
[ 1.411432] ehci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 1
[ 1.411456] ehci_hcd 0000:00:1a.0: debug port 2
[ 1.415332] ehci_hcd 0000:00:1a.0: cache line size of 64 is not supported
[ 1.415342] ehci_hcd 0000:00:1a.0: irq 16, io mem 0xf7138000
[ 1.430463] ehci_hcd 0000:00:1a.0: USB 2.0 started, EHCI 1.00
[ 1.430597] ehci_hcd 0000:00:1d.0: PCI INT A -> GSI 23 (level, low) -> IRQ 23
[ 1.430609] ehci_hcd 0000:00:1d.0: setting latency timer to 64
[ 1.430612] ehci_hcd 0000:00:1d.0: EHCI Host Controller
[ 1.430640] ehci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2
[ 1.430660] ehci_hcd 0000:00:1d.0: debug port 2
[ 1.434549] ehci_hcd 0000:00:1d.0: cache line size of 64 is not supported
[ 1.434557] ehci_hcd 0000:00:1d.0: irq 23, io mem 0xf7137000
[ 1.450449] ehci_hcd 0000:00:1d.0: USB 2.0 started, EHCI 1.00
[ 1.742293] usb 1-1: new high-speed USB device number 2 using ehci_hcd
[ 1.986153] usb 2-1: new high-speed USB device number 2 using ehci_hcd
[ 2.190082] usb 1-1.2: new low-speed USB device number 3 using ehci_hcd
[ 2.358151] usb 1-1.4: new full-speed USB device number 4 using ehci_hcd
[ 2.522050] usb 2-1.6: new full-speed USB device number 3 using ehci_hcd
[ 2.721932] usb 1-1.4.3: new full-speed USB device number 5 using ehci_hcd
[ 510.603551] usb 1-1.4.1: new full-speed USB device number 6 using ehci_hcd
[ 510.819417] usb 1-1.4.1: new full-speed USB device number 7 using ehci_hcd
[ 1674.568827] ehci_hcd 0000:00:1d.0: PCI INT A disabled
[ 1674.588826] ehci_hcd 0000:00:1a.0: PCI INT A disabled
[ 1675.608476] ehci_hcd 0000:00:1d.0: PME# enabled
[ 1675.608502] ehci_hcd 0000:00:1d.0: wake-up capability enabled by ACPI
[ 1675.624266] ehci_hcd 0000:00:1a.0: PME# enabled
[ 1675.624280] ehci_hcd 0000:00:1a.0: wake-up capability enabled by ACPI
[ 1676.631091] ehci_hcd 0000:00:1a.0: restoring config space at offset 0xf (was 0x100, writing 0x10b)
[ 1676.631104] ehci_hcd 0000:00:1a.0: restoring config space at offset 0x4 (was 0x0, writing 0xf7138000)
[ 1676.631110] ehci_hcd 0000:00:1a.0: restoring config space at offset 0x1 (was 0x2900000, writing 0x2900002)
[ 1676.631130] ehci_hcd 0000:00:1a.0: wake-up capability disabled by ACPI
[ 1676.631133] ehci_hcd 0000:00:1a.0: PME# disabled
[ 1676.631181] ehci_hcd 0000:00:1d.0: restoring config space at offset 0xf (was 0x100, writing 0x103)
[ 1676.631195] ehci_hcd 0000:00:1d.0: restoring config space at offset 0x4 (was 0x0, writing 0xf7137000)
[ 1676.631200] ehci_hcd 0000:00:1d.0: restoring config space at offset 0x1 (was 0x2900000, writing 0x2900002)
[ 1676.631219] ehci_hcd 0000:00:1d.0: wake-up capability di...

Read more...

Revision history for this message
wrapperband (drajdoyle) wrote :

I am also affected by this bug. Every time I start a USB web cam Kaffiene stops with a message box "Read error from".

Press the button and it can be restarted, with both working .....

I have been putting up for it for a good while, possibly since Kubuntu 11.04. Currently on 12.10 normal release. I'd be really happy to see it fixed, and test any updates.

Revision history for this message
penalvch (penalvch) wrote :

Patrick Welche, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? If so, could you please test for this with the latest development release of Ubuntu? ISO images are available from http://cdimage.ubuntu.com/daily-live/current/ .

If it remains an issue, could you please run the following command in the development release from a Terminal (Applications->Accessories->Terminal), as it will automatically gather and attach updated debug information to this report:

apport-collect -p linux <replace-with-bug-number>

Also, could you please test the latest upstream kernel available following https://wiki.ubuntu.com/KernelMainlineBuilds ? It will allow additional upstream developers to examine the issue. Please do not test the daily folder, but the one all the way at the bottom. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this bug is fixed in the mainline kernel, please add the following tags:
kernel-fixed-upstream
kernel-fixed-upstream-VERSION-NUMBER

where VERSION-NUMBER is the version number of the kernel you tested. For example:
kernel-fixed-upstream-v3.11-rc5

This can be done by clicking on the yellow circle with a black pencil icon next to the word Tags located at the bottom of the bug description. As well, please remove the tag:
needs-upstream-testing

If the mainline kernel does not fix this bug, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-VERSION-NUMBER

As well, please remove the tag:
needs-upstream-testing

Once testing of the upstream kernel is complete, please mark this bug's Status as Confirmed. Please let us know your results. Thank you for your understanding.

tags: added: bios-outdated-0590 needs-upstream-testing
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu laptop testing tracker.

A list of all reports related to this bug can be found here:
http://laptop.qa.ubuntu.com/qatracker/reports/bugs/1014749

tags: added: laptop-testing
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.