You are not logged in.

#1 2023-03-26 19:32:29

psskch
Member
Registered: 2023-03-26
Posts: 2

[Solved] No HDMI sound with ALSA - Playback open error

Hello,
I recently installed Arch Linux on a new PC (as the only OS), plugged to my TV with HDMI. Video is working fine, but the audio doesn't work.
I've been searching a solution on the Arch Linux wiki and forums, but to no avail.
For some context of what I did/try:

  • the user belongs to the "audio" group.

  • alsa-firmware, sof-firmware and alsa-ucm-conf packages are installed.

  • I have briefly installed pulseaudio to check if it would solve my issue, and uninstalled it right after. I removed /etc/pulse/client.conf and didn't find any other PulseAudio files remaining. The "fuser -v /dev/snd/*" command outputs nothing.

  • all channels were unmuted using alsamixer

Here's the output of some commands:

$ cat /proc/asound/cards
 0 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0x6e080000 irq 17
 2 [Audio          ]: USB-Audio - USB Audio
                      Generic USB Audio at usb-0000:00:14.0-12, high speed
$ cat /proc/asound/modules
 0 snd_hda_intel
 2 snd_usb_audio
$ lspci -nn | grep -i audio
00:1f.3 Audio device [0403]: Intel Corporation Tiger Lake-H HD Audio Controller [8086:43c8] (rev 11)
01:00.1 Audio device [0403]: NVIDIA Corporation Device [10de:10fa] (rev a1)
$ ls -l /dev/snd/
total 0
drwxr-xr-x  2 root root       60 Mar 26 18:52 by-id
drwxr-xr-x  2 root root       80 Mar 26 18:52 by-path
crw-rw----+ 1 root audio 116,  7 Mar 26 18:52 controlC0
crw-rw----+ 1 root audio 116, 11 Mar 26 18:52 controlC2
crw-rw----+ 1 root audio 116,  6 Mar 26 18:52 hwC0D0
crw-rw----+ 1 root audio 116,  2 Mar 26 18:52 pcmC0D3p
crw-rw----+ 1 root audio 116,  3 Mar 26 18:52 pcmC0D7p
crw-rw----+ 1 root audio 116,  4 Mar 26 18:52 pcmC0D8p
crw-rw----+ 1 root audio 116,  5 Mar 26 18:52 pcmC0D9p
crw-rw----+ 1 root audio 116,  9 Mar 26 18:52 pcmC2D0c
crw-rw----+ 1 root audio 116,  8 Mar 26 18:52 pcmC2D0p
crw-rw----+ 1 root audio 116, 10 Mar 26 18:52 pcmC2D1c
crw-rw----+ 1 root audio 116,  1 Mar 26 18:52 seq
crw-rw----+ 1 root audio 116, 33 Mar 26 18:52 timer
$ lsmod | grep '^snd'
snd_sof_pci_intel_tgl    16384  0
snd_sof_intel_hda_common   229376  1 snd_sof_pci_intel_tgl
snd_sof_intel_hda      24576  1 snd_sof_intel_hda_common
snd_sof_pci            24576  2 snd_sof_intel_hda_common,snd_sof_pci_intel_tgl
snd_sof_xtensa_dsp     20480  1 snd_sof_intel_hda_common
snd_sof               376832  3 snd_sof_pci,snd_sof_intel_hda_common,snd_sof_intel_hda
snd_sof_utils          20480  1 snd_sof
snd_soc_hdac_hda       28672  1 snd_sof_intel_hda_common
snd_hda_ext_core       36864  3 snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_sof_intel_hda
snd_soc_acpi_intel_match    73728  2 snd_sof_intel_hda_common,snd_sof_pci_intel_tgl
snd_soc_acpi           16384  2 snd_soc_acpi_intel_match,snd_sof_intel_hda_common
snd_soc_core          434176  4 soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hda
snd_compress           32768  1 snd_soc_core
snd_hda_codec_hdmi     94208  1
snd_pcm_dmaengine      20480  1 snd_soc_core
snd_usb_audio         442368  0
snd_hda_intel          65536  0
snd_intel_dspcfg       36864  3 snd_hda_intel,snd_sof,snd_sof_intel_hda_common
snd_intel_sdw_acpi     20480  2 snd_sof_intel_hda_common,snd_intel_dspcfg
snd_usbmidi_lib        53248  1 snd_usb_audio
snd_hda_codec         217088  4 snd_hda_codec_hdmi,snd_hda_intel,snd_soc_hdac_hda,snd_sof_intel_hda
snd_rawmidi            53248  1 snd_usbmidi_lib
snd_seq_device         16384  1 snd_rawmidi
snd_hda_core          139264  7 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_sof_intel_hda_common,snd_soc_hdac_hda,snd_sof_intel_hda
snd_hwdep              20480  2 snd_usb_audio,snd_hda_codec
snd_pcm               200704  12 snd_hda_codec_hdmi,snd_hda_intel,snd_usb_audio,snd_hda_codec,soundwire_intel,snd_sof,snd_sof_intel_hda_common,snd_compress,snd_soc_core,snd_sof_utils,snd_hda_core,snd_pcm_dmaengine
snd_timer              53248  1 snd_pcm
snd                   151552  13 snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_sof,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HISENSE]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Audio [USB Audio], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
$ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HISENSE
    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
