'How to use android midi USB stack with non-compliant devices
I have a working android app which uses a proprietary java midi implementation to talk to a non-compliant midi device over USB. I now want to move to the standard android midi USB stack but can’t determine how to add/extend the necessary tests to allow the non-compliant device to be detected as a midi device.
The non-compliant device does not present an “Audio Device” type USB interface - which is required in order to be midi class compliant - but rather a number of “Vendor Specific” interfaces, which represent the midi ports. Because of this, the android midi stack (eg using the sample MidiScope) does not see the device.
The current, proprietary stack, on USB device connect, uses a priori knowledge of the specific vendor connection details to determine that the connection is indeed a midi device, and then creates midi device connection events using the correct USB interfaces.
I want to reproduce this connection logic, but using android’s midi stack, but can’t find where incoming USB connection is determined to be a midi device, and thus passed to the android midi service. I have examined the android source for UsbDeviceManager, UsbHostManager, UsbService, MidiService, MidiManager, MidiDeviceInfo, MidiDeviceService etc but can’t not see where this ‘midi device validation/filtering” occurs.
If anyone can point me in the right direction as to how I can achieve my goal I would be very grateful.
Solution 1:[1]
Android's UsbAlsaManager.java just uses the Linux MIDI devices.
So to be able to access your device in Android, you have to add support to the Linux USB MIDI driver, and then wait until the new kernel version shows up on your Android device.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | CL. |