Summary:ASTERISK-04193: [patch] new jb - limit the number of contiguous interpolation frames returned by the jb
Reporter:grolloj (grolloj)Labels:
Date Opened:2005-05-16 15:34:44Date Closed:2008-01-15 15:38:47.000-0600
Versions:Frequency of
Environment:Attachments:( 0) max_contig_interp_fr.no_cnt_loss.2.patch.txt
Description:If a client doesn't send a silence frame (CNG) before it stops sending voice, the new jitterbuffer continues to expect voice frames and requests interpolation for every missing frame. This isn't optimal because continuing to interpolate just wastes cpu time and after a number of frames generates silence.

In order to cap the number of consecutive interpolation frames returned by the jitterbuffer, the patch adds a maxjitterinterps parameter to iax.conf.sample. This setting only affects the new jb.

Capping the number of interpolation frames returned is easy enough. I'd like feedback on which of the two patches would be more appropriate:

1) cnt_loss: Once max interps have been returned, the jitterbuffer will continue to return JB_NOFRAMES and update its lost frames statistics. A client using jb_next() to determine when to retrieve the next frame will poll every 20ms (or interp len) for the next frame.

2) no_cnt_loss: Once max interps have been returned, the jitterbuffer assumes that silence has begun. This prevents the client from continuing to call jb_get() every 20ms. The first voice frame received will bring the jitterbuffer out of silence mode. This saves calls to jb_get(), but the lost frame statistics won't be updated.

Would it be better to continue to poll in order to update lost frame statistics or would it be better to assume a silent period has begun to avoid polling? I prefer assuming silence, but am providing both patches for review.


Disclaimer on file
Comments:By: Mark Spencer (markster) 2005-06-02 13:45:26

Please update for latest CVS.  Thanks!

By: Mark Spencer (markster) 2005-06-02 13:46:41

I'll take the patch behind door #2, Jeff.

By: grolloj (grolloj) 2005-06-02 15:39:21

Mark, I've updated to patch cleanly against head. This is the one that won't keep counting frames as lost.

I did also change this patch so that it'd be on by default. It's set to stop interpolating after 10 lost voice frames.

By: Kevin P. Fleming (kpfleming) 2005-06-20 21:19:38

Committed to CVS HEAD, thanks!

By: Digium Subversion (svnbot) 2008-01-15 15:38:47.000-0600

Repository: asterisk
Revision: 5951

U   trunk/channels/chan_iax2.c
U   trunk/configs/iax.conf.sample
U   trunk/jitterbuf.c
U   trunk/jitterbuf.h

r5951 | kpfleming | 2008-01-15 15:38:46 -0600 (Tue, 15 Jan 2008) | 2 lines

control maximum number of interpolation frames generated during silence by jitterbuffer (bug ASTERISK-4193)