Hi Jianfeng Liu, On Thu Sep 25, 2025 at 6:05 AM CEST, Jianfeng Liu wrote: > After reusing drm_hdmi_audio_* helpers and drm_bridge_connector > integration in drm/msm/dp, we have dropped msm_dp_audio_hw_params and > use msm_dp_audio_prepare instead. While userspace is still calling > hw_params to do audio initialization, and we get the following errors: > > q6apm-lpass-dais 3700000.remoteproc:glink-edge:gpr:service@1:bedais: > q6apm_lpass_dai_prepare() started > q6apm-lpass-dais 3700000.remoteproc:glink-edge:gpr:service@1:bedais: > q6apm_lpass_dai_prepare() started > q6apm-lpass-dais 3700000.remoteproc:glink-edge:gpr:service@1:bedais: > q6apm_lpass_dai_prepare() started > hdmi-audio-codec hdmi-audio-codec.0.auto: hdmi_codec_hw_params() started > q6apm-lpass-dais 3700000.remoteproc:glink-edge:gpr:service@1:bedais: > q6apm_lpass_dai_prepare() started > qcom-apm gprsvc:service:2:1: Error (1) Processing 0x01001002 cmd > qcom-apm gprsvc:service:2:1: DSP returned error[1001002] 1 > q6apm-lpass-dais 3700000.remoteproc:glink-edge:gpr:service@1:bedais: Failed > to start APM port 104 > q6apm-lpass-dais 3700000.remoteproc:glink-edge:gpr:service@1:bedais: ASoC > error (-22): at snd_soc_dai_prepare() on DISPLAY_PORT_RX_0 > MultiMedia2 Playback: ASoC error (-22): at dpcm_run_update_startup() on > MultiMedia2 Playback > > msm_dp_audio_prepare is not called because hdmi-codec driver only checks > and runs hw_params before q6apm_lpass_dai_prepare(). This commit will > add hw_params callback same as drm_connector_hdmi_audio_prepare, so that > hdmi-codec driver can work with userspace alsa.
This also fixes DP audio regression on qcm6490-fairphone-fp5 (using Elite audio architecture) [ 133.986865] qcom-q6afe aprsvc:service:4:4: AFE enable for port 0x6020 failed -110 [ 133.986878] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: fail to start AFE port 68 [ 133.986881] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: ASoC error (-110): at snd_soc_dai_prepare() on DISPLAY_PORT_RX_0 [ 134.045112] qcom-q6afe aprsvc:service:4:4: cmd = 0x100e5 returned error = 0x9 [ 134.045192] qcom-q6afe aprsvc:service:4:4: DSP returned error[9] [ 134.045214] qcom-q6afe aprsvc:service:4:4: AFE enable for port 0x6020 failed -22 [ 134.045231] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: fail to start AFE port 68 [ 134.045243] q6afe-dai 3700000.remoteproc:glink-edge:apr:service@4:dais: ASoC error (-22): at snd_soc_dai_prepare() on DISPLAY_PORT_RX_0 Tested-by: Luca Weiss <[email protected]> # qcm6490-fairphone-fp5 And I guess, even though I reported it after this patch was sent: Closes: https://lore.kernel.org/linux-arm-msm/[email protected]/ Regards Luca > > Tested with Radxa Dragon Q6A. > > Fixes: 98a8920e7b07 ("drm/msm/dp: reuse generic HDMI codec implementation") > Signed-off-by: Jianfeng Liu <[email protected]> > --- > > Changes in v2: > - Link to v1: > https://lore.kernel.org/linux-arm-msm/[email protected]/ > - Use more detailed trace log in commit message. > - Drop the empty line between Fixex and SoB. > > drivers/gpu/drm/display/drm_hdmi_audio_helper.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/display/drm_hdmi_audio_helper.c > b/drivers/gpu/drm/display/drm_hdmi_audio_helper.c > index 7d78b02c1446..6ca1c7ad0632 100644 > --- a/drivers/gpu/drm/display/drm_hdmi_audio_helper.c > +++ b/drivers/gpu/drm/display/drm_hdmi_audio_helper.c > @@ -130,6 +130,7 @@ EXPORT_SYMBOL(drm_connector_hdmi_audio_plugged_notify); > > static const struct hdmi_codec_ops drm_connector_hdmi_audio_ops = { > .audio_startup = drm_connector_hdmi_audio_startup, > + .hw_params = drm_connector_hdmi_audio_prepare, > .prepare = drm_connector_hdmi_audio_prepare, > .audio_shutdown = drm_connector_hdmi_audio_shutdown, > .mute_stream = drm_connector_hdmi_audio_mute_stream,
