Need help troubleshooting HDMI sound in alsa

Everything about X, Gnome, KDE, ... and everything running on it

Need help troubleshooting HDMI sound in alsa

Postby gurfle » 2019-08-09 04:40

Laptop: Panasonic Toughbook CF-54
Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
Kernel: 4.19.0-0.bpo.5-amd64 #1 SMP Debian 4.19.37-4~bpo9+1 (2019-06-19) x86_64
Desktop: Mate 1.16.2
Audio software: alsa 1.1.3 only (i.e. pulseaudio, that comes tightly integrated into mate has been disabled)
Code: Select all
nick@newlaptop:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC256 Analog [ALC256 Analog]
  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
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
nick@newlaptop:~$

Note: Missing volume bar over S/PDIF devices in alsamixer (click on image for more readable, higher resolution image)
Image
and of course the problem here is that no sound comes out of the HDMI jack on my machine, even though video does just fine.

I don't know, but maybe someone can confirm that digital output channels in alsa can only be on or off, i.e. have no volume control. If so, then the lack of volume bar is not a symptom of my lack of HDMI sound problem, as I had originally thought.

In case there is any doubt about what I am checking, with the alsamixer settings shown above, HDMI cable plugged in, I only get from internal speakers with the first use of aplay in the following:
Code: Select all
nick@newlaptop:~$ aplay -D plughw:0,0 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
nick@newlaptop:~$ aplay -D plughw:0,3 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
nick@newlaptop:~$ aplay -D plughw:0,7 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
nick@newlaptop:~$ aplay -D plughw:0,8 /usr/share/sounds/alsa/Front_Center.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
nick@newlaptop:~$

Also, I think, but am not sure that S/PDIF shown in alsamixer refers to the HDMI channels I am trying to get sound out of. Is there a way to know?

I know from WIN10 on another partition of the same machine that the hardware connection for sound from laptop HDMI jack to TV is fully functional, so there has to be a Linux software issue.

Even though a bit dated, the most useful document on linux sound drivers I have found is
https://mchehab.fedorapeople.org/kernel_docs_latex/sound.pdf
but everything on HDMI in it either doesn't apply or concerns kernel coding beyond my abilities.

Two things stick out to me:

1) Section 2.5.1 of that document talks about controls that allow "userspace applications like pulseaudio" to switch things like headphones and microphones on and off as they are plugged in and out. This was in fact a feature that worked when I had pulseaudio running, but now, with pulseaudio disabled, I have to switch headphone and mic. on manually from alsamixer. Is auto-detecting the headphone and mic. in fact possible with only alsa running (i.e. without also running a "userspace application like pulseaudio" on top of alsa)?

2) alsa does properly detect a USB sound card as soon as it is plugged in.

3) Most references I've found solving HDMI sound issues involve alsa seeing the HDMI device on a separate "card" from the one involving analog speaker and microphone, but on my system HDMI shows up on the same "card" as the analog stuff.

In summary, with only alsa running, none of the "hotplgging" features on the built in "catd0" of the laptop work (i.e. both headphone and HDMI sound), wheras USB "sound card hotplugging" does work.

Any suggestions on more effective troubleshooting would be greatly appreciated.

TIA
Last edited by gurfle on 2019-08-09 09:01, edited 1 time in total.
User avatar
gurfle
 
Posts: 360
Joined: 2009-06-04 02:08
Location: Seattle, Washington, US

Re: Need help troubleshooting HDMI sound in alsa

Postby Head_on_a_Stick » 2019-08-09 08:54

gurfle wrote:Is auto-detecting the headphone and mic. in fact possible with only alsa running (i.e. without also running a "userspace application like pulseaudio" on top of alsa)?

Yes, the "Auto-Mute Mode" (which is enabled in your screenshot) should do this. Not sure why it doesn't work for you.

gurfle wrote:with only alsa running, none of the "hotplgging" features on the built in "catd0" of the laptop work (i.e. both headphone and HDMI sound), wheras USB "sound card hotplugging" does work.

To switch to the HDMI output with pure ALSA see https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture/Troubleshooting#HDMI.
User avatar
Head_on_a_Stick
 
Posts: 10321
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Need help troubleshooting HDMI sound in alsa

Postby gurfle » 2019-08-09 18:33

Head_on_a_Stick wrote:To switch to the HDMI output with pure ALSA see https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture/Troubleshooting#HDMI.