default:CARD=Audio
    USB Audio, USB Audio
    Default Audio Device
sysdefault:CARD=Audio
    USB Audio, USB Audio
    Default Audio Device
front:CARD=Audio,DEV=0
    USB Audio, USB Audio
    Front output / input
surround21:CARD=Audio,DEV=0
    USB Audio, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Audio,DEV=0
    USB Audio, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Audio,DEV=0
    USB Audio, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Audio,DEV=0
    USB Audio, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Audio,DEV=0
    USB Audio, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Audio,DEV=0
    USB Audio, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Audio,DEV=0
    USB Audio, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
$ cat /etc/modprobe.d/alsa-base.conf
options snd_hda_intel index=1,0

When I run the speaker-test command, I get the following error:

$ speaker-test -c2

speaker-test 1.2.8

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
Playback open error: -2,No such file or directory

If I set the default card to the USB Audio, it works and I can hear sound if I plug a headphone into my PC's jack.
I can also get the sound to play on the TV by specifying the playback device in the speaker-test command:

$ speaker-test -c2 -D hdmi:NVidia

speaker-test 1.2.8

Playback device is hdmi:NVidia
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 64 to 1048576
Period size range from 32 to 524288
Using max buffer size 1048576
Periods = 4
was set period_size = 262144
was set buffer_size = 1048576
 0 - Front Left
 1 - Front Right

I have tried using this configuration (my /etc/asound.conf is empty):

$ cat ~/.asoundrc
pcm.!default.type plug;
pcm.default.slave.pcm.type hw;
pcm.default.slave.pcm.card 0;

but then I get the following error:

$ speaker-test -c2

speaker-test 1.2.8

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Playback open error: -2,No such file or directory

I have absolutely no idea where to go next, any help would be greatly appreciated. I can of course provide more information if necessary.

Last edited by psskch (2023-03-26 22:01:22)

Offline

#2 2023-03-26 19:51:02

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,415

Re: [Solved] No HDMI sound with ALSA - Playback open error

Revert the audio group, it can lead to unwanted side effects and is normally not necessary with proper logind sessions

You need to play to the correct device, if speaker-test -D hdmi:Nvidia worked then that will be device 3 so your .asoundrc should be

defaults.pcm.card 0;
defaults.pcm.device 3;

that should be all in there.

Online

#3 2023-03-26 22:00:54

psskch
Member
Registered: 2023-03-26
Posts: 2

Re: [Solved] No HDMI sound with ALSA - Playback open error

Thank you, that worked !

Offline

Board footer

Powered by FluxBB