From: HyeongJun An <sammiee5311@gmail.com>
To: Takashi Iwai <tiwai@suse.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Mark Brown <broonie@kernel.org>,
Shuah Khan <shuah@kernel.org>,
linux-sound@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
HyeongJun An <sammiee5311@gmail.com>
Subject: [PATCH 4/4] selftests/alsa: Test the sequencer UMP system message conversion
Date: Wed, 2 Dec 2026 16:32:15 +0900 [thread overview]
Message-ID: <20261202073215.2588603-5-sammiee5311@gmail.com> (raw)
In-Reply-To: <20261202073215.2588603-1-sammiee5311@gmail.com>
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@gmail.com>
---
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
prev parent reply other threads:[~2026-12-02 7:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 7:32 [PATCH 0/4] ALSA: seq: ump: Fix a program change and test more conversions HyeongJun An
2026-12-02 7:32 ` [PATCH 1/4] ALSA: seq: ump: Don't leave the bank LSB in a MIDI 1.0 program change HyeongJun An
2026-12-02 7:32 ` [PATCH 2/4] selftests/alsa: Test the sequencer UMP bank and program change conversion HyeongJun An
2026-12-02 7:32 ` [PATCH 3/4] selftests/alsa: Test the sequencer UMP SysEx conversion HyeongJun An
2026-12-02 7:32 ` HyeongJun An [this message]
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=20261202073215.2588603-5-sammiee5311@gmail.com \
--to=sammiee5311@gmail.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=shuah@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®