6 ms·
Sub-10ms roundtrip audio latency on Android
- omegaworks 10y agoWhat's iOS' audio latency?
- DrJokepu 10y agohttp://superpowered.com/latency http://superpowered.com/latency Generally around 6-8ms.
- deleted 10y ago[deleted]
- niftich 10y agoAbout 7-12 ms. Actual benchmarks by an audio SDK maker here: http://superpowered.com/latency http://superpowered.com/latency
- tonyarkles 10y agoAnd it's been like that for a long time. Last time I did mobile audio programming (2009? 2010?), the Android test devices I had (Galaxy S2?) were operating around 100ms audio latency. Glad to see they've improved!
- rectang 10y agoAnd how about macOS?
- bramen 10y agoDepends on how good your soundcard's drivers are. But I think Mac OS X is capable of something like 48 samples at a bare minimum? Therefore it depends on the sample rate you're using as well. Higher sample rates yield lower latencies but higher CPU usage. At 44.1khz that's about 1ms.
- andrewstuart2 10y 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 https://developer.android.com/about/dashboards/index.html
- szantog 10y 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.
- andrewstuart2 10y agoA brief skim of the article they link regarding Marshmallow [1] provides this quote: > As readers may recall, 10ms round-trip audio latency is the threshold that must be met by Android to be considered truly 'pro audio'. This wasn't possible before Marshmallow (per aforementioned article), and therefore pro-quality audio apps are still only truly possible on 10% of Android devices. So the market is opened up for 100 million devices. I'm not saying it's not a huge number of devices. But it's not as huge as the blog states. [1] http://superpowered.com/superpowered-android-media-server http://superpowered.com/superpowered-android-media-server
- JohnTHaller 10y agoIt's open to more of them the 10% that currently have it. Whether the OEM provides a build of Android Marshmallow or not plays a roll for most consumers. Quite a few consumers have the option to unlock their device and bypass the OEM to get Android Marshmallow on their device (Cyanogen et al).
- szantog 10y ago
- vvanders 10y agoAwesome stuff. Solid to see such a nice side-by-side integration without interfering with the existing media server.
- vlaskovits 10y agoThanks!
- deleted 10y ago[deleted]
- nix0n 10y agoHow 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 https://github.com/felixpalmer/android-visualizer/issues/5 which details some of the problems that audio tunneling can cause)
- whatever_dude 10y agoA good first step is probably to read Android's own current situation page on the matter and look at the numbers. http://source.android.com/devices/audio/latency_measurements.html http://source.android.com/devices/audio/latency_measurements... Basically it has been getting and better with new versions of Android and better hardware, but it still has room for improvements.
- bitL 10y agoHooray! Congrats!
- Animats 10y agoIt often takes over 500ms to get voice through the cellular network. Worrying about 10ms in applications seems excessive.
- virtuabhi 10y agoIt will be useful for apps, esp. those targeting musicians. Iphone had sub-10ms latency for a long time.
- tqkxzugoaupvwqr 10y agoIt’s not for phone calls but real-time audio applications, e.g. music creation apps or games.
- niftich 10y agoIt's for real-time music/audio apps, like virtual pianos, etc. These can be 100% local, and excessive latency is frustrating to the user.
- l1ambda 10y agoThis latency mentioned is useful for music and VoIP apps.
- vlaskovits 10y agoNot only is 10ms roundtrip latency critical to the interactive audio type applications mentioned by others -- it is critical for VR too.
- whatever_dude 10y agoIt's not used for that. It's used for applications that need audio feedback after a trigger. In those cases 14ms+ is already way too much to the point of being unusable. For example: https://www.youtube.com/watch?v=_eE7NtK4jX8 https://www.youtube.com/watch?v=_eE7NtK4jX8
- exDM69 10y agoAbout 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).
- bramen 10y agoSo this is kind of like ASIO drivers for Android? I hope it gains wider applicability, it's about time.
- AceJohnny2 10y 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 10y agoYou'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?
- vlaskovits 10y agoHi there, We're licensing the Superpowered Media Server to OEMs who want to differentiate their Android build by bringing latency down to pro audio levels. As we say in the article, we squeeze latency out of user space with our zero latency SDK as well as out service space with our new server.
- AceJohnny2 10y agoWhat is the business case here? A provider of audio software can write an iOS app that will out of the box avoid these latency issues for the variety of iOS hardware out there, or they can take on the task of creating hardware, customizing Android, using your media server and SDK, in order to avoid those latencies on Android. One path seems easier and cheaper than the other...
- vlaskovits 10y agoIf you want to develop an app that depends on low latency such as an interactive audio app or DAW, then on iOS that is entirely doable. If you want to do the same on Android, or port that same app from iOS to Android, than that is virtually impossible. From: http://superpowered.com/androidaudiopathlatency http://superpowered.com/androidaudiopathlatency "Many mobile apps that are critically dependent on low latency audio functionality such as some games, synthesizers, DAWs (Digital Audio Workstations), interactive audio apps and virtual instrument apps, and the coming wave of virtual reality apps, all of which thrive on Apple's platform (App Store + iOS devices) --- and generate big revenues for App Store and iOS developers are largely non-existent on Android. Android Audio's 10 Millisecond Problem, a little understood yet extremely difficult technical challenge with enormous ramifications, prevents these sorts of revenue producing apps from performing in an acceptable manner and even being published (!) on Android at this point in time. Startups and developers are unwilling to port and publish otherwise successful iOS apps (with ~10 ms audio latency needs) on Android for fear of degraded audio performance resulting in negative word-of-mouth and a hit to their professional reputation and brand. Consumers lose because have a strong desire to buy such apps on Android, as shown by revenue data on iOS, and currently, are unable to do so. One can appreciate the scale of this problem/opportunity when one takes into account the so-called 'next billion' consumers who will be 'mobile-only'." No app developer will, as you describe: "take on the task of creating hardware, customizing Android, using your media server and SDK, in order to avoid those latencies on Android." But OEMs seeking to differentiate their Android builds will integrate Superpowered Media Server, allowing for low latency functionality.
- sengork 10y agoDoes 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 10y agoAmbient 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.
- aarohmankad 10y agoWhat about for application in a headphone? You wouldn't have issues with changes in distance, as your ears would always be a set distance away from the drivers. For example, what is the latency on Bose's QuietComfort 25?
- ars 10y agoYou would need a latency of something like 0.01ms or even less. If I remember right such a low latency is basically impossible, so sound canceling headphones have to try to predict the sound before it happens. There are large problems with simply the speed of sound - you don't really have time to emit the new sound, and if you move the mic farther from the speaker you don't accurately match the sound, and can make things worse. That's why the headphones use fancy algorithms to try to guess what the sound will be, and that's why good ones cost so much, instead them being a simple analog circuit.
- brokenmachine 10y ago
- TwoBit 10y agoSo why is this so hard for Android but seemingly easy for every other OS out there?
- Chilinot 10y agoShort 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.
- qb45 10y agoI bet your iOS also has some abstraction layer, I doubt you get to poke DAC chip registers directly from userspace. Superpowered Media Server is an abstraction layer too and so are desktop OS audio APIs. And yet, they don't suck as badly.
- exDM69 10y agoOn iOS, you'd at least be running audio code on native code without garbage collectors or other expensive runtime features. Native apps with low latency wasn't what Android was originally intended for. Apple has the best audio stack out of the box anyway (desktop and mobile). There are very few music apps for Android, a lot of music apps are iOS only (or target a select few Android devices).
- exDM69 10y agoThe 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.
- tehrei 10y agoCan't you just install JACK on Android and be done with it?
- anotheryou 10y agocan 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 10y agoThe 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.
- anotheryou 10y agothanks. Great!
- gravypod 10y agoI'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.