About Android new AAudio API & Constant, low Latency

221 views
Skip to first unread message

Nordhal Mabire

unread,
Apr 12, 2017, 11:58:10 AM4/12/17
to android-ndk
Hi,

I just read a little about AAudio API, and I would like to know if this API will benefit from constant latency , quoting Audio Device : "Audio device is a hardware interface or virtual endpoint that acts as a source or sink for a continuous stream of digital audio data" ?

Any comments regarding this would be very appreciated !

Regards,

Nordhal

Don Turner

unread,
Apr 12, 2017, 12:33:32 PM4/12/17
to android-ndk
Hi Nordhal, 

Could you expand a little on what you mean by "constant latency", currently both OpenSL ES and AAudio have approximately constant latency, which is determined by the device hardware.

Thanks, 

Don

Phil Burk

unread,
Apr 12, 2017, 12:49:49 PM4/12/17
to android-ndk
Hello Nordhal,

In OpenSL ES, the latency can change if the audio is rerouted from one device to another. This can happen, for example, when the user switches from speaker to headset. My goal is to avoid that in AAudio by disconnecting the device when that occurs. The app has to reconnect but at least it knows the latency has changed.  Note that in DP1, auto-routing can still occur in AAudio.

There is another way that latency can change in AAudio. That is if the app intentionally changes the effective size of the buffer. That is part of the latency tuning mechanism that allows an app to find the the lowest latency that does not cause underruns.


Phil Burk
Reply all
Reply to author
Forward
0 new messages