[pjsip] Play audio with samples/playfile correctly, but not on pjsua

Benny Prijono bennylp at pjsip.org
Thu May 15 10:35:58 EDT 2008

2008/5/15 Fan-Cheng Wu …ÇèóÕ\ <fcwu.cs95g at nctu.edu.tw>:
> I used simple_pjsua.c, not pjsua due to authentication failed when
>  making a call.
>  My complete code of simple_pjsua.c is viewed from
>  http://rafb.net/p/1isvbx36.html
>  I highlight some lines here.
>  1. change codec priority (Line 169 ~ 201) by
>     pjsua_codec_set_priority(&codecs[6].codec_id,200);
>     Terminal output actually said it used PCMU.
>  2. EC is disabled by pjsua_set_ec(0,0) at line 235
>  Besides, I also tried pjsua_conf_connect(ci.conf_slot, 0) and
>  pjsua_conf_connect(0,ci.conf_slot) at line 119 and 120. CPU
>  utilization would decrease
>  to 5%. Thus I expect encode/decode utilize most time of CPU.

Okay, it could be because of the resampling. Since the default clock
rate for both sound device and the bridge is 16KHz, and we are using
PCMU for the call, then resampling will be used. Try setting the clock
rate to 8000.

For a more complete checklist on how to optimize the CPU usage, please
see http://trac.pjsip.org/repos/wiki/FAQ#cpu


More information about the pjsip mailing list