OK. I know there are may be incompatible sound cards. But in my case I've manged to have sound via HDMI twice! And then, after reboot its lost again.
I believe it's because of some race condition in configs, hardware detection etc.
Please help if you know something about how ALSA works deep inside.
Details:
sudo cat /proc/asound/card0/codec* | grep HDMI
Codec: Intel Kabylake HDMI
Pincap 0x0b000094: OUT Detect HBR HDMI DP
Pin Default 0x58560010: [N/A] Digital Out at Int HDMI
Pincap 0x0b000094: OUT Detect HBR HDMI DP
Pin Default 0x58560020: [N/A] Digital Out at Int HDMI
Pincap 0x0b000094: OUT Detect HBR HDMI DP
Pin Default 0x58560030: [N/A] Digital Out at Int HDMI
sudo cat /proc/asound/card0/codec* | grep Codec
Codec: Intel Kabylake HDMI
Yes. This NUC has no analog outputs. That's OK.
Next.
sudo dmesg | grep -E 'ALSA|HDA|HDMI|sound|hda.codec|hda.intel'
[ 0.452220] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[ 12.740050] snd_hda_intel 0000:00:1f.3: enabling device (0000 -> 0002)
[ 12.740290] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 1188.109725] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
No matter how I config options in alsa-base.conf and how many times I do alsa force-reload, I don't see any info about snd_hda_codec_hdmi in dmesg ouptut. And I don't have sound via HDMI (and at all, because there's not analog codec in this NUC). And aplay -l
gives zero. And alsamixer shows the sound cards but says it has no outputs.
But then, suddenly, after hours of tries it appears.
[ 0.450122] ACPI: Added _OSI(Linux-Lenovo-NV-HDMI-Audio)
[ 15.935079] snd_hda_intel 0000:00:1f.3: enabling device (0000 -> 0002)
[ 15.935346] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 327.214058] snd_hda_codec_hdmi hdaudioC0D2: HDMI: pin nid 5 not registered
[ 345.550477] snd_hda_codec_hdmi hdaudioC0D2: HDMI: pin nid 5 not registered
[ 366.102616] snd_hda_codec_hdmi hdaudioC0D2: HDMI: pin nid 5 not registered
[ 372.439981] snd_hda_codec_hdmi hdaudioC0D2: HDMI: pin nid 5 not registered
[ 458.554436] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 458.573743] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input12
[ 458.573791] input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input13
[ 458.573826] input: HDA Intel PCH HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input14
[ 458.573867] input: HDA Intel PCH HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input15
[ 458.573910] input: HDA Intel PCH HDMI/DP,pcm=10 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input16
[ 4198.722336] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 4198.743532] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input17
[ 4198.743588] input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input18
[ 4198.743642] input: HDA Intel PCH HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input19
[ 4198.743695] input: HDA Intel PCH HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input20
[ 4198.743742] input: HDA Intel PCH HDMI/DP,pcm=10 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input21
[ 5086.250736] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 5086.269058] input: HDA Intel PCH HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input22
[ 5086.269130] input: HDA Intel PCH HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input23
[ 5086.269166] input: HDA Intel PCH HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input24
[ 5086.269195] input: HDA Intel PCH HDMI/DP,pcm=9 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input25
[ 5086.269253] input: HDA Intel PCH HDMI/DP,pcm=10 as /devices/pci0000:00/0000:00:1f.3/sound/card1/input26
And I have sound via HDMI. But it disappears after reboot and no chance to have it back.
Why?! I can't understand how device can work SOMETIMES. And I can't find out conditions to reproduce and save. Any workaround...