[libhid-discuss] Trouble with IOCTL_USB_REAPURB

Storm Scratcher stormscratcher at gmail.com
Fri Dec 22 11:41:10 CET 2006


Hi Charles,

Thanks for answers.

Host controller is a SL811HS.

I tried with libusb-0.1.8 and i get this : "could not claim interface 0:
Device or resource busy"

usb_set_debug: Setting debugging level to 9 (on)
 NOTICE: hid_init(): libhid 0.2.14.0.0 is being initialized.
  TRACE: hid_init(): initialising USB subsystem...
usb_os_init: Found USB VFS at /proc/bus/usb
  TRACE: hid_init(): scanning for USB busses...
usb_os_find_busses: Skipping non bus directory devices
usb_os_find_busses: Skipping non bus directory drivers
usb_os_find_busses: Found 001
  TRACE: hid_init(): scanning for USB devices...
usb_os_find_devices: Found 001 on 001
Config descriptor too short (expected 257, got 15)
usb_os_find_devices: Found 002 on 001
Config descriptor too short (expected 257, got 15)
usb_os_find_devices: Found 003 on 001
Config descriptor too short (expected 257, got 24)
 NOTICE: hid_init(): successfully initialised HID library.
  TRACE: hid_new_HIDInterface(): creating a new HIDInterface instance...
  TRACE: hid_force_open(): forcefully opening a device interface according
to matching criteria...
  TRACE: hid_get_usb_handle(): acquiring handle for a USB device...
  TRACE: hid_find_usb_device(): enumerating USB busses...
  TRACE: hid_find_usb_device(): enumerating USB devices on bus 001...
  TRACE: hid_find_usb_device(): inspecting USB device 001/001[0]...
