If it wasn’t annoying enough that Android has some issues with sound quality differences of Bluetooth audio codecs, it seems as if there’s a latency problem as well. While it’s not an issue for music playback, Bluetooth latency is an important factor when watching movies, making calls, and playing games.
You’ve probably already noticed it yourself when pausing music or skipping to the next track. There’s a lag between your input and the sound changing in your ear. With gaming, in particular, lag from audio cues can be particularly jarring.
Wait … what is latency?
Latency is essentially the length of time between when a process is told to start and when it actually executes. For example, the delay between pressing the play button and music starting to play, or between clicking a button and a character jumping on-screen in a video game. It’s not a deliberate delay, but the result of various processes in the system each taking time to complete before we get the desired output. With Bluetooth audio, this is the time taken for a sample of audio to arrive in your ear from a digital file on your player.
Try it out for yourself. Press play on each of the audio files below and see if you can notice the delay between when you click and when you hear the sound. (You might need to let them buffer the first time for an accurate result!)
Latency tolerance depends on the example, as our eyes can detect images with just a 13ms delay but most people’s reaction times are above 200ms. When it comes to sound, individuals can’t perceive latency below 20ms and many struggle to discern a delay between 40 to 80ms either, although this varies from person to person. Above 150ms becomes quite noticeable. With that in mind, ideal Bluetooth headphones should offer at most 100ms of latency to rival our perception, and the lower the better.
Unfortunately, this isn’t the case, especially when playing back audio through an Android smartphone. Not only is latency very high, but it varies by a huge amount between different handset manufacturers.
Android audio chain and Bluetooth latency explained
Google has made a number of tweaks to Android’s audio chain over the years, many aimed at lower latency. However, most of the latency fixes have addressed recording and headphone playback, but nothing dedicated to Bluetooth. The introduction of the faster AAudio API versus OpenSL ES renderer in Android Oreo, low latency and pro audio performance modes, and Sound Amplifier in Android Pie have all overlooked the need for a lower latency Bluetooth signal chain.
To explain why this is the problem that it is, we need to understand how audio moves around the Android OS.
The audio starts in whatever app you’re using, this could be a music or video player, a game, or any other general application. The app creates a media session that feeds audio into the API of choice, either OpenSL ES or AAudio. This API is responsible for handling sample rates and file format conversions between source and destination, it’s also where Android can mix audio files and run other effects. After that, the API passes data from its audio stream to the Hardware Abstraction Layer (HAL). This is where hardware, such as headphones, speakers, or your phone’s Bluetooth chip receive their data from the OS.
During each of these stages, data is passed to and from first-in-first-out (FIFO) buffers. A buffer is essentially a list of the audio samples ready to be processed or transmitted. Longer buffers have a greater latency between the time a sample is written into it and read out by the next task. Smaller buffers are better for low latency, but bigger buffers prevent glitches from occurring if a buffer write is missed or is delayed. Remember, Android is processing lots more things than your music and audio threads have to fight for scheduling time on the CPU.
Android is built to optimize these buffer sizes, but a lot of this depends on work that the OEM has done in the audio processing chain and elsewhere. For example, phones with very aggressive CPU performance throttling will result in longer buffers but better battery life. Many of Android’s low latency API calls and flags are also optional, meaning some phones support lower latency audio paths than others.
Android's complex audio chain, combined with the already sluggish Bluetooth standard, results in very high latency.
Bluetooth adds in another step. Remember, we also need to convert our audio stream into a codec format, which requires yet more buffers. This data then has to be queued, packaged, and sent over the Bluetooth hardware. Perhaps surprisingly, data conversion for codecs is very fast. For example, aptX encoding is done in under 2ms. That’s a tiny fraction of time compared to the delay added by the broader system.
Overall, Android system latency for wireless audio can be in the region of 100ms, a further 100ms or more for the Bluetooth data transfer, and just 2ms for the actual audio conversion.
Smartphone Bluetooth latency test results
To test, we grabbed:
- Huawei Mate 20 Pro,
- Samsung Galaxy S10,
- OnePlus 6T,
- Google Pixel 3 XL
- Bluetooth receiver with support for all of today’s Bluetooth codecs
- Teensy LC microcontroller to use with Google’s WALT latency testing app.
We ran 100 tests on each handset for each codec, so our results produced 2,800 data points.
The graph details how each of our four Android handsets handled each codec. The only thing to note about these results is that latency will vary slightly when using a different receiver, but encode/decode latency is so fast that it’s not the biggest contributor.
For starters, there’s a lot of variation between handsets and codecs. Google’s Pixel 3 XL offers the lowest overall latency and also the smallest variation between test runs. The OnePlus 6T produces similar results, although it shows a greater variance with AAC, SBC, and aptX HD. Even though these phones are by far the best I’ve tested, their average latency comes out to 244ms and 250ms respectively. Certainly not ideal for real-time content.
The Huawei Mate 20 Pro showcases the aforementioned Android software issues. Its average Bluetooth latency is a staggering 484ms, almost double that of the Google Pixel 3. It also shows considerable variance in Bluetooth latency, averaging 47ms between its fastest and slowest delay. The Samsung Galaxy S10 is certainly better, but also exhibits a lack of consistency in its Bluetooth latency. This will be frustrating for real-time content.
It's not just the >250ms latency that's poor, but many phones have a very high latency variation too.
The explanation for these differences harkens back to the Android audio chain discussed earlier. There’s no way to enforce the use of the AAudio over the more variable OpenSL ES APIs. The ALSA drivers, audio and Bluetooth HAL, and AudioFlinger buffer sizes are all variable depending on how the OEM implements them in its version of Android. The bottom line is that Android does not offer a fast track, low latency wireless audio path that is guaranteed to work across all handsets.
Are some codecs better than others?
We’ve already discussed that audio codec encoding and decoding latency is the least of our Bluetooth worries, but it’s still worth investigating whether different codecs produce better or worse results. It’s unlikely that major differences will be exclusively the result of encoding times, as different codecs also require unique CPU resources and buffers which can contribute to overall system latency.
Averaged across our four test devices, it’s the SBC and aptX codecs that offer the lowest average latency – 308ms and 316ms respectively. However, aptX offers a lower typical variance of just 25.7ms compared to 41.9ms with SBC. LDAC scores similarly, offering 324ms of latency, although some devices saw very high variance when using the 990kbps high-quality setting.
AAC is the worst performer across these Android devices. Average latency clocks in at 369ms. Worse still, there’s an average 45ms variation in latency result, and the OnePlus 6T and Galaxy S10 hit a 90ms variation. The AAC codec also showcased the highest variable audio quality performance across devices we tested in the past. It’s definitely the most unreliable Bluetooth codec on Android smartphones. It’s one of the reasons why we recommend you don’t use AirPods with Android phones.
Low latency matters if Bluetooth is to rival wired headphones
Wired headphones aren’t going anywhere anytime soon, but if Google and others are convinced about eventually moving to a wireless world it has to get serious about Bluetooth audio. Not just in terms of music quality, but also matching the user experience for calls, films, and gaming. Wired headsets offer zero latency, and Bluetooth execution needs to close the gap to be considered viable. Part of this will have to come from changes to the Bluetooth standard itself, but it’s clear that Android and OEMs can do better too.
The bottom line is that Android’s Bluetooth audio latency remains highly unpredictable depending on the handset manufacturer. Google is leading the way by implementing its latest low latency signal routing, but other manufacturers are still slow on the uptake.
Android Bluetooth latency varies a lot by manufacturer, and that's a major problem.
Phones that deviate away from the stock Android seem to perform worse in our tests. Your best bet is to stick to smartphones that offer a stock or near stock Android experience. This includes phones from OnePlus, Google, and Nokia.
Unfortunately, there isn’t a common codec for customers to pick if they are after proper low latency (aptX Low Latency is obsolete). Qualcomm’s upcoming aptX Adaptive codec promises just 80ms latency and could be the wireless solution for low latency consumer needs. But we’ll have to wait to get products in our hands before making any judgment calls, as latency could well vary by device as well.