HDMI audio does not work on Geminilake in certain circumstances
My setup is a bit different from the typical distribution and I think that triggers the problem.
This is on a Pentium Silver N5030 (DMI: ECS LIVA Q2/PB02CF, BIOS LIVAQ2.03 01/21/2022) with a single HDMI output.
What happens at boot time is this:
-
the i915 module is loaded. It reads the state from the hardware.
Note, that at that point EDID is not read. I don't have fbdev emulation or an initramfs userspace that could trigger this. This is probably the main difference that triggers the issue.
-
the audio driver is loaded. This is a Geminilake CPU so it does a atomic commit in
glk_force_audio_cdclk(enable=true)
-
now Weston starts. It causes EDID to be loaded and does its first atomic commit. It uses the same mode. And as far as I can tell, here is where the problem starts:
In
intel_atomic_check()
old_crtc_state->inherited
is now false for the only crtc. As a result,intel_crtc_needs_modeset()
returns false and sointel_modeset_pipe_config()
is not called.
The end result is, that audio is not enabled for the output. The dmesg for this with drm.debug=0x1e is attached drm-debug.txt.
I've done some more testing and noted a few things:
If I do a commit with a different mode then intel_modeset_pipe_config()
is called and audio starts working.
If I wait longer after step 2. then runtime PM calls (indirectly) glk_force_audio_cdclk(enable=false)
. In this case I get this in the log:
[ 21.344594] snd_hda_intel 0000:00:0e.0: azx_get_response timeout, switching to polling mode: last cmd=0x20bf8100
[ 22.374413] snd_hda_intel 0000:00:0e.0: No response from codec, disabling MSI: last cmd=0x20bf8100
[ 23.404608] snd_hda_intel 0000:00:0e.0: azx_get_response timeout, switching to single_cmd mode: last cmd=0x20bf8100
[ 23.808907] snd_hda_codec_hdmi hdaudioC0D2: Unable to sync register 0x2f0d00. -5
At that point, audio is broken until I reboot.
As far as I can tell, all of this happens every single time. And I've tested this with 5.15.x and drm-tip from today (v5.17-rc7-1525-g3e6b6cad3c11).