Opened 10 years ago

Last modified 9 years ago

#969 closed enhancement

Improvement in jitter buffer algoritm for low bandwidth network (thanks Emil Sturniolo for the suggestion) — at Version 2

Reported by: bennylp Owned by: nanang
Priority: normal Milestone: release-1.6
Component: pjmedia Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description (last modified by nanang)

On low bandwidth network, high jitter and frame lost are usually the issues. The first issue is basically jitter buffer (JB) responsibility area.

One simple way to detect jitter is by detecting the existence of burst, i.e: number of incoming frames from network between two playout clockticks, where without jitter, it should be always equal to one. Current JB uses such mechanism to measure actual burst level and use the burst level to manage the latency (due to clock drift) by periodically dropping/discarding frames. However as clock drift usually increases the latency very smoothly, JB will only drop/discard a frame at least every 200ms.

In fact, it's been reported that as the burst is rather extreme in low bandwidth network, discard rate of 200ms seems to be insufficient as frequently JB tends to get full (high latency). Moreover, when it is full, it will drop 1/4th of its size when new frame arrives. This causes large portion of a conversation to be dropped. So, the issues identified here are latency and audio cut.

A better algorithm to optimize latency and avoid bulk drops, let's say progressive discard algorithm, will progressively discard frames as the buffer fills up.

The algorithm specifications:

  1. Instead of dropping large consecutive frames, it should discard frames in spread.
  2. The discard rate/aggressiveness should be adaptive to the network condition, notice some useful real-time indicators such as latency/size, burst level.
  3. JB discards a frame by marking the frame with specific internal frame type, such as PJMEDIA_JB_DISCARDED_FRAME.
  4. Discarded frames will not be returned to application, it will just get ignored/skipped in GET operation. So application will never get a frame with type PJMEDIA_JB_DISCARDED_FRAME.
  5. Avoid discarding back-to-back frames.
  6. Pass jbuf_test (of pjmedia_test), it may also need a test case of periodic large-burst spikes.

Change History (2)

comment:1 Changed 10 years ago by bennylp

  • Milestone changed from release-1.5 to release-1.6

comment:2 Changed 10 years ago by nanang

  • Description modified (diff)
  • Summary changed from Improvement in jitter buffer algoritm to make space for new frames when it is full (thanks Emil Sturniolo for the suggestion) to Improvement in jitter buffer algoritm for low bandwidth network (thanks Emil Sturniolo for the suggestion)
Note: See TracTickets for help on using tickets.