Extremely fluctuating CPU load when decreasing audio frame size

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

 



Hi,

I'm experiencing issues when reducing the audio frame length. I'm building
on the simple_pjsua.c example and "reopening" the audio device as:

    // Get conferencing media port (and close current sound device)
    cport = pjsua_set_no_snd_dev();

    pjmedia_aud_dev_default_param(-1, &param);
    param.dir = PJMEDIA_DIR_CAPTURE_PLAYBACK;
    param.rec_id = -1;
    param.play_id = -1;
    param.clock_rate = 16000;
    param.channel_count = 1;
    param.samples_per_frame = 64;
    param.bits_per_sample = 16;
    param.flags =
PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY|PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY;
    param.input_latency_ms = 64; // Samples, not milliseconds! (or... ?)
    param.output_latency_ms = 64;
    status = pjmedia_snd_port_create2(limes_pool, (const
pjmedia_aud_param*)&param, &sndport);
    if(status != PJ_SUCCESS) printf("Couldn't re-open sound device (%d).\n",
status);

    status = pjmedia_snd_port_connect(sndport, cport);
    if(status != PJ_SUCCESS) printf("Couldn't connect sound port (%d).\n",
status);

This seems to work quite well, but the CPU load is very weird (I just run
the program without having any call going). When using 64 samples/frame
(=4ms/frame) the CPU load normaly resides at a few percent but peaks at
whopping 50% exactly every 50 seconds! For frame length of 128 samples
(=8ms), the CPU load most often resides at a few percent but peaks at ~30%
every 50 seconds. For 256 samples/frame (=16ms) the CPU load stays around
6-12% constantly.

Like I wrote previously, I don't have any call ongoing when checking the CPU
loads. If I have a call, I get increased CPU load (of course) but still the
(then even higher) peaks.

I'm wondering if this is normal behaviour?

(Running on an ARM9 @ 300MHz and checking CPU load by telneting to the
board, running "top".)

Regards,
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20110831/6c364dbb/attachment-0001.html>


[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