|
From: Frank T. <fr...@fr...> - 2009-07-25 23:45:21
|
I am having a problem with missing interrupt reports in my application. I am using libusb-1.0.2 to access a HID device (I'm testing with a Logitech Dual Action gamepad). I can tell I am missing reports, because quite regularly it appears a button is stuck down. If I look in my application debug, I can see that the last report included the key down bit, but no following report to say the key has been released. My original application used libusb-0.1.12 because I wanted it to work on WIN32 too. The application created a background thread for the USB processing. In this thread, I'd loop around forever calling usb_interrupt_read with a 50msec timeout. If I received a message I'd process it, then continue waiting for the next message. Because this wasn't working, I suspected I was receiving interrupts while I wasn't waiting in a usb_interrupt_read. I changed my code so that the USB read thread only did the interrupt read, then put the message in a local queue, minimising the time away from the interrupt read. This didn't help. Next change was to create multiple read threads on the same device. Still no change. Then I upgraded to libusb-1.0.2. The initial port just used sync transfers. Same problem. Next I changed my code to use async requests. It is written such that I can submit multiple transfer requests, and I can run with multiple read threads. Still no change. Help! I am doing something fundementally wrong, or is there something special that needs to be done to read interrupt reports? I'm not sure how libusb works with interrupt reports. I've read some USB documentation that says USB interrupt reports are only returned to the host when polled for. Is this handled by the host hardware, or is this in the device driver? Is this initiated by libusb? Any help will be appreciated. Thanks, Frank |