Re: [pjsip] CPU is up to 10% after pjsua_set_snd_dev()

S
samuel.vinson
Thu, Nov 6, 2008 6:33 PM

If you use snd_auto_close_time=0
You don't need to call pjsua_set_snd_dev

Samuel

Message du 06/11/08 18:52
De : "Alexei Kuznetsov"
A : "samuel. vinson" , "pjsip list"
Copie à :
Objet : Re: [pjsip] CPU is up to 10% after pjsua_set_snd_dev()

I've played a little more and figured out that if I make a call, cpu usage decreases to normal. Here's the program flow:  0. Create pjsua, init with snd_auto_close_time=0, add transport 1. pjsua_start() 2. pjsua_set_snd_dev() -- after that cpu is about 10%  If the user leaves the app alone at this stage, it consumes cpu cycles.  3. pjsua_call_make_call() 4. pjsua_call_hangup() or call termination from another party -- cpu back to 0% after that step.  I have to call pjsua_set_snd_dev() at program start-up to select appropriate sound device. Is there a procedure to explicitly close the thing that snd_auto_close_time=0 closes after a voice call?  On Thu, Nov 6, 2008 at 8:31 PM, Alexei Kuznetsov  wrote: > Thanks, I didn't know about that parameter. Just tried it. It helped > in case of pjsua app: cpu usage decreases to less than 1% after making > a call. But if I use pjsua-lib and call pjsua_set_snd_dev(), cpu usage > stays high. > > Alexei > > On Thu, Nov 6, 2008 at 8:00 PM, samuel.vinson  wrote: >> >> Did you try to use auto-sound-close parameter with value=0 ? >> >> Samuel >> >> >> >>> Message du 06/11/08 13:57 >>> De : "Alexei Kuznetsov" >>> A : "pjsip list" >>> Copie à : >>> Objet : Re: [pjsip] CPU is up to 10% after pjsua_set_snd_dev() >> >>> >>> >>> I mean, the application uses 10% of cpu without any media active. >>> Also, pjsua without any params uses less than 1% cpu after start-up, >>> but 10% after the first call. Is it something you could improve in the >>> future? Or is it the design, or is it not up to pjproject but to other >>> code pjrpoject uses? Is it on a Mac only? >>> >>> -- >>> Best regards, >>> Alexei >>> >>> On Thu, Nov 6, 2008 at 12:05 PM, Nanang Izzuddin wrote: >>> > Hi, >>> > >>> > I guess that's normal, I experienced about the same with echo >>> > canceller enabled (running pjsua without any params). >>> > >>> > Regards, >>> > nanang >>> > >>> > >>> > On Thu, Nov 6, 2008 at 5:45 AM, Alexei Kuznetsov wrote: >>> >> Hi, >>> >> >>> >> After calling pjsua_set_snd_dev() CPU loads up to 10%. Mac OS X 10.5.5, >>> >> Intel. >>> >> >>> >> Is that an ussue or a normal behavior? >>> >> >>> >> -- >>> >> Best regards, >>> >> Alexei Kuznetsov >

Créez votre adresse électronique prenom.nom@laposte.net
1 Go d'espace de stockage, anti-spam et anti-virus intégrés.

