managed-midi icon indicating copy to clipboard operation
managed-midi copied to clipboard

Droid: MidiManager.GetDevices() returns 0 devices...

Open BradChase2011 opened this issue 4 years ago • 2 comments

I was wondering if this is an issue with Xamarin/Mono or why the device count is 0? doing something as simple as this:

            MidiManager manager = GetSystemService(Context.MidiService) as MidiManager;
            MidiDeviceInfo[] devInfo = manager.GetDevices();

to verify why MidiAccessManager.Default.Outputs was throwing a null reference.

Unfortunately GetDevices() on 4 different phones/tablets using the latest VS 2019 always has a count of 0. PackageManager.HasSystemFeature(PackageManager.FeatureMidi) always shows as true.

So I guess my question is, are there any samples to run on android and is there a way to check if this is an issue with all of our devices, managed-midi, or Xamarin.Android. Thanks much! Cant wait to use the library.

BradChase2011 avatar Feb 15 '20 21:02 BradChase2011

I haven't pushed anything than master version of my own app (already obsolete). I have been Linux based developer and after I left Xamarin I had little chance have hackable Xamarin.Android environment (their build had been broken quite often, Linux is unsupported, and no IDE due to shitty leadership at VS team) and now I'm away from other devices that has Xamarin set up. So my suggestions are all without trying anything:

  1. There is a distance between feature flags and device availability. Android has no pre-installed devices by default (so as Mac). Have some midi device service apps installed (for example OPL3 Midi Synthesizer or Fluidsynth Midi Synthesizer) and see if they show up as MIDI devices on other apps (like Dreamhound).
  2. If they show up, then try with your MidiManager client app and see if they show up.
  3. Whenever possible it's always good to try the same code logic on Android Studio and see if it works. Looks like it can be quite simple two lines of code in Kotlin within default MainActivity in default app template.

atsushieno avatar Feb 16 '20 03:02 atsushieno

Hey thanks much for the reply. Yea I definitely understand some of those points for sure! So quick question then... Do you happen to have an example of your fluid synth service code? I saw you had a test app, but I couldnt find any code to look at for including the libraries and such.

Thanks again!

BradChase2011 avatar Feb 19 '20 21:02 BradChase2011