]> git.alsa-project.org Git - alsa-utils.git/commitdiff
alsaloop: only log xrun debug messages when verbose
authorPeter Korsgaard <peter@korsgaard.com>
Wed, 4 Jun 2025 07:35:00 +0000 (09:35 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 8 Jan 2026 13:20:14 +0000 (14:20 +0100)
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>
alsaloop/pcmjob.c

index ffb439b45e66df4e843958d5acbdf66fecd0af27..2720f55f0f4855dc94ab30e3f2a2222eb7f52432 100644 (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;