3 ms·
> Which parts of the software stack are causing it? There is a diagram lower down in the article with the components (ALSA, audioflinger etc). http://www.andr
by rogerbinns 11y ago
> Which parts of the software stack are causing it?
There is a diagram lower down in the article with the components (ALSA, audioflinger etc).
http://www.androidpolice.com/wp-content/uploads/2015/11/nexus2cee_Android-Audio-Path-Latency-Superpowered-Audio700px.gif http://www.androidpolice.com/wp-content/uploads/2015/11/nexu...
- dgregd 11y agoActually Android standard doesn't include ALSA. There is a thin sound HAL above ALSA, OSS and other Linux sound technologies. Of course many phone vendors use ALSA to implement Android HAL layer. It seems that Samsung uses its own sound drivers and therefore they have small audio latency compared to other Android vendors.
- exDM69 11y agoThe infographic looked so much like an ad that I skipped over it. So this is one of the "good" Android audio stacks, getting 36ms latency. But half of that is "wasted" in user space, in AudioFlinger as well as the app ring buffer (which seems pretty big to me). I'd like to see the comparison to a "bad" Android device. Doing some internet searches, I found someone who had plugged in PulseAudio to an Android phone and got 20 ms latency instead of the 170+ ms latency from AudioFlinger on the same device [0]. That's pretty huge. Ideally, there should be no user space middleware component processing audio in between, this could half the latency (according to the diagram), bringing the latency to acceptable levels. But ALSA isn't really intended for routing audio on the fly conveniently (e.g. when plugging/unplugging headphones), so there is some room for improvement too. Overall, the situation is pretty sad. Linux can do better than that but a modern multimedia device (desktop or mobile) has several audio outputs and hot-plugging, which makes the situation rather difficult using ALSA only. And the userspace audio components just aren't great. http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-fight/ http://arunraghavan.net/2012/01/pulseaudio-vs-audioflinger-f...