1
0
Fork 0

alsaloop: only log xrun debug messages when verbose

Xruns can happen quite often (E.G. continuously when using alsaloop to/from
the UAC gadget driver without a connected host), so only log the debug
messages when verbose logging has been requested to not flood the logs.

Closes: https://github.com/alsa-project/alsa-utils/pull/302
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Peter Korsgaard 2025-06-04 09:35:00 +02:00 committed by Jaroslav Kysela
parent 502340490f
commit c38f4bb0d1

View file

@ -647,13 +647,15 @@ static int xrun(struct loopback_handle *lhandle)
int err;
if (lhandle == lhandle->loopback->play) {
logit(LOG_DEBUG, "underrun for %s\n", lhandle->id);
if (verbose)
logit(LOG_DEBUG, "underrun for %s\n", lhandle->id);
xrun_stats(lhandle->loopback);
if ((err = snd_pcm_prepare(lhandle->handle)) < 0)
return err;
lhandle->xrun_pending = 1;
} else {
logit(LOG_DEBUG, "overrun for %s\n", lhandle->id);
if (verbose)
logit(LOG_DEBUG, "overrun for %s\n", lhandle->id);
xrun_stats(lhandle->loopback);
if ((err = snd_pcm_prepare(lhandle->handle)) < 0)
return err;