Android : audio latency problem

Posted: November 21, 2011 in Audio, IT/Dev
Tags: , , ,

 
Android faces a high performance problem (very high audio latency, see also here) that prevents from using it to develop software samples players and effects units). Some gain can be achieved by customizing kernel’s settings (differ from all hardware vendors) however it can’t match the required low buffers, and Google still didn’t provide any solution in Android 4’s SDK :

The WHOLE audio architecture is a joke.
http://www.netmite.com/android/mydroid/development/pdk/docs/audio_sub_system.html

It’s one of the worst over-engineered pieces of software i have ever seen in my life. I believe that most people who had the unpleasant experience to look at the sources will agree: the amount of layers and complexity added above the linux sound system is ridicolous. Whats the point? You don’t gain any extra functionality. Security? Priority handling (Phone calls)??? If that is Googles concern then the solution is at best amateurish and doesn’t really work (i have killed/locked the audio system several times – by accident – with my audio tests).

The “standard” way to do audio I/O would be to use interrupts which access ring buffers in a locking-free way – this idea is at least 20 years old.

What makes this even more worse is that Google:

– doesn’t care/understand the problem

– doesn’t respond to this issue

– ignores a huge market (games, music apps, …)

– provides wrong solutions

– a configuration option (android.hardware.audio.low_latency) is not enough. I’m impressed about this great achievement – i bet the best Google engineers sat down for two years to invent it
– defining 45ms as low latency? are you serious? shows again lack of knowledge. 5-10ms would be low-latency.

– OpenSL ES !? Again, a new (very complex) layer above AudioTrack without solving fundamental issues – great šŸ˜¦ you only get rid of the Java layer.

In addition the hardware buffers on some devices (afaik Qualcomm at least) are huge and are required to filled before any audio output can be started. This prevents low-latency audio on some devices. Finally the scheduling frequency (20 ms or so) of Android further limits the minimum size of any buffers.

IK Multimedia may have found some trick, however the workaround won’t be available before months (and may be restricted to their applications), and couldn’t circumvent Google OS design limitations : high number of layers, lack of skills in audio management principles, use of JNI).

Recent graphical performance tests with Google Nexus 2 (3 times slower than iPhone 4S) also confirm that Google does not have experience beyond javascript, while Apple have had a long time with assembly and kernel development.

Advertisements
Comments
  1. Tom says:

    I absolutely agree with you! Some months ago I’ve been trying to get VoIP running on Android. I tried many apps, but the output latency is so bad that it’s completly useless for “interactive” VoIP! See my post at cyanogenmod forum: http://forum.cyanogenmod.com/topic/16479-voip-audio-delay/page__view__findpost__p__168239.

    On my HTC Desire with Cyanogenmod 7.1 (Android 2.3.7 / Kernel 2.6.35) I have an audio output latency somewhere in the region of 300-400ms. I also tried tweaking the kernel-drivers (Qualcomm QDSP) and lower the buffer sizes (default 3072 samples@44.1kHz), but then the audio gets choppy when doing UI interactions.

    I really wonder why Google (and the Hardware Vendors) do not care about this problem!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s