diff options
author | Jaroslav Kysela <perex@perex.cz> | 2009-11-10 08:53:02 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-11-10 10:06:57 -0500 |
commit | e3303235209c0496b490e10ab131e72a9568c153 (patch) | |
tree | 6ebac5010679a20afe06fb9362c52f12f6f55a4c /sound | |
parent | fb8d1a344dbe963f16249d07eee8415e93f9f3c2 (diff) |
ALSA: hda - proc - show which I/O NID is associated to PCM device
Output something like:
Node 0x02 [Audio Output] wcaps 0x11: Stereo
Device: name="ALC888 Analog", type="Audio", device=0, substream=0
Converter: stream=0, channel=0
...
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 9 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 1 | ||||
-rw-r--r-- | sound/pci/hda/hda_proc.c | 16 |
3 files changed, 21 insertions, 5 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 146f95be8737..480d1ec49c99 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -2877,14 +2877,15 @@ static int set_pcm_default_values(struct hda_codec *codec, | |||
2877 | return 0; | 2877 | return 0; |
2878 | } | 2878 | } |
2879 | 2879 | ||
2880 | const char *snd_hda_pcm_type_name[HDA_PCM_NTYPES] = { | ||
2881 | "Audio", "SPDIF", "HDMI", "Modem" | ||
2882 | }; | ||
2883 | |||
2880 | /* | 2884 | /* |
2881 | * get the empty PCM device number to assign | 2885 | * get the empty PCM device number to assign |
2882 | */ | 2886 | */ |
2883 | static int get_empty_pcm_device(struct hda_bus *bus, int type) | 2887 | static int get_empty_pcm_device(struct hda_bus *bus, int type) |
2884 | { | 2888 | { |
2885 | static const char *dev_name[HDA_PCM_NTYPES] = { | ||
2886 | "Audio", "SPDIF", "HDMI", "Modem" | ||
2887 | }; | ||
2888 | /* audio device indices; not linear to keep compatibility */ | 2889 | /* audio device indices; not linear to keep compatibility */ |
2889 | static int audio_idx[HDA_PCM_NTYPES][5] = { | 2890 | static int audio_idx[HDA_PCM_NTYPES][5] = { |
2890 | [HDA_PCM_TYPE_AUDIO] = { 0, 2, 4, 5, -1 }, | 2891 | [HDA_PCM_TYPE_AUDIO] = { 0, 2, 4, 5, -1 }, |
@@ -2903,7 +2904,7 @@ static int get_empty_pcm_device(struct hda_bus *bus, int type) | |||
2903 | if (!test_and_set_bit(audio_idx[type][i], bus->pcm_dev_bits)) | 2904 | if (!test_and_set_bit(audio_idx[type][i], bus->pcm_dev_bits)) |
2904 | return audio_idx[type][i]; | 2905 | return audio_idx[type][i]; |
2905 | 2906 | ||
2906 | snd_printk(KERN_WARNING "Too many %s devices\n", dev_name[type]); | 2907 | snd_printk(KERN_WARNING "Too many %s devices\n", snd_hda_pcm_type_name[type]); |
2907 | return -EAGAIN; | 2908 | return -EAGAIN; |
2908 | } | 2909 | } |
2909 | 2910 | ||
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 624060837653..cbf199a98ab2 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -894,6 +894,7 @@ int snd_hda_codec_build_controls(struct hda_codec *codec); | |||
894 | /* | 894 | /* |
895 | * PCM | 895 | * PCM |
896 | */ | 896 | */ |
897 | extern const char *snd_hda_pcm_type_name[]; | ||
897 | int snd_hda_build_pcms(struct hda_bus *bus); | 898 | int snd_hda_build_pcms(struct hda_bus *bus); |
898 | int snd_hda_codec_build_pcms(struct hda_codec *codec); | 899 | int snd_hda_codec_build_pcms(struct hda_codec *codec); |
899 | void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, | 900 | void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, |
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index 95f24e4729f8..f5639c2988ab 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c | |||
@@ -309,7 +309,21 @@ static void print_audio_io(struct snd_info_buffer *buffer, | |||
309 | struct hda_codec *codec, hda_nid_t nid, | 309 | struct hda_codec *codec, hda_nid_t nid, |
310 | unsigned int wid_type) | 310 | unsigned int wid_type) |
311 | { | 311 | { |
312 | int conv = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0); | 312 | int pcm, conv; |
313 | for (pcm = 0; pcm < codec->num_pcms; pcm++) { | ||
314 | int type; | ||
315 | struct hda_pcm *cpcm = &codec->pcm_info[pcm]; | ||
316 | for (type = 0; type < 2; type++) { | ||
317 | if (cpcm->stream[type].nid != nid || cpcm->pcm == NULL) | ||
318 | continue; | ||
319 | snd_iprintf(buffer, " Device: name=\"%s\", type=\"%s\", device=%i, substream=%i\n", | ||
320 | cpcm->name, | ||
321 | snd_hda_pcm_type_name[cpcm->pcm_type], | ||
322 | cpcm->pcm->device, | ||
323 | cpcm->pcm->streams[type].substream->number); | ||
324 | } | ||
325 | } | ||
326 | conv = snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_CONV, 0); | ||
313 | snd_iprintf(buffer, | 327 | snd_iprintf(buffer, |
314 | " Converter: stream=%d, channel=%d\n", | 328 | " Converter: stream=%d, channel=%d\n", |
315 | (conv & AC_CONV_STREAM) >> AC_CONV_STREAM_SHIFT, | 329 | (conv & AC_CONV_STREAM) >> AC_CONV_STREAM_SHIFT, |