Skip to content

Commit e85b926

Browse files
committed
ALSA: seq: Print UMP Endpoint and Block information in proc outputs
This patch enhances the /proc/asound/seq/clients output to show a few more information about the assigned UMP Endpoint and Blocks. The "Groups" are shown in 1-based group number to align with the sequencer client name and port number. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230523075358.9672-36-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent d2d247e commit e85b926

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

sound/core/seq/seq_clientmgr.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,6 +2120,33 @@ static void terminate_ump_info_strings(void *p, int type)
21202120
}
21212121
}
21222122

2123+
#ifdef CONFIG_SND_PROC_FS
2124+
static void dump_ump_info(struct snd_info_buffer *buffer,
2125+
struct snd_seq_client *client)
2126+
{
2127+
struct snd_ump_endpoint_info *ep;
2128+
struct snd_ump_block_info *bp;
2129+
int i;
2130+
2131+
if (!client->ump_info)
2132+
return;
2133+
ep = client->ump_info[SNDRV_SEQ_CLIENT_UMP_INFO_ENDPOINT];
2134+
if (ep && *ep->name)
2135+
snd_iprintf(buffer, " UMP Endpoint: \"%s\"\n", ep->name);
2136+
for (i = 0; i < SNDRV_UMP_MAX_BLOCKS; i++) {
2137+
bp = client->ump_info[i + 1];
2138+
if (bp && *bp->name) {
2139+
snd_iprintf(buffer, " UMP Block %d: \"%s\" [%s]\n",
2140+
i, bp->name,
2141+
bp->active ? "Active" : "Inactive");
2142+
snd_iprintf(buffer, " Groups: %d-%d\n",
2143+
bp->first_group + 1,
2144+
bp->first_group + bp->num_groups);
2145+
}
2146+
}
2147+
}
2148+
#endif
2149+
21232150
/* UMP-specific ioctls -- called directly without data copy */
21242151
static int snd_seq_ioctl_client_ump_info(struct snd_seq_client *caller,
21252152
unsigned int cmd,
@@ -2654,6 +2681,9 @@ void snd_seq_info_clients_read(struct snd_info_entry *entry,
26542681
c, client->name,
26552682
client->type == USER_CLIENT ? "User" : "Kernel",
26562683
midi_version_string(client->midi_version));
2684+
#if IS_ENABLED(CONFIG_SND_SEQ_UMP)
2685+
dump_ump_info(buffer, client);
2686+
#endif
26572687
snd_seq_info_dump_ports(buffer, client);
26582688
if (snd_seq_write_pool_allocated(client)) {
26592689
snd_iprintf(buffer, " Output pool :\n");

0 commit comments

Comments
 (0)