]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ALSA: ump: Indicate the inactive group in legacy substream names
authorTakashi Iwai <tiwai@suse.de>
Fri, 29 Nov 2024 09:45:43 +0000 (10:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Jan 2025 09:34:17 +0000 (10:34 +0100)
[ Upstream commit e29e504e7890b9ee438ca6370d0180d607c473f9 ]

Since the legacy rawmidi has no proper way to know the inactive group,
indicate it in the rawmidi substream names with "[Inactive]" suffix
when the corresponding UMP group is inactive.

Link: https://patch.msgid.link/20241129094546.32119-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/core/ump.c

index 0ade67d6b0896e79795348d6b6292cb646f1d2da..55d5d8af5e4417ed479aa26f291398d1a277302b 100644 (file)
@@ -1256,8 +1256,9 @@ static void fill_substream_names(struct snd_ump_endpoint *ump,
                name = ump->groups[idx].name;
                if (!*name)
                        name = ump->info.name;
-               snprintf(s->name, sizeof(s->name), "Group %d (%.16s)",
-                        idx + 1, name);
+               snprintf(s->name, sizeof(s->name), "Group %d (%.16s)%s",
+                        idx + 1, name,
+                        ump->groups[idx].active ? "" : " [Inactive]");
        }
 }