Skip to content

Commit c2d188e

Browse files
committed
ALSA: ump: Don't enumeration invalid groups for legacy rawmidi
The legacy rawmidi tries to enumerate all possible UMP groups belonging to the UMP endpoint. But currently it shows all 16 ports when the UMP endpoint is configured with static blocks, although most of them may be unused. There was already a fix for the sequencer client side to ignore such groups in the commit 3bfd7c0 ("ALSA: seq: ump: Skip useless ports for static blocks"), and this commit is a similar fix for UMP rawmidi devices; it adds simply the check for the validity of each group that has been already parsed. (Note that the group info was moved to snd_ump_endpoint.groups[] by the commit 0642a3c ("ALSA: ump: Update substream name from assigned FB names")). Link: https://patch.msgid.link/20241104100735.16127-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent c9363bb commit c2d188e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/core/ump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ static int fill_legacy_mapping(struct snd_ump_endpoint *ump)
12331233

12341234
num = 0;
12351235
for (i = 0; i < SNDRV_UMP_MAX_GROUPS; i++)
1236-
if (group_maps & (1U << i))
1236+
if ((group_maps & (1U << i)) && ump->groups[i].valid)
12371237
ump->legacy_mapping[num++] = i;
12381238

12391239
return num;

0 commit comments

Comments
 (0)