USB isochronous data transfer

I'm currently trying to find a way to handle USB data transfer on an isochronous endpoint on my Android 3.2 tablet (host mode is supported). After writing the prototype code, I noticed that the constant file for USB_ENDPOINT_XFER_ISOC states that "Type is Isochronous endpoint (not currently supported)."

Is this possible without rooting the device? If so, how do I do this?

Ideally, I was hoping to stay in the java API, but if this is possible only through the NDK, I would have to continue this. I also understand that there may be some problems with USB bandwidth, based on the following message: USB user-mode isochronous transfer from device to host

+6
source share
2 answers

I think you can do it without a root.

You will need to do all this using the native C code interface with a USB device using USBFS. The big problem is the lack of linux usbfs documentation. Basically, everything should be done through ioctls. However, you open the device, as usual, with Java. Then you pass the file descriptor from USBDeviceConnection

Add to this that you will need to parse all the USB descriptors yourself. You can get them again from the USBDeviceConnection . Going from descriptor to descriptor is just a search for documentation for which each descriptor means a MASSIVE headache, but you can find most of the documentation at www.usb.org.

I wrote most of the code that is required for parsing audio devices, and I got to the point of trying to send an isochronous transmission, and then started getting errors.

After switching to libusb, I found that the problem in my case was that the audio device also had HID controllers, and the default driver was attacked by this and steal the entire bandwidth from isochronous transmission. If I knew this before, I could continue to use the non-root non-libusb method. As it was, I got isochronous translations working via lib usb, but this required a root device :(

At some point I will return to him.

In conclusion, I am sure it is possible, but it will not be easy!

+5
source

I wrote a Java class for isochronous USB data transfer in Android (or Linux): UsbIso

It uses JNA to access the USBFS API through IOCTL calls.

+6
source

Source: https://habr.com/ru/post/906163/


All Articles