Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'topic/midi' into for-linus

* topic/midi:
sound: rawmidi: disable active-sensing-on-close by default
sound: seq_oss_midi: remove magic numbers
sound: seq_midi: do not send MIDI reset when closing
seq-midi: always log message on output overrun

+12 -11
+1 -1
sound/core/rawmidi.c
··· 274 274 return err; 275 275 substream->opened = 1; 276 276 if (substream->use_count++ == 0) 277 - substream->active_sensing = 1; 277 + substream->active_sensing = 0; 278 278 if (mode & SNDRV_RAWMIDI_LFLG_APPEND) 279 279 substream->append = 1; 280 280 rmidi->streams[substream->stream].substream_opened++;
+8 -6
sound/core/seq/oss/seq_oss_midi.c
··· 20 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 21 */ 22 22 23 + #include <sound/asoundef.h> 23 24 #include "seq_oss_midi.h" 24 25 #include "seq_oss_readq.h" 25 26 #include "seq_oss_timer.h" ··· 477 476 ev.source.port = dp->port; 478 477 if (dp->seq_mode == SNDRV_SEQ_OSS_MODE_SYNTH) { 479 478 ev.type = SNDRV_SEQ_EVENT_SENSING; 480 - snd_seq_oss_dispatch(dp, &ev, 0, 0); /* active sensing */ 479 + snd_seq_oss_dispatch(dp, &ev, 0, 0); 481 480 } 482 481 for (c = 0; c < 16; c++) { 483 482 ev.type = SNDRV_SEQ_EVENT_CONTROLLER; 484 483 ev.data.control.channel = c; 485 - ev.data.control.param = 123; 486 - snd_seq_oss_dispatch(dp, &ev, 0, 0); /* all notes off */ 484 + ev.data.control.param = MIDI_CTL_ALL_NOTES_OFF; 485 + snd_seq_oss_dispatch(dp, &ev, 0, 0); 487 486 if (dp->seq_mode == SNDRV_SEQ_OSS_MODE_MUSIC) { 488 - ev.data.control.param = 121; 489 - snd_seq_oss_dispatch(dp, &ev, 0, 0); /* reset all controllers */ 487 + ev.data.control.param = 488 + MIDI_CTL_RESET_CONTROLLERS; 489 + snd_seq_oss_dispatch(dp, &ev, 0, 0); 490 490 ev.type = SNDRV_SEQ_EVENT_PITCHBEND; 491 491 ev.data.control.value = 0; 492 - snd_seq_oss_dispatch(dp, &ev, 0, 0); /* bender off */ 492 + snd_seq_oss_dispatch(dp, &ev, 0, 0); 493 493 } 494 494 } 495 495 }
+3 -4
sound/core/seq/seq_midi.c
··· 120 120 return -EINVAL; 121 121 runtime = substream->runtime; 122 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 125 return -ENOMEM; 125 126 } 126 127 if (snd_rawmidi_kernel_write(substream, buf, count) < count) ··· 237 236 memset(&params, 0, sizeof(params)); 238 237 params.avail_min = 1; 239 238 params.buffer_size = output_buffer_size; 239 + params.no_active_sensing = 1; 240 240 if ((err = snd_rawmidi_output_params(msynth->output_rfile.output, &params)) < 0) { 241 241 snd_rawmidi_kernel_release(&msynth->output_rfile); 242 242 return err; ··· 250 248 static int midisynth_unuse(void *private_data, struct snd_seq_port_subscribe *info) 251 249 { 252 250 struct seq_midisynth *msynth = private_data; 253 - unsigned char buf = 0xff; /* MIDI reset */ 254 251 255 252 if (snd_BUG_ON(!msynth->output_rfile.output)) 256 253 return -EINVAL; 257 - /* sending single MIDI reset message to shut the device up */ 258 - snd_rawmidi_kernel_write(msynth->output_rfile.output, &buf, 1); 259 254 snd_rawmidi_drain_output(msynth->output_rfile.output); 260 255 return snd_rawmidi_kernel_release(&msynth->output_rfile); 261 256 }