Skip to contentSkip to conversation

Incorrect name of PCM

DISCUSSION Christopher Head 3 participants 11 messages Jul 22, 2018 – Jul 24, 2018

lore
Share & tools
lore
#0 lore raw

Hi folks,
I have an Asus P8H77-I motherboard. On board is an Intel HDA connected to a Via VT1708S codec. There are a number of analogue ports. In addition to them, on the back panel are an HDMI port (from an integrated GPU) and a TOSLINK port. The motherboard manual isn’t totally clear on whether the HDMI port can also carry sound or only video, but Windows claims to be able to send sound there, so probably yes. I don’t use the integrated GPU, though.

Here’s the problem:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: VT1708S Analog [VT1708S Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: VT1708S Alt Analog [VT1708S Alt
Analog] Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: VT1708S Digital [VT1708S Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

OK, a little bit unexpected that there is only one digital device listed rather than two. The codec datasheet says it should have two digital output widgets. Maybe it’s due to the integrated GPU being disabled though.

$ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=PCH
    HDA Intel PCH, VT1708S Analog
    Default Audio Device
sysdefault:CARD=PCH
    HDA Intel PCH, VT1708S Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=PCH,DEV=0
    HDA Intel PCH, VT1708S Digital
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 1
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
    HDA NVidia, HDMI 2
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
    HDA NVidia, HDMI 3
    HDMI Audio Output

Why is this wrong? Because when I play to the “hdmi” PCM, at least with the S/PDIF switch turned on in mixer controls, the sound comes out the TOSLINK port! It seems that the PCM naming is wrong. This is all without any configuration file. Everything works fine, just the name is wrong.

I don’t know whether turning off the S/PDIF switch results in the sound coming out the HDMI port instead; maybe it does (I don’t have anything that speaks HDMI and can also play sound to test with). Either way, seems like it should be called either “spdif” (if it’s only the TOSLINK port) or some combination of the two (if it’s both and switchable by the mixer switch).

If replying, please note that I’m not subscribed.

Thanks!

Signature · 1 line
Christopher Head
#1 lore raw
Quoted 11 lines · Christopher Head

Hi folks,
I have an Asus P8H77-I motherboard. On board is an Intel HDA connected to a Via VT1708S codec. There are a number of analogue ports. In addition to them, on the back panel are an HDMI port (from an integrated GPU) and a TOSLINK port. The motherboard manual isn’t totally clear on whether the HDMI port can also carry sound or only video, but Windows claims to be able to send sound there, so probably yes. I don’t use the integrated GPU, though.

Here’s the problem:

Quoted 14 lines
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: VT1708S Analog [VT1708S Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: VT1708S Alt Analog [VT1708S Alt
Analog] Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: VT1708S Digital [VT1708S Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Please look at the card numbers here. The HDMI output is provided from a different HD-audio controller (of GPU), so it's assigned to a different card. If you pass only "hdmi" to applications, it implicitly assumes the default card 0.

For playing via HDMI on your machine, you'd need to pass as "aplay -L" shows, one of the following:

Quoted 4 lines

hdmi:CARD=NVidia,DEV=0
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=1

Quoted 8 lines

HDA NVidia, HDMI 1
HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
HDA NVidia, HDMI 2
HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
HDA NVidia, HDMI 3
HDMI Audio Output

The device number depends on the HDMI port you plugged in. The above can be in a shorter form like "hdmi:1,0", too.

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#2 lore raw
Quoted 17 lines · Takashi Iwai

For playing via HDMI on your machine, you'd need to pass as "aplay -L" shows, one of the following:

Quoted 4 lines

hdmi:CARD=NVidia,DEV=0
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=1

Quoted 8 lines

HDA NVidia, HDMI 1
HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
HDA NVidia, HDMI 2
HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
HDA NVidia, HDMI 3
HDMI Audio Output

Quoted 2 lines

The device number depends on the HDMI port you plugged in. The above can be in a shorter form like "hdmi:1,0", too.

Hi,
Thanks for responding. Did you miss this part of the aplay -L output?

hdmi:CARD=PCH,DEV=0
HDA Intel PCH, VT1708S Digital
HDMI Audio Output

This is the part I think is wrong, not the parts mentioning the NVidia HDMI outputs.

Thanks,

Signature · 1 line
Christopher Head
#3 lore raw
Quoted 19 lines · Christopher Head
Quoted 17 lines · Takashi Iwai

For playing via HDMI on your machine, you'd need to pass as "aplay -L" shows, one of the following:

Quoted 12 lines

hdmi:CARD=NVidia,DEV=0
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
HDA NVidia, HDMI 1
HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
HDA NVidia, HDMI 2
HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
HDA NVidia, HDMI 3
HDMI Audio Output

Quoted 5 lines
Quoted 2 lines

The device number depends on the HDMI port you plugged in. The above can be in a shorter form like "hdmi:1,0", too.

Hi,
Thanks for responding. Did you miss this part of the aplay -L output?

No.

Quoted 5 lines

hdmi:CARD=PCH,DEV=0
HDA Intel PCH, VT1708S Digital
HDMI Audio Output

This is the part I think is wrong, not the parts mentioning the NVidia HDMI outputs.

Just ignore this entry. alsa-lib tries to parse the all possible outputs that are provided from the kernel interface. Due to historical reasons, this digital output might be either SPDIF or HDMI, and alsa-lib has no knowledge to distinguish easily, hence both spdif and hdmi device names are provided equally for such a case.

Again, on your machine, the HDMI output is the card#1, not card#0. The hdmi alsa-lib definition for card#0 is nothing but an alias of the general digital I/O.

HTH,

Takashi

#4 lore raw
Quoted 5 lines · Takashi Iwai

Just ignore this entry. alsa-lib tries to parse the all possible outputs that are provided from the kernel interface. Due to historical reasons, this digital output might be either SPDIF or HDMI, and alsa-lib has no knowledge to distinguish easily, hence both spdif and hdmi device names are provided equally for such a case.

Not here, they aren’t. There is no PCM named “spdif” at all: it isn’t in the list, and if I type it, I can’t play to it for a reason that looks a lot like it doesn’t exist.

Signature · 1 line
Christopher Head
#5 lore raw
Quoted 9 lines · Christopher Head
Quoted 5 lines · Takashi Iwai

Just ignore this entry. alsa-lib tries to parse the all possible outputs that are provided from the kernel interface. Due to historical reasons, this digital output might be either SPDIF or HDMI, and alsa-lib has no knowledge to distinguish easily, hence both spdif and hdmi device names are provided equally for such a case.

Not here, they aren’t. There is no PCM named “spdif” at all: it isn’t in the list, and if I type it, I can’t play to it for a reason that looks a lot like it doesn’t exist.

OK, then another possibility is a BIOS bug. BIOS declares the pin as HDMI incorrectly although it's a SPDIF.

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#6 lore raw
Quoted 2 lines · On Mon, 23 Jul 2018 19:40:36 +0200 Takashi Iwai <[email protected]> wrote:

OK, then another possibility is a BIOS bug. BIOS declares the pin as HDMI incorrectly although it's a SPDIF.

That would appear to be the case. According to the VT1708S datasheet, the typical application is for digital output widget node 0x12, attached to pin complex node 0x20, to be used for S/PDIF, and digital output widget node 0x15, attached to pin complex node 0x21, to be used for HDMI. The datasheet’s default values for the Configuration Default words for the two pin complex nodes agree with that configuration. This also appears to be how my motherboard is configured.

However, I have attached /proc/asound/card0/codec#0; this file states that node 0x20 is HDMI and 0x21 is S/PDIF, and having decoded the raw words based on the Intel HDA specification revision 1.0a, I agree that the kernel is decoding them correctly. I assume the kernel driver doesn’t change these words, which means the information I’m seeing there, since it’s not the codec default, must have been put there by the BIOS, apparently erroneously.

Is this something that the ALSA project wants to (or even can) add a quirk for? I am already running the most recent BIOS available.

Signature · 1 line
Christopher Head
#7 lore raw
Quoted 23 lines · Christopher Head
Quoted 2 lines · On Mon, 23 Jul 2018 19:40:36 +0200 Takashi Iwai <[email protected]> wrote:

OK, then another possibility is a BIOS bug. BIOS declares the pin as HDMI incorrectly although it's a SPDIF.

That would appear to be the case. According to the VT1708S datasheet, the typical application is for digital output widget node 0x12, attached to pin complex node 0x20, to be used for S/PDIF, and digital output widget node 0x15, attached to pin complex node 0x21, to be used for HDMI. The datasheet’s default values for the Configuration Default words for the two pin complex nodes agree with that configuration. This also appears to be how my motherboard is configured.

However, I have attached /proc/asound/card0/codec#0; this file states that node 0x20 is HDMI and 0x21 is S/PDIF, and having decoded the raw words based on the Intel HDA specification revision 1.0a, I agree that the kernel is decoding them correctly. I assume the kernel driver doesn’t change these words, which means the information I’m seeing there, since it’s not the codec default, must have been put there by the BIOS, apparently erroneously.

Quoted 2 lines

Is this something that the ALSA project wants to (or even can) add a quirk for? I am already running the most recent BIOS available.

You just need to disable the unused HDMI pin by setting the pin config value, even without recompiling drivers. It can be overridden by "patch" file, as mentioned in Documentation/sound/hd-audio/notes.rst.

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#8 lore raw
Quoted 3 lines · On Tue, 24 Jul 2018 07:22:52 +0200 Takashi Iwai <[email protected]> wrote:

You just need to disable the unused HDMI pin by setting the pin config value, even without recompiling drivers. It can be overridden by "patch" file, as mentioned in Documentation/sound/hd-audio/notes.rst.

I didn’t disable it, rather switched the config words between the two pins (since all the research I’ve done suggests that both outputs do exist, they’re just labelled backwards). Now the PCM is named “iec958” and everything is perfect. Thanks for the help!

Signature · 1 line
Christopher Head
#9 lore raw
Quoted 4 lines · Christopher Head

On Tue, 24 Jul 2018 07:22:52 +0200
Takashi Iwai <[email protected]> wrote:

Quoted 8 lines
Quoted 3 lines

You just need to disable the unused HDMI pin by setting the pin config value, even without recompiling drivers. It can be overridden by "patch" file, as mentioned in Documentation/sound/hd-audio/notes.rst.

I didn’t disable it, rather switched the config words between the two pins (since all the research I’ve done suggests that both outputs do exist, they’re just labelled backwards). Now the PCM is named “iec958” and everything is perfect. Thanks for the help!

Good to hear :)

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#10 lore raw
In reply to Takashi Iwai
Quoted 17 lines · Takashi Iwai

For playing via HDMI on your machine, you'd need to pass as "aplay -L" shows, one of the following:

Quoted 4 lines

hdmi:CARD=NVidia,DEV=0
HDA NVidia, HDMI 0
HDMI Audio Output
hdmi:CARD=NVidia,DEV=1

Quoted 8 lines

HDA NVidia, HDMI 1
HDMI Audio Output
hdmi:CARD=NVidia,DEV=2
HDA NVidia, HDMI 2
HDMI Audio Output
hdmi:CARD=NVidia,DEV=3
HDA NVidia, HDMI 3
HDMI Audio Output

Quoted 2 lines

The device number depends on the HDMI port you plugged in. The above can be in a shorter form like "hdmi:1,0", too.

Hi,
Thanks for responding. Did you miss this part of the aplay -L output?

hdmi:CARD=PCH,DEV=0
HDA Intel PCH, VT1708S Digital
HDMI Audio Output

This is the part I think is wrong, not the parts mentioning the NVidia HDMI outputs.

Thanks,

Signature · 3 lines
Christopher Head
-- 
Christopher Head