I am currently trying to interface with a USB audio device from user land. I currently have the device fully enumerated and I\'ve set the interface and set the alternative
Ok so it turns out that the problem is due to the fact that the android OS has placed an HID driver to handle the HID controls. This seems to block up the bandwidth. Detaching these drivers from the HID interfaces releases the bandwidth allowing the isochronous transfer to proceed.
You detach the kernel driver by doing the following:
usbdevfs_ioctl command;
command.ifno = mpInterface->GetInterfaceNumber();
command.ioctl_code = USBDEVFS_DISCONNECT;
command.data = NULL;
int ret = ioctl( fd, USBDEVFS_IOCTL, &command );
Otherwise what I have done is correct.
I understand the only reason you're not using libusb is that you can't open the usb device by by yourself but you do have a file descriptor pointing to it.
If this is all correct, why are you trying to re-implement everything there is in libusb instead of just re-implementing the usb_open() function which would take a file descriptor as argument and your struct usb_device*. You could take most of the code from the libusb usb_open() source code, and use libusb for the rest.
I have written a Java class for user mode USB isochronous transfer: UsbIso
It uses JNA to access the USBFS API via IOCTL calls.