Bug 204133

Summary: The HDMI audio on Intel Icelake platform doesn't work (fail rate is 1/5)
Product: Drivers Reporter: Hui Wang (hui.wang)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED CODE_FIX    
Severity: blocking CC: tiwai
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 5.2-rc7 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg with hdim audio worked
dmesg with the hdmi audio failed
A fix for invalid port/pin mapping

Description Hui Wang 2019-07-11 06:46:34 UTC
We tested mainline kernel v5.2-rc7 on the Intel ICL platform, the hdmi audio sometimes can't work, the fail rate is about 1/5. When hdmi audio doesn't work, we can see error log from dmesg:

[   11.006074] snd_hda_intel 0000:00:1f.3: No response from codec, disabling MSI: last cmd=0x202f8100
[   12.018190] snd_hda_intel 0000:00:1f.3: azx_get_response timeout, switching to single_cmd mode: last cmd=0x202f8100
[   12.018373] azx_single_wait_for_response: 21 callbacks suppressed
[   12.303601] snd_hda_codec_hdmi hdaudioC0D2: Unable to sync register 0x2f8100. -5
[   12.920238] snd_hda_codec_realtek hdaudioC0D0: Unable to sync register 0x2b8000. -5
[   12.920728] snd_hda_codec_realtek hdaudioC0D0: Unable to sync register 0x2b8000. -5


I don't know if it is a alsa bug or a i915 driver's bug.
Comment 1 Hui Wang 2019-07-11 06:51:02 UTC
Created attachment 283615 [details]
dmesg with hdim audio worked
Comment 2 Hui Wang 2019-07-11 06:51:37 UTC
Created attachment 283617 [details]
dmesg with the hdmi audio failed
Comment 3 Takashi Iwai 2019-07-13 18:01:55 UTC
0xf81 is Intel-specific verb and the stall implies that something went wrong in GPU side.  Better to report to Intel people.
Comment 4 Takashi Iwai 2019-07-15 19:40:46 UTC
BTW, the error below appears frequently:
  snd_hda_codec_hdmi hdaudioC0D2: HDMI: pin nid 5 not registered

I guess this is a bug due to the lack of reverse port/pin mapping in HDMI codec driver.  The patch below should address it.  Could you check it?

But I'm not sure whether this is relevant with the codec stall at all.

Please check which code path triggers the codec error.  You can put a WARN_ON() at the error message line, for example.  It's likely the runtime PM resume path, and if so, it's either intel_haswell_enable_all_pins() or intel_haswell_fixup_enable_dp12() call.  Both of them are basically superfluous for runtime PM resume, and we may skip it conditionally.
Comment 5 Takashi Iwai 2019-07-15 19:41:30 UTC
Created attachment 283711 [details]
A fix for invalid port/pin mapping
Comment 6 Hui Wang 2019-07-16 15:25:16 UTC
Thank you, saw your patch in the ML, and I will test the patch and update the test result soon (you could merge your patch first, no need to wait for my testing result since your patch really fix sth).
Comment 7 Hui Wang 2019-07-17 08:55:54 UTC
Tested the patch, it worked very well, the problem is fixed. And close this bug.