alsa: use (blksz - round) as start threshold.

The threshold making poll() return POLLOUT is one block (according to
alsa library sources). If a poll-based program writes blksz - 1
samples, playback never starts but poll won't return POLLOUT either.
In turn the program deadlocks. The problem could be observed in the
sio_alsa_xrun() routine.
This commit is contained in:
Alexandre Ratchov 2019-07-01 17:12:00 +02:00
parent f9c0bed6d9
commit cbdd29c403
1 changed files with 1 additions and 1 deletions

View File

@ -875,7 +875,7 @@ sio_alsa_setpar(struct sio_hdl *sh, struct sio_par *par)
return 0;
}
err = snd_pcm_sw_params_set_start_threshold(hdl->opcm,
oswp, hdl->par.bufsz);
oswp, hdl->par.bufsz - hdl->par.round);
if (err < 0) {
DALSA("couldn't set play start threshold", err);
hdl->sio.eof = 1;