Skip to contentSkip to conversation

selftests/alsa: Add a test for the sequencer UMP conversion of RPN/NRPN

PATCH Applied HyeongJun An 2 participants 2 messages Nov 10

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/alsa: Add a test for the sequencer UMP conversion of RPN/NRPN

The sequencer converts MIDI 1.0 CC and CONTROL14 events to UMP for UMP clients. Add a test that sends such events from a legacy client to a UMP MIDI 2.0 client and checks the RPN/NRPN packets it receives, and one that checks that a UMP MIDI 1.0 client gets the CCs as they are.

The cases cover switching between RPN and NRPN, Data Entry sent with nothing selected, repeated Data Entry, Null RPN and NRPN, and the CONTROL14 path. Some of them come from the KUnit test in Alyandra Zahran Nadhir's patch.

The test skips when /dev/snd/seq can't be opened or the kernel has no UMP support in the sequencer.

---
This depends on the RPN/NRPN series [1]. Without it, 11 of the 22 tests fail.

[1] https://lore.kernel.org/all/[email protected]/

Prepared with Claude Code (Claude Opus 5.5). Tested on x86_64 under
qemu: 22/22 pass with the series applied.

 tools/testing/selftests/alsa/.gitignore     |   1 +
 tools/testing/selftests/alsa/Makefile       |   3 +-
 tools/testing/selftests/alsa/seq-ump-test.c | 452 ++++++++++++++++++++
 3 files changed, 455 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/alsa/seq-ump-test.c
tools/testing/selftests/alsa/.gitignore +1 -0
index 7b0e1e9ebf1b..a0762c3c52e6 100644
@@ -2,5 +2,6 @@ aloop-test
 global-timer
 mixer-test
 pcm-test
+seq-ump-test
 test-pcmtest-driver
 utimer-test
tools/testing/selftests/alsa/Makefile +2 -1
index afd64a679dc1..92de58287e77 100644
@@ -16,7 +16,8 @@ LDLIBS+=-lpthread
 
 OVERRIDE_TARGETS = 1
 
-TEST_GEN_PROGS := aloop-test mixer-test pcm-test test-pcmtest-driver utimer-test
+TEST_GEN_PROGS := aloop-test mixer-test pcm-test seq-ump-test test-pcmtest-driver \
+		  utimer-test
 
 TEST_GEN_PROGS_EXTENDED := libatest.so global-timer
 
tools/testing/selftests/alsa/seq-ump-test.c new file +452 -0

452 lines not on this page · raw message

Signature · 1 line
2.43.0
Applied
#1 lore raw
Quoted 11 lines · HyeongJun An

The sequencer converts MIDI 1.0 CC and CONTROL14 events to UMP for UMP clients. Add a test that sends such events from a legacy client to a UMP MIDI 2.0 client and checks the RPN/NRPN packets it receives, and one that checks that a UMP MIDI 1.0 client gets the CCs as they are.

The cases cover switching between RPN and NRPN, Data Entry sent with nothing selected, repeated Data Entry, Null RPN and NRPN, and the CONTROL14 path. Some of them come from the KUnit test in Alyandra Zahran Nadhir's patch.

Quoted 5 lines

The test skips when /dev/snd/seq can't be opened or the kernel has no UMP support in the sequencer.

Applied to for-next branch now. Thanks.

Takashi