This is probably not necessary, but since aplay from the alsa-utils
package sets it in the same way, it can't hurt to do this.
unsigned buffer_time;
int ret;
const char *msg;
+ unsigned period_time;
PARA_INFO_LOG("opening %s\n", conf->device_arg);
msg = "unable to open pcm";
&buffer_time, NULL);
if (ret < 0)
goto fail;
+ period_time = buffer_time / 4;
+ msg = "could not set period time";
+ ret = snd_pcm_hw_params_set_period_time_near(pad->handle, hwparams,
+ &period_time, 0);
+ if (ret < 0)
+ goto fail;
+
msg = "unable to install hw params";
ret = snd_pcm_hw_params(pad->handle, hwparams);
if (ret < 0)