HDMI audio changes the ELD pin node after resume from suspend mode

We have an Acer Aspire TC-865 desktop equipped with Intel i7-8700 and NVIDIA GeForce GTX 1050. The HDMI cable is plugged to the NVIDIA card and a display with builtin speakers directly.

Tested with kernel 5.2. The HDMI audio works correctly before suspend. Pin#5 holds the ELD.

[   26.504190] snd_hda_codec_hdmi hdaudioC1D0: HDMI hot plug event: Codec=0 Pin=5 Device=0 Inactive=0 Presence_Detect=1 ELD_Valid=1
[   26.507811] snd_hda_codec_hdmi hdaudioC1D0: HDMI status: Codec=0 Pin=5 Presence_Detect=1 ELD_Valid=1
[   26.892083] snd_hda_codec_hdmi hdaudioC1D0: HDMI: detected monitor ASUS VP247
                  at connection type HDMI

The HDMI audio may become failed after resume. Pin#5 does not hold ELD any more. It changes to Pin#4.

[  369.300562] snd_hda_intel 0000:01:00.1: azx_get_response timeout, polling the codec once: last cmd=0x005f0900
[  370.304539] snd_hda_intel 0000:01:00.1: azx_get_response timeout, switching to polling mode: last cmd=0x005f0900
[  371.308512] snd_hda_intel 0000:01:00.1: azx_get_response timeout, switching to single_cmd mode: last cmd=0x005f0900
[  371.308526] snd_hda_codec_hdmi hdaudioC1D0: HDMI status: Codec=0 Pin=5 Presence_Detect=1 ELD_Valid=1
[  371.308670] snd_hda_intel 0000:01:00.1: get_response timeout: IRS=0x0
[  371.308673] snd_hda_codec_hdmi hdaudioC1D0: HDMI: invalid ELD buf size -1
[  371.404592] snd_hda_intel 0000:01:00.1: Clearing TCSEL
[  371.404610] snd_hda_intel 0000:01:00.1: Setting Nvidia snoop: 1
[  371.407882] snd_hda_codec_hdmi hdaudioC1D0: generic_hdmi_resume
[  371.408380] snd_hda_codec_hdmi hdaudioC1D0: HDMI status: Codec=0 Pin=4 Presence_Detect=1 ELD_Valid=1
[  371.412402] snd_hda_codec_hdmi hdaudioC1D0: HDMI: detected monitor ASUS VP247
                  at connection type HDMI

This issue will make Pulse Audio choose wrong profile and become Dummy Output, then cannot output sound.

before suspend: alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1
after resume: Dummy Output

This bug is also filed at 204199 – HDMI audio changes the ELD pin node after resume from suspend mode
nvidia-bug-report.log.gz (995 KB)
alsa-info_after-resume.txt (66.9 KB)
alsa-info_before-suspend.txt (57.9 KB)
dmesg.log (84.3 KB)
pactl_after_resume.txt (5.02 KB)
pactl_before_suspend.txt (6.36 KB)

Did you already try with the latest 430 or a legacy 390 driver? Some audio weirdness has been fixed with that.

I have tried nvidia 430.34. But this issue still can be reproduced.

By the way, GeForce RTX 2080 also hits same issue.