[ linux-usb, please CC: me, as I'm not subscribed ] On Monday 04 of June 2012, Matthew Garrett wrote: > > > > > > I'm writing to let you know that there is a regression in > > > > > > uvcvideo for my camera: > > > (adding missing part of the log from a previous e-mail) > > > > > > uvcvideo: Device requested 3060 B/frame bandwidth. > > > uvcvideo: Selecting alternate setting 11 (3060 B/frame bandwidth). > > > usb 2-2: USB disconnect, device number 6 > > > uvcvideo: Allocated 5 URB buffers of 32x3060 bytes each. > > > uvcvideo: Failed to submit URB 0 (-19). > > > usb 2-2: new high-speed USB device number 7 using ehci_hcd > > > > > > > > > usb 2-2: New USB device found, idVendor=5986, idProduct=02c1 > > > > > > usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 > > > > > > usb 2-2: Product: BisonCam, NB Pro > > > > > > usb 2-2: Manufacturer: BISON Corporation > > > > > > usb 2-2: SerialNumber: 20090505 > > > > > > uvcvideo: Found UVC 1.00 device BisonCam, NB Pro (5986:02c1) > > > > > > input: BisonCam, NB Pro as > > > > > > /devices/pci0000:00/0000:00:1d.7/usb2/2-2/2-2:1.0/input/input13 > > > > > > This is a webcam present in MSI U200 (Wind12) netbook series. > > > > > > > > > > > > Last working version of uvcvideo is the one shipped with 2.6.36 > > > > > > kernel, first kernel that ships a broken version is 2.6.37 (and > > > > > > 3.4 still doesn't work). What happens is, when any software > > > > > > (guvcvideo, flash plugin, skype) tries to access the webcam, > > > > > > kernel sees an USB disconnect and immediate reconnect. > > > > > > > > > > There can be several causes to this issue. A device disconnecting > > > > > on its own without reason is definitely a bug, and can be caused > > > > > by a device firmware bug (most UVC webcams are known to be very > > > > > buggy) or a USB core bug. I usually incriminate the device > > > > > firmware first, a change on the host side (either in the USB core > > > > > or the UVC driver) might have cause differences in timings that > > > > > can trigger a race condition on the device side. > > > > > > > > > > The best way to debug this would be to bisect the kernel. Would you > > > > > be able to do that ? > > > > > > > > It took me a while (on my CULV 1.3GHz netbook...), but here it goes: > > > > > > > > $ git bisect good > > > > 3dae8b41dc5651f8eb22cf310e8b116480ba25b7 is the first bad commit > > > > commit 3dae8b41dc5651f8eb22cf310e8b116480ba25b7 > > > > Author: Matthew Garrett <mjg@xxxxxxxxxx> > > > > Date: Thu Sep 16 15:00:04 2010 -0300 > > > > > > > > V4L/DVB: uvc: Enable USB autosuspend by default on uvcvideo > > > > > > > > We've been doing this for a while in Fedora without any > > > > complaints. > > > > > > > > Signed-off-by: Matthew Garrett <mjg@xxxxxxxxxx> > > > > Acked-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx> > > > > Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx> > > > > : > > > > :040000 040000 8df4a95ecacca8f551552ee55c86261701250b6c > > > > > > > > 09686bc05852cd9dd4c9b3501138ec7cc32d7c78 Mdrivers > > > > $ > > > > > > > > Furthermore, I can confirm that reverting this commit in 3.4 codebase > > > > fixes my problem. > > > > > > Thanks a lot for working on this. > > > > > > Matthew, it seems you have a complaint now :-) Would you be able to try > > > and debug that with Jakub ? Jakub, the first step will probably be to > > > enable USB debugging (CONFIG_USB_DEBUG=y) and send the complete kernel > > > log around the disconnection. Would you be able to do that ? > > > > Ok, so something in the resume path triggers a disconnect. Oliver, any > > ideas? This is from 3.5-rc1 with CONFIG_USB_DEBUG=y, uvcvideo loaded with trace=2047: uvcvideo: uvc_v4l2_open usb usb2: usb auto-resume ehci_hcd 0000:00:1d.7: resume root hub hub 2-0:1.0: hub_resume hub 2-0:1.0: port 2: status 0507 change 0000 usb 2-2: usb auto-resume hub 2-0:1.0: state 7 ports 6 chg 0000 evt 0000 ehci_hcd 0000:00:1d.7: GetStatus port:2 status 001005 0 ACK POWER sig=se0 PE CONNECT usb 2-2: finish resume uvcvideo: Resuming interface 0 uvcvideo: Resuming interface 1 ehci_hcd 0000:00:1d.7: reused qh f12a1f80 schedule usb 2-2: link qh16-0001/f12a1f80 start 1 [1/0 us] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_ioctl(VIDIOC_G_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FRAMESIZES) (...) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_ioctl(VIDIOC_G_INPUT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUMINPUT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCTRL) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_release usb 2-2: unlink qh16-0001/f12a1f80 start 1 [1/0 us] uvcvideo: uvc_v4l2_open ehci_hcd 0000:00:1d.7: reused qh f12a1f80 schedule usb 2-2: link qh16-0001/f12a1f80 start 1 [1/0 us] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_ioctl(VIDIOC_G_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FRAMESIZES) (...) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_ioctl(VIDIOC_G_INPUT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUMINPUT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCTRL) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FRAMESIZES) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FRAMEINTERVALS) (...) uvcvideo: uvc_v4l2_ioctl(VIDIOC_TRY_FMT) uvcvideo: Trying format 0x56595559 (YUYV): 640x480. uvcvideo: Using default frame interval 41666.6 us (24.0 fps). uvcvideo: uvc_v4l2_ioctl(VIDIOC_S_FMT) uvcvideo: Trying format 0x56595559 (YUYV): 640x480. uvcvideo: Using default frame interval 41666.6 us (24.0 fps). uvcvideo: uvc_v4l2_ioctl(VIDIOC_S_PARM) uvcvideo: Setting frame interval to 1/24 (416666). uvcvideo: uvc_v4l2_ioctl(VIDIOC_G_PARM) uvcvideo: uvc_v4l2_ioctl(VIDIOC_REQBUFS) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYBUF) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYBUF) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYBUF) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYBUF) uvcvideo: uvc_v4l2_mmap uvcvideo: uvc_v4l2_mmap uvcvideo: uvc_v4l2_mmap uvcvideo: uvc_v4l2_mmap uvcvideo: uvc_v4l2_ioctl(VIDIOC_QBUF) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QBUF) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QBUF) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QBUF) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCTRL) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCTRL) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCTRL) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCTRL) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCTRL) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCTRL) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCTRL) uvcvideo: uvc_v4l2_ioctl(VIDIOC_G_EXT_CTRLS) uvcvideo: uvc_v4l2_ioctl(VIDIOC_STREAMON) uvcvideo: Device requested 3060 B/frame bandwidth. uvcvideo: Selecting alternate setting 11 (3060 B/frame bandwidth). hub 2-0:1.0: state 7 ports 6 chg 0000 evt 0004 ehci_hcd 0000:00:1d.7: GetStatus port:2 status 001002 0 ACK POWER sig=se0 CSC hub 2-0:1.0: port 2, status 0100, change 0001, 12 Mb/s usb 2-2: USB disconnect, device number 2 usb 2-2: unregistering device usb 2-2: unregistering interface 2-2:1.0 uvcvideo: Allocated 5 URB buffers of 32x3060 bytes each. uvcvideo: Failed to submit URB 0 (-19). usb 2-2: unlink qh16-0001/f12a1f80 start 1 [1/0 us] ehci_hcd 0000:00:1d.7: shutdown urb f2795580 ep7in-intr usb 2-2: unregistering interface 2-2:1.1 usb 2-2: usb_disable_device nuking all URBs ehci_hcd 0000:00:1d.7: GetStatus port:2 status 001803 0 ACK POWER sig=j CSC CONNECT hub 2-0:1.0: debounce: port 2: total 125ms stable 100ms status 0x501 ehci_hcd 0000:00:1d.7: port 2 reset complete, port enabled ehci_hcd 0000:00:1d.7: GetStatus port:2 status 001005 0 ACK POWER sig=se0 PE CONNECT usb 2-2: new high-speed USB device number 3 using ehci_hcd ehci_hcd 0000:00:1d.7: port 2 reset complete, port enabled ehci_hcd 0000:00:1d.7: GetStatus port:2 status 001005 0 ACK POWER sig=se0 PE CONNECT usb 2-2: skipped 1 descriptor after configuration usb 2-2: skipped 6 descriptors after interface usb 2-2: skipped 1 descriptor after endpoint usb 2-2: skipped 12 descriptors after interface usb 2-2: default language 0x0409 usb 2-2: udev 3, busnum 2, minor = 130 usb 2-2: New USB device found, idVendor=5986, idProduct=02c1 usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 2-2: Product: BisonCam, NB Pro usb 2-2: Manufacturer: BISON Corporation usb 2-2: SerialNumber: 20090505 usb 2-2: usb_probe_device usb 2-2: configuration #1 chosen from 1 choice usb 2-2: adding 2-2:1.0 (config #1, interface 0) uvcvideo 2-2:1.0: usb_probe_interface uvcvideo 2-2:1.0: usb_probe_interface - got id uvcvideo: Probing generic UVC device 2 uvcvideo: Found format YUV 4:2:2 (YUYV). uvcvideo: - 640x480 (24.0 fps) uvcvideo: - 160x120 (24.0 fps) uvcvideo: - 176x144 (24.0 fps) uvcvideo: - 320x240 (24.0 fps) uvcvideo: - 352x288 (24.0 fps) uvcvideo: - 800x600 (7.5 fps) uvcvideo: - 1024x768 (7.5 fps) uvcvideo: - 1280x1024 (7.5 fps) uvcvideo: Found a Status endpoint (addr 87). uvcvideo: Found UVC 1.00 device BisonCam, NB Pro (5986:02c1) uvcvideo: Added control 00000000-0000-0000-0000-000000000101/2 to device 2 entity 2 uvcvideo: Adding mapping 'Brightness' to control 00000000-0000-0000-0000-000000000101/2. uvcvideo: Added control 00000000-0000-0000-0000-000000000101/3 to device 2 entity 2 uvcvideo: Adding mapping 'Contrast' to control 00000000-0000-0000-0000-000000000101/3. uvcvideo: Added control 00000000-0000-0000-0000-000000000101/7 to device 2 entity 2 uvcvideo: Adding mapping 'Saturation' to control 00000000-0000-0000-0000-000000000101/7. uvcvideo: Added control 00000000-0000-0000-0000-000000000101/8 to device 2 entity 2 uvcvideo: Adding mapping 'Sharpness' to control 00000000-0000-0000-0000-000000000101/8. uvcvideo: Added control 00000000-0000-0000-0000-000000000101/9 to device 2 entity 2 uvcvideo: Adding mapping 'Gamma' to control 00000000-0000-0000-0000-000000000101/9. uvcvideo: Scanning UVC chain: OT 5 <- XU 4 <- XU 3 <- PU 2 <- IT 1 uvcvideo: Found a valid video chain (1 -> 5). input: BisonCam, NB Pro as /devices/pci0000:00/0000:00:1d.7/usb2/2-2/2-2:1.0/input/input10 uvcvideo: UVC device initialized. usb 2-2: adding 2-2:1.1 (config #1, interface 1) hub 2-0:1.0: state 7 ports 6 chg 0000 evt 0004 uvcvideo: uvc_v4l2_open usb 2-2: link qh16-0001/f127a740 start 2 [1/0 us] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_release usb 2-2: unlink qh16-0001/f127a740 start 2 [1/0 us] uvcvideo: uvc_v4l2_open ehci_hcd 0000:00:1d.7: reused qh f127a740 schedule usb 2-2: link qh16-0001/f127a740 start 2 [1/0 us] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FRAMESIZES) (...) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FMT) uvcvideo: uvc_v4l2_release usb 2-2: unlink qh16-0001/f127a740 start 2 [1/0 us] uvcvideo: uvc_v4l2_open ehci_hcd 0000:00:1d.7: reused qh f127a740 schedule usb 2-2: link qh16-0001/f127a740 start 2 [1/0 us] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_release usb 2-2: unlink qh16-0001/f127a740 start 2 [1/0 us] uvcvideo: uvc_v4l2_open ehci_hcd 0000:00:1d.7: reused qh f127a740 schedule usb 2-2: link qh16-0001/f127a740 start 2 [1/0 us] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_ioctl(VIDIOC_G_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FRAMESIZES) (...) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_ioctl(VIDIOC_G_INPUT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUMINPUT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCTRL) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_release usb 2-2: unlink qh16-0001/f127a740 start 2 [1/0 us] uvcvideo: uvc_v4l2_open ehci_hcd 0000:00:1d.7: reused qh f127a740 schedule usb 2-2: link qh16-0001/f127a740 start 2 [1/0 us] uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_ioctl(VIDIOC_G_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FRAMESIZES) (...) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUM_FMT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_ioctl(VIDIOC_G_INPUT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_ENUMINPUT) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCTRL) uvcvideo: uvc_v4l2_ioctl(VIDIOC_QUERYCAP) uvcvideo: uvc_v4l2_release usb 2-2: unlink qh16-0001/f127a740 start 2 [1/0 us] uvcvideo: uvc_v4l2_release usb 2-2: selecting invalid interface 1 uvcvideo: Suspending interface 1 uvcvideo: Suspending interface 0 usb 2-2: usb auto-suspend, wakeup 0 hub 2-0:1.0: hub_suspend usb usb2: bus auto-suspend, wakeup 1 ehci_hcd 0000:00:1d.7: suspend root hub Regards, Jakub. -- Jakub Jankowski|shasta@xxxxxxxxxxx|http://toxcorp.com/ GPG: FCBF F03D 9ADB B768 8B92 BB52 0341 9037 A875 942D -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html