Discussion:
Canon DSLR unhappy on USB 3.0 port (OK on 2.0)
James
2012-06-04 17:24:50 UTC
Permalink
Hello,

I'm experiencing issues with Canon EOS DSLRs (60D, 400D -- both have USB
2.0 connections) when connected to a USB 3.0 port on my notebook. After
connecting it, the camera seems to be recognised by the kernel, but is
sometimes unusable by gphoto2; Nautilus never seems to recognise it on
USB 3.0. In dmesg, immediately after connecting:


[ 72.674463] usb 3-1: new high-speed USB device number 2 using xhci_hcd
[ 72.764255] usb 3-1: New USB device found, idVendor=04a9, idProduct=3215
[ 72.764265] usb 3-1: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[ 72.764272] usb 3-1: Product: Canon Digital Camera
[ 72.764276] usb 3-1: Manufacturer: Canon Inc.
[ 72.765264] usb 3-1: ep 0x81 - rounding interval to 32768
microframes, ep desc says 0 microframes
[ 72.765275] usb 3-1: ep 0x2 - rounding interval to 32768 microframes,
ep desc says 0 microframes


Sometimes gphoto2 works, but the most consistent way I've found to make
it fail is to run gphoto2 -L shortly after connecting (which might be
successful), and then run it again. If this fails, there's a delay of a
few seconds and it returns


*** Error ***
PTP I/O error

*** Error ***
An error occurred in the io-library ('Unspecified error'): No error
description available
*** Error (-1: 'Unspecified error') ***


and messages like


usbfs: usb 3-1: process 8502 (pool) did not claim interface 0 before use


appear in dmesg. I have logs showing what appears in dmesg after
enabling usbfs_snoop in both the for both USB 2.0 and USB 3.0; and
gphoto2's debugging output. Let me know if these would be helpful and
I'll send them (please let me know the most appropriate destination and
format).

Everything works fine with USB 2.0.

Versions of things:

Distro: Fedora 17
Kernel 3.4
gphoto2 2.4.14
USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller
(rev 04) (prog-if 30 [XHCI])
Camera: 04a9:3215 Canon EOS 60D, firmware up-to-date

Many thanks,
James.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Peter Stuge
2012-06-04 17:36:32 UTC
Permalink
Hi James,
Post by James
I'm experiencing issues with Canon EOS DSLRs (60D, 400D -- both have USB
2.0 connections) when connected to a USB 3.0 port on my notebook. After
connecting it, the camera seems to be recognised by the kernel, but is
sometimes unusable by gphoto2;
libgphoto2 uses libusb, which talks to the kernel via usbfs. There's
another thread about this very problem. Latest status is that Sarah
is looking into making a patch for the kernel xhci-hcd driver, which
might behave slightly differently than ehci-hcd, causing also your
issue. Hold on for her patch. See thread:

usbdevfs: BULK_CONTINUATION flag does not work with XHCI controller

http://marc.info/?l=linux-usb&m=133882811627994

(Warning: big cross-posting.)


//Peter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Sarah Sharp
2012-06-07 15:59:23 UTC
Permalink
Post by James
Hello,
I'm experiencing issues with Canon EOS DSLRs (60D, 400D -- both have
USB 2.0 connections) when connected to a USB 3.0 port on my
notebook. After connecting it, the camera seems to be recognised by
the kernel, but is sometimes unusable by gphoto2; Nautilus never
seems to recognise it on USB 3.0. In dmesg, immediately after
[ 72.674463] usb 3-1: new high-speed USB device number 2 using xhci_hcd
[ 72.764255] usb 3-1: New USB device found, idVendor=04a9, idProduct=3215
[ 72.764265] usb 3-1: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[ 72.764272] usb 3-1: Product: Canon Digital Camera
[ 72.764276] usb 3-1: Manufacturer: Canon Inc.
[ 72.765264] usb 3-1: ep 0x81 - rounding interval to 32768
microframes, ep desc says 0 microframes
[ 72.765275] usb 3-1: ep 0x2 - rounding interval to 32768
microframes, ep desc says 0 microframes
Can you please post the output of `sudo lsusb -v -d 04a9:3215`? Your
device is advertising an endpoint interval of zero microframes, and the
xHCI driver is setting the internally used interval to the highest
interval. That would make interrupt or isochronous transfers take a
*very* long time. The xHCI driver should just set the interval to one
microframe instead.

