You are not logged in.

#1 2021-07-20 20:21:57

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,378

[SOLVED] No sound from HDMI audio system

I'm setting up a new system with hdmi only output and I must be missing some step to get audio.  The hdmi cable is connected to a monitor with built in speakers which worked well when booting windows (which was preinstalled but now gone).

Now that arch is installed, I have no sound.  alsamixer shows only a single sound card with 5 controls (S/PDIF, S/PDIF 1, ... S/PDIF 4) each of which only has a mute / unmute toggle (no volume).  All are unmuted.  This is consistent with the devices shown by `aplay -l`:

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

I've tried various invocations of speaker-test to no avail:

$ speaker-test -c 2

speaker-test 1.2.5.1

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

The results above are similar with no ~/.asoundrc, or with content of that file matching several different recommended configurations including the one below.

$ cat ~/.asoundrc
defaults.pcm.!card "PCH"
defaults.ctl.!card "PCH"

Any help would be appreciated as I've never had audio over HDMI before and I'm not really sure where to start.

Last edited by Trilby (2021-07-21 14:36:45)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#2 2021-07-21 06:21:37

seth
Member
Registered: 2012-09-03
Posts: 22,180

Offline

#3 2021-07-21 14:16:09

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,378

Re: [SOLVED] No sound from HDMI audio system

With the .asoundr from the gentoo page I get output like the following from speaker-test (regardless of the number of channels specified with the -c flag):

$ speaker-test -c 2

speaker-test 1.2.5.1

Playback device is default
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 8544000
Period size range from 32 to 4272000
Using max buffer size 8544000
Periods = 4
Unable to set hw params for playback: Cannot allocate memory
Setting of hwparams failed: Cannot allocate memory

I'm not sure that section is really relevant as the gentoo-page's asoundrc is to address problems specific to some applications:

gentoo page wrote:

With a default installed ALSA installation, it is possible for a S/PDIF or HDMI connection to work out of the box (no .asoundrc file alterations). While only some applications, such as the web browser's Adobe Flash plugin will fail playing sound. As such, the below .asoundrc is usually required

EDIT: scratch that, with the gentoo asoundrc aplay does work, just speaker-test fails as above.  I'll do a bit more testing.
Mine doesn't work "out of the box" - I'm not trying to get sound to work better or with more applications, I simply have no sound at all yet even from speaker-test / aplay.

Last edited by Trilby (2021-07-21 14:22:11)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2021-07-21 14:25:53

seth
Member
Registered: 2012-09-03
Posts: 22,180

Re: [SOLVED] No sound from HDMI audio system

Unable to set hw params for playback: Cannot allocate memory
Setting of hwparams failed: Cannot allocate memory

https://bugzilla.redhat.com/show_bug.cgi?id=1959169 ?

Mine doesn't work "out of the box"

hdmi/gpu related errors in dmesg?

Offline

#5 2021-07-21 14:36:21

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,378

Re: [SOLVED] No sound from HDMI audio system

The gentoo asoundrc does indeed seem to work except for speaker-test (aplay works, browser audio works).  It took a little trial and error to merge the softvol example and the spdif gentoo example, but this now works for all my needs: I have working sound and the ability to adjust volume:

pcm.!spdif {
     type hw
     card 0
     device 3
}

pcm.!softvol {
	type softvol
	slave.pcm "spdif"
	control {
		name "Master"
		card 0
	}
}

pcm.!default {
	type plug
	slave.pcm "softvol"
}

speaker-test still doesn't work (odd), and the command from the redhat bug didn't have any apparent affect with or without the asoundrc.

Thanks for pointing me to the gentoo page, that was the fix I need.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2021-07-23 20:24:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,378

Re: [SOLVED] No sound from HDMI audio system

The above asoundrc can, apparently, be drastically simplified for the same result:

pcm.!default {
	type softvol
	slave.pcm hdmi:PCH
	control {
		name "Master"
		card 0
	}
}

This has *almost* everything working.  But I'm not having any luck with zoom.  There are two zoom clients in the AUR, one of them picks up my microphone, but doesn't recognize any audio output devices; the other finds the hdmi audio output, but can't connect to my microphone.  Zoom sucks ... but everyone expects it to be used.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2021-07-23 21:07:02

seth
Member
Registered: 2012-09-03
Posts: 22,180

Offline

Board footer

Powered by FluxBB