monkeyswarm / MobMuPlat

MobMuPlat is an iOS & Android app to host PureData patches with custom visual interfaces and hardware access.
www.mobmuplat.com
Other
182 stars 25 forks source link

Direct input/output from/to USB devices (bypassing the Android Driver) & Oboe support #88

Open pingarelho opened 1 year ago

pingarelho commented 1 year ago

MobMuPlat is one of the coolest apps I have ever used on Android. The only problem I have encountered while using it is latency. Both my tablet's (Android 8.0) built in DAC/ADC and an external audio interface using an OTG cable generate latency that deems playing with a MIDI controller impossible.

To circumvent this, an USB audio driver that communicates directly with class-compliant interfaces/DACs could be implemented. This has been done by the company eXtream Software Development with their Audio Evolution Mobile and USB Audio Player PRO apps. A company called HiBy has also implemented something similar with HiBy Music. This app also claims to do "direct output to USB DAC".

Unfortunately I couldn't find any open source drivers or libraries that claim to do this. There is Oboe which seems to have lower latency than MobMuPlat over AAudio (Android 8.1+, API 27+, tested on my phone with an app that supports it) but when you have to stick to OpenSL ES (Android 4.1+, API 16+, tested on my tablet) it is still terrible. I suspect this is the library that MobMuPlat uses for audio?

Furthermore, a dedicated USB audio driver would allow the app to utilize 24/32 bit depths and higher sample rates for external DACs that support them. From what I've gathered, Oboe doesn't do this, but it would still allow for MobMuPlat to have lower latency on Android 8.1+ devices.