top | item 11917665

Sub-10ms roundtrip audio latency on Android

142 points| vlaskovits | 9 years ago |superpowered.com

46 comments

order

andrewstuart2|9 years ago

> We updated our findings with the recent improvements in Android M (Marshmallow)

> opening a market of 1.1 billion devices

Minor nit, but considering that google says Marshmallow is on 10.1% of devices [1], that figure is an order of magnitude too high.

[1] https://developer.android.com/about/dashboards/index.html

szantog|9 years ago

"We updated our findings with the recent improvements in Android M (Marshmallow), and recently released a solution for Android’s USB audio and MIDI challenges, opening a market of 1.1 billion devices for pro audio application creators."

Those are two separate things:

1. Updated analysis on the latency with regards to Marshmallow.

2. Superpowered USB Audio and MIDI SDK opens a market of 1.1 billion devices.

AceJohnny2|9 years ago

"It can be installed on any Android userdebug build or rooted production build."

"Installing on Samsung Galaxy devices is not recommended"

So, not for apps on devices today.

exDM69|9 years ago

You're correct. It doesn't seem to be for consumer oriented products today. But it's a start...

I guess they're targetting some professional audio gear that have an Android-based component in it. Or hope to get this sold to phone/tablet vendors who would like to build a music-oriented product. Or get acquired by Google and get integrated into Android proper. Or just make Android a viable backend for their cross-platform audio sdk.

Can anyone from Superpowered chime in and shed some light on who or what you're targetting?

nix0n|9 years ago

How does this compare to the existing audio tunneling in some versions of Android?

(The best writeup of this I've seen is https://github.com/felixpalmer/android-visualizer/issues/5 which details some of the problems that audio tunneling can cause)

vvanders|9 years ago

Awesome stuff. Solid to see such a nice side-by-side integration without interfering with the existing media server.

gravypod|9 years ago

I'd be interested in seeing what the android devs could do if they included specs for FPGAs into phones.

I think that would be a very fast way to get android to connect any IO to any configuration they need very quickly.

There also seems to be a growing trend to include ARMs inside actual FPGAs.

bramen|9 years ago

So this is kind of like ASIO drivers for Android? I hope it gains wider applicability, it's about time.

TwoBit|9 years ago

So why is this so hard for Android but seemingly easy for every other OS out there?

exDM69|9 years ago

The article kind of touches that:

"Ultimately, the Android audio tack has fundamental architectural problems stemming from engineering decisions made at Android’s genesis, well before Google’s acquisition of Android."

Much of Android was designed for simple apps written in Java and running on resource-constrained devices. This is quite far from the reality of today. Perhaps it allowed Android to get to the market early and get a thriving app ecosystem, but billions of dollars have been poured to fixing those "mistakes" from the early days.

Audio apps are pretty much the polar opposite from what Android was originally designed for. Audio processing needs to run on native code or at least without ever invoking the garbage collector or any other unpredictable source of latency.

iOS and OSX audio stack is completely different and achieves a very low latency. Many musicians prefer Apple products because the audio works well out of the box. You might be able to achieve similar performance with Windows or Linux, but it's not as easy.

While the Superpowered has a neat improvement on Android's latency figures, 8...24 ms is not good enough for professional music use (and they don't mention any confidence intervals). For music apps, audio latency must be consistently less than 10 ms, preferably less than 5 ms.

It's an improvement but I don't think it inspires enough confidence that you'd see musicians performing in front of an audience using Android devices any time soon.

Chilinot|9 years ago

Short answer: abstraction layers.

Because Android has to be able to run on so many devices there are a bunch of abstraction layers between the app and the hardware, all adding delay.

iOs does not have this issue.

sengork|9 years ago

Does this mean we can finally have an app that'd invert the input from the microphone and play it back on the loudspeaker effectively performing surrounding ambient noise cancellation?

brokenmachine|9 years ago

Ambient noise cancellation is more complicated than that. Consider that as you changed your distance from the speaker you would be going into and out of phase with the signal, you would effectively be doubling the ambient noise at some locations, and cancelling it at others.

Also 10ms response time would definitely be too slow for such an application.

If that worked, you could just use an opamp with a sub-microsecond response time with a cheap mic and speaker for a couple of dollars, and I'm sure China would have flooded the market.

I would give anything for a working ambient noise canceller. I would point it at the leafblowers outside while I sip champagne.

randyrand|9 years ago

Reflections also make this not work.

anotheryou|9 years ago

can someone explain the practical use case?

- future apps can implement the code for less latency on the current android version?

- future roms can have less latency with this code?

- existent apps can have less latency with a 3rd party app helping?

- I need the loopback dongle?

vlaskovits|9 years ago

The practical use case is that you will see commercial Android builds that will have integrated the Superpowered Media Server, allowing Android to become the great music and entertainment platform it should be.

bitL|9 years ago

Hooray! Congrats!

tehrei|9 years ago

[deleted]

Animats|9 years ago

It often takes over 500ms to get voice through the cellular network. Worrying about 10ms in applications seems excessive.

niftich|9 years ago

It's for real-time music/audio apps, like virtual pianos, etc. These can be 100% local, and excessive latency is frustrating to the user.

tqkxzugoaupvwqr|9 years ago

It’s not for phone calls but real-time audio applications, e.g. music creation apps or games.

virtuabhi|9 years ago

It will be useful for apps, esp. those targeting musicians. Iphone had sub-10ms latency for a long time.

vlaskovits|9 years ago

Not only is 10ms roundtrip latency critical to the interactive audio type applications mentioned by others -- it is critical for VR too.

exDM69|9 years ago

About 10 ms is the maximum latency that can be tolerated in music applications. Preferably it should be around 5 ms.

If you're a musician, you can easily notice when the sound doesn't come out when you press your finger on the keyboard or sing to a microphone. 5 ms is not noticeable at all, 10 ms feels a bit off but is tolerable, above 25 ms is clearly noticeable and very annoying (ie. it's no longer a musical instrument).

l1ambda|9 years ago

This latency mentioned is useful for music and VoIP apps.