If you use snd_auto_close_time=0 You don't need to call pjsua_set_snd_dev Samuel > Message du 06/11/08 18:52 > De : "Alexei Kuznetsov" > A : "samuel. vinson" , "pjsip list" > Copie à : > Objet : Re: [pjsip] CPU is up to 10% after pjsua_set_snd_dev() > > I've played a little more and figured out that if I make a call, cpu usage decreases to normal. Here's the program flow: 0. Create pjsua, init with snd_auto_close_time=0, add transport 1. pjsua_start() 2. pjsua_set_snd_dev() -- after that cpu is about 10% If the user leaves the app alone at this stage, it consumes cpu cycles. 3. pjsua_call_make_call() 4. pjsua_call_hangup() or call termination from another party -- cpu back to 0% after that step. I have to call pjsua_set_snd_dev() at program start-up to select appropriate sound device. Is there a procedure to explicitly close the thing that snd_auto_close_time=0 closes after a voice call? On Thu, Nov 6, 2008 at 8:31 PM, Alexei Kuznetsov wrote: > Thanks, I didn't know about that parameter. Just tried it. It helped > in case of pjsua app: cpu usage decreases to less than 1% after making > a call. But if I use pjsua-lib and call pjsua_set_snd_dev(), cpu usage > stays high. > > Alexei > > On Thu, Nov 6, 2008 at 8:00 PM, samuel.vinson wrote: >> >> Did you try to use auto-sound-close parameter with value=0 ? >> >> Samuel >> >> >> >>> Message du 06/11/08 13:57 >>> De : "Alexei Kuznetsov" >>> A : "pjsip list" >>> Copie à : >>> Objet : Re: [pjsip] CPU is up to 10% after pjsua_set_snd_dev() >> >>> >>> >>> I mean, the application uses 10% of cpu without any media active. >>> Also, pjsua without any params uses less than 1% cpu after start-up, >>> but 10% after the first call. Is it something you could improve in the >>> future? Or is it the design, or is it not up to pjproject but to other >>> code pjrpoject uses? Is it on a Mac only? >>> >>> -- >>> Best regards, >>> Alexei >>> >>> On Thu, Nov 6, 2008 at 12:05 PM, Nanang Izzuddin wrote: >>> > Hi, >>> > >>> > I guess that's normal, I experienced about the same with echo >>> > canceller enabled (running pjsua without any params). >>> > >>> > Regards, >>> > nanang >>> > >>> > >>> > On Thu, Nov 6, 2008 at 5:45 AM, Alexei Kuznetsov wrote: >>> >> Hi, >>> >> >>> >> After calling pjsua_set_snd_dev() CPU loads up to 10%. Mac OS X 10.5.5, >>> >> Intel. >>> >> >>> >> Is that an ussue or a normal behavior? >>> >> >>> >> -- >>> >> Best regards, >>> >> Alexei Kuznetsov > Créez votre adresse électronique prenom.nom@laposte.net 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.
AK
Alexei Kuznetsov
Thu, Nov 6, 2008 6:50 PM

I'm calling pjsua_set_snd_dev() to choose a sound device. For example,
user plugged-in a headset, selected it, shut down the app and started
it again with the headset plugged-in. I'd like the app to use this
headset for sound IO, that's why I call pjsua_set_snd_dev() with
appropriate device IDs at the beginning.

I don't think snd_auto_close_time=0 could help me in that case. But I
do need snd_auto_close_time=0 to auto-close the sound device when
idle. The problem was that a sound device did open but did not
auto-close after pjsua_set_snd_dev() even if pjsua had been
initialized with snd_auto_close_time=0.

Best regards,
Alexei

On Thu, Nov 6, 2008 at 9:33 PM, samuel.vinson samuelv@laposte.net wrote:

If you use snd_auto_close_time=0
You don't need to call pjsua_set_snd_dev

I'm calling pjsua_set_snd_dev() to choose a sound device. For example, user plugged-in a headset, selected it, shut down the app and started it again with the headset plugged-in. I'd like the app to use this headset for sound IO, that's why I call pjsua_set_snd_dev() with appropriate device IDs at the beginning. I don't think snd_auto_close_time=0 could help me in that case. But I do need snd_auto_close_time=0 to auto-close the sound device when idle. The problem was that a sound device did open but did not auto-close after pjsua_set_snd_dev() even if pjsua had been initialized with snd_auto_close_time=0. Best regards, Alexei On Thu, Nov 6, 2008 at 9:33 PM, samuel.vinson <samuelv@laposte.net> wrote: > > If you use snd_auto_close_time=0 > You don't need to call pjsua_set_snd_dev