kshoji / USB-MIDI-Driver

USB MIDI Driver for Android 3.1 or later
Apache License 2.0
290 stars 104 forks source link

Suppress mis-detection as USB Audio. #33

Open kshoji opened 9 years ago

kshoji commented 9 years ago

Some Android devices treat USB MIDI devices as USB Audio devices. When such Android device attaches USB MIDI device, USB Audio will be selected as the audio output source. As the result, sound playing will be stopped.

planethcom commented 9 years ago

Maybe this helps some of you guys. As a workaround, I’ve added this part to the FAQs of my website:


No Sound when USB MIDI Controller/Keyboard connected

This seems to be an Android OS or driver bug on several devices (e.g. Sony XPeria Z1/Z3 running on Android 4.4). Devices with that bug think the connected USB MIDI device is actually an USB Audio interface and therefore route the audio output to the USB MIDI interface rather than the speakers/headphones (which does of course not work).

For now, the only workaround is to override the wrong audio routing in use of an app called SoundAbout, which can be downloaded from Google Play:

https://play.google.com/store/apps/details?id=com.woodslink.android.wiredheadphoneroutingfix https://play.google.com/store/apps/details?id=com.woodslink.android.wiredheadphoneroutingfix

Once installed, follow the steps below:

  1. Launch G-Stomper
  2. Plug in MIDI keyboard (and grant permission)
  3. Launch SoundAbout
  4. Select the desired media for audio in "Media audio" (headphones/speaker)
  5. Set "SoundAbout Service" to "ON" (with or without status)
  6. Go back to G-Stomper

Et voilà, audio works again.

Von: Kaoru Shoji [mailto:notifications@github.com] Gesendet: Donnerstag, 12. März 2015 11:05 An: kshoji/USB-MIDI-Driver Betreff: [USB-MIDI-Driver] Suppress mis-detection as USB Audio. (#33)

Some Android devices treat USB MIDI devices as USB Audio devices. When such Android device attaches USB MIDI device, USB Audio will be selected as the audio output source. As the result, sound playing will be stopped.

— Reply to this email directly or view it on GitHub https://github.com/kshoji/USB-MIDI-Driver/issues/33 .Das Bild wurde vom Absender entfernt.

kshoji commented 9 years ago

I've analysed the SoundAbout app, and wrote the code and document about this issue. Please test the code on the branch. I've tried the code with Xperia Z1(Android 4.4), it seems working well.

planethcom commented 9 years ago

Hi Kaoru

Thanks a million, that’s great news. I’ll analyze the code as soon as possible and test it on the Z3.

Greetings, Andreas

Von: Kaoru Shoji [mailto:notifications@github.com] Gesendet: Donnerstag, 19. März 2015 11:13 An: kshoji/USB-MIDI-Driver Cc: planethcom Betreff: Re: [USB-MIDI-Driver] Suppress mis-detection as USB Audio. (#33)

I've analysed the SoundAbout app, and wrote the code and document about this issue. Please test the code on the branch. I've tried the code with Xperia Z1(Android 4.4), it seems working well.

— Reply to this email directly or view it on GitHub https://github.com/kshoji/USB-MIDI-Driver/issues/33#issuecomment-83479515 .Das Bild wurde vom Absender entfernt.

planethcom commented 9 years ago

Hi Kaoru

Finally our movement is done and I got back to work, and so found time to test your solution.

First of all, excellent work, the solution is simple and works out of the box.

There are 2 things that could be problematic:

  1.  The fact that you restrict it to sony, but the mis-detection appears to happen on many different devices from different manufacturers. 

    But as far as I see this is not an issue, since the restriction could simply be removed.

  2.  You hard link the audio output to the internal speaker/headphone jack. 

    But what if a user has a Bluetooth speaker system connected while connecting Midi Equipment? Shouldn’t there be an option to select where to route the audio output?

I’ve also tested it on the Z3 with the latest Android update (5.0.2) where the mis-detection does not happen anymore (even without the fix). I don’t know if this applies to all Android 5.0.2 builds, but I’d say no, since the manufacturers often work with their own drivers.

However, thanks a ton, as is it already works around 95% of the problems.

Greetings, Andreas

Von: Kaoru Shoji [mailto:notifications@github.com] Gesendet: Donnerstag, 19. März 2015 11:13 An: kshoji/USB-MIDI-Driver Cc: planethcom Betreff: Re: [USB-MIDI-Driver] Suppress mis-detection as USB Audio. (#33)

I've analysed the SoundAbout app, and wrote the code and document about this issue. Please test the code on the branch. I've tried the code with Xperia Z1(Android 4.4), it seems working well.

— Reply to this email directly or view it on GitHub https://github.com/kshoji/USB-MIDI-Driver/issues/33#issuecomment-83479515 .Das Bild wurde vom Absender entfernt.

sinosoidal commented 8 years ago

Hi. I found this issue was the answer to my problems but I can't seem to make the workaround to work. I have registered the UsbAudioConnectionCanceller but I'm not having any intent being filtered. I'm currently using Android 5.1.1 on a Bq Aquaris M5. I'm trying with two distinct MIDI interfaces: Roland UM-ONE and Arturia Minilab. Has anyone here stumbled on this also?