Well, that is exactly what I have done, as detailed in my original post - though I see your remark was posted 7 minutes before I edited it to show I had indeed performed precisely the procedure detailed in that link :wink:

I see, however that in alsa a better search "keyword" than HDMI is SPDIF, so perhaps doing a little more research with that in mind will help :idea:
User avatar
gurfle
 
Posts: 360
Joined: 2009-06-04 02:08
Location: Seattle, Washington, US

Re: Need help troubleshooting HDMI sound in alsa

Postby gurfle » 2019-08-09 20:45

gurfle wrote:I see, however that in alsa a better search "keyword" than HDMI is SPDIF, so perhaps doing a little more research with that in mind will help :idea:

On a whim, I put in /etc/modprobe.d/sound.conf
Code: Select all
options snd-hda-intel model=spdif
which is a valid option in my kernel, but nothing changed.

There is also something curious that happens if I put
Code: Select all
blacklist snd-hda-codec-hdmi
into /etc/modprobe.d/blacklist.conf.
According to /var/log/messages, without the blacklist I get four additional HDMI devices (7, 8, 9 and 10):
Code: Select all
Aug  9 13:11:24 newlaptop kernel: [   10.715273] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/sound/card0/input27
Aug  9 13:11:24 newlaptop kernel: [   10.715416] input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1f.3/sound/card0/input28
Aug  9 13:11:24 newlaptop kernel: [   10.715643] input: HDA Intel PCH HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:1f.3/sound/card0/input29
Aug  9 13:11:24 newlaptop kernel: [   10.716274] input: HDA Intel PCH HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:1f.3/sound/card0/input30
Aug  9 13:11:24 newlaptop kernel: [   10.716442] input: HDA Intel PCH HDMI/DP,pcm=10 as [b]/devices/pci0000:00/0000:00:1f.3/sound/card0/input31

With the blacklist, only device 3 is listed in the messages file, however . . . devices 7 and 8 are still listed by "aplay -l". Very strange.

I did one more thorough check:
1) Computer and TV off, cable hooked up to both.
2) Completely boot into Windows 10.
3) Turn on TV.
4) Sound is immediately switched from computer to TV in by Windiows.
3) After reboot into Linux without touching cables and using the setup and method described previously, aplay produces sound on computer speakers, but no sound comes out of TV through any of the HDMI devices it recognizes.


Here are some areas that remain suspect (to me anyway):

1) The fact that alsa cannot detect hotplugging on headset jack and yet with pulseaudio running it does!
I mention this symptom here because "hotplug" detection of the HDMI devices (which works in Windows) also fails in alsa (though for HDMI - as opposed to the headset - the same inability to detect applies with pulseaudio running as well).

2) The strange behavior of snd-hda-codec-hdmi, which seems to be trying to get loaded twice when not blacklisted, and once when blacklisted, whereby it appears that each time the attempt is made (obviously it can only actually be loaded once) two extra HDMI devices show up on sound card "0" (at least ;partially, given that even with blacklist aplay sees 2 extra HDMI devices that are not??? listed in /etc/var/log/messages).

3) In every single discussion of HDMI sound issues I have found online, HDMI is listed by alsa on its own "card", i.e. not on the same card as analog devices like speaker, headphone and mic. That is the reason none of the possible solutions from those discussions ends up helping me.
Does anyone else have HDMI as just another device on their built in sound card? If not, could the fact that I do provide a clue to the source of my problem?
User avatar
gurfle
 
Posts: 360
Joined: 2009-06-04 02:08
Location: Seattle, Washington, US

Re: Need help troubleshooting HDMI sound in alsa

Postby KoO » 2019-08-16 23:56

Not sure if any of this will help with hdmi on Deb10 the first thing I do is remove pulseaudio and run straight alsa with usb dac tascam2x2. I do this on antiX & MX too
All sound works just fine including waterfox , mpd , etc (without installing apulse)
(To find my monitor settings I use = xrandr --current)

Set default sound card... Must be done from sudo

Open alsa mixer with sudo press F6 or S select your card then sudo alsactl store.

sudo alsamixer

sudo alsactl store

and

Setting the default device
Jump to: navigation, search

Find your desired card with:

cat /proc/asound/cards

and then create /etc/asound.conf with following:

defaults.pcm.card 1
defaults.ctl.card 1

Replace "1" with number of your card determined above.
Systems : antiX , MX Linux , Debian buster .
KoO
 
Posts: 5
Joined: 2019-04-20 02:42


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable