Greetings, I am seeking guidance to improve voice latency for an embedded VoIP application using PJSIP 1.0.1. The target is an OMAP3530zoom. When establishing a call between pjsua on a PC and a (slightly modified) simple-pjsua on the target, there is high latency on the OMAP. Latency is highest when all clock rates (conf bridge and sound device) are set to 8 Khz (>2 seconds) and lowest when all clock rates are set to 44100 Hz (~500 msec). This behavior is puzzling because I would expect less latency with a lower clock rate. I have followed the suggestions in the FAQ regarding latency and optimization. I have included the sndinfo and sndtest results below for 8Khz and 44100 Hz. The attached document contains screen shots of the media stats dump and codec list. Being new to VoIP development, I would greatly appreciate your insight and any suggestions you might have for further tuning. Thanks in advance, Kim Using PJSIP 1.0.1 target board: OMAP3530zoom *************************************************** sndtest - --rate=8000 (Frame interval max=256.012, max Jitter = 256) *************************************************** 00:07:35.884 sndtest.c 0: /dev/dsp (capture=16, playback=16) 00:07:35.884 sndtest.c default sampling rate: 44100 00:07:36.408 sndtest.c Testing playback device /dev/dsp 00:07:36.408 sndtest.c Testing capture device /dev/dsp 00:07:36.929 sndtest.c Please wait while test is in progress (~11 secs).. 00:07:52.541 sndtest.c Dumping results: 00:07:52.541 sndtest.c Parameters: clock rate=8000Hz, 80 samples/frame 00:07:52.541 sndtest.c Playback stream report: 00:07:52.541 sndtest.c Duration: 9s.990 00:07:52.541 sndtest.c Frame interval: min=0.000ms, max=256.042ms 00:07:52.541 sndtest.c Jitter: min=9.756ms, avg=28.725ms, max=256.042ms 00:07:52.541 sndtest.c Capture stream report: 00:07:52.542 sndtest.c Duration: 9s.980 00:07:52.542 sndtest.c Frame interval: min=0.000ms, max=256.012ms 00:07:52.542 sndtest.c Jitter: min=9.756ms, avg=28.741ms, max=256.012ms 00:07:52.542 sndtest.c Checking for clock drifts: 00:07:52.542 sndtest.c No clock drifts is detected 00:07:52.542 sndtest.c Test completed with some warnings 00:07:52.939 pasound.c PortAudio sound library shutting down.. *************************************************** sndtest - --rate=44100 (Frame interval max=46.783, max Jitter = 46.783) *************************************************** 00:05:16.571 sndtest.c 0: /dev/dsp (capture=16, playback=16) 00:05:16.571 sndtest.c default sampling rate: 44100 00:05:16.979 sndtest.c Testing playback device /dev/dsp 00:05:16.979 sndtest.c Testing capture device /dev/dsp 00:05:17.410 sndtest.c Please wait while test is in progress (~11 secs).. 00:05:29.424 sndtest.c Dumping results: 00:05:29.424 sndtest.c Parameters: clock rate=44100Hz, 441 samples/frame 00:05:29.424 sndtest.c Playback stream report: 00:05:29.424 sndtest.c Duration: 10s.030 00:05:29.424 sndtest.c Frame interval: min=0.000ms, max=46.783ms 00:05:29.424 sndtest.c Jitter: min=9.756ms, avg=25.605ms, max=46.753ms 00:05:29.424 sndtest.c Capture stream report: 00:05:29.424 sndtest.c Duration: 10s.030 00:05:29.424 sndtest.c Frame interval: min=0.000ms, max=46.783ms 00:05:29.424 sndtest.c Jitter: min=9.756ms, avg=25.591ms, max=46.783ms 00:05:29.425 sndtest.c Checking for clock drifts: 00:05:29.425 sndtest.c No clock drifts is detected 00:05:29.425 sndtest.c Test completed with some warnings 00:05:29.596 pasound.c PortAudio sound library shutting down.. *************************************************** sndinfo output *************************************************** 00:10:22.066 os_core_unix.c pjlib 1.0.1 for POSIX initialized 00:10:23.787 pasound.c PortAudio sound library initialized, status=0 00:10:23.787 pasound.c PortAudio host api count=1 00:10:23.787 pasound.c Sound device count=1 00:10:23.788 pjlib select() I/O Queue created (0x48e04) Device #00: Name : /dev/dsp # of input channels : 16 # of output channels: 16 Default clock rate : 44100 Hz *************************************************** config_site.h *************************************************** #define PJ_CONFIG_MAXIMUM_SPEED #define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_PORTAUDIO_SOUND #define PJMEDIA_PREFER_DIRECT_SOUND 0 #define PJMEDIA_SND_DEFAULT_REC_LATENCY 40 #define PJMEDIA_SND_DEFAULT_PLAY_LATENCY 40 #define PJMEDIA_SOUND_USE_DELAYBUF 0 #define PJMEDIA_SOUND_BUFFER_COUNT 6 // Per pjsip recommendations - CPU optimize #if defined(PJ_CONFIG_MAXIMUM_SPEED) # define PJ_ENABLE_EXTRA_CHECK 0 # undef PJ_OS_HAS_CHECK_STACK # define PJ_OS_HAS_CHECK_STACK 0 # define PJ_DEBUG 0 # define PJSIP_SAFE_MODULE 0 # define PJSIP_UNESCAPE_IN_PLACE 1 # define PJ_HASH_USE_OWN_TOLOWER 1 #endif Kimberly Gibbs kimberly_gibbs at yahoo.com LinkedIn: http://www.linkedin.com/in/kimberlygibbs -------------- next part -------------- A non-text attachment was scrubbed... Name: Latency Test.doc Type: application/octet-stream Size: 177152 bytes Desc: not available URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090320/01a1b425/attachment-0001.doc>