Check CPU Utilization (moved)
Moved to https://docs.pjsip.org/en/latest/specific-guides/audio-troubleshooting/checks/cpu.html
Some audio problems are caused by high CPU utilization, so check that CPU utilization is not too high during the call. Sometimes CPU utilization of 75% or more is enough to cause audio distruptions in some systems, although in others the audio quality is till fine even with >90% CPU utilization. But to troubleshoot the problems it always help to try to lower the CPU usage to see if the audio quality improves.
Remedy to lower CPU utilization:
- Disable echo canceller (with pjsua, EC is by default enabled. You can disable it with --ec-tail 0 command line argument.
- If you're using complex codecs such as Speex or iLBC, try to use PCMU or PCMA (pjsua by default uses Speex/16KHz. Use --add-codec pcmu to use PCMU).
- Use the release build instead of debug build (remove -g option from CFLAGS if you're using gcc).
- Lower the sampling rate (by default pjsua uses 16KHz or 44.1KHz - 48KHz in Mac OS. You can override the clock rate with ---clock-rate 8000 command line argument to pjsua). However, when changing the clock rate, make sure that this clock rate matches the clock rate of the codec to be used, or otherwise resampling will be applied!
- Close other applications that consume CPU.
- As the last resort, upgrade your hardware!
FYI, my computer is an old PIII/600MHz laptop running Win2K, and it runs okay with default pjsua settings (Speex/16KHz with 800ms EC tail) as long as I use the release build. Your mileage will vary, of course.