mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Karpiniec <tk@1.21jiggawatts.net>
To: alsa-devel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Prevent loss of state between MIDI subscriptions
Date: Wed, 26 Dec 2012 15:20:32 +1100	[thread overview]
Message-ID: <50DA7B10.9030807@1.21jiggawatts.net> (raw)

A MIDI input parser is unnecessarily reset whenever a new subscription 
is created.

This is a particular problem with the Novation Launchpad, which sends a 
single NOTEON command, then a series of notes indefinitely unless a 
control button is pressed or it is power cycled. If a user application 
restarts and resubscribes, the parser no longer knows that it is 
receiving NOTEONs and fails to pass on new input.

Signed-off-by: Thomas Karpiniec <tk@1.21jiggawatts.net>
---
  sound/core/seq/seq_midi.c |    1 -
  1 file changed, 1 deletion(-)

diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c
index 64069db..1a977df 100644
--- a/sound/core/seq/seq_midi.c
+++ b/sound/core/seq/seq_midi.c
@@ -200,7 +200,6 @@ static int midisynth_subscribe(void *private_data, 
struct snd_seq_port_subscribe
  		snd_rawmidi_kernel_release(&msynth->input_rfile);
  		return err;
  	}
-	snd_midi_event_reset_encode(msynth->parser);
  	runtime->event = snd_midi_input_event;
  	runtime->private_data = msynth;
  	snd_rawmidi_kernel_read(msynth->input_rfile.input, NULL, 0);
-- 
1.7.10.4

             reply	other threads:[~2012-12-26  4:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-26  4:20 Thomas Karpiniec [this message]
2012-12-26  4:53 ` Thomas Karpiniec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50DA7B10.9030807@1.21jiggawatts.net \
    --to=tk@1.21jiggawatts.net \
    --cc=alsa-devel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®