libusb and Android: libusb_control_transfer timeout

286 views
Skip to first unread message

Andrei

unread,
Jun 21, 2011, 8:34:49 PM6/21/11
to android-platform
Hi all

I've run into some trouble while porting some code to android. I took
a code snippet from our linux application that communicates with our
device through libusb and began porting it. Using the android-ndk-r5b
everything compiles fine. I copied over the libusb source and included
it as a static library in my shared library, then I load the shared
library from my app.
On the android phone (Samsung Galaxy S2) I plug in our device using an
OTG cable and then mount the usbfs with devmode=0666.

The problem occurs at the point in the code where
libusb_control_transfer() is called. Keep in mind that up until this
point other libusb commands like libusb_get_device_list(),
libusb_get_device_descriptor, libusb_claim_interface() are successful
and I can find my device by checking vid pid of available devices.

I've tried to track down in the kernel source where the timeout occurs
and I've found that in the file drivers/usb/core/message.c in the
function usb_start_wait_urb(), that usb_submit_urb() returns
successfully, but then times out right after that. Seems like the urb
is queued and that's it, my app hangs waiting for its completion.

Any help or pointers on what to do from here or where to look?
Reply all
Reply to author
Forward
0 new messages