* [PATCH] ALSA: ump: Fix dropped data bytes at UMP System message conversion
@ 2026-10-29 13:05 HyeongJun An
2026-10-31 16:03 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: HyeongJun An @ 2026-10-29 13:05 UTC (permalink / raw)
To: tiwai; +Cc: perex, linux-sound, linux-kernel, HyeongJun An, stable
The cvt_ump_system_to_legacy() function switches on
ump_message_status_code(), which returns only the upper 4 bits of the
status. The case labels are the full 0xf1, 0xf2 and 0xf3 values, so they
never match. MIDI Time Code, Song Position and Song Select are converted
to the status byte alone, and their data bytes are lost.
Switch on the full status byte in buf[0] instead.
Both callers of snd_ump_convert_from_ump() pass the result on as is: the
legacy rawmidi input of a UMP endpoint, and the MIDI 1.0 path of the
f_midi2 USB gadget.
Fixes: 0b5288f5fe63 ("ALSA: ump: Add legacy raw MIDI support")
Cc: stable@vger.kernel.org
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
---
Prepared with Claude Code (Claude Opus 5.5). Tested with a KUnit case
for snd_ump_convert_from_ump() under UML. Without this patch, MIDI Time
Code, Song Select and Song Position come out as one byte with no data.
With it, they keep their data bytes. Timing Clock still converts to one
byte.
sound/core/ump_convert.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/core/ump_convert.c b/sound/core/ump_convert.c
index 0a7972d91ec5..ecbd894f4c83 100644
--- a/sound/core/ump_convert.c
+++ b/sound/core/ump_convert.c
@@ -69,7 +69,7 @@ static u32 upscale_14_to_32bit(u16 src)
static int cvt_ump_system_to_legacy(u32 data, unsigned char *buf)
{
buf[0] = ump_message_status_channel(data);
- switch (ump_message_status_code(data)) {
+ switch (buf[0]) {
case UMP_SYSTEM_STATUS_MIDI_TIME_CODE:
case UMP_SYSTEM_STATUS_SONG_SELECT:
buf[1] = (data >> 8) & 0x7f;
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ALSA: ump: Fix dropped data bytes at UMP System message conversion
2026-10-29 13:05 [PATCH] ALSA: ump: Fix dropped data bytes at UMP System message conversion HyeongJun An
@ 2026-10-31 16:03 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2026-10-31 16:03 UTC (permalink / raw)
To: HyeongJun An; +Cc: tiwai, perex, linux-sound, linux-kernel, stable
On Thu, 29 Oct 2026 14:05:37 +0100,
HyeongJun An wrote:
>
> The cvt_ump_system_to_legacy() function switches on
> ump_message_status_code(), which returns only the upper 4 bits of the
> status. The case labels are the full 0xf1, 0xf2 and 0xf3 values, so they
> never match. MIDI Time Code, Song Position and Song Select are converted
> to the status byte alone, and their data bytes are lost.
>
> Switch on the full status byte in buf[0] instead.
>
> Both callers of snd_ump_convert_from_ump() pass the result on as is: the
> legacy rawmidi input of a UMP endpoint, and the MIDI 1.0 path of the
> f_midi2 USB gadget.
>
> Fixes: 0b5288f5fe63 ("ALSA: ump: Add legacy raw MIDI support")
> Cc: stable@vger.kernel.org
> Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Applied now. Thanks.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-31 16:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29 13:05 [PATCH] ALSA: ump: Fix dropped data bytes at UMP System message conversion HyeongJun An
2026-10-31 16:03 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.