[alsa-devel] aplay -l vs. aplay -L: Missing PCMs?

Jaroslav Kysela perex at perex.cz
Fri Aug 20 10:34:18 CEST 2010


On Thu, 19 Aug 2010, Stephen Warren wrote:

> The Azalia controller on NVIDIA GPUs gives 4 ALSA hw devices:
>
> (on card 1):
>
> [swarren at swarren-lx2 ~]$ sudo aplay -l
> **** List of PLAYBACK Hardware Devices ****
> card 0: NVidia [HDA NVidia], device 0: ALC1200 Analog [ALC1200 Analog]
>  Subdevices: 1/1
>  Subdevice #0: subdevice #0
> card 0: NVidia [HDA NVidia], device 3: ALC1200 Digital [ALC1200 Digital]
>  Subdevices: 1/1
>  Subdevice #0: subdevice #0
> card 1: NVidia_1 [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
>  Subdevices: 1/1
>  Subdevice #0: subdevice #0
> card 1: NVidia_1 [HDA NVidia], device 7: NVIDIA HDMI [NVIDIA HDMI]
>  Subdevices: 1/1
>  Subdevice #0: subdevice #0
> card 1: NVidia_1 [HDA NVidia], device 8: NVIDIA HDMI [NVIDIA HDMI]
>  Subdevices: 1/1
>  Subdevice #0: subdevice #0
> card 1: NVidia_1 [HDA NVidia], device 9: NVIDIA HDMI [NVIDIA HDMI]
>  Subdevices: 1/1
>  Subdevice #0: subdevice #0
>
> ... all of which appear to work OK.
>
> However, the list of available "PCMs" from aplay -L doesn't expose them all:
>
> [swarren at swarren-lx2 ~]$ sudo aplay -L
> front:CARD=NVidia,DEV=0
>    HDA NVidia, ALC1200 Analog
>    Front speakers
> surround40:CARD=NVidia,DEV=0
>    HDA NVidia, ALC1200 Analog
>    4.0 Surround output to Front and Rear speakers
> surround41:CARD=NVidia,DEV=0
>    HDA NVidia, ALC1200 Analog
>    4.1 Surround output to Front, Rear and Subwoofer speakers
> surround50:CARD=NVidia,DEV=0
>    HDA NVidia, ALC1200 Analog
>    5.0 Surround output to Front, Center and Rear speakers
> surround51:CARD=NVidia,DEV=0
>    HDA NVidia, ALC1200 Analog
>    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
> surround71:CARD=NVidia,DEV=0
>    HDA NVidia, ALC1200 Analog
>    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
> hdmi:CARD=NVidia,DEV=0
>    HDA NVidia, ALC1200 Digital
>    HDMI Audio Output
> null
>    Discard all samples (playback) or generate zero samples (capture)
> pulse
>    Playback/recording through the PulseAudio sound server
> hdmi:CARD=NVidia_1
>    HDA NVidia, NVIDIA HDMI
>    HDMI Audio Output
>
> Similarly, pulseaudio only shows one output for the GPU; I assume it uses
> the same enumeration mechanism for ALSA sinks as "aplay -L".
>
> Instead, I imagined that I'd see 4 PCMs listed by "aplay -L"; one for each
> converter. Is this an incorrect assumption? How would I make that happen?

There is a bug in alsa-lib to namehint.c. The code assumes that hw device 
number is similar to logical device numbers which is not true in case of 
your HDMI devices:

3, 7, 8, 9

The fallback code is used and only first logical device 0 is created.

Could you test this patch?

http://git.alsa-project.org/?p=alsa-lib.git;a=commitdiff;h=97d25c0766405453d3c298bd51dd4916121a4f6a

PulseAudio uses different device enumeration, so ask on their mailing 
list.

 					Jaroslav

-----
Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.



More information about the Alsa-devel mailing list