mirror of https://github.com/ericonr/sndio.git
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:
parent
f9c0bed6d9
commit
cbdd29c403
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue