Hi Benny, Effectively, my question was wrong. I have two steps : - init + pjsua_create + pjsua_init + pjsua_transport_create + pjsua_media_transports_create + pjsua_start - connect + pjsua_acc_add I call "init" and just after "connect". So in this case, the CPU increase to 80%, just because micro is activated. But I don't need micro before the communication is established. The CPU problem comes from Darwin and not your implementation. I think, because this problem doesn't exist on windows and especially because I have the same with micro without pjsip ;-) With this description, perhaps you have another solution to deactivate micro. Thanks in advance Samuel Benny Prijono a ?crit : > On 3/11/08, Samuel Vinson <samuelv at laposte.net> wrote: > >> Hi, >> >> When you use pjsua API, pjsua_create activates input and output media. >> On iPod touch/iPhone, when micro is activated CPU increases to 80%. >> > > Is it? If I recall correctly pjsua_create() doesn't do anything useful > except to call Pa_Initialize(). Could it be because of echo canceller? > Would it help if you open the sound device in lower clock rate (btw > there's a new option, "snd_clock_rate" to control the clock rate of > the sound device in latest pjsua-lib). > > >> So is it possible to deactivate input media (micro) when there are no >> call, and activate input media when the call is established ? >> For example in callback 'on_call_media_state' when the media_status >> equals PJSUA_CALL_MEDIA_ACTIVE (establishing) >> >> If it's possible where should I closed media input when call is hang up ? >> > > Yes it's possible. To do this, you'd need to watch for these events: > - on_call_media_state() is called with PJSUA_CALL_MEDIA_ACTIVE > - whenever the application plays/records files or tones > - on_call_media_state() is called with non-active state > - when call is disconnected > - when file recording/playback stops > > And whenever you have these events, call > pjmedia_conf_get_connect_count() to get the number of connections in > the bridge. If the value is zero, you can shutdown the sound device, > and if not, you need to have the sound device running. > > cheers, > -benny > > > > >> Thanks >> >> Samuel >> >> _______________________________________________ >> Visit our blog: http://blog.pjsip.org >> >> pjsip mailing list >> pjsip at lists.pjsip.org >> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org >> >> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > >