Android Marshmallow edges closer to “Pro Audio” with lower audio latency

by: Rob TriggsFebruary 3, 2016
958

chromecast audio review aa (6 of 7)

Despite a number of smartphone manufacturers offering improved audio hardware in their latest smartphones, Android’s software latency has historically been very poor, preventing many professional audio applications from making their way to the hugely popular mobile platform. However, the folks over at Superpowered have gone back to have a look at Android Marshmallow’s round trip audio latency and there appear to have been a number of improvements.

Before we go any further, round-trip audio latency is very important for real time applications, as users don’t want to have to contend with a noticeable delay when recording, editing or playing back content. Round-trip refers to the time it takes for audio to enter the system, be put into software for processing, and then put back out from a speaker or headphone jack. Human delay perception ends at under 20ms (milliseconds), so the latency of any real time system should be below this figure, with 10ms being the target that is perceived as instantaneous.

You won't be using Android for live music effects unless latency reaches less than 20ms.

Shutterstock You won’t be using Android for live music effects unless latency reaches less than 20ms.

Previous testing on Android KitKat and Lollipop devices revealed round-trip latency figures in the hundreds of milliseconds, resulting in a very noticeable delay and making the operating system useless for real-time applications. Even the best Android devices struggled to go lower than 40ms. However, Google has made some major improvements with Android 6.0 Marshmallow, allowing for figures in the sub-20ms range. The Nexus 6P clocks in at 18ms, while the Nexus 9 manages 15ms.

Google appears to have made two notable changes with Marshmallow: a smaller ring buffer size and a new professional audio flag feature. The buffer size has been chopped in half to 128 samples. A buffer stores a selection of samples before these are all sent off into the system together and a smaller buffer means that the whole system updates much more frequently. Buffers and batch processing are often more efficient than sample by sample transfers and processing, so there are trade-offs to find the ideal buffer size.

This smaller buffer saving halves the latency throughout the ALSA (Advanced Linux Sound Architecture) and AudioFlinger sections for both input and output paths, making a noticeable difference to the round-trip times. The graphics below show the audio paths and times recorded with the Nexus 9 tablet.

Android 5.0 Lollipop Audio Path Latency
Android 6.0 Marshmallow Audio Path Latency

Android Marshmallow (API 23) also introduces a new FEATURE_AUDIO_PRO flag for developers to look for to reduce the audio output buffer size for the lowest possible latency. A look through Google’s documentation states that devices using this flag must offer 20ms or less round-trip latency and should aim for 10ms. USB audio class devices are also supported through USB host mode, so low latency USB add-ons are now also a practical possibility.

As an added bonus, Android now also supports MIDI as part of the Professional Audio package. Although, this hasn’t been implemented into the native layer. This flag marks a major effort to differentiate Android devices that are capable of professional audio applications, and is a major improvement over the FEATURE_AUDIO_LOW_LATENCY flag from the Gingerbread days, which offers at best a 50ms round-trip.

If you’re interested, Superpowered offers a very detailed explanation of how this all breaks down, including a look at the slightly different latency results when using built-in and external hardware. Android still has a number of issues, but the situation is gradually improving for real-time professional audio.

Previously we have seen that Google’s Nexus devices have been the better performers when it comes to audio latency and this latest testing hasn’t yet shown if these improvements can and have been applied to other Marshmallow powered devices. Google states that only the Nexus 5X, 6P and 9 are “Pro Audio” Nexus devices, so there are probably some hardware requirements in addition to Marshmallow’s software improvements.

CS4272 Codec 24bitRelated: The great audio myth: why you don’t need that 32-bit DAC24

Samsung, which offers its own Audio SDK to tap into low latency audio, will be releasing a Samsung Professional Audio SDK 3.0 with its upcoming Galaxy S7 flagship smartphone, which will hopefully match these Nexus results. We will just have to wait and see if other manufacturers support these improved features. Still, there are promising signs that Android may eventually be useful as a real-time audio platform.

  • Maybe, I’ll wait for Android Nolengur

  • tiger

    According to site above, Apple products consistently gets below 10 ms!

    • s2weden2000

      the faPple uses their own core audio implementation…

      • tiger

        Sure works well don’t you think?! Real-time audio mixing….

        • s2weden2000

          i don´t use their products …

    • pianoman

      Which is a lie.

  • I feel like such a Android noob but what phone is that in the first picture? :P

    • I think Moto X

    • Amit

      Motox Style

      • Amit

        Or motox pure depending on the world city you are in:)

    • PNWtech

      Yeah that’s the Moto X Pure/Style Edition with the white face

    • God damn it looks lovely ^^ Thank you all :)

  • PNWtech

    Glad they are taking audio performance serious. My Android device is my music player. Can’t be alone in this

    • Mr. Bill

      Why does round trip latency matter for a music player? Android probably has better support for media formats than iOS – something that’s practically more important. This is specifically for if you want to use your phone as a realtime audio processor. I’d rather have a dedicated device for that sort of thing, personally.

      • Derek Jones

        It doesn’t so much for a music player, but Android has lagged far behind iOS as a platform for mobile music production in part because of this.

        The couple of dozen music apps for Android is far outweighed presently by the over 500 music production apps available for the iOS platform, ranging from DAWs like Auria Pro and Cubasis, synth apps like iMIni, iMS-20, iVCS3, Animoog, iSEM, Z3TA+ etc., drum apps like DrumPerfect Pro, guitar and amp modeling like BIAS & Tonestack (although IK Multimedia have made a small inroad here with some of their Amplitube apps, but still on limited platforms), MIDI sequencers, FX apps, mastering apps, mixers, notation apps and the associated interconnection mechanisms like Audiobus, Inter-App Audio and now upcoming AU support.

        That’s due in significant part to this latency issue, not to mention the wide diversity of device formats and capabilities which has made it harder for developers to produce apps that will perform consistently well over the different devices.

        So, let’s hope that this begins to pave a way for more development for Android devices so that musicians have an even broader spectrum of devices to choose from.

        There are still a good number of hurdles to overcome for Android to succeed here. Over the past 5 years a burgeoning audio and MIDI hardware industry has also grown up with plug-and-play MIDI and class-compliant audio support for iOS devices and there are multiple choices for musicians using iPads across a wide variety of such hardware such as MIDI keyboards, drum pads, controllers, audio interfaces and so on.

        I use 6 iPads in the studio along with acoustic, analog, virtual analog and digital hardware as well as guitars, bass, drums and desktop DAWs for music production – all playing nicely together. That’s made possible by not only the high-quality available apps, but also this seamless support for iPad hardware and software by the rest of the audio industry.

        I don’t have anything against Android – I have three devices that run Android and I like them. They’ve been great for streaming audio from online services and watching Netflix, but I don’t use any of them for music production. Perhaps things will now begin to change. Hope so – always good to have competition in the market to generate new ideas :-)

      • tb303

        It’s handy to have an all round device that you tend to have with you all the time, you never know when you want to tap out some musical ideas, you’re not likely to carry a dedicated device all the time, I’ve wanted this feature in Android for quite a while.