In alsa_init() we set the buffer time to the maximum value supported
by the device. However, on some systems this time is more than 10
seconds, which is much too high.
This patch changes alsa_init() to use a buffer time of at most
0.5 seconds.
NULL);
if (ret < 0 || buffer_time == 0)
goto fail;
+ /* buffer at most 500 milliseconds */
+ buffer_time = PARA_MIN(buffer_time, 500U * 1000U);
msg = "could not set buffer time";
ret = snd_pcm_hw_params_set_buffer_time_near(pad->handle, hwparams,
&buffer_time, NULL);