How to check why sound over HDMI doesn't work
After asking this questions multiple times on gentoo IRC and finally the forums, I was pushed in the right direction and able to solve the problem.
~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
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
As stated in line2 these are all the available playback devices. I configured my /etc/asound.conf accordingly. (can be done in ~/.asoundrc per user, too)
~ $ cat /etc/asound.conf
pcm.analog {
type hw
card 0
device 0 }
pcm.digital {
type hw
card 0
device 1 }
pcm.hdmi0 {
type hw
card 0
device 3 }
pcm.hdmi1 {
type hw
card 0
device 7 }
In each entry the part after the dot is a local alias free to chose. Other applications can use this to identify the device. Using aplay -D plug:hdmi1 ~/soundfile.wav
finally played a sound (actually you should play a wav file cause aplay cannot decode mp3 or likewise).
So I appended these few lines to my /etc/asound.conf
pcm.!default {
type plug
slave.pcm "hdmi1"
}
And now everything works like a charm.
Related videos on Youtube
Coffeee
Informatics Student Fitness enthusiast, avid mountain and road biker.
Updated on September 18, 2022Comments
-
Coffeee over 1 year
I installed Gentoo clean on my system, except my /home but I deleted all hidden folders that might have an impact on sound (.mplayer .pulse* .config .esd_auth and more) and with a fresh user
adduser mistertest -m -G audio,video,users
the result is the same, no sound when I play a file in mplayer.Its a Z68 Chipset and I am using the Intel IGP H2000 inside my CPU, so this should not be an issue of the spdif connector on my mainboard and I think i have installed all the correct modules in the kernel. I have no aditional hardware to check if my sound is working at all (no headset or external speakers), but I suppose the problem is either some bad config or the internal spdif (if there is such).
dronemother ~ # lsmod | grep snd snd_hda_codec_hdmi 22705 1 snd_hda_codec_realtek 190506 1 snd_hda_intel 21727 3 snd_hda_codec 63422 3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel snd_hwdep 5726 1 snd_hda_codec snd_pcm 69969 3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec snd_timer 17697 1 snd_pcm snd 53814 13 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_ timer soundcore 5009 1 snd snd_page_alloc 6641 2 snd_hda_intel,snd_pcm dronemother ~ # lspci -v # cut other stuff away here 00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05) Subsystem: ASRock Incorporation Device 1892 Flags: bus master, fast devsel, latency 0, IRQ 46 Memory at fe600000 (64-bit, non-prefetchable) [size=16K] Capabilities: [50] Power Management version 2 Capabilities: [60] MSI: Enable+ Count=1/1 Maskable- 64bit+ Capabilities: [70] Express Root Complex Integrated Endpoint, MSI 00 Capabilities: [100] Virtual Channel Capabilities: [130] Root Complex Link Kernel driver in use: snd_hda_intel Kernel modules: snd-hda-intel
I have pulseaudio, alsa-plugins, mplayer, mixer and pavucontrol installed. I get no errors when playing a file in mplayer just no sound.
So how can I examine where exactly my problem is located?
Edit: I just booted the PC from a Ubuntu Live USB stick, sound did not work, too. (took a bit longer, cannot restart the server every day, some people rely on its services.)
-
Admin over 12 yearsDoes playing around with the volume controls with
alsamixer
(in media-sound/alsa-utils) change anything? -
Admin over 12 yearswell playing around does not seem to change anything but all S/PDIF channels are set to off. But activating them did not help.
-
Admin over 12 yearsAnd you can't turn them on? ('m' to unmute)
-
Admin over 12 yearsYes, but they are only "bool" so no more options than on/off. I think the problem is somewhere else. I will try to get my hands on a headset tomorrow.
-
Admin over 12 yearsYou can try booting with a Fedora or Ubuntu liveCD. If sound works out of the box for some other distro, it may give you a clue about the configuration.
-
-
Vetrivelmurugan about 11 yearsShould we assume that you're not using pulseaudio?