summaryrefslogtreecommitdiff
path: root/seq
diff options
context:
space:
mode:
authorMartin Koegler <martin.koegler@chello.at>2016-03-08 23:06:47 +0100
committerTakashi Iwai <tiwai@suse.de>2016-03-09 09:15:43 +0100
commitccc108fb83bf31d6995c80ba9716ef3760f49637 (patch)
treee0c10c1ab25214922e9cbd7b3f745bdca80403b5 /seq
parent380c9fa444e88f259c6cdc51b18365b80f73c17b (diff)
downloadalsa-utils-ccc108fb83bf31d6995c80ba9716ef3760f49637.tar.gz
aconnect: Show sequencer sound card numer/PID via aconnect
rawmidi devices expose the card number via IOCTLs, which allows to find the corresponding device in sysfs. The sequencer provides no identifing data. Chromium works around this issue by scanning rawmidi as well as sequencer devices and matching them by using assumtions, how the kernel register sequencer devices. This patch adds support for displaying the sound card number/PID to aconnect. Signed-off-by: Martin Koegler <martin.koegler@chello.at> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'seq')
-rw-r--r--seq/aconnect/aconnect.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/seq/aconnect/aconnect.c b/seq/aconnect/aconnect.c
index 8d6cebb..85a7770 100644
--- a/seq/aconnect/aconnect.c
+++ b/seq/aconnect/aconnect.c
@@ -166,11 +166,26 @@ static void print_port(snd_seq_t *seq, snd_seq_client_info_t *cinfo,
snd_seq_port_info_t *pinfo, int count)
{
if (! count) {
- printf(_("client %d: '%s' [type=%s]\n"),
+ int card = -1, pid = -1;
+
+ printf(_("client %d: '%s' [type=%s"),
snd_seq_client_info_get_client(cinfo),
snd_seq_client_info_get_name(cinfo),
(snd_seq_client_info_get_type(cinfo) == SND_SEQ_USER_CLIENT ?
_("user") : _("kernel")));
+
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_CARD
+ card = snd_seq_client_info_get_card(cinfo);
+#endif
+ if (card != -1)
+ printf(",card=%d", card);
+
+#ifdef HAVE_SEQ_CLIENT_INFO_GET_PID
+ pid = snd_seq_client_info_get_pid(cinfo);
+#endif
+ if (pid != -1)
+ printf(",pid=%d", pid);
+ printf("]\n");
}
printf(" %3d '%-16s'\n",
snd_seq_port_info_get_port(pinfo),