seq-midi: always log message on output overrun
authorClemens Ladisch <clemens@ladisch.de>
Mon, 13 Jul 2009 11:30:22 +0000 (13:30 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 15 Jul 2009 09:56:06 +0000 (11:56 +0200)
It turns out that the main cause of output buffer overruns is not slow
drivers but applications that generate too many messages.  Therefore, it
makes more sense to make that error message always visible, and to
rate-limit it.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/seq_midi.c

index 4d26146a62ccd8fd2fff0c73ea25507ff4a6550f..3810c52f652e2f99282174668b8d9eaca6964667 100644 (file)
@@ -120,7 +120,8 @@ static int dump_midi(struct snd_rawmidi_substream *substream, const char *buf, i
                return -EINVAL;
        runtime = substream->runtime;
        if ((tmp = runtime->avail) < count) {
-               snd_printd("warning, output event was lost (count = %i, available = %i)\n", count, tmp);
+               if (printk_ratelimit())
+                       snd_printk(KERN_ERR "MIDI output buffer overrun\n");
                return -ENOMEM;
        }
        if (snd_rawmidi_kernel_write(substream, buf, count) < count)
This page took 0.059277 seconds and 5 git commands to generate.