Question

I have read that audio latency has been reduced to as low as 12ms on the Android 4.2 Jelly Bean OS. However, I have also read that this improvement is available on the Nexus 10 but not on the Nexus 7.

How could these two devices use the same OS and yet have different audio latency? Is this information accurate?

Was it helpful?

Solution

The concrete implementation of AudioHardwareInterface is an implementation decision for a phone vendor- in many cases it's built on alsa, but doesn't have to be.

Below this level there is a great deal of choice of the SoC platform used (nVidia Tegra3 in Nexus 7 and Samsung Exynos in Nexus 10). The OS is very definitely not the same below this level.

Factors that potentially affect latency include:

  • Hardware restrictions on the DMA buffer used for audio - minimum size or requirements for it to be a power-of-two size.
  • Minimum buffer sizes enforced by device drivers - justified or not.
  • Low-latency means that audio needs servicing more often - all the way up the application stack. Ideally you need to be able to get real-time scheduling for any thread generating audio and the ability to mlock the program code and stack in memory. If you can't get this (and I suspect you still can't on Android), the value of latency is chosen such that audio runs reliably most of the time.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top