Skip to contentSkip to conversation

Prevent loss of state between MIDI subscriptions

PATCH In review Thomas Karpiniec 1 participant 2 messages Dec 26, 2012 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Prevent loss of state between MIDI subscriptions

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.

---
 sound/core/seq/seq_midi.c |    1 -
 1 file changed, 1 deletion(-)
sound/core/seq/seq_midi.c +0 -1
index 64069db..1a977df 100644
@@ -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);
Signature · 1 line
1.7.10.4
#1 lore raw

Apologies for the linewrap. This will be better:

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.

---
 sound/core/seq/seq_midi.c |    1 -
 1 file changed, 1 deletion(-)
sound/core/seq/seq_midi.c +0 -1
index 64069db..1a977df 100644
@@ -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);
Signature · 1 line
1.7.10.4