Question

As we know that when we open a device for playback, then we have to provide data to device at the rate device operates (means we must match to the rate of the device), otherwise we will get under-run.

    "Under-run/over-run can be overcomed by increasing the buffer size"
I can understand how over-run can be overcomed, but how under-run can be eliminated by increasing buffer size. Can we overcome under-run by using snd_pcm_sw_params_set_silence_size or snd_pcm_sw_params_set_silence_threshold?. What is the exact difference between these two?. Any help thanks in advance.

Was it helpful?

Solution

The silence size/threshold settings are more generic than needed in practice.

To reinitialize any just-played part of the buffer with zeros, set the silence threshold to zero, and set the silence size to the boundary value (which you can read with snd_pcm_sw_params_get_boundary).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top