Jitter buffers: balance choppy audio against playback delay
A jitter buffer absorbs variation in RTP packet arrival. Learn how fixed and adaptive buffers trade interruptions for conversational delay, and how to measure and tune them with WebRTC statistics.
Jitter buffers: balance choppy audio against playback delay
A jitter buffer briefly holds incoming RTP media packets whose arrival times vary, then releases them in playback order. More buffering gives late packets a chance to arrive before playout and can reduce gaps, but increases conversational delay. The goal is not zero jitter; it is acceptable playout quality within a latency budget.
Fixed and adaptive buffers
A fixed buffer keeps a preset wait time. It is simple, but can be too small during variable network conditions or add needless delay when the network is stable. An adaptive buffer adjusts its target using arrival patterns and buffer state. WebRTC NetEq is one example: it continually optimizes buffering delay for network conditions, waits for packets until playout, discards packets that are too late, and can time-stretch audio when buffer level differs from its target.
RTP interarrival jitter and buffer delay are different metrics. RFC 3550 defines interarrival jitter as a smoothed statistical estimate of differences between packet spacing at sender and receiver; it is a snapshot in an RTCP report, not a direct buffer-size recommendation. Packetization and sender timing, the distribution of delays, late-packet rate, and the service's latency budget also matter.
Read delay and interruptions together
A longer wait can allow more packets to arrive before playback, reducing gaps or concealment. But it slows turn-taking, and waiting longer cannot rescue packets whose playout deadline has passed. Increasing the target too much in response to one short spike may make playback steadier while making conversation feel sluggish. A growing queue also cannot solve persistent network congestion by itself.
Where supported, WebRTC statistics expose cumulative jitterBufferDelay; divide it by jitterBufferEmittedCount for average residence time. jitterBufferTargetDelay gives the average target, while jitterBufferMinimumDelay tracks a minimum without external additions such as synchronization targets. packetsDiscarded and concealedSamples help identify late packets and locally replaced audio. Availability depends on implementation and browser support, and counters alone do not describe perceived quality.
Measure and tune
For the same call interval, record RTP loss/reordering, packet arrival intervals, actual and target buffer delay, late discards, concealed samples, and audible interruptions.
Inspect distributions and bursts by interval, not only one average. A mean can hide rare but large delays.
Check whether interruptions follow arrivals later than the target. For temporary variation, inspect adaptive behavior; for persistent congestion or wireless loss, investigate the network, bitrate, or route first.
If tuning is needed, change one target or limit at a time. Under the same conditions compare delay, late discards, concealment, and listening quality. Set a delay limit for interactive calls.
Discarding a packet after its playout deadline may be necessary to preserve timing. The missing interval may then use PLC or supported FEC, which does not mean the original was restored.
Example: suppose audio is packetized in 20 ms intervals and one packet arrives 35 ms later than usual. Waiting may increase delay if the playout deadline has not passed; after the deadline, the receiver may discard it and conceal the gap. These numbers illustrate the trade-off, not universal settings.
There is no universally correct buffer duration. Compare late discards and concealment with average and tail latency and actual conversational quality, under the same network conditions.
References
[RFC 3550: RTP, interarrival jitter in reception reports](https://www.rfc-editor.org/rfc/rfc3550.html)
[Official WebRTC NetEq documentation](https://webrtc.googlesource.com/src.git/+/9d738557a2492104bcea32a183a7106aa2fbd547/modules/audio_coding/neteq/g3doc/index.md)
[W3C WebRTC Stats API: jitter buffer statistics](https://www.w3.org/TR/webrtc-stats/)