From f907ed94f993b0cd366c26eaa88b90c5454203ae Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 13 Jul 2009 13:30:22 +0200 Subject: seq-midi: always log message on output overrun 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 Signed-off-by: Takashi Iwai --- sound/core/seq/seq_midi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sound/core') diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c index 4d26146..3810c52 100644 --- a/sound/core/seq/seq_midi.c +++ b/sound/core/seq/seq_midi.c @@ -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) -- cgit v1.1