High CPU Usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Perhaps it is the sound device. If you can't avoid pjsua_set_snd_dev()
in the initialization, try to put pjsua_conf_disconnect(0,0) after
pjsua_set_snd_dev() to activate the auto-close timer of the sound
device (sound device auto-close feature is enabled by default).

BR,
nanang


On Fri, Apr 23, 2010 at 9:32 PM, Xavier LaRue <xlarue at hcn-inc.com> wrote:
> Hi,
>
> I'm currently implementing a deamon that will stay resident on my device
> until
> somone / something decide to call using this deamon. So at the deamon
> initialisation,
> I initialise pjsua with all parameters needed and I don't understand why,
> while IDLE
> my deamon take 25% of my atom n270 cpu... On my core 2 duo, it's about 1 to
> 4 % of
> my cpu ...
>
> Is there a setting that I need to set to tell to pjsua/pjsip to idle more...
> Or..
> After some invetigating the "worker" thread of pjsip is using 23.7 % of the
> cpu...
>
> FYI, here is my initialisation code
>
> ? ?pj_status_t retcode;
>
> ? ?retcode = pjsua_create();
>
> ? ?if (retcode != PJ_SUCCESS)
> ? ? ? ?error_exit("Cannot Create pjsua", retcode);
>
> ? ?pj_status_t status;
>
> ? ?{
> ? ? ? ?pjsua_config cfg;
> ? ? ? ?pjsua_logging_config log_cfg;
> ? ? ? ?pjsua_media_config mcfg;
>
>
> ? ? ? ?pjsua_config_default(&cfg);
> // ? ? ? ?cfg.cb.on_incoming_call = &on_incoming_call;
> ? ? ? ?cfg.cb.on_call_media_state = &c_on_call_media_state;
> ? ? ? ?cfg.cb.on_call_state = &c_on_call_state;
>
> ? ? ? ?pjsua_logging_config_default(&log_cfg);
> ? ? ? ?log_cfg.cb = &c_log_callback;
> ? ? ? ?log_cfg.console_level = 3;
>
> ? ? ? ?pjsua_media_config_default(&mcfg);
>
> ? ? ? ?status = pjsua_init(&cfg, &log_cfg, &mcfg);
> ? ? ? ?if (status != PJ_SUCCESS) error_exit("Error in pjsua_init()",
> status);
>
>
> ? ? ? ?pjmedia_aud_dev_info snd_info[255];
> ? ? ? ?unsigned int heh = 255;
> ? ? ? ?pjsua_enum_aud_devs(snd_info, &heh);
>
> ? ? ? ?qDebug() << "===== Listing the Audio Devices... ";
> ? ? ? ?for (int i = 0; i < heh; i++)
> ? ? ? ?{
> ? ? ? ? ? ?qDebug() << snd_info[i].name <<
> snd_info[i].default_samples_per_sec << snd_info[i].driver <<
> snd_info[i].input_count << snd_info[i].output_count;
> ? ? ? ?}
>
> ? ? ? ?pjsua_set_snd_dev(5,5);
> ? ?}
>
> /* Add UDP transport. */
> ? ?{
> ? ? ? ? pjsua_transport_config cfg;
>
> ? ? ? ? pjsua_transport_config_default(&cfg);
> ? ? ? ? status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &cfg, NULL);
> ? ? ? ? if (status != PJ_SUCCESS) error_exit("Error creating transport",
> status);
> ? ?}
> /* Initialization is done, now start pjsua */
> ? ?status = pjsua_start();
> ? ?if (status != PJ_SUCCESS) error_exit("Error starting pjsua", status);
>
> /* account registration here... */
>
> I hope somone will have an idea !
> Thanks a lot,
> Xavier LaRue
>
> _______________________________________________
> 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
>



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux