[libhid-discuss] Timeout getting HID Descriptor

rbjones999 at comcast.net rbjones999 at comcast.net
Wed Aug 26 18:13:21 UTC 2009


Thanks for the pointer to usbsnoop solution - this appears to work! 

Ron 


----- Original Message ----- 
From: "Charles Lepple" <clepple at ghz.cc> 
To: rbjones999 at comcast.net 
Cc: libhid-discuss at lists.alioth.debian.org 
Sent: Tuesday, August 25, 2009 6:26:04 PM GMT -06:00 US/Canada Central 
Subject: Re: [libhid-discuss] Timeout getting HID Descriptor 

On Aug 25, 2009, at 5:46 PM, rbjones999 at comcast.net wrote: 

> Hello, 
> 
> I'm getting a timeout getting the HID Descriptor from a third party 
> device. Here is the lsusb -vvv output: 
> 
> Bus 005 Device 002: ID 0483:5057 SGS Thomson Microelectronics 
[...] 
> Report Descriptor: (length is 34) 
> Item(Global): Usage Page, data= [ 0xa0 0xff ] 65440 
> (null) 
> Item(Local ): Usage, data= [ 0xa5 ] 165 
> (null) 
> Item(Main ): Collection, data= [ 0x01 ] 1 
> Application 
> Item(Local ): Usage, data= [ 0xa6 ] 166 
> (null) 
> Item(Local ): Usage, data= [ 0xa7 ] 167 
> (null) 
> Item(Global): Logical Minimum, data= [ 0x80 ] 128 
> Item(Global): Logical Maximum, data= [ 0x7f ] 127 
> Item(Global): Report Size, data= [ 0x08 ] 8 
> Item(Global): Report Count, data= [ 0x3c ] 60 
> Item(Main ): Input, data= [ 0x02 ] 2 
> Data Variable Absolute No_Wrap Linear 
> Preferred_State No_Null_Position 
> Non_Volatile Bitfield 
> Item(Local ): Usage, data= [ 0xa9 ] 169 
> (null) 
> Item(Global): Logical Minimum, data= [ 0x80 ] 128 
> Item(Global): Logical Maximum, data= [ 0x7f ] 127 
> Item(Global): Report Size, data= [ 0x08 ] 8 
> Item(Global): Report Count, data= [ 0x3c ] 60 
> Item(Main ): Output, data= [ 0x02 ] 2 
> Data Variable Absolute No_Wrap Linear 
> Preferred_State No_Null_Position 
> Non_Volatile Bitfield 
> Item(Main ): End Collection, data=none 
[...] 
> can't get debug descriptor: Connection timed out 
> cannot read device status, Connection timed out (110) 

Despite the timeout messages, lsusb got the HID report descriptor. 

> Note the timeouts at the end. And here is the output of the HID test 
> program, modified to match this device: 
> 
> TRACE: hid_find_usb_device(): inspecting USB device 005/002[0]... 
> TRACE: hid_compare_usb_device(): comparing match specifications to 
> USB device... 
> TRACE: hid_compare_usb_device(): inspecting vendor ID... 
> TRACE: hid_compare_usb_device(): match on vendor ID: 0x0483. 
> TRACE: hid_compare_usb_device(): inspecting product ID... 
> TRACE: hid_compare_usb_device(): match on product ID: 0x5057. 
> TRACE: hid_compare_usb_device(): no custom matching function 
> supplied. 
> NOTICE: hid_find_usb_device(): found a matching USB device 
> 005/002[0]. 
> TRACE: hid_force_open(): claiming USB device 005/002[0]. 
> NOTICE: hid_force_open(): successfully claimed USB device 005/002[0]. 
> TRACE: hid_init_parser(): initialising the HID parser for USB 
> Device 005/002[0]... 
> TRACE: hid_init_parser(): allocating space for HIDData structure... 
> TRACE: hid_init_parser(): successfully allocated memory for 
> HIDData strcture. 
> TRACE: hid_init_parser(): allocating space for HIDParser 
> structure... 
> TRACE: hid_init_parser(): successfully allocated memory for 
> HIDParser strcture. 
> NOTICE: hid_init_parser(): successfully initialised the HID parser 
> for USB Device 005/002[0]. 
> TRACE: hid_prepare_hid_descriptor(): initialising the HID 
> descriptor for USB device 005/002[0]... 
> TRACE: hid_prepare_hid_descriptor(): retrieving HID descriptor for 
> USB device 005/002[0]... 
> WARNING: hid_prepare_hid_descriptor(): failed to get HID descriptor 
> for USB device 005/002[0]:error sending control message: Connection 
> timed out 
[...] 

This is a different timeout. 

> Any help is greatly appreciated. This device works on Windows with 
> the vendor's software. 

I suspected as much. I believe lsusb is retrieving the HID descriptors 
from the end of the interface or configuration descriptor, but libhid 
is using what should be an equally valid request to fetch /just/ the 
HID descriptor. 

Since the device is not behaving according to spec, you may have 
better luck just operating it with the vendor's software, and using 
usbsnoop2libusb[*] to construct a custom libusb-based driver. 

[*] http://iki.fi/lindi/darcs/usbsnoop2libusb/usbsnoop2libusb.pl 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20090826/2b479dd0/attachment.htm>


More information about the libhid-discuss mailing list