Changes between Version 20 and Version 21 of Getting-Started/BB10


Ignore:
Timestamp:
Apr 19, 2013 10:55:58 AM (11 years ago)
Author:
bennylp
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Getting-Started/BB10

    v20 v21  
    230230 
    231231 
     232[[BR]] 
     233 
     234= Performance Tuning = #performance 
     235 
     236This section describes some performance tuning tips to reduce CPU utilization on the device. These are subset of the more [wiki:FAQ#cpu thorough performance tuning] as explained in the FAQ, please check that out for further reading. 
     237 
     238The recommendation below was based on experimentation on Z10 device. The full result of the experimentation is attached as PDF. The patch to measure CPU is also attached. 
     239 
     240=== Tune Resampling Quality === 
     241 
     242Because default media clock rate is 16Khz (the {{{pjsua_media_config.clock_rate}}} setting), sample rate conversion (a.k.a resampling) will be used whenever a media port with clock rate other than 16Khz is added to the conference bridge. This happens, for example, when call is established with narrowband codec such as G.711, GSM, iLBC, Speex-NB, and AMR-NB. 
     243 
     244By default high quality resampling with large filter is used, and this uses a lot of CPU. The small filter resample produces indistinguishable result on mobile devices, and uses much less CPU. The small filter resample can be activated by setting {{{pjsua_media_config.quality}}} to 4 (default is 8), or by declaring {{{PJSUA_DEFAULT_CODEC_QUALITY}}} to 4 in {{{config_site.h}}}. This is now the default value in {{{config_site_sample.h}}}, so if your {{{config_site.h}}} includes {{{config_site_sample.h}}} (which is recommended above), you will get this setting. 
     245 
     246Changing {{{pjsua_media_config.quality}}} from 8 to 4 reduces CPU utilization for PCMU call from 13% to 3%. 
     247 
     248=== Avoid Resampling Altogether === 
     249 
     250If all of your audio codecs are narrowband, then you should initialize PJSUA-LIB with 8Khz clock rate (set {{{pjsua_media_config.clock_rate}}} to 8000) to avoid resampling altogether. 
     251 
     252Without resampling, a PCMU call uses 0% CPU! 
     253 
     254=== configure-bb10 script does not enable optimization by default === 
     255 
     256This applies to PJSIP's {{{configure-bb10}}} script and also the {{{generic-configure-bb10}}} for building OpenCore AMR-NB that is distributed by PJSIP-Demo. Both do not put "-O2" by default. 
     257 
     258Adding "-O2" could potentially reduce CPU utilization by 20%. 
     259 
     260=== Codecs === 
     261 
     262Codec is the main contributor of CPU usage. Below is rough CPU utilization measurement for some codecs. Please see the attached PDF document for more complete results. 
     263 
     264Narrowband, without resampling (pjsua_media_config.clock_rate=8000): 
     265 - PCMU: 0% 
     266 - iLBC: 13% 
     267 - !OpenCore AMR-NB: 26% 
     268 
     269Narrowband, with small filter resampling (pjsua_media_config.clock_rate=16000, pjsua_media_config.quality=4): 
     270 - PCMU: 3% 
     271 - iLBC: 15% 
     272 - !OpenCore AMR-NB: 27% 
     273 
     274Wideband, without resampling (pjsua_media_config.clock_rate=16000): 
     275 - G.722: 5% 
     276 - !OpenCore Speex/WB: 20% 
     277 
     278 
     279 
     280 
    232281 
    233282[[BR]]