5.6. Audio Latency

Audio latency is the time delay as an audio signal passes through a system. Many classes of applications rely on short latencies, to achieve real-time sound effects.

For the purposes of this section, use the following definitions:

output latency. The interval between when an application writes a frame of PCM-coded data and when the corresponding sound is presented to environment at an on-device transducer or signal leaves the device via a port and can be observed externally.

cold output latency. The output latency for the first frame, when the audio output system has been idle and powered down prior to the request.

continuous output latency. The output latency for subsequent frames, after the device is playing audio.

input latency. The interval between when a sound is presented by environment to device at an on-device transducer or signal enters the device via a port and when an application reads the corresponding frame of PCM-coded data.

lost input. The initial portion of an input signal that is unusable or unavailable.

cold input latency. The sum of lost input time and the input latency for the first frame, when the audio input system has been idle and powered down prior to the request.

continuous input latency. The input latency for subsequent frames, while the device is capturing audio.

continuous round-trip latency. The sum of continuous input latency plus continuous output latency plus one buffer period. The buffer period allows time for the app to process the signal and time for the app to mitigate phase difference between input and output streams.

Timestamp. A pair consisting of a relative frame position within a stream and the estimated time when that frame enters or leaves the audio processing pipeline on the associated endpoint. See also AudioTimestamp.

If device implementations declare android.hardware.audio.output they are STRONGLY RECOMMENDED to meet or exceed the following requirements:

[C-SR] Cold output latency of 100 milliseconds or less

[C-SR] Continuous output latency of 45 milliseconds or less

[C-SR] Minimize the cold output jitter

[C-SR] The output timestamp returned by AudioTrack.getTimestamp and AAudioStream_getTimestamp is accurate to +/- 1 ms.

If device implementations meet the above requirements, after any initial calibration, when using both the OpenSL ES PCM buffer queue and AAudio native audio APIs, for continuous output latency and cold output latency over at least one supported audio output device, they are: