An update on Android's audio latency




Posted by Don Turner - Android Developer Relations Engineer



Header image of audio waves going through phone



This article takes a look at what's changed in the Android ecosystem for audio developers recently, the audio latency of popular Android devices, and discusses Android's suitability for real-time audio apps.



What's changed?




Over the past four years we have taken a number of actions that have improved audio latency.



timeline of key events which have had an impact on the audio latency of Android devices. Pre-2017: Google working directly with OEMs to reduce audio latency. Start 2017: AAudio - new high-performance audio API is released. Mid-2018: Oboe - an open source, C++ wrapper for AAudio and OpenSL ES is released. Mid 2019: Pixel 3A is the first 10ms Android phone. Mid 2020: OpenSL ES is deprecated. Start 2021: Oboe has 4bn+ installs


Latency reduction




These actions, coupled with a renewed focus from device manufacturers on audio latency, have led to significant improvements in the device ecosystem. The average latency of the most popular Android phones has dropped to under 40ms, which is well within the range required for real-time applications.



bar graph showing average audio latency of 20 most popular Android phones. In Jan 2017 it was 109 milliseconds. In Jan 2021 it was 39 milliseconds.

device popularity source: appbrain.com



Greater consistency



Digging into the data we can see that in 2017 there was a significant difference between the highest and lowest values (222ms).



bar graph showing audio latency of most popular Android phones in Jan 2017. There are 19 in total, all of which are Samsung Galaxy models. The average latency is 109ms, smallest value is 36ms, highest is 258ms, range is 222ms.

device popularity source: appbrain.com




Compare that to the data for 2021. The range has reduced by a factor of 8 to just 28ms, providing a far more consistent audio experience. This is more impressive when you consider that there are now multiple OEMs on the most-popular list, compared to only a single manufacturer in 2017. In addition, many of the devices on the list are not high-end flagship models.



bar graph showing audio latency of most popular Android phones in Jan 2021. There are 20 in total, with models from Samsung, Redmi, Oppo, Huawei and Vivo. The average latency is 39ms, smallest value is 28ms, highest is 56ms, range is 28ms.

device popularity source: appbrain.com



Tap-to-tone latency





Up to now I've been referring to round-trip audio latency. Round-trip latency involves three components in the audio chain: audio input, audio processing and audio output.



Many real-time audio apps generate audio from screen tap events rather than relying on input audio. These kinds of apps are sensitive to "tap-to-tone" latency - the time taken from tapping on the screen to hearing a sound. The latency introduced by tapping the touch screen is anywhere from 10-35ms, with 20ms being fairly typical on modern Android devices.



To estimate tap-to-tone latency given round-trip latency, you can subtract the audio input latency (typically 5ms), and add the touch latency (typically 20ms). In other words, add 15ms to the round-trip latency. Given the numbers above, this means the average tap-to-tone latency of the most popular android phones is also well under that required for most real-time audio applications.



Looking to the future





Despite the significant reductions in audio latency across the Android ecosystem our work is nowhere near complete. 20ms round-tip latency is required for Android professional audio apps, and 10ms remains the long term goal. And at this time some less popular devices still have high audio latency. However, if you have been holding back on developing an Android app because of audio latency, it might be time to reconsider.



To get started, check out the Oboe getting started guide or video tutorials.



Data sources and tools





OboeTester



WALT



appbrain.com



superpowered.com/latency



gsmarena.com



juce.com/maq



various internal data sources

Komentar

Postingan populer dari blog ini

Android Neural Networks API 1.3 and PyTorch Mobile support

Turning it up to 11: Android 11 for developers

Students Learn Android App Development with Google Developer Student Clubs