From: HyeongJun An <sammiee5311@gmail.com>
To: Takashi Iwai <tiwai@suse.com>
Cc: Jaroslav Kysela <perex@perex.cz>,
Alyandra Zahran Nadhir <alyandra5b@gmail.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, HyeongJun An <sammiee5311@gmail.com>
Subject: [PATCH 2/4] ALSA: seq: ump: Clear stale selectors in sequencer conversion
Date: Sun, 8 Nov 2026 21:47:49 +0900 [thread overview]
Message-ID: <3c5cb0ef0023c4d2e835805498a14751a92feda0.1794141913.git.sammiee5311@gmail.com> (raw)
In-Reply-To: <cover.1794141913.git.sammiee5311@gmail.com>
From: Alyandra Zahran Nadhir <alyandra5b@gmail.com>
The sequencer MIDI 2.0 converter tracks RPN and NRPN selection flags
separately. When the controller stream switches selector type, the
previous flag remains set; fill_rpn() checks RPN first and can encode
subsequent NRPN data as RPN.
Flush pending parameter data with the old selector, then clear the
opposite selector before recording new state in both CC and Control14
event paths.
Fixes: e9e02819a98a ("ALSA: seq: Automatic conversion of UMP events")
Cc: <stable@vger.kernel.org>
Signed-off-by: Alyandra Zahran Nadhir <alyandra5b@gmail.com>
[HyeongJun An: drop the KUnit test, fix the subject, add Fixes and stable Cc]
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
---
sound/core/seq/seq_ump_convert.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sound/core/seq/seq_ump_convert.c b/sound/core/seq/seq_ump_convert.c
index ff4ee26adad1..bac37d4ef43c 100644
--- a/sound/core/seq/seq_ump_convert.c
+++ b/sound/core/seq/seq_ump_convert.c
@@ -847,6 +847,7 @@ static int cc_ev_to_ump_midi2(const struct snd_seq_event *event,
switch (index) {
case UMP_CC_RPN_MSB:
ret = fill_rpn(cc, data, channel, true);
+ cc->nrpn_set = 0;
cc->rpn_set = 1;
cc->cc_rpn_msb = val;
if (cc->cc_rpn_msb == 0x7f && cc->cc_rpn_lsb == 0x7f)
@@ -854,6 +855,7 @@ static int cc_ev_to_ump_midi2(const struct snd_seq_event *event,
break;
case UMP_CC_RPN_LSB:
ret = fill_rpn(cc, data, channel, true);
+ cc->nrpn_set = 0;
cc->rpn_set = 1;
cc->cc_rpn_lsb = val;
if (cc->cc_rpn_msb == 0x7f && cc->cc_rpn_lsb == 0x7f)
@@ -861,11 +863,13 @@ static int cc_ev_to_ump_midi2(const struct snd_seq_event *event,
break;
case UMP_CC_NRPN_MSB:
ret = fill_rpn(cc, data, channel, true);
+ cc->rpn_set = 0;
cc->nrpn_set = 1;
cc->cc_nrpn_msb = val;
break;
case UMP_CC_NRPN_LSB:
ret = fill_rpn(cc, data, channel, true);
+ cc->rpn_set = 0;
cc->nrpn_set = 1;
cc->cc_nrpn_lsb = val;
break;
@@ -975,6 +979,7 @@ static int ctrl14_ev_to_ump_midi2(const struct snd_seq_event *event,
case UMP_CC_RPN_MSB:
case UMP_CC_RPN_LSB:
ret = fill_rpn(cc, data, channel, true);
+ cc->nrpn_set = 0;
cc->cc_rpn_msb = msb;
cc->cc_rpn_lsb = lsb;
cc->rpn_set = 1;
@@ -984,6 +989,7 @@ static int ctrl14_ev_to_ump_midi2(const struct snd_seq_event *event,
case UMP_CC_NRPN_MSB:
case UMP_CC_NRPN_LSB:
ret = fill_rpn(cc, data, channel, true);
+ cc->rpn_set = 0;
cc->cc_nrpn_msb = msb;
cc->nrpn_set = 1;
cc->cc_nrpn_lsb = lsb;
--
2.43.0
next prev parent reply other threads:[~2026-11-08 12:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-08 12:47 [PATCH 0/4] ALSA: ump: Fix RPN/NRPN handling at MIDI 1.0 CC conversion HyeongJun An
2026-11-08 12:47 ` [PATCH 1/4] ALSA: ump: Clear stale RPN selector on NRPN change HyeongJun An
2026-11-08 12:47 ` HyeongJun An [this message]
2026-11-08 12:47 ` [PATCH 3/4] ALSA: ump: Fix RPN/NRPN state handling at MIDI 1.0 CC conversion HyeongJun An
2026-11-08 12:47 ` [PATCH 4/4] ALSA: seq: " HyeongJun An
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=3c5cb0ef0023c4d2e835805498a14751a92feda0.1794141913.git.sammiee5311@gmail.com \
--to=sammiee5311@gmail.com \
--cc=alyandra5b@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
/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®