Check that you have permissions to write to 001/001 and, if you don't, that
you set up hotplug (http://linux-hotplug.sourceforge.net/) correctly.
USB error: could not claim interface 0: Device or resource busy
  TRACE: hid_compare_usb_device(): comparing match specifications to USB
device...
  TRACE: hid_compare_usb_device(): inspecting vendor ID...
  TRACE: hid_compare_usb_device(): no match on vendor ID.
  TRACE: hid_compare_usb_device(): inspecting product ID...
  TRACE: hid_compare_usb_device(): no match on product ID.
  TRACE: hid_compare_usb_device(): no custom matching function supplied.
 NOTICE: hid_find_usb_device(): vendor 0x0000 of USB device 001/001[0] does
not match 0x0c2e.
  TRACE: hid_find_usb_device(): inspecting USB device 001/002[0]...
Check that you have permissions to write to 001/002 and, if you don't, that
you set up hotplug (http://linux-hotplug.sourceforge.net/) correctly.
USB error: could not claim interface 0: Device or resource busy
  TRACE: hid_compare_usb_device(): comparing match specifications to USB
device...
  TRACE: hid_compare_usb_device(): inspecting vendor ID...
  TRACE: hid_compare_usb_device(): no match on vendor ID.
  TRACE: hid_compare_usb_device(): inspecting product ID...
  TRACE: hid_compare_usb_device(): match on product ID: 0x0234.
  TRACE: hid_compare_usb_device(): no custom matching function supplied.
 NOTICE: hid_find_usb_device(): vendor 0x050d of USB device 001/002[0] does
not match 0x0c2e.
  TRACE: hid_find_usb_device(): inspecting USB device 001/003[0]...
Check that you have permissions to write to 001/003 and, if you don't, that
you set up hotplug (http://linux-hotplug.sourceforge.net/) correctly.
USB error: could not claim interface 0: Device or resource busy
  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: 0x0c2e.
  TRACE: hid_compare_usb_device(): inspecting product ID...
  TRACE: hid_compare_usb_device(): match on product ID: 0x0200.
  TRACE: hid_compare_usb_device(): no custom matching function supplied.
 NOTICE: hid_find_usb_device(): found a matching USB device 001/003[0].
  TRACE: hid_force_open(): claiming USB device 001/003[0].
Check that you have permissions to write to 001/003 and, if you don't, that
you set up hotplug (http://linux-hotplug.sourceforge.net/) correctly.
USB error: could not claim interface 0: Device or resource busy
  TRACE: hid_os_force_claim(): failed to claim USB device 001/003[0], trying
2 more time(s)...
  TRACE: hid_os_force_claim(): detaching kernel driver from USB device
001/003[0]...
  TRACE: hid_os_force_claim(): trying again to claim USB device
001/003[0]...
 NOTICE: hid_force_open(): successfully claimed USB device 001/003[0].
  TRACE: hid_init_parser(): initialising the HID parser for USB Device
001/003[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 001/003[0].
  TRACE: hid_prepare_hid_descriptor(): initialising the HID descriptor for
USB device 001/003[0]...
  TRACE: hid_prepare_hid_descriptor(): retrieving HID descriptor for USB
device 001/003[0]...
 NOTICE: hid_prepare_hid_descriptor(): successfully initialised HID
descriptor for USB device 001/003[0] (63 bytes).
  TRACE: hid_prepare_report_descriptor(): initialising the report descriptor
for USB device 001/003[0]...
  TRACE: hid_prepare_report_descriptor(): retrieving report descriptor for
USB device 001/003[0]...
 NOTICE: hid_prepare_report_descriptor(): successfully initialised report
descriptor for USB device 001/003[0].
  TRACE: hid_prepare_parser(): setting up the HID parser for USB device
001/003[0]...
  TRACE: hid_reset_parser(): resetting the HID parser for USB device
001/003[0]...
  TRACE: hid_prepare_parser(): dumping the raw report descriptor
  TRACE: hid_prepare_parser(): 0x000: 0x05 0x01 0x09 0x06 0xa1 0x01 0x05
0x07
  TRACE: hid_prepare_parser(): 0x008: 0x19 0xe0 0x29 0xe7 0x15 0x00 0x25
0x01
  TRACE: hid_prepare_parser(): 0x010: 0x75 0x01 0x95 0x08 0x81 0x02 0x95
0x01
  TRACE: hid_prepare_parser(): 0x018: 0x75 0x08 0x81 0x01 0x95 0x05 0x75
0x01
  TRACE: hid_prepare_parser(): 0x020: 0x05 0x08 0x19 0x01 0x29 0x05 0x91
0x02
  TRACE: hid_prepare_parser(): 0x028: 0x95 0x01 0x75 0x03 0x91 0x01 0x95
0x06
  TRACE: hid_prepare_parser(): 0x030: 0x75 0x08 0x15 0x00 0x25 0x65 0x05
0x07
  TRACE: hid_prepare_parser(): 0x038: 0x19 0x00 0x29 0x65 0x81 0x00 0xc0
  TRACE: hid_prepare_parser(): parsing the HID tree of USB device
001/003[0]...
 NOTICE: hid_prepare_parser(): successfully set up the HID parser for USB
device 001/003[0].
 NOTICE: hid_force_open(): successfully opened USB device 001/003[0].
device identification of HIDInterface 001/003[0]:
  dev_handle:    0x00028f98
  device:        0x0002c450
  location:      001/003
  manufacturer:  Metrologic
  product:       Metrologic Scanner
  TRACE: hid_reset_parser(): resetting the HID parser for USB device
001/003[0]...
  TRACE: hid_dump_tree(): iterating the parse tree for USB device
001/003[0]...
parse tree of HIDInterface 001/003[0]:
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x90
  path: 0x00010006.0x00000000; type: 0x90
  path: 0x00010006.0x00000000; type: 0x90
  path: 0x00010006.0x00000000; type: 0x90
  path: 0x00010006.0x00000000; type: 0x90
  path: 0x00010006.0x00000000; type: 0x90
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  path: 0x00010006.0x00000000; type: 0x80
  TRACE: hid_reset_parser(): resetting the HID parser for USB device
001/003[0]...
Begin Run() ...
USB_ENDPOINT_IN = 128
  TRACE: hid_interrupt_read(): retrieving interrupt report from device
001/003[0] ...
WARNING: hid_interrupt_read(): failed to get interrupt read from device
001/003[0]: could not claim interface 0: Device or resource busy
End Run() ...



2006/12/21, Charles Lepple <clepple at ghz.cc>:
>
> On Dec 20, 2006, at 11:58 AM, Storm Scratcher wrote:
>
> > Hi !
> >
> >  I use libusb 0.1.12 and libhid from svn (0.2.14 i think) on arm7
> >  platform running kernel 2.4.24
> >  I wrote a program which read data from a metrologic barcode scanner
> >  I use hid_interrupt_read() function to get data from scanner :
> >
> >  m_iHIDErrorCode = hid_interrupt_read( m_pHidHandle, USB_ENDPOINT_IN
> > +1,
> >  un_pcData, un_uiDataLength, un_uiTimeout );
> >
> >  With a timeout of 1000, it hangs during an IOCTL_USB_REAPURB in
> > one of
> >  the libusb functions : usb_urb_transfer() ( called by
> >  usb_interrupt_read() called by hid_interrupt_read() :) )
>
> This sounds like a bad interaction between your version of libusb and
> the kernel.
>
> Which host controller interface are you using - OHCI or UCHI?
>
> Older versions of libusb (0.1.10, or maybe earlier) did not use the
> URB ioctl()s, but used the proc interface to send and receive
> packets. If you have time, that's what I would look at first.
>
> >  With a timeout of 0, i can read data from scanner without problems
> > but
> >  when i close connection, i was unable to read data from device (my
> >  program is blocked on hid_interrupt_read() function). I need to
> > reboot
> >  the cpu
> >
> >  I test my program into my computer (i386) on Redhat Fedora Core 5
> > (kernel 2.6.15) and
> >  i don't notice any problems to read data from scanner with my program
> >  (and the same librairies compiled for i386).
> >
> >  Can you explain function hid_set_idle(), i do this after open
> >  connection with hid_force_open function :
>
> This is a thin wrapper around the HID Set_Idle request. See the HID
> spec (page 62 of version 1.11) for more details:
>
> http://www.usb.org/developers/devclass_docs/HID1_11.pdf
>
> You probably want to set the idle time to something non-zero. The
> actual value will depend on the application.
>
>
> --
> Charles Lepple
> clepple at ghz.cc
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20061222/293f9d80/attachment.htm


More information about the libhid-discuss mailing list