It's possible the interval issue is the root cause of your problems, so
let's get that fixed before we assume it's a libusb issue.
Post by James
Sometimes gphoto2 works, but the most consistent way I've found to
make it fail is to run gphoto2 -L shortly after connecting (which
might be successful), and then run it again. If this fails, there's
a delay of a few seconds and it returns
*** Error ***
PTP I/O error
*** Error ***
An error occurred in the io-library ('Unspecified error'): No error
description available
*** Error (-1: 'Unspecified error') ***
and messages like
usbfs: usb 3-1: process 8502 (pool) did not claim interface 0 before use
That's an issue with gphoto. It needs to claim the interface before it
uses it.
Post by James
appear in dmesg. I have logs showing what appears in dmesg after
enabling usbfs_snoop in both the for both USB 2.0 and USB 3.0; and
gphoto2's debugging output. Let me know if these would be helpful
and I'll send them (please let me know the most appropriate
destination and format).
I need a usbmon log of the failed and successful gphoto2 runs, dmesg
with CONFIG_USB_XHCI_HCD_DEBUGGING and CONFIG_USB_DEBUG turned on, and
the usbfs_snoop log. Please send in plain text, or if that's too big,
then send a zip file.
Post by James
Everything works fine with USB 2.0.
Distro: Fedora 17
Kernel 3.4
Hooray, a recent stable kernel. :) Are you ok with building a custom
kernel if I need you to test patches?
Post by James
gphoto2 2.4.14
USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller
(rev 04) (prog-if 30 [XHCI])
Camera: 04a9:3215 Canon EOS 60D, firmware up-to-date
Sarah Sharp
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Alan Stern
2012-06-07 16:58:20 UTC
Permalink
Post by Sarah Sharp
Post by James
Hello,
I'm experiencing issues with Canon EOS DSLRs (60D, 400D -- both have
USB 2.0 connections) when connected to a USB 3.0 port on my
notebook. After connecting it, the camera seems to be recognised by
the kernel, but is sometimes unusable by gphoto2; Nautilus never
seems to recognise it on USB 3.0. In dmesg, immediately after
[ 72.674463] usb 3-1: new high-speed USB device number 2 using xhci_hcd
[ 72.764255] usb 3-1: New USB device found, idVendor=04a9, idProduct=3215
[ 72.764265] usb 3-1: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[ 72.764272] usb 3-1: Product: Canon Digital Camera
[ 72.764276] usb 3-1: Manufacturer: Canon Inc.
[ 72.765264] usb 3-1: ep 0x81 - rounding interval to 32768
microframes, ep desc says 0 microframes
[ 72.765275] usb 3-1: ep 0x2 - rounding interval to 32768
microframes, ep desc says 0 microframes
Can you please post the output of `sudo lsusb -v -d 04a9:3215`? Your
device is advertising an endpoint interval of zero microframes, and the
xHCI driver is setting the internally used interval to the highest
interval. That would make interrupt or isochronous transfers take a
*very* long time. The xHCI driver should just set the interval to one
microframe instead.
I've seen those sorts of messages many times before. They probably are
bulk endpoints.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
James
2012-06-07 20:03:57 UTC
Permalink
Post by Sarah Sharp
Can you please post the output of `sudo lsusb -v -d 04a9:3215`?
Bus 003 Device 003: ID 04a9:3215 Canon, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x04a9 Canon, Inc.
idProduct 0x3215
bcdDevice 0.02
iManufacturer 1 Canon Inc.
iProduct 2 Canon Digital Camera
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 2mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 6 Imaging
bInterfaceSubClass 1 Still Image Capture
bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470)
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0001
Self Powered


[Note that I get "rounding interval" messages with pretty much anything
I attach to a USB 3.0 port (mouse, 3G modem -- also not *entirely* happy
on USB 3.0, but probably another story), but they work fine so I
generally ignore it.]
Post by Sarah Sharp
I need a usbmon log of the failed and successful gphoto2 runs, dmesg
with CONFIG_USB_XHCI_HCD_DEBUGGING and CONFIG_USB_DEBUG turned on, and
the usbfs_snoop log. Please send in plain text, or if that's too big,
then send a zip file.
Right, I *think* I've captured this stuff, but as it's 1MB I've included
it in the attached zip file. I built a kernel with those options
enabled, enabled usbfs_snoop, and ran usbmon according to the kernel
docs (on 3u). The files and actions I took are:

01 - dmesg taken before attaching the camera
02 - dmesg having just attached & started the camera

I then ran gphoto2 -L twice, it failed in both cases, giving

03 - the usbmon output for the first failed gphoto2 sessions

Then turned the camera off, too another dmesg:

04 - dmesg after the camera was turned off.

Tried again, this time running gphoto2 quickly a number of times after
attaching.

05 - usbmon output featuring the successful runs

Finally switched off the camera.

06 - dmesg after unplugging.

Hope this includes all you need.

I am willing to test patches.

Thanks,
James.

Loading...