Summary:ASTERISK-04065: [patch] new jb - prevent late voice frame from ending silent state
Reporter:grolloj (grolloj)Labels:
Date Opened:2005-05-04 11:46:05Date Closed:2008-01-15 15:33:48.000-0600
Versions:Frequency of
Environment:Attachments:( 0) silence_begin_ts.2.patch.txt
( 1) silence_begin_ts.patch.txt
Description:Currently, if the new jb receives a CNG frame, then receives a late or out of order voice packet, it will cause the jb to leave it's silent state. This will 1) cause unnecessary calls to jb_next, jb_get; 2) cause calls to jb_get to return INTERP, which will cause needless processing and may degrade audio quality of a "silent" period of the call; 3) cause statistics reported by the jb to report loss when there isn't any.

To fix, I've changed the way the jitterbuffer tracks its silent state. Instead of storing the silent state as a boolean, I've stored the timestamp of the last frame received that indicated silence and I've prevented the jitterbuffer from leaving the silent state because of voice frame that should have arrived before silence began.

I originally included this fix as part of a larger patch in bug ASTERISK-3933965, but am breaking it out to make review easier.


Disclaimer on file
Comments:By: Mark Spencer (markster) 2005-05-04 15:51:28

Need stevek to comment here.

By: stevekstevek (stevekstevek) 2005-05-04 17:17:59


Jeff G works for me, and sits about 7 feet from my desk;  we're working together on all of these patches.

This fixes a real issue that we've observed in testing;  it will only happen, however, when packets are reordered on the network.

By: Mark Spencer (markster) 2005-05-08 15:16:17

One quick note, we need to be sure this can all be reset (e.g. on getting a "mark" bit in RTP if we ever were to apply this to RTP and/or if we get a "0" timestamp in IAX and use that to reset the jitter buffer and timestamps).

By: grolloj (grolloj) 2005-05-09 09:57:57

jb_reset() should take care of resetting the jitterbuffer when necessary. The patch I just uploaded fixes a minor omission in the first patch which may have caused a frame to be missed after a reset.

By: Mark Spencer (markster) 2005-05-09 10:18:55

Added to CVS, thanks!

By: Russell Bryant (russell) 2005-05-10 00:05:06

new jb is not in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:33:48.000-0600

Repository: asterisk
Revision: 5612

U   trunk/jitterbuf.c
U   trunk/jitterbuf.h

r5612 | markster | 2008-01-15 15:33:48 -0600 (Tue, 15 Jan 2008) | 2 lines

Fix jitter issues with out-of-order audio (bug ASTERISK-4065)