0

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.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Nicko
  • 51
  • 1
  • 1
  • So you are trying to present the [android app custom java midi implementation as a Android Framework MidiService](https://developer.android.com/reference/android/media/midi/package-summary.html#manifest_files) or are you trying to build your own Custom ROM and make it so that your non-compliant device appears as a compliant device? – Morrison Chang Nov 21 '19 at 06:47
  • Which device is this? – CL. Nov 21 '19 at 08:25

1 Answers1

0

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.

CL.
  • 173,858
  • 17
  • 217
  • 259