USB Midi driver for Android crashes

806 views Asked by At

I am trying to use this USB-MIDI-Driver https://github.com/kshoji/USB-MIDI-Driver in my project. I added the driver using gradle,

maven {url 'https://github.com/kshoji/USB-MIDI-Driver/raw/master/MIDIDriver/snapshots'}
...
compile 'jp.kshoji:midi-driver:0.1.1:@aar'

copied the sample (https://github.com/kshoji/USB-MIDI-Driver/blob/master/MIDIDriverSample/src/jp/kshoji/driver/midi/sample/UsbMidiDriverSampleActivity.java), removed the "play audio" part and started the activity from my MainActivity.

My problem is, that with time it gets slower and slower, it misses events, I skip frames, the ui becomes unresponsive, the device is detatched and my app crashes more or less... The pre-compiled project from Google Play Market works fine though.

The only thing I can think of is that I use the wrong version of the driver or sample... Is there anyone who had a similar problem and can help me?

1

There are 1 answers

0
Kolja Kirsch On BEST ANSWER

I did not really find an answer but followed kshojis comment in Send MIDI messages over USB on Android and tried the alternative driver he suggests (http://www.humatic.de/htools/nmj/).

nmj seems to use much less resources but requires you to interpret midi-events. http://www.petesqbsite.com/sections/express/issue18/midifilespart1.html is a nice resource on how to read midi.