how to reduce CPU load and improve voice quality on mobile device FR

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

 



 Hi
I have followed the suggestions given by Benny and have tried http://trac.pjsip.org/repos/wiki/FAQ#cpu 
all the steps properly. Now I am getting the good voice quality when the CPU utilization is about 80-90 % by pjsua.
When I run other application on openmoko freerunner the CPU utilization by pjsua reduces to around 40% and the voice quality becomes very poor.

Please advise me how to stabilize the voice quality when the CPU utilization is varying .

As I just want to run pjsua what other libraries or the part of code I can remove before compiling so that it takes less CPU.


Any related advise is welcome.

Tarun



----- Original Message ----
From: Benny Prijono <bennylp@xxxxxxxxx>
To: pjsip list <pjsip at lists.pjsip.org>
Sent: Tuesday, August 19, 2008 2:17:39 AM
Subject: Re: how to reduce CPU load and improve voice quality on mobile device FR


On Mon, Aug 18, 2008 at 6:14 PM, TARUN CHAPLOT <tarunchaplot at yahoo.com> wrote:


Hello All
Thanks for the prompt replies.

I am using pjsip 0.9.0 version on openmoko FR compiled in arm-angstrom-linux environment 
by using following command

--host=arm-angstrom-linux-gnueabi



I've no clue about OpenMoko so I'm not sure what build command to suggest, but I guess if it builds and runs fine then it's okay then. More below.
 


I am having problem with sound quality 

	* audio stutters, 
	* audio break-ups. I looked through the checklist https://trac.pjsip.org/repos/wiki/sound-problems, and I ran the sound test by

./sndtest  (https://trac.pjsip.org/repos/wiki/audio-check-sound-device-jitter)

and got the below given results .



----------------------------------------------------------------------------------------------------
 17:49:15.121 os_core_unix.c pjlib 0.9.0-release for POSIX initialized
 17:49:19.212      pasound.c PortAudio sound library initialized, status=0
 17:49:19.215      pasound.c PortAudio host api count=1
 17:49:19.217      pasound.c Sound device count=1
 17:49:19.222          pjlib select() I/O Queue created (0x47754)
 17:49:19.226      sndtest.c Found 1 devices:
 17:49:19.228      sndtest.c  0: /dev/dsp (capture=16, playback=16)
 17:49:19.915      sndtest.c Testing playback device /dev/dsp
 17:49:19.917      sndtest.c Testing capture device /dev/dsp
 17:49:20.481      sndtest.c  Please wait while test is in progress (~11 secs)..
 17:49:32.424      sndtest.c  Dumping results:
 17:49:32.425      sndtest.c   Parameters: clock rate=8000Hz, 80 samples/frame
 17:49:32.425      sndtest.c   Playback stream report:
 17:49:32.425      sndtest.c    Duration: 9s.980
 17:49:32.426      sndtest.c    Frame interval: min=0.004ms, max=132.173ms
 17:49:32.426      sndtest.c    Jitter: min=9.955ms, avg=28.194ms, max=132.168ms
 17:49:32.427      sndtest.c   Capture stream report:
 17:49:32.427      sndtest.c    Duration: 9s.980
 17:49:32.427      sndtest.c    Frame interval: min=0.003ms, max=132.144ms
 17:49:32.428      sndtest.c    Jitter: min=9.943ms, avg=28.187ms, max=132.141ms
 17:49:32.428      sndtest.c   Checking for clock drifts:
 17:49:32.428      sndtest.c    No clock drifts is detected
 17:49:32.429      sndtest.c  Test completed with some warnings
--------------------------------------------------------------------------------------------------------------
As the avg jitter is below 32 ms so that is fine but the max jitter is very high (132.168ms) so as suggested on that page 

That's awful indeed. You can try the following (either alone or combination of them) and see which one helps:
 - increase PJMEDIA_SOUND_BUFFER_COUNT to 16
 - use larger frame size (e.g. set PJSUA_DEFAULT_AUDIO_FRAME_PTIME to 40)
 - disable VAD (--no-vad option)
 

I would like to ask what can be the problem. Do I need to change the jitter buffer settings according to device (openmoko FR).?



The problem is with the sound device itself. I'm not sure changing jitter buffer settings will help since the default values should be big enough already (360ms). But lets do the above first and we'll come back at this later.

 
Further I tried using PCMU and Speex codecs but do not see any change in CPU load.



The FAQ http://trac.pjsip.org/repos/wiki/FAQ#cpu really has explained everything, if you don't see any improvements I suspect some of the steps are not followed properly. In particular please read again item no 4 there about choosing sampling rate, which means that if you use PCMU, you should also use --clock-rate 8000 option.

Cheers
 Benny


 
Any kind of suggestion will be greatly appeciated.

Thanks
Tarun






----- Original Message ----
From: Benny Prijono <bennylp@xxxxxxxxx>
To: pjsip list <pjsip at lists.pjsip.org>
Sent: Monday, August 18, 2008 8:29:01 PM
Subject: Re: how to reduce CPU load and improve voice quality on mobile device FR


On Mon, Aug 18, 2008 at 6:51 AM, TARUN CHAPLOT <tarunchaplot at yahoo.com> wrote:

Hi,

We are having a problem with running PJSIP on the neo freerunner, and have tried a
 variety of solutions to fix this but still not successful.   The setup
 that we are using is PJSIP on a Mac with OSX, and PJSIP compiled for
openmoko.I compiled PJSIP for openmoko by setting the env using command
 source /usr/local/openmoko/arm/setup-env
and ./configure --host=arm-angstrom-linux-gnueabi.
 


First thing first, what pjsip version?


 When we run PJSIP between the Mac and Openmoko, we are encountering  problems. 
The  problem is that the sound quality is very bad. When we speak
 into the Mac, the sound coming from the Openmoko comes out in stutters
(on and off every half second). It is also full of static.  
When we try a VOIP call directly from mac to mac, it works and sounds fine.  



If you haven't seen this, perhaps you can follow the checklists in https://trac.pjsip.org/repos/wiki/sound-problems, and find out what the exact problem is.
 
I looked at the CPU load and found that it is almost 80% on freerunner and 25 % on Mac OS X.
I have tried with different codecs e.g. speex ,PCMA and GSM.

Please advise me that how can I reduce the CPU load. I have followed the following http://trac.pjsip.org/repos/wiki/FAQ#cpu but 
no improvement.



Now that's surprising. You *should* see significant difference in CPU usage between Speex and PCMU. If not, then that probably suggests that the problem is elsewhere.

Cheers
 Benny

 
Thanks in advance.

Tarun




_______________________________________________
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


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080827/492a1c79/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