[PATCH 4/4] selftests/alsa: Test the sequencer UMP system message conversion
From: HyeongJun An
Date: Wed Dec 02 2026 - 02:32:48 EST
Check that a song position, a song select and a system reset from a
legacy client reach UMP MIDI 1.0 and MIDI 2.0 clients as UMP system
packets, with the song position LSB first and both of its bytes.
These were fixed by commit edb32776196a ("ALSA: seq: Fix incorrect UMP
type for system messages"), commit 700fe6fd093d ("ALSA: seq: Fix yet
another spot for system message conversion"),
commit 310fa3ec2859 ("ALSA: seq: ump: Fix swapped song position pointer
data"), commit 9d65ab6050d2 ("ALSA: seq: Fix missing MSB in MIDI2 SPP
conversion") for the MIDI 2.0 client, and commit 55fac50ea46f ("ALSA:
seq: ump: Fix missing System Reset message handling").
Signed-off-by: HyeongJun An <sammiee5311@xxxxxxxxx>
---
tools/testing/selftests/alsa/seq-ump-test.c | 28 +++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/tools/testing/selftests/alsa/seq-ump-test.c b/tools/testing/selftests/alsa/seq-ump-test.c
index a0855dd451c2a..5745cfd522972 100644
--- a/tools/testing/selftests/alsa/seq-ump-test.c
+++ b/tools/testing/selftests/alsa/seq-ump-test.c
@@ -262,6 +262,8 @@ struct event {
{ SNDRV_SEQ_EVENT_CONTROL14, ch, param, value }
#define PGM(ch, value) \
{ SNDRV_SEQ_EVENT_PGMCHANGE, ch, 0, value }
+#define SYS(type, value) \
+ { SNDRV_SEQ_EVENT_##type, 0, 0, value }
static int send_events(struct seq_client *src, struct seq_client *dst,
const struct event *ev, int n)
@@ -571,6 +573,14 @@ TEST_F(seq_ump, sysex_split)
{ 0x3032090a, 0 });
}
+/* system messages are UMP system packets, with both song position bytes */
+TEST_F(seq_ump, system)
+{
+ SEND(SYS(SONGPOS, 0x1234), SYS(SONGSEL, 5), SYS(RESET, 0));
+ EXPECT_MT_PACKETS(1, { 0x10f23424, 0 }, { 0x10f30500, 0 },
+ { 0x10ff0000, 0 });
+}
+
/* a UMP MIDI 1.0 client gets the CCs as they are, RPN selection included */
TEST(midi1_passthrough)
{
@@ -729,6 +739,24 @@ TEST_F(seq_pair, ump_midi2_to_midi1_rpn)
{ 0x20b10609, 0 }, { 0x20b1260d, 0 });
}
+/* the same system messages to a UMP MIDI 1.0 client */
+TEST_F(seq_pair, midi1_system)
+{
+ int skip = 0;
+ int err;
+
+ err = open_pair(&self->dst, SNDRV_SEQ_CLIENT_UMP_MIDI_1_0,
+ &self->src, 0, &skip);
+ if (skip)
+ SKIP(return, "UMP sequencer client unavailable: %s",
+ strerror(-err));
+ ASSERT_EQ(0, err);
+
+ SEND(SYS(SONGPOS, 0x1234), SYS(SONGSEL, 5), SYS(RESET, 0));
+ EXPECT_MT_PACKETS(1, { 0x10f23424, 0 }, { 0x10f30500, 0 },
+ { 0x10ff0000, 0 });
+}
+
/* UMP MIDI 1.0 to MIDI 2.0: the bank select CCs go into the program change */
TEST_F(seq_pair, ump_midi1_to_midi2_program)
{
--
2.43.0