]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
Merge branch 'topic/midi' into for-linus
authorTakashi Iwai <tiwai@suse.de>
Thu, 10 Sep 2009 13:32:56 +0000 (15:32 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 10 Sep 2009 13:32:56 +0000 (15:32 +0200)
* 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

sound/core/rawmidi.c
sound/core/seq/oss/seq_oss_midi.c
sound/core/seq/seq_midi.c

index 473247c8e6d3e22c2e3466e80443e6e6e3054680..c0adc14c91f0ad31b2f42084c794d7f1a70957a5 100644 (file)
@@ -274,7 +274,7 @@ static int open_substream(struct snd_rawmidi *rmidi,
                return err;
        substream->opened = 1;
        if (substream->use_count++ == 0)
-               substream->active_sensing = 1;
+               substream->active_sensing = 0;
        if (mode & SNDRV_RAWMIDI_LFLG_APPEND)
                substream->append = 1;
        rmidi->streams[substream->stream].substream_opened++;
index 0a711d2d04f0f3736572844698b8bc0ff389b384..9dfb2f77be608368ff897c948742dbf806fa52cd 100644 (file)
@@ -20,6 +20,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
+#include <sound/asoundef.h>
 #include "seq_oss_midi.h"
 #include "seq_oss_readq.h"
 #include "seq_oss_timer.h"
@@ -476,19 +477,20 @@ snd_seq_oss_midi_reset(struct seq_oss_devinfo *dp, int dev)
                ev.source.port = dp->port;
                if (dp->seq_mode == SNDRV_SEQ_OSS_MODE_SYNTH) {
                        ev.type = SNDRV_SEQ_EVENT_SENSING;
-                       snd_seq_oss_dispatch(dp, &ev, 0, 0); /* active sensing */
+                       snd_seq_oss_dispatch(dp, &ev, 0, 0);
                }
                for (c = 0; c < 16; c++) {
                        ev.type = SNDRV_SEQ_EVENT_CONTROLLER;
                        ev.data.control.channel = c;
-                       ev.data.control.param = 123;
-                       snd_seq_oss_dispatch(dp, &ev, 0, 0); /* all notes off */
+                       ev.data.control.param = MIDI_CTL_ALL_NOTES_OFF;
+                       snd_seq_oss_dispatch(dp, &ev, 0, 0);
                        if (dp->seq_mode == SNDRV_SEQ_OSS_MODE_MUSIC) {
-                               ev.data.control.param = 121;
-                               snd_seq_oss_dispatch(dp, &ev, 0, 0); /* reset all controllers */
+                               ev.data.control.param =
+                                       MIDI_CTL_RESET_CONTROLLERS;
+                               snd_seq_oss_dispatch(dp, &ev, 0, 0);
                                ev.type = SNDRV_SEQ_EVENT_PITCHBEND;
                                ev.data.control.value = 0;
-                               snd_seq_oss_dispatch(dp, &ev, 0, 0); /* bender off */
+                               snd_seq_oss_dispatch(dp, &ev, 0, 0);
                        }
                }
        }
index 4d26146a62ccd8fd2fff0c73ea25507ff4a6550f..ebaf1b541dcda7e2ccc39bc62416342cde6f8ead 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)
@@ -236,6 +237,7 @@ static int midisynth_use(void *private_data, struct snd_seq_port_subscribe *info
        memset(&params, 0, sizeof(params));
        params.avail_min = 1;
        params.buffer_size = output_buffer_size;
+       params.no_active_sensing = 1;
        if ((err = snd_rawmidi_output_params(msynth->output_rfile.output, &params)) < 0) {
                snd_rawmidi_kernel_release(&msynth->output_rfile);
                return err;
@@ -248,12 +250,9 @@ static int midisynth_use(void *private_data, struct snd_seq_port_subscribe *info
 static int midisynth_unuse(void *private_data, struct snd_seq_port_subscribe *info)
 {
        struct seq_midisynth *msynth = private_data;
-       unsigned char buf = 0xff; /* MIDI reset */
 
        if (snd_BUG_ON(!msynth->output_rfile.output))
                return -EINVAL;
-       /* sending single MIDI reset message to shut the device up */
-       snd_rawmidi_kernel_write(msynth->output_rfile.output, &buf, 1);
        snd_rawmidi_drain_output(msynth->output_rfile.output);
        return snd_rawmidi_kernel_release(&msynth->output_rfile);
 }