Ask HN: Android low latency audio in 2023
With the desire to clarify what's going on with Android low latency, see the links below from around 2018-2021, with a third link from an unknown date, however which claims devices that can go down to around 13ms round trip latency.
On March 11th of the first link, the author talks about using a MIDI device to be able to focus mainly on the output latency only, does that mean using another input device other than the screen can generally get Android output latency down to 20ms or lower!?
Any clarification gratefully received.
https://news.ycombinator.com/item?id=26388441
https://news.ycombinator.com/item?id=18199290
https://chromium.googlesource.com/external/github.com/google...
44 comments
[ 3.2 ms ] story [ 71.3 ms ] threadWhy do some Google engineers make $500k-$3m/yr?
and as long as they can sell ads nobody cares
Plus, people who are the real deal are "coming up" all the time and they need to start somewhere.
https://source.android.com/docs/core/audio/latency/measureme...
More info here [1]/[2] about device requirements.
[1] https://android-developers.googleblog.com/2021/03/an-update-...
[2] https://source.android.com/docs/compatibility/13/android-13-...
Just buy Apple gear. Apple did the work of getting the latency low, plus, all your musician friends will be using it.
I used to want it for music production but modern mac airs are both cheaper and better devices to make music on while being ultra portable.
I'm really confused by their definition of low-latency. For me, everything above 10ms is not low latency and I can -feel- that things get sluggish and a little less responsive.
And btw. I've achieved ~5ms latency on Windows devices 10+ years ago.
It's too bad, because as of today you cannot really use Android devices for live-music making on them.
Other people -swear- that its impossible to feel the difference, however I can't provide evidence other than 'blind testing' which I have passed. How do you know if you're feeling input latency or response latency with your devices ?
I had a “gaming” laptop which had about 30 ms of latency on the screen which I measured by hooking up multiple monitors, running a clock, and photographing the screens. (I got photos where there were different numbers on different screens!)
I was playing League of Legends at the time and it always seemed like I’d get hit and there was nothing I could do about it. Once I started playing on the external monitor I started playing a lot better.
Earlier I was playing Titanfall on a Samsung TV and just getting killed despite Titanfall being forgiving to players who suck. Sure enough I put the TV in “game mode” and all of a sudden I’m “in the game”.
I’m a weeaboo so I play a lot of turn-based games, Musou games and others that are not twitchy but I find there are occasional of single-player games such as Sword Art Online: Fatal Bullet that I just can’t progress on without the TV being in game mode.
This is despite the general advice that you shouldn’t use game mode for single-player games. Now I don’t know if other people can anticipate the future better than I can and tolerate latency better (I am a schizotype) or if a lot of people play multiplayer games with high latency and suck at it and don’t know why or if a lot of people try multiplayer games and quit because of their monitor or TV.
Its not just you. Someone gave me a keychron keyboard to test out because they thought my using 'mainstream' brands that weren't lubricated or whatever was bad, and even wired the input latency on the keychron was worse than relatively cheap logitech (G613) and razer (blackwidow mini v3) keyboards on 2.4ghz. I don't know if its their USB polling or what but these well reviewed keychron keyboards were basically completely unusable to me.
RTings.com usually includes tests of latency in their keyboard reviews under 'typing experience' which is helpful if shopping.
Maybe one day if keychron cares enough to fix it I'll give them another try.
General BT is useless for music.
My guess, based on experience with Rasberry Pi's: to do better than that, you need all drivers on the phone to have PREEMPT_RT patches, and contention with GPUs may be a deal-killer.
You might be interested in this approach:
PiPedal delivers sub-4ms latency (measured using loopback) without dropouts using a Raspberry PI that's accessed from a phone using Wi-Fi direct. (disclosure: I'm the author).A few observations:
- An SMP_PREEMPT or SMP_RT Linux kernel is mandatory. Audio threads need to run with high real-time priority.
- Real-time and audio and GPUs don't seem to play well together. PiPedal delivers stable low-latency audio -- I think -- primarily because it runs headless.
- On Raspberry pi, GPUs have a dire effect on low-latency audio. Using non-GPU graphics drivers helps.
- SD card i/o has a moderately dire effect on low-latency audio. Ethernet and Wi-Fi i/o seems to have little to no effect on low-latency audio. Drive i/o to USB-connected storage devices is less of a problem with the caveat that the USB 2.0 ports share a bus, and USB 3.0 ports share a separate bus. The storage device should be on a USB 3.0 port, and the UBS audio device should be on a USB 2.0 port.
- All of this requires a Linux kernel later than ~5.15. Round about that time, the kernel ingested a significant portion of the PREEMPT_RT patches; and USB audio is essentially unusable prior to 5.10. This disqualifies a lot of ARM SOCs which still have 4.x kernels!
Contention with SD card i/o may just reflect the fact that full PREEMPT_RT patches haven't yet been propagated into mainline device drivers for that i/o path. Or that the patch set doesn't exist at all. A PREEMPT_RT kernel doesn't fix the problem.
Significantly, the Linux 5.1x audio and SMP_PREEMPT improvements post-date the Android real-time audio initiative. It might be time for Google to take another kick at the can. But in the meantime, real-time audio on Android remains borked.