[Freeswitch-dev] MTU setting and application buffer size

Juraj Fabo juraj.fabo at gmail.com
Tue Oct 4 16:56:17 MSD 2011


I read through the previous answers several times again and did some progress.
I found out that the valid codec_ms values are <10ms,60ms> and using lower
values will not work.

>> 80 means a hardware interrupt is received every 10ms with 80 bytes per
>> time slot. This is the recommended mode. A value of 40 will increase
>> interrupt load and not necesarily reduce your latency, you must reduce
>> the "user period", which is how often the driver will deliver
>> media/data to the user application. This is done using
>> sangoma_tdm_set_usr_period().
>> The codec_ms is used to call sangoma_tdm_set_usr_period(). This is how
>> often the driver will deliver data to the user application (for
>> example, waking it up from select()).

In each of the the test below the codec_ms was set to 1 with hope
of fastest data delivery, however this resulted to 20ms codec_ms
which is default.

> Please, have a look at the results with various parameters used:
> mtu:80 txqueue_size=1  rxqueue_size=1   one-direction delay=60ms
> round-trip delay=120ms
> mtu:80 txqueue_size=2  rxqueue_size=2   one-direction delay=80ms
> round-trip delay=160ms
> mtu:80 txqueue_size=10 rxqueue_size=10 one-direction delay=240ms
> round-trip delay=480ms
> mtu:40 txqueue_size=1  rxqueue_size=1   one-direction delay=40ms
> round-trip delay=80ms
> mtu:40 txqueue_size=2  rxqueue_size=2   one-direction delay=60ms
> round-trip delay=120ms
> mtu:40 txqueue_size=5  rxqueue_size=5   one-direction delay=120ms
> round-trip delay=240ms
> mtu:16 txqueue_size=1  rxqueue_size=1   one-direction delay=30ms
> round-trip delay=60ms
> mtu:8  txqueue_size=1   rxqueue_size=1   one-direction delay=25ms
> round-trip delay=50ms
> mtu:8  txqueue_size=10 rxqueue_size=10 one-direction delay=205ms
> round-trip delay=410ms

Updated test result with the codec_ms=10 is following:
mtu:16 txqueue_size=1  rxqueue_size=10   one-direction delay=20ms
round-trip delay=50ms
mtu:80 txqueue_size=1  rxqueue_size=10   one-direction delay=56ms
round-trip delay=110ms

However, this is still not 10ms with the default MTU:80 and codec_ms:10 :(

Anyway, is it a good idea to use so assymetric tx/rx queue sizes?

with best regards


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev mailing list