diff mbox series

[2/3] ALSA: ump: Indicate the inactive group in legacy substream names

Message ID 20241129094546.32119-3-tiwai@suse.de (mailing list archive)
State New
Headers show
Series ALSA: ump: Fixes for legacy rawmidi handling | expand

Commit Message

Takashi Iwai Nov. 29, 2024, 9:45 a.m. UTC
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.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/core/ump.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/sound/core/ump.c b/sound/core/ump.c
index 9f9ad106107f..7b00a957e548 100644
--- a/sound/core/ump.c
+++ b/sound/core/ump.c
@@ -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]");
 	}
 }