Skip to content

Commit

Permalink
seq-midi: always log message on output overrun
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Clemens Ladisch authored and Takashi Iwai committed Jul 15, 2009
1 parent 6847e15 commit f907ed9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/core/seq/seq_midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f907ed9

Please sign in to comment.