aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/seq/seq_midi.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/seq/seq_midi.c')
-rw-r--r--sound/core/seq/seq_midi.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c
index 4d26146a62cc..ebaf1b541dcd 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
120 return -EINVAL; 120 return -EINVAL;
121 runtime = substream->runtime; 121 runtime = substream->runtime;
122 if ((tmp = runtime->avail) < count) { 122 if ((tmp = runtime->avail) < count) {
123 snd_printd("warning, output event was lost (count = %i, available = %i)\n", count, tmp); 123 if (printk_ratelimit())
124 snd_printk(KERN_ERR "MIDI output buffer overrun\n");
124 return -ENOMEM; 125 return -ENOMEM;
125 } 126 }
126 if (snd_rawmidi_kernel_write(substream, buf, count) < count) 127 if (snd_rawmidi_kernel_write(substream, buf, count) < count)
@@ -236,6 +237,7 @@ static int midisynth_use(void *private_data, struct snd_seq_port_subscribe *info
236 memset(&params, 0, sizeof(params)); 237 memset(&params, 0, sizeof(params));
237 params.avail_min = 1; 238 params.avail_min = 1;
238 params.buffer_size = output_buffer_size; 239 params.buffer_size = output_buffer_size;
240 params.no_active_sensing = 1;
239 if ((err = snd_rawmidi_output_params(msynth->output_rfile.output, &params)) < 0) { 241 if ((err = snd_rawmidi_output_params(msynth->output_rfile.output, &params)) < 0) {
240 snd_rawmidi_kernel_release(&msynth->output_rfile); 242 snd_rawmidi_kernel_release(&msynth->output_rfile);
241 return err; 243 return err;
@@ -248,12 +250,9 @@ static int midisynth_use(void *private_data, struct snd_seq_port_subscribe *info
248static int midisynth_unuse(void *private_data, struct snd_seq_port_subscribe *info) 250static int midisynth_unuse(void *private_data, struct snd_seq_port_subscribe *info)
249{ 251{
250 struct seq_midisynth *msynth = private_data; 252 struct seq_midisynth *msynth = private_data;
251 unsigned char buf = 0xff; /* MIDI reset */
252 253
253 if (snd_BUG_ON(!msynth->output_rfile.output)) 254 if (snd_BUG_ON(!msynth->output_rfile.output))
254 return -EINVAL; 255 return -EINVAL;
255 /* sending single MIDI reset message to shut the device up */
256 snd_rawmidi_kernel_write(msynth->output_rfile.output, &buf, 1);
257 snd_rawmidi_drain_output(msynth->output_rfile.output); 256 snd_rawmidi_drain_output(msynth->output_rfile.output);
258 return snd_rawmidi_kernel_release(&msynth->output_rfile); 257 return snd_rawmidi_kernel_release(&msynth->output_rfile);
259} 258}