[Speex-dev] Proper use of jitter-buffer "margin" parameter.

Joshua Gargus schwa at fastmail.us
Wed Oct 1 17:41:22 PDT 2008

Replying to myself, in case it helps others...

To use margin properly, it seems like you should push in a number of
samples equal to the margin before issuing your first "get'.  This makes
sense, but wasn't clear to me from the documentation.


Joshua Gargus wrote:
> Hi,
> We've been having mixed success (mostly good) with the jitter-buffer,
> and I'm trying to understand what my options are for tuning JB
> parameters to our particular use-case.
> In what may become a series of emails, my first question is how to
> properly set the margin parameter.
> I have set up a test harness that allows me to synthesize arbitrary
> sequences of puts/gets, so that I can test the results with different
> parameters under repeatable (simulated) network conditions.  I started
> with the ideal case: 1-1 interleaved puts/gets, to test the hypothesis
> that the sound should be perfect (i.e. identical to decoding the sound
> directly, without the jitter-buffer in the middle).
> The first thing that jumped out at me was that increasing the margin
> parameter results in an artifact right at the beginning of the speech. 
> I tried margin values of 0, 320, 640, and 960 (multiples of 320 because
> I'm using the wideband mode)... as the margin increases, so does the
> severity/duration of the glitch.  What is the proper way to use the
> margin parameter?  Should I ensure that I push in extra data before
> doing my first get?  Also, the default value of margin is "1", not
> zero.  At first, this made me think that the margin should small
> integers such as 1, 2, 3.  Should my values be 1, 321, 641, etc.?  Or what?
> Thanks in advance,
> Josh
> _______________________________________________
> Speex-dev mailing list
> Speex-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/speex-dev

More information about the Speex-dev mailing list