Some thoughts on Android development and the latency question
As some of us have discovered very quickly, audio latency on Android is high. There were some indications that the figure of 45ms would somehow be achievable (ie. a buffer of 2048 frames a 44.1kHz), however, I am not sure it is achievable anywhere. On my Galaxy Tab 10.1, which is brand new, I am getting around 200 ms, which is about four times that figure.
There have been some efforts showing that given the right software support, lower latencies are possible. In this blog, for instance, we see the use of pulseaudio on an Android phone, with a 20ms latency reported. The crucial point however is this: do we want to develop for a custom system? The answer, as far as I am concerned is no. In my view, we need to use the OS as-is, off-the-shelf. Customised systems, rooted devices, etc., might be good for playing around, but it is not a productive way to go. Eventually, we would like the user down the street to be able to run our apps on her/is device.
I see similarities with the way pro-audio developed on Linux. In the early days with OSS devices and non-preemtible kernels, many people took to customising their systems to get some sort of decent audio support. But then slowly things start to change. First, better support for devices came with ALSA, then Jack was released, followed by more readily-available low-latency kernel patches (and prebuilt kernels). Then stock kernels got preemption support, so that now 10-15ms latency (not ‘low’ but acceptable) is standard and millisecond-level latency is available in specialised kernels. People can develop for this, knowing that the Linux desktop user will be able to take advantage of it.
So, for the time being, we need to keep asking the Android team to give us lower latencies. Develop apps that will benefit from it. Show them how it can make a difference. The way I see this, there is enough in Android to make it a very good platform for what we do, we only need the latency issue addressed. Hopefully, they are hearing this loud and clear.