[libhid-discuss] Different behaviour in x86 and ARM targets

jose.goncalves at inov.pt jose.goncalves at inov.pt
Thu Mar 12 02:09:28 UTC 2009


Hi,

I am using libhid 0.2.16 to read data from a barcode scanner.
This is an example of what I do:

while (1) {
	ret = hid_interrupt_read(hid, ENDPOINT_ADDR, packet, PACKET_LEN, 100);
	if (ret == HID_RET_SUCCESS) {
		/* process data */
	} else if (ret != HID_RET_TIMEOUT) {
		fprintf(stderr, "ERROR %d: %s\n", ret, hid_strerror(ret));
		sleep(1);
	} else {
		/* process timeout */
	}
}

While this works fine on my PC with Ubuntu 8.10 (kernel 2.6.27), on a 
ARM target (kernel 2.6.24), with the same libhid sources, I have an 
error on every first hid_interrupt_read() call that occurs after a 
timeout. Here is the libhid log of that situation (no scanner data 
input):

NOTICE: hid_force_open(): successfully opened USB device 001/009[0].
  TRACE: hid_interrupt_read(): retrieving interrupt report from device 
001/009[0] ...
WARNING: hid_interrupt_read(): timeout on interrupt read from device 
001/009[0]
  TRACE: hid_interrupt_read(): retrieving interrupt report from device 
001/009[0] ...
WARNING: hid_interrupt_read(): failed to get all of interrupt report 
from device 001/009[0]; requested: 64 bytes, sent: 0 bytes.
ERROR 21: libhid: interrupt read failed
  TRACE: hid_interrupt_read(): retrieving interrupt report from device 
001/009[0] ...
WARNING: hid_interrupt_read(): timeout on interrupt read from device 
001/009[0]
  TRACE: hid_interrupt_read(): retrieving interrupt report from device 
001/009[0] ...
WARNING: hid_interrupt_read(): failed to get all of interrupt report 
from device 001/009[0]; requested: 64 bytes, sent: 0 bytes.
ERROR 21: libhid: interrupt read failed  TRACE: hid_interrupt_read(): 
retrieving interrupt report from device 001/009[0] ...

Executing the same code on x86 Ubuntu I get only timeouts, no errors:

NOTICE: hid_force_open(): successfully opened USB device 001/007[0].
  TRACE: hid_interrupt_read(): retrieving interrupt report from device 
001/007[0] ...
WARNING: hid_interrupt_read(): timeout on interrupt read from device 
001/007[0]
  TRACE: hid_interrupt_read(): retrieving interrupt report from device 
001/007[0] ...
WARNING: hid_interrupt_read(): timeout on interrupt read from device 
001/007[0]
  TRACE: hid_interrupt_read(): retrieving interrupt report from device 
001/007[0] ...

Do you know what could be the problem?

Regards,
José Miguel Gonçalves




More information about the libhid-discuss mailing list