I've been working on using OpenSL for a low latency audio app for Android. So far the lowest latency I've managed to achieve is 200ms on a Samsung Galaxy S5 (touch-to-sound, measured by tapping and recording tap sound followed by app sound). I think I can bring it down to 160ms by improving some internal app logic. Right now there is upto 40ms of delay between the app receiving the touch and getting the callback for that audio. I think this is because I'm constantly queueing empty buffers when there is no audio. Is this bad practice? I get audio artifacts though when I try approaches that only queue when there is audio for some reason.
Anyway, my question is, what is the lowest achievable latency using openSL from touch to audio output on any of the newest Android devices? (I know it differs from device to device, but I was wondering what is the best device for low latency if there is one, and what is the value of this lowest latency? or perhaps the average obtainable minimum for recent devices?).
Android: sound API (deterministic, low latency)
The above link from about a year ago states that it is around the 180ms range. Is this still the lowest possible for OpenSL? The recommended answer says that Music Synthesizer for android obtains a "total output latency" of under 30 ms. But when I run it on a Samsung Galaxy S5 it has a touch to sound latency of 200ms. What is that "total output latency" referring to? Am I missing something?
How do I decrease the latency further?
Thanks for any help you can give me!
Edit: I'm doing everything stated here Low-latency audio playback on Android except NEON or SSE instructions but my processing time is less than the 15% stated there so that shouldn't be a problem. I am enqueuing a buffer with 2*PROPERTY_OUTPUT_FRAMES_PER_BUFFER shorts for stereo sound. Is that too high?