Skip to contentSkip to conversation

Clean some logs on rockchip hdmi audio

PATCH Superseded Detlev Casanova 2 participants 5 messages Jul 17, 2025 – Jul 18, 2025

Subsystems (6)
DRM drivers Sound DRM misc ASoC +2 more subsystems

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Clean some logs on rockchip hdmi audio

HDMI audio is showing lots of logs, particularly when HDMI is disconnected.

It doubled on RK3588 with the addition of the second HDMI TX port, so clean it up to avoid missing important log lines.

Detlev Casanova (3):
drm/bridge: dw-hdmi-qp: Return 0 in audio prepare when disconnected
ASoC: hdac_hdmi: Use dev_info on invalid ELD version drm/bridge: synopsys: Do not warn about audio params computation

 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 5 ++---
 sound/soc/codecs/hdac_hdmi.c                 | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)
Signature · 1 line
2.50.1
#1 lore raw

PATCH 1/3 drm/bridge: dw-hdmi-qp: Return 0 in audio prepare when disconnected

To configure audio registers, the clock of the video port in use must be enabled.
As those clocks are managed by the VOP driver, they can't be enabled here to write the registers even when the HDMI cable is disconnected.

Furthermore, the registers values are computed from the TMDS char rate, which is not available when disconnected.

Returning -ENODEV seemed reasonable at first, but ASoC will log an error multiple times if dw_hdmi_qp_audio_prepare() return an error. Userspace might also retry multiple times, filling the kernel log with:

hdmi-audio-codec hdmi-audio-codec.0.auto: ASoC error (-19): at snd_soc_dai_prepare() on i2s-hifi

This has become even worse with the support of the second HDMI TX port.

Activating the clocks to write fake data (fake because the TMDS char rate is unavailable) would require API changes to communicate between VOP and HDMI, which doesn't really make sense.

Using a cached regmap to be dumped when a cable is connected won't work because writing order is important and some data needs to be retrieved from registers to write others.

Returning 0 to silently fail sounds like the best and simplest solution.

---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +1 -1
index 5e5f8c2f95be1..7d3d7b5084c8d 100644
@@ -459,7 +459,7 @@ static int dw_hdmi_qp_audio_prepare(struct drm_connector *connector,
 	bool ref2stream = false;
 
 	if (!hdmi->tmds_char_rate)
-		return -ENODEV;
+		return 0;
 
 	if (fmt->bit_clk_provider | fmt->frame_clk_provider) {
 		dev_err(hdmi->dev, "unsupported clock settings\n");
Signature · 1 line
2.50.1
maintainer
#2 lore raw

Re: [PATCH 1/3] drm/bridge: dw-hdmi-qp: Return 0 in audio prepare when disconnected

Am Donnerstag, 17. Juli 2025, 23:56:18 Mitteleuropäische Sommerzeit schrieb Detlev Casanova:

Quoted 36 lines

To configure audio registers, the clock of the video port in use must be enabled.
As those clocks are managed by the VOP driver, they can't be enabled here to write the registers even when the HDMI cable is disconnected.

Furthermore, the registers values are computed from the TMDS char rate, which is not available when disconnected.

Returning -ENODEV seemed reasonable at first, but ASoC will log an error multiple times if dw_hdmi_qp_audio_prepare() return an error. Userspace might also retry multiple times, filling the kernel log with:

hdmi-audio-codec hdmi-audio-codec.0.auto: ASoC error (-19): at snd_soc_dai_prepare() on i2s-hifi

This has become even worse with the support of the second HDMI TX port.

Activating the clocks to write fake data (fake because the TMDS char rate is unavailable) would require API changes to communicate between VOP and HDMI, which doesn't really make sense.

Using a cached regmap to be dumped when a cable is connected won't work because writing order is important and some data needs to be retrieved from registers to write others.

Returning 0 to silently fail sounds like the best and simplest solution.

---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +0 -0
index 5e5f8c2f95be1..7d3d7b5084c8d 100644

drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c static int dw_hdmi_qp_audio_prepare(struct drm_connector *connector, · line 462

Quoted 5 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +1 -1
@@ -459,7 +459,7 @@ static int dw_hdmi_qp_audio_prepare(struct drm_connector *connector,
 	bool ref2stream = false;
 
 	if (!hdmi->tmds_char_rate)
-		return -ENODEV;
+		return 0;

nit: part of me would like a short comment stating the requirment of the running video-clock.

Heiko

Quoted 4 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +0 -0
 	if (fmt->bit_clk_provider | fmt->frame_clk_provider) {
 		dev_err(hdmi->dev, "unsupported clock settings\n");
 
#3 lore raw

PATCH 2/3 ASoC: hdac_hdmi: Use dev_info on invalid ELD version

In reply to Detlev Casanova

When disconnected, the ELD data cannot be read by the display driver, so it just sets the data to 0.

That makes the ELD parsing code read an ELD version of 0, which is invalid. In hdac_hdmi, that is logged with dev_err(), but should be logged with dev_info() instead as it is done in sound/core/pcm_drm_eld.c

This avoids printing multiple messages like:

HDMI: Unknown ELD version 0

in the kernel log when userspace tries to open the sound device.

---
 sound/soc/codecs/hdac_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/hdac_hdmi.c +1 -1
index 1139a2754ca33..4cc3b7a1062bd 100644
@@ -1232,7 +1232,7 @@ static int hdac_hdmi_parse_eld(struct hdac_device *hdev,
 						>> DRM_ELD_VER_SHIFT;
 
 	if (ver != ELD_VER_CEA_861D && ver != ELD_VER_PARTIAL) {
-		dev_err(&hdev->dev, "HDMI: Unknown ELD version %d\n", ver);
+		dev_info(&hdev->dev, "HDMI: Unknown ELD version %d\n", ver);
 		return -EINVAL;
 	}
 
Signature · 1 line
2.50.1
#4 lore raw

PATCH 3/3 drm/bridge: synopsys: Do not warn about audio params computation

In reply to Detlev Casanova

There is no need to warn about non pre-computed values, just change it to dbg.

---
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +1 -2
index 7d3d7b5084c8d..0571d604d8aa3 100644
@@ -276,8 +276,7 @@ static unsigned int dw_hdmi_qp_find_n(struct dw_hdmi_qp *hdmi, unsigned long pix
 	if (n > 0)
 		return n;
 
-	dev_warn(hdmi->dev, "Rate %lu missing; compute N dynamically\n",
-		 pixel_clk);
+	dev_dbg(hdmi->dev, "Rate %lu missing; compute N dynamically\n", pixel_clk);
 
 	return dw_hdmi_qp_compute_n(hdmi, pixel_clk, sample_rate);
 }
Signature · 1 line
2.50.1