From 0c3fd96693ddac03805482af722a6f8438a2c40f Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Fri, 12 Jun 2020 22:26:34 +0200 Subject: [PATCH] Fix confusion between ALSA output and input periods count. This could cause the play start threshold to be larger than the play buffer in turn causing playback to never start. --- libsndio/sio_alsa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libsndio/sio_alsa.c b/libsndio/sio_alsa.c index 4c47ea6..c544c4a 100644 --- a/libsndio/sio_alsa.c +++ b/libsndio/sio_alsa.c @@ -821,9 +821,9 @@ sio_alsa_setpar(struct sio_hdl *sh, struct sio_par *par) return 0; hdl->par.msb = 1; hdl->par.bps = SIO_BPS(hdl->par.bits); - hdl->par.rate = irate; - hdl->par.round = iround; - hdl->par.bufsz = iround * iperiods; + hdl->par.rate = orate; + hdl->par.round = oround; + hdl->par.bufsz = oround * operiods; hdl->par.appbufsz = hdl->par.bufsz; /* software params */