Review Board 1.7.16


Improve behavior of jitterbuffer when maxjitterbuffer is set

Review Request #144 - Created Feb. 6, 2009 and submitted

Matthew Nicholson
1.4
14044
Reviewers
asterisk-dev
Asterisk
This patch improves the way the jitterbuffer handles maxjitterbuffer and dramatically reduces the number of frames dropped when maxjitterbuffer is exceeded.  In the current jitterbuffer, when maxjitterbuffer is exceeded, all new frames are dropped until the jitterbuffer is empty.  This patch modifies the code to only drop frames until maxjitterbuffer is no longer exceeded.

Also, previously when maxjitterbuffer was exceeded, dropped frames were not tracked causing stats for dropped frames to be incorrect, this patch also addresses that problem.
To test this patch I setup two boxes and one endpoint;

sip endpoint -> box1 -> box2

I used netem (from the linux kernel) on box2 to generate jitter in all packets it originated.  I set netem to delay 50% of the packets by 0ms to 1100ms and I set maxjitterbuffer to 1000ms.  The new code performed as intended and dramatically increased audio quality.
Review request changed
Updated (Feb. 6, 2009, 8:03 a.m.)
  • To test this patch I setup two boxes and one endpoint;
    
    [sip endpoint] -> box1 -> box2
    
    I used netem (from the linux kernel) on box2 to generate jitter in all packets it originated.  I set netem to delay 50% of the packets by 0ms to 1100ms and I set maxjitterbuffer to 1000ms.  The new code performed as intended and dramatically increased audio quality.

    To test this patch I setup two boxes and one endpoint;
    
    sip endpoint -> box1 -> box2
    
    I used netem (from the linux kernel) on box2 to generate jitter in all packets it originated.  I set netem to delay 50% of the packets by 0ms to 1100ms and I set maxjitterbuffer to 1000ms.  The new code performed as intended and dramatically increased audio quality.
Tweaked the testing done section.
Ship it!
Posted (Feb. 10, 2009, 4:25 a.m.)
Excellent work on testing.  Other than a couple of lines with trailing whitespace, it looks fine.
/branches/1.4/main/jitterbuf.c (Diff revision 1)
 
 
trailing whitespace

https://reviewboard.asterisk.org/ runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to asteriskteam@digium.com.