snd_pcm_uframes_t buffer_size;
int err;
size_t n;
- snd_pcm_uframes_t xfer_align;
unsigned int rate;
snd_pcm_uframes_t start_threshold, stop_threshold;
snd_pcm_hw_params_alloca(¶ms);
exit(EXIT_FAILURE);
}
snd_pcm_sw_params_current(handle, swparams);
- err = snd_pcm_sw_params_get_xfer_align(swparams, &xfer_align);
- if (err < 0) {
- error(_("Unable to obtain xfer align\n"));
- exit(EXIT_FAILURE);
- }
if (avail_min < 0)
n = chunk_size;
else
err = snd_pcm_sw_params_set_avail_min(handle, swparams, n);
/* round up to closest transfer boundary */
- n = (buffer_size / xfer_align) * xfer_align;
+ n = buffer_size;
if (start_delay <= 0) {
start_threshold = n + (double) rate * start_delay / 1000000;
} else
err = snd_pcm_sw_params_set_stop_threshold(handle, swparams, stop_threshold);
assert(err >= 0);
- err = snd_pcm_sw_params_set_xfer_align(handle, swparams, xfer_align);
- assert(err >= 0);
-
if (snd_pcm_sw_params(handle, swparams) < 0) {
error(_("unable to install sw params:"));
snd_pcm_sw_params_dump(swparams, log);
return err;
}
- /* align all transfers to 1 sample */
- err = snd_pcm_sw_params_set_xfer_align(handle, swparams, 1);
- if (err < 0) {
- fprintf(stderr, _("Unable to set transfer align for playback: %s\n"), snd_strerror(err));
- return err;
- }
-
/* write the parameters to the playback device */
err = snd_pcm_sw_params(handle, swparams);
if (err < 0) {