wiki:audio-problem-dropouts

Version 9 (modified by bennylp, 17 years ago) (diff)

--

Audio Problem: Audio Drop-outs or Stutters

Symptoms

The audio is sounding like it's skipping some frames.

Sample WAV File

See the attachment on the bottom of this page. You can hear the stutters at 2.5 second, 3.8 second, 8.8 second.

(audio file courtesy of Chen Huan <chenhuan at sict.ac.cn> who managed to convince his girlfriend to record the audio for testing :) ).

Checklists

Here are the checklists related to stutters problem:

  1. Check whether the symptom is observable when looping the microphone to the speaker locally.
  2. Check for network impairments of incoming RTP packets
  3. Check that CPU Utilization is not Too High

Windows Mobile Workaround

Chen Huan observed stutters on Windows Mobile devices, and it turns out that this was caused by frame duration or samples_per_frame setting that is set too low when opening the sound device.

The usual settings for frame duration is 10ms or 20ms, which is good to provide low delay streaming. But it seems that Windows Mobile just can't handle this, and increasing the frame duration to 80ms seems to cure the problem.

Example:

 #define PTIME 20

  int clock_rate = 8000;
  int channel_count = 1;
  int samples_per_frame = clock_rate * PTIME / 1000;
  int bits_per_sample = 16;


  status = pjmedia_conf_create( pool,	      /* pool to use	    */
				port_count,   /* number of ports    */
				clock_rate,
				channel_count,
				samples_per_frame,
				bits_per_sample,
				0,	      /* options	    */
				&conf	      /* result		    */
				);

The snippet above will create a conference bridge with internal sound device, using frame duration setting of 20ms (the PTIME macro). To fix the stutter problem, change PTIME to 80.

Attachments (1)

Download all attachments as: .zip