Skip to contentSkip to conversation

HDA HDMI audio doesn't work on Intel Geminilake machines

DISCUSSION Hui Wang 2 participants 4 messages Nov 2, 2017 – Nov 6, 2017

Subsystems (5)
DRM drivers Sound Intel i915 ASoC +1 more subsystems
lore
Share & tools
lore

Hui Wang

author
#0 lore raw

We have several Geminilake laptop and desktop machines, on these machines, the HW configs are same and are as shown below:

the HDA controller: 00:0e.0 Audio device [0403]: Intel Corporation Device [8086:3198] (rev 01)
the HDMI codec: Vendor Id: 0x8086280d
VGA controller: 00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:3184] (rev 01) (prog-if 00 [VGA controller])

The problem is if we boot the system without plugging the HDMI monitor, the Linux kernel can't find HDMI codec at all. If we plug the HDMI monitor before booting up, the kernel can find the HDMI codec, but there are many errors (as shown below) and the HDMI audio can't play any sound.

Codec: Intel Geminilake HDMI
Address: 2
AFG Function Id: 0x1 (unsol 0)
Vendor Id: 0x8086280d
Subsystem Id: 0x80860101
Revision Id: 0x100000
No Modem Function Group found
Default PCM:
N/A
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
State of AFG node 0x01:
  Power: setting=UNKNOWN, actual=UNKNOWN, Error, Clock-stop-OK, Setting-reset Invalid AFG subtree
--endcollapse--

[   25.504069] snd_hda_intel 0000:00:0e.0: azx_get_response timeout, switching to polling mode: last cmd=0x20bf8100 [   26.516125] snd_hda_intel 0000:00:0e.0: No response from codec, disabling MSI: last cmd=0x20bf8100 [   27.528058] snd_hda_intel 0000:00:0e.0: azx_get_response timeout, switching to single_cmd mode: last cmd=0x20bf8100 [   27.528259] azx_single_wait_for_response: 12 callbacks suppressed
[   27.547927] snd_hda_codec_hdmi hdaudioC0D2: Unable to sync register 0x2f0d00. -5

We have tested the latest mainline kernel, but the testing result is the same.

So does the existing kernel driver support the HDMI audio well for Geminilake? If it does, what is wrong with those machines, HW issue or BIOS issue?

Thanks in advance.

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#1 lore raw
Quoted 9 lines · Hui Wang

We have several Geminilake laptop and desktop machines, on these machines, the HW configs are same and are as shown below:

the HDA controller: 00:0e.0 Audio device [0403]: Intel Corporation Device [8086:3198] (rev 01)
the HDMI codec: Vendor Id: 0x8086280d
VGA controller: 00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:3184] (rev 01) (prog-if 00 [VGA controller])

Quoted 4 lines

The problem is if we boot the system without plugging the HDMI monitor, the Linux kernel can't find HDMI codec at all. If we plug the HDMI monitor before booting up, the kernel can find the HDMI codec, but there are many errors (as shown below) and the HDMI audio can't play any sound.

Please create a bugzilla. Share the logs after applying the attached test patch. Note to enable the debug logs.

Quoted 29 lines

Codec: Intel Geminilake HDMI
Address: 2
AFG Function Id: 0x1 (unsol 0)
Vendor Id: 0x8086280d
Subsystem Id: 0x80860101
Revision Id: 0x100000
No Modem Function Group found
Default PCM:
N/A
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
State of AFG node 0x01:
  Power: setting=UNKNOWN, actual=UNKNOWN, Error, Clock-stop-OK,
Setting-reset
Invalid AFG subtree
--endcollapse--

[   25.504069] snd_hda_intel 0000:00:0e.0: azx_get_response timeout, switching to polling mode: last cmd=0x20bf8100
[   26.516125] snd_hda_intel 0000:00:0e.0: No response from codec, disabling MSI: last cmd=0x20bf8100
[   27.528058] snd_hda_intel 0000:00:0e.0: azx_get_response timeout, switching to single_cmd mode: last cmd=0x20bf8100
[   27.528259] azx_single_wait_for_response: 12 callbacks suppressed [   27.547927] snd_hda_codec_hdmi hdaudioC0D2: Unable to sync register 0x2f0d00. -5

Quoted 5 lines

We have tested the latest mainline kernel, but the testing result is the same.

So does the existing kernel driver support the HDMI audio well for Geminilake? If it does, what is wrong with those machines, HW issue or

Hi,

Yes HDMI audio is tested on Geminilake. Can you please share information on model you are testing? Also what is the BIOS version you are using?

Quoted 1 line

BIOS issue?

Yes this may be a BIOS issue as well.

Regards,
Subhransu

Quoted 9 lines

Thanks in advance.

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Quoted 1 line

From 10444c1630a1958658f45dcf176cb1e268e98dcb Mon Sep 17 00:00:00 2001

From: Sathyanarayana Nujella <[email protected]>
Date: Mon, 23 Oct 2017 19:48:31 -0700
Subject: [PATCH] TEST: Read CDCLK, PW2 and other reg from Audio driver

Add Infrastructure to read i915 PW2/CDCLK and rest of reg from audio

---
 drivers/gpu/drm/i915/intel_audio.c | 18 ++++++++++++++++++
 include/drm/i915_component.h       |  2 ++
 include/sound/hda_i915.h           |  3 +++
 sound/hda/hdac_i915.c              | 16 ++++++++++++++++
 sound/pci/hda/hda_controller.c     |  3 +++
 sound/soc/intel/skylake/skl.c      |  4 ++++
 6 files changed, 46 insertions(+)
drivers/gpu/drm/i915/intel_audio.c +18 -0
index 27743be5b768..864f0430a95c 100644
@@ -698,6 +698,23 @@ static void i915_audio_component_put_power(struct device *kdev)
 	intel_display_power_put(kdev_to_i915(kdev), POWER_DOMAIN_AUDIO);
 }
 
+#define HSW_PWR_WELL_DRIVER                     _MMIO(0x45404)
+
+static int i915_audio_readmisc(struct device *kdev)
+{
+	struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
+	uint32_t cdclk_tmp = I915_READ(CDCLK_CTL);
+	uint32_t AudChickenbit = I915_READ(HSW_AUD_CHICKENBIT);
+	uint32_t PwCtl2 = I915_READ(HSW_PWR_WELL_DRIVER);
+
+	printk("%s %d\n",__func__,__LINE__);
+	printk("%s HSW_AUD_CHICKENBIT=0x%x\n",__func__,AudChickenbit);
+	printk("%s cdclk_ctl =0x%x\n",__func__,cdclk_tmp );
+	printk("%s  cdclk_freq=0x%x\n",__func__, I915_READ(CDCLK_FREQ));
+	printk("%s PWR_WELL_CTL2 =0x%x\n",__func__, PwCtl2 );
+	return 0;
+}
+
 static void i915_audio_component_codec_wake_override(struct device *kdev,
 						     bool enable)
 {
@@ -868,6 +885,7 @@ static int i915_audio_component_get_eld(struct device *kdev, int port,
 	.get_cdclk_freq	= i915_audio_component_get_cdclk_freq,
 	.sync_audio_rate = i915_audio_component_sync_audio_rate,
 	.get_eld	= i915_audio_component_get_eld,
+	.readmisc	= i915_audio_readmisc,
 };
 
 static int i915_audio_component_bind(struct device *i915_kdev,
include/drm/i915_component.h +2 -0
index 545c6e0fea7d..08d055b17d4f 100644
@@ -79,6 +79,8 @@ struct i915_audio_component_ops {
 	 */
 	int (*get_eld)(struct device *, int port, int pipe, bool *enabled,
 		       unsigned char *buf, int max_bytes);
+
+	int (*readmisc)(struct device *);
 };
 
 /**
include/sound/hda_i915.h +3 -0
index 5ab972e116ec..18b98caddef6 100644
@@ -17,6 +17,9 @@ int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, int dev_id,
 int snd_hdac_i915_init(struct hdac_bus *bus);
 int snd_hdac_i915_exit(struct hdac_bus *bus);
 int snd_hdac_i915_register_notifier(const struct i915_audio_component_audio_ops *);
+
+int snd_hdac_readmisc(struct hdac_bus *bus);
+
 #else
 static inline int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable)
 {
sound/hda/hdac_i915.c +16 -0
index 038a180d3f81..ddd3d555e849 100644
@@ -59,6 +59,22 @@ int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable)
 }
 EXPORT_SYMBOL_GPL(snd_hdac_set_codec_wakeup);
 
+int snd_hdac_readmisc(struct hdac_bus *bus)
+{
+	struct i915_audio_component *acomp = bus->audio_component;
+
+	if (!acomp || !acomp->ops)
+	{
+		printk("%s %d\n",__func__,__LINE__);
+		return -ENODEV;
+	}
+	acomp->ops->readmisc(acomp->dev);
+	printk("%s %d\n",__func__,__LINE__);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(snd_hdac_readmisc);
+
 /**
  * snd_hdac_display_power - Power up / down the power refcount
  * @bus: HDA core bus
sound/pci/hda/hda_controller.c +3 -0
index d1eb14842340..af5b8ec8372a 100644
@@ -36,6 +36,7 @@
 #include <sound/core.h>
 #include <sound/initval.h>
 #include "hda_controller.h"
+#include <sound/hda_i915.h>
 
 #define CREATE_TRACE_POINTS
 #include "hda_controller_trace.h"
@@ -1194,6 +1195,8 @@ static int probe_codec(struct azx *chip, int addr)
 	int err;
 	unsigned int res = -1;
 
+	snd_hdac_readmisc(bus);
+
 	mutex_lock(&bus->cmd_mutex);
 	chip->probing = 1;
 	azx_send_cmd(bus, cmd);
sound/soc/intel/skylake/skl.c +4 -0
index d6b01ae165d3..874f3e83f51c 100644
@@ -743,6 +743,9 @@ static int probe_codec(struct hdac_ext_bus *ebus, int addr)
 		(AC_VERB_PARAMETERS << 8) | AC_PAR_VENDOR_ID;
 	unsigned int res = -1;
 
+	printk("%s %d\n",__func__,__LINE__);
+	snd_hdac_readmisc(bus);
+
 	mutex_lock(&bus->cmd_mutex);
 	snd_hdac_bus_send_cmd(bus, cmd);
 	snd_hdac_bus_get_response(bus, addr, &res);
@@ -750,6 +753,7 @@ static int probe_codec(struct hdac_ext_bus *ebus, int addr)
 	if (res == -1)
 		return -EIO;
 	dev_dbg(bus->dev, "codec #%d probed OK\n", addr);
+	printk("%s %d\n",__func__,__LINE__);
 
 	return snd_hdac_ext_bus_device_init(ebus, addr);
 }
Signature · 1 line
1.9.1
author
#2 lore raw
Quoted 10 lines · Subhransu S. Prusty
Quoted 9 lines · Hui Wang

We have several Geminilake laptop and desktop machines, on these machines, the HW configs are same and are as shown below:

the HDA controller: 00:0e.0 Audio device [0403]: Intel Corporation Device [8086:3198] (rev 01)
the HDMI codec: Vendor Id: 0x8086280d
VGA controller: 00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:3184] (rev 01) (prog-if 00 [VGA controller])

Quoted 6 lines
Quoted 4 lines

The problem is if we boot the system without plugging the HDMI monitor, the Linux kernel can't find HDMI codec at all. If we plug the HDMI monitor before booting up, the kernel can find the HDMI codec, but there are many errors (as shown below) and the HDMI audio can't play any sound.

Please create a bugzilla. Share the logs after applying the attached test patch. Note to enable the debug logs.

OK, got it, thanks.

Quoted 32 lines
Quoted 32 lines

Codec: Intel Geminilake HDMI
Address: 2
AFG Function Id: 0x1 (unsol 0)
Vendor Id: 0x8086280d
Subsystem Id: 0x80860101
Revision Id: 0x100000
No Modem Function Group found
Default PCM:
N/A
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
State of AFG node 0x01:
  Power: setting=UNKNOWN, actual=UNKNOWN, Error, Clock-stop-OK,
Setting-reset
Invalid AFG subtree
--endcollapse--

[   25.504069] snd_hda_intel 0000:00:0e.0: azx_get_response timeout, switching to polling mode: last cmd=0x20bf8100
[   26.516125] snd_hda_intel 0000:00:0e.0: No response from codec, disabling MSI: last cmd=0x20bf8100
[   27.528058] snd_hda_intel 0000:00:0e.0: azx_get_response timeout, switching to single_cmd mode: last cmd=0x20bf8100
[   27.528259] azx_single_wait_for_response: 12 callbacks suppressed [   27.547927] snd_hda_codec_hdmi hdaudioC0D2: Unable to sync register 0x2f0d00. -5

We have tested the latest mainline kernel, but the testing result is the same.

Quoted 6 lines
Quoted 2 lines

So does the existing kernel driver support the HDMI audio well for Geminilake? If it does, what is wrong with those machines, HW issue or

Hi,

Yes HDMI audio is tested on Geminilake. Can you please share information on model you are testing? Also what is the BIOS version you are using?

They are all Dell laptop or desktop machines which are not released to market yet. The BIOS version of one of the laptops is 0.3.4.

And I will try to upload logs to the bugzilla.

Thank you.

Quoted 14 lines
Quoted 1 line

BIOS issue?

Yes this may be a BIOS issue as well.

Regards,
Subhransu

Quoted 8 lines

Thanks in advance.

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

author
#3 lore raw
In reply to Subhransu S. Prusty
Quoted 10 lines · Subhransu S. Prusty
Quoted 9 lines · Hui Wang

We have several Geminilake laptop and desktop machines, on these machines, the HW configs are same and are as shown below:

the HDA controller: 00:0e.0 Audio device [0403]: Intel Corporation Device [8086:3198] (rev 01)
the HDMI codec: Vendor Id: 0x8086280d
VGA controller: 00:02.0 VGA compatible controller [0300]: Intel Corporation Device [8086:3184] (rev 01) (prog-if 00 [VGA controller])

Quoted 7 lines
Quoted 4 lines

The problem is if we boot the system without plugging the HDMI monitor, the Linux kernel can't find HDMI codec at all. If we plug the HDMI monitor before booting up, the kernel can find the HDMI codec, but there are many errors (as shown below) and the HDMI audio can't play any sound.

Please create a bugzilla. Share the logs after applying the attached test patch. Note to enable the debug logs.

The bug was created, https://bugzilla.kernel.org/show_bug.cgi?id=197785

If need me to do more tests, just let me know.

Thanks in advance.

Hui.
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel