Skip to content

Commit 29ad5de

Browse files
committed
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. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
1 parent bbd106d commit 29ad5de

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

alsaloop/pcmjob.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,13 +647,15 @@ static int xrun(struct loopback_handle *lhandle)
647647
int err;
648648

649649
if (lhandle == lhandle->loopback->play) {
650-
logit(LOG_DEBUG, "underrun for %s\n", lhandle->id);
650+
if (verbose)
651+
logit(LOG_DEBUG, "underrun for %s\n", lhandle->id);
651652
xrun_stats(lhandle->loopback);
652653
if ((err = snd_pcm_prepare(lhandle->handle)) < 0)
653654
return err;
654655
lhandle->xrun_pending = 1;
655656
} else {
656-
logit(LOG_DEBUG, "overrun for %s\n", lhandle->id);
657+
if (verbose)
658+
logit(LOG_DEBUG, "overrun for %s\n", lhandle->id);
657659
xrun_stats(lhandle->loopback);
658660
if ((err = snd_pcm_prepare(lhandle->handle)) < 0)
659661
return err;

0 commit comments

Comments
 (0)