Disable low latency audio for OpenSL

310 views
Skip to first unread message

Peter Brooks

unread,
Mar 5, 2014, 10:55:52 AM3/5/14
to andro...@googlegroups.com
Does anyone have any pointers for disabling low latency audio on the Audio Flinger that is used by OpenSL?

We've run into https://android-review.googlesource.com/#/c/71022/ and would look to disable the low latency flag would help.

Michael Moussa

unread,
Mar 7, 2014, 8:59:41 AM3/7/14
to andro...@googlegroups.com
If I remember correctly, I think I asked Glenn Kasten about this at Google IO and there was no explicit way to disable fast path. I think you have to purposely use a non native sample rate or buffer size. Glenn, please correct me if I am wrong.

Mike

Glenn Kasten

unread,
Mar 7, 2014, 9:17:04 PM3/7/14
to andro...@googlegroups.com
As fast tracks don't support effects, one kind of hacky way to disable fast path is to
add one of the effect interfaces to your player object e.g bass boost.
For the gory details see the source code.
One (ancient and unofficial but easy to access) version is here:
Note: this code has changed somewhat since this version, but it gives the idea.

However, I'm very curious why you need to disable fast path.
I'd like to understand the real problem and help solve the root cause if possible.

Michael Moussa

unread,
Mar 8, 2014, 8:20:59 AM3/8/14
to andro...@googlegroups.com
Glenn, one use case is to support 3rd party audio effects apps. Like if you have a music player app, where low latency audio is not needed, and you want it to work with a 3rd party equalizer app.

Mike

Message has been deleted

Peter Brooks

unread,
Mar 15, 2014, 9:52:04 AM3/15/14
to andro...@googlegroups.com
Hi guys,
Thanks for the very good responses, I would of replied sooner but wasn't getting any notifications.

We have an issue on Nexus 7's where our audio using AndoridSimpleBufferQueue on OpenSL clips/crackles.

I've now attempted your hack and it's fixed the Nexus 7 problem, I can provide more info on the audio if required.
Reply all
Reply to author
Forward
0 new messages