4

I want to do a concept for a real-time interface for audio interaction, so real low latency is essential. I have read a lot about this topic in the last week, but it's impossible to get a real overview in such a short time. So before I dig really deep I need to evaluate the feasibility from this project.

I've read a lot about the problems with Android and low latency audio applications and I know that iOS is way superior in this field, but I would prefer Android when it's possible. (I don't have a mac which is essential for developing iOS, and I just like the more 'open' Andoid more )

So my question are:

  1. Is the bad low latency behaviour only related to actual audio buffer/processing, or does it affect midi or OSC only applications too? For me the interface is the important part - that means it's ok for me just to get midi/OSC commands which are processed in a separate PC.

  2. I need a low overall latency (from the finger touch event to command output). Is this also a problem with Android compared to iOS?

eldarerathis
  • 35,455
  • 10
  • 90
  • 93

3 Answers3

2

Latency is primarily a function of the audio buffer. There is an extensive discussion of the latest developments here:

http://createdigitalmusic.com/2012/07/android-high-performance-audio-in-4-1-and-what-it-means-plus-libpd-goodness-today/

Tl;dr version: Galaxy Nexus is capable of 12ms audio buffer latency as of Jelly Bean. I have read elsewhere that the Nexus 10 and Nexus 4 can do the same, but the Nexus 7 lags behind.

And here is a slightly more technical discussion that will also lead you to a library that uses Open SL to achieve low latency:

https://github.com/libpd/pd-for-android/wiki/Low-latency-support-for-compliant-devices

anthropomo
  • 4,100
  • 1
  • 24
  • 39
2

Android sound's slow latency is related on device's sound buffer length.

I benchmarked with my old Tablet(Android 3.2, Acer ICONIA Tab A500).
The latency of transferring one MIDI event(Note-on) was 12 msec in average.
I think apps without audio can make enough.

I created the benchmark with Java. Using the Android NDK will get better performance.

kshoji
  • 126
  • 1
  • 3
  • Thanks, that's the kind of information I'm looking for! 12 ms sounds not that good, but it's near a usable level. May I ask how you have measured it a bit more detailed to understand better what the 12 ms mean in this context? The rough description of the measurement setup would be interesting in particular. – audio_developer Feb 08 '13 at 16:23
  • I wrote the benchmark program like below. 1. Send a MIDI packet from Mac to Android, with the USB MIDI cable. 2. Android receives a MIDI packet. Then, the Android send MIDI back to the Mac immediately. 3. Mac receives MIDI, then the Mac records the duration. It took 24 mSec in average. This duration contains both of the transfer direction; sending and receiving. So, I evaluated the one way direction latency as 12 mSec. – kshoji Feb 12 '13 at 02:24
0

In addition to kshoji & anthropomo answers,
Another great review:
http://createdigitalmusic.com/2013/05/why-mobile-low-latency-is-hard-explained-by-google-galaxy-nexus-still-android-of-choice/

Gal Margalit
  • 5,525
  • 6
  • 52
  • 56