Skip to content

Commit edad3f9

Browse files
committed
ALSA: ump: Update legacy substream names upon FB info update
The legacy rawmidi substreams should be updated when UMP FB Info or UMP FB Name are received, too. Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent e29e504 commit edad3f9

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

sound/core/ump.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ static int process_legacy_output(struct snd_ump_endpoint *ump,
3737
u32 *buffer, int count);
3838
static void process_legacy_input(struct snd_ump_endpoint *ump, const u32 *src,
3939
int words);
40+
static void update_legacy_names(struct snd_ump_endpoint *ump);
4041
#else
4142
static inline int process_legacy_output(struct snd_ump_endpoint *ump,
4243
u32 *buffer, int count)
@@ -47,6 +48,9 @@ static inline void process_legacy_input(struct snd_ump_endpoint *ump,
4748
const u32 *src, int words)
4849
{
4950
}
51+
static inline void update_legacy_names(struct snd_ump_endpoint *ump)
52+
{
53+
}
5054
#endif
5155

5256
static const struct snd_rawmidi_global_ops snd_ump_rawmidi_ops = {
@@ -861,6 +865,7 @@ static int ump_handle_fb_info_msg(struct snd_ump_endpoint *ump,
861865
fill_fb_info(ump, &fb->info, buf);
862866
if (ump->parsed) {
863867
snd_ump_update_group_attrs(ump);
868+
update_legacy_names(ump);
864869
seq_notify_fb_change(ump, fb);
865870
}
866871
}
@@ -893,6 +898,7 @@ static int ump_handle_fb_name_msg(struct snd_ump_endpoint *ump,
893898
/* notify the FB name update to sequencer, too */
894899
if (ret > 0 && ump->parsed) {
895900
snd_ump_update_group_attrs(ump);
901+
update_legacy_names(ump);
896902
seq_notify_fb_change(ump, fb);
897903
}
898904
return ret;
@@ -1262,6 +1268,14 @@ static void fill_substream_names(struct snd_ump_endpoint *ump,
12621268
}
12631269
}
12641270

1271+
static void update_legacy_names(struct snd_ump_endpoint *ump)
1272+
{
1273+
struct snd_rawmidi *rmidi = ump->legacy_rmidi;
1274+
1275+
fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_INPUT);
1276+
fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT);
1277+
}
1278+
12651279
int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump,
12661280
char *id, int device)
12671281
{
@@ -1298,10 +1312,7 @@ int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump,
12981312
rmidi->ops = &snd_ump_legacy_ops;
12991313
rmidi->private_data = ump;
13001314
ump->legacy_rmidi = rmidi;
1301-
if (input)
1302-
fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_INPUT);
1303-
if (output)
1304-
fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT);
1315+
update_legacy_names(ump);
13051316

13061317
ump_dbg(ump, "Created a legacy rawmidi #%d (%s)\n", device, id);
13071318
return 0;

0 commit comments

Comments
 (0)