[pjsip] Media issue with multiple (parallel) calls
Anshuman S. Rawat
arawat at 3clogic.com
Tue Feb 12 08:36:02 EST 2008
>> We have integrated G729 codec with PJSIP 0.7.0 (revision 1538) and media
>> flow works fine for 1 call at a time. However, if we make multiple (even
>> G729 calls in parallel the media becomes very choppy and choppiness seems
>> increase with increasing number of parallel G729 calls. The root cause of
>> the problem seems to be the fact that encoding and decoding happen in a
>> single thread for all the calls (I printed out thread IDs in the encode
>> decode routine of G729 - thread ID was same). The small verification I
>> was that I placed 2 parallel (G729) calls and heard choppy media. On
>> of the calls on hold the choppiness dissappeared and reappeared when the
>> held call was unheld.
> When conference bridge is used, then most media processing will be
> done in the context of the sound device thread indeed, because audio
> sources need to be mixed at the same time.
> Are you really tight on CPU? If so, then perhaps this was caused by
> the lack of power to run more than one simultaneous G729 calls rather
> than encode/decode being done in a single thread.
I dont think I am tight on CPU. I have a Centrino Duo @2GHz with a GB of
BTW, I do see these frequently in the log file.
13:33:33.750 splitcomb.c Overflow in downstream direction
13:33:33.750 splitcomb.c Underflow in upstream direction
Any suggestion/hints on what could be causing this?
>> I tried increasing the number of worker threads being created in
>> to no effect. I was contemplating of how to put encode and decode in
>> seperate threads. Maybe Benny or someone whose faced a similar problem
>> give some suggestions?
> You can create a media port with a worker thread in it, so that:
> - when get_frame() is called on this port, you call get_frame() to the
> - when put_frame() is called, you copy the frame and instruct the
> worker thread to call put_frame() to the stream.
> Then instead of registering the stream to the bridge, you register
> this port to the bridge instead.
> Visit our blog: http://blog.pjsip.org
> pjsip mailing list
> pjsip at lists.pjsip.org
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.19.19/1256 - Release Date: 2/2/2008
> 1:50 PM
More information about the pjsip