mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] ALSA: ump: Fix RPN/NRPN handling at MIDI 1.0 CC conversion
@ 2026-11-08 12:47 HyeongJun An
  2026-11-08 12:47 ` [PATCH 1/4] ALSA: ump: Clear stale RPN selector on NRPN change HyeongJun An
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: HyeongJun An @ 2026-11-08 12:47 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Jaroslav Kysela, Alyandra Zahran Nadhir, linux-sound,
	linux-kernel, HyeongJun An

Hello Takashi,

As you asked in [1], this puts Alyandra's selector fix and my fixes for
the other RPN/NRPN cases into one series, for both the UMP core
converter and the sequencer.

Patches 1 and 2 are Alyandra's [2], without the KUnit test. Selecting
an RPN now clears the NRPN selection and vice versa. Patches 3 and 4
keep the selection after a send and clear only the data, drop data when
nothing is selected, and handle a Null NRPN like a Null RPN.

What a MIDI 2.0 receiver gets, before and after the series:

  Input                                    Before             After
  Null RPN, Data Entry, select RPN 0/1     RPN 0/0 = 0x40     nothing
  Data Entry, select RPN 0/1               RPN 0/0 = 0x40     nothing
  RPN 0/2 + data, data again, RPN 0/1      0/2, then 0/0      0/2, 0/2
  Null RPN, Data Entry, select NRPN 0/5    NRPN 0/0 = 0x40    nothing
  select RPN 0/0, NRPN 1/2 + data          RPN 0/0            NRPN 1/2
  Null NRPN, Data Entry                    NRPN 127/127       nothing
  select RPN 0/127, Null RPN, data         RPN 0/127          nothing
  RPN 0/1 + data, CC 38, select RPN 0/2    0/1, then 0/0      0/1, 0/1
  RPN 1/1 + data, RPN LSB 2, data          1/1, then 0/2      1/1, 1/2
  Null RPN, RPN MSB 5, data                RPN 5/0            RPN 5/127
  RPN 0/1 + data (unchanged)               RPN 0/1            RPN 0/1

The 0/127 row and the last two changes come from holding the RPN/NRPN
numbers, as a MIDI 1.0 receiver does.

I checked the core converter with a local KUnit test over 35 input
sequences. The 17 that changed are all of the kinds above, and the
others give the same packets as before. The sequencer side was run
with a legacy client sending CC and CONTROL14 events to a MIDI 2.0
client on a patched kernel under qemu. That test will become the
selftest, with Alyandra's cases added, as a separate patch.

Two cases are left as they were. A CC 6 alone waits for a CC 38 or
the next CC 98 to 101, so a second CC 6 replaces the first instead of
sending it. A CC 38 alone after a send waits the same way, and when
the next CC 98 to 101 flushes it, it still goes out with MSB 0, now
under the kept selection. Changing those would be a separate patch.

[1] https://lore.kernel.org/all/878q33y4z4.wl-tiwai@suse.de/
[2] https://lore.kernel.org/all/20261107111056.667-1-alyandra5b@gmail.com/

Prepared with Claude Code (Claude Opus 5.5). Tested on x86_64.

Best regards,
HyeongJun An

Alyandra Zahran Nadhir (2):
  ALSA: ump: Clear stale RPN selector on NRPN change
  ALSA: seq: ump: Clear stale selectors in sequencer conversion

HyeongJun An (2):
  ALSA: ump: Fix RPN/NRPN state handling at MIDI 1.0 CC conversion
  ALSA: seq: ump: Fix RPN/NRPN state handling at MIDI 1.0 CC conversion

 sound/core/seq/seq_ump_convert.c | 32 ++++++++++++++++++++++++++++----
 sound/core/ump_convert.c         | 28 ++++++++++++++++++++++++----
 2 files changed, 52 insertions(+), 8 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-08 12:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/4] ALSA: seq: ump: Clear stale selectors in sequencer conversion HyeongJun An
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

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®