On Tue, Feb 08, 2005 at 05:15:49PM +0100, Aur?lien Jarno wrote: > Brian Ristuccia wrote: > >On Tue, Feb 08, 2005 at 10:13:51AM +0100, Aurelien Jarno wrote: > > > >>Do you get also the problem with 'lsusb -v' (for the usbutils packages). > >>As it cycle through all possible values of the libusb structures, it > >>think it is a good test. > >> > > > > > >lsusb -v seems to work OK. But it's not linked against the libusb shared > >library on this system. > Which system are you using? lsusb is linked to libusb in both sarge and sid. >
After some testing, I determined that the combination of usbutils (0.70-1) and libusb-0.1-4 (0.1.9-1) on arm results in bogus zero values for bNumInterfaces and the associated *interface pointer winds up null. This same code works fine on x86. Both gphoto2 and ptpcam assume that bNumInterfaces is >=1 and dev->config->interface always points at a valid usb_interface structure, so that would explain their crashing in this case. The lsusb in usbutils (0.9-1) on arm returns the correct values. See battached for a side-by-side diff of output from usbutils lsusb (0.9-1) and usbutils lsusb (0.70-1). Hope this helps. -- Brian Ristuccia [EMAIL PROTECTED]
Bus 001 Device 001: ID 0000:0000 Virtual Hub | Bus 001 Device
001: ID 0000:0000
Device Descriptor: Device
Descriptor:
bLength 18 bLength
18
bDescriptorType 1
bDescriptorType 1
bcdUSB 1.10 bcdUSB
1.10
bDeviceClass 9 Hub bDeviceClass
9 Hub
bDeviceSubClass 0 |
bDeviceSubClass 0 Unused
bDeviceProtocol 0
bDeviceProtocol 0
bMaxPacketSize0 8
bMaxPacketSize0 8
idVendor 0x0000 Virtual | idVendor
0x0000
idProduct 0x0000 Hub | idProduct
0x0000
bcdDevice 0.00 bcdDevice
0.00
iManufacturer 0 iManufacturer
0
iProduct 2 USB OHCI Root Hub iProduct
2 USB OHCI Root Hub
iSerial 1 e0020000 iSerial
1 e0020000
bNumConfigurations 1
bNumConfigurations 1
Configuration Descriptor: Configuration
Descriptor:
bLength 9 | bLength
0
bDescriptorType 2 |
bDescriptorType 0
wTotalLength 25 |
wTotalLength 0
bNumInterfaces 1 |
bNumInterfaces 0
bConfigurationValue 1 |
bConfigurationValue 0
iConfiguration 0 |
iConfiguration 0
bmAttributes 0x40 |
bmAttributes 0x00
Self Powered <
MaxPower 0mA MaxPower
0mA
Interface Descriptor: | Hub Descriptor:
bLength 9 | bLength
9
bDescriptorType 4 |
bDescriptorType 41
bInterfaceNumber 0 | nNbrPorts
3
bAlternateSetting 0 |
wHubCharacteristic 0x0010
bNumEndpoints 1 | Ganged
power switching
bInterfaceClass 9 Hub | No
overcurrent protection
bInterfaceSubClass 0 |
bPwrOn2PwrGood 2 * 2 milli seconds
bInterfaceProtocol 0 |
bHubContrCurrent 0 milli Ampere
iInterface 0 |
DeviceRemovable 0x7f
Endpoint Descriptor: |
PortPwrCtrlMask 0x30
bLength 7 | Hub Port
Status:
bDescriptorType 5 | Port 1:
0000.0303 lowspeed power enable connect
bEndpointAddress 0x81 EP 1 IN | Port 2:
0000.0100 power
bmAttributes 3 | Port 3:
0000.0103 power enable connect
Transfer Type Interrupt <
Synch Type none <
wMaxPacketSize 2 <
bInterval 255 <
Language IDs: (length=4) <
0000 (null)((null)) <
Bus 001 Device 006: ID 045e:0048 Microsoft Corp. Bus 001 Device
006: ID 045e:0048 Microsoft Corp.
Device Descriptor: Device
Descriptor:
bLength 18 bLength
18
bDescriptorType 1
bDescriptorType 1
bcdUSB 2.00 bcdUSB
2.00
bDeviceClass 0 Interface | bDeviceClass
0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bDeviceProtocol 0
bMaxPacketSize0 8
bMaxPacketSize0 8
idVendor 0x045e Microsoft Corp. idVendor
0x045e Microsoft Corp.
idProduct 0x0048 idProduct
0x0048
bcdDevice 1.24 bcdDevice
1.24
iManufacturer 0 iManufacturer
0
iProduct 1 | iProduct
1 Microsoft� Office Keyboard
iSerial 0 iSerial
0
bNumConfigurations 1
bNumConfigurations 1
Configuration Descriptor: Configuration
Descriptor:
bLength 9 | bLength
0
bDescriptorType 2 |
bDescriptorType 0
wTotalLength 59 |
wTotalLength 0
bNumInterfaces 2 |
bNumInterfaces 0
bConfigurationValue 1 |
bConfigurationValue 0
iConfiguration 1 |
iConfiguration 0
bmAttributes 0xa0 |
bmAttributes 0x00
Remote Wakeup | MaxPower
0mA
MaxPower 100mA <
Interface Descriptor: <
bLength 9 <
bDescriptorType 4 <
bInterfaceNumber 0 <
bAlternateSetting 0 <
bNumEndpoints 1 <
bInterfaceClass 3 Human Interface Devices <
bInterfaceSubClass 1 Boot Interface Subclass <
bInterfaceProtocol 1 Keyboard <
iInterface 1 <
HID Device Descriptor: <
bLength 9 <
bDescriptorType 33 <
bcdHID 1.10 <
bCountryCode 0 <
bNumDescriptors 1 <
bDescriptorType 34 Report <
wDescriptorLength 60 <
cannot get report descriptor <
Endpoint Descriptor: <
bLength 7 <
bDescriptorType 5 <
bEndpointAddress 0x81 EP 1 IN <
bmAttributes 3 <
Transfer Type Interrupt <
Synch Type none <
wMaxPacketSize 8 <
bInterval 10 <
Interface Descriptor: <
bLength 9 <
bDescriptorType 4 <
bInterfaceNumber 1 <
bAlternateSetting 0 <
bNumEndpoints 1 <
bInterfaceClass 3 Human Interface Devices <
bInterfaceSubClass 0 No Subclass <
bInterfaceProtocol 0 None <
iInterface 1 <
HID Device Descriptor: <
bLength 9 <
bDescriptorType 33 <
bcdHID 1.10 <
bCountryCode 0 <
bNumDescriptors 1 <
bDescriptorType 34 Report <
wDescriptorLength 157 <
cannot get report descriptor <
Endpoint Descriptor: <
bLength 7 <
bDescriptorType 5 <
bEndpointAddress 0x82 EP 2 IN <
bmAttributes 3 <
Transfer Type Interrupt <
Synch Type none <
wMaxPacketSize 8 <
bInterval 10 <
Language IDs: (length=4) <
0409 English(US) <
Bus 001 Device 005: ID 04b0:0406 Nikon Corp. Bus 001 Device
005: ID 04b0:0406 Nikon Corp.
Device Descriptor: Device
Descriptor:
bLength 18 bLength
18
bDescriptorType 1
bDescriptorType 1
bcdUSB 1.10 bcdUSB
1.10
bDeviceClass 0 Interface | bDeviceClass
0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bDeviceProtocol 0
bMaxPacketSize0 8
bMaxPacketSize0 8
idVendor 0x04b0 Nikon Corp. idVendor
0x04b0 Nikon Corp.
idProduct 0x0406 idProduct
0x0406
bcdDevice 1.00 bcdDevice
1.00
iManufacturer 1 | iManufacturer
1 NIKON
iProduct 2 | iProduct
2 NIKON DSC D70
iSerial 0 iSerial
0
bNumConfigurations 1
bNumConfigurations 1
Configuration Descriptor: Configuration
Descriptor:
bLength 9 | bLength
0
bDescriptorType 2 |
bDescriptorType 0
wTotalLength 39 |
wTotalLength 0
bNumInterfaces 1 |
bNumInterfaces 0
bConfigurationValue 1 |
bConfigurationValue 0
iConfiguration 0 |
iConfiguration 0
bmAttributes 0xc0 |
bmAttributes 0x00
Self Powered <
MaxPower 0mA MaxPower
0mA
Interface Descriptor: <
bLength 9 <
bDescriptorType 4 <
bInterfaceNumber 0 <
bAlternateSetting 0 <
bNumEndpoints 3 <
bInterfaceClass 6 <
bInterfaceSubClass 1 <
bInterfaceProtocol 1 <
iInterface 0 <
Endpoint Descriptor: <
bLength 7 <
bDescriptorType 5 <
bEndpointAddress 0x01 EP 1 OUT <
bmAttributes 2 <
Transfer Type Bulk <
Synch Type none <
wMaxPacketSize 64 <
bInterval 0 <
Endpoint Descriptor: <
bLength 7 <
bDescriptorType 5 <
bEndpointAddress 0x82 EP 2 IN <
bmAttributes 2 <
Transfer Type Bulk <
Synch Type none <
wMaxPacketSize 64 <
bInterval 0 <
Endpoint Descriptor: <
bLength 7 <
bDescriptorType 5 <
bEndpointAddress 0x83 EP 3 IN <
bmAttributes 3 <
Transfer Type Interrupt <
Synch Type none <
wMaxPacketSize 8 <
bInterval 10 <
Language IDs: (length=4) <
0409 English(US) <

