Re: [PATCH v3 2/4] media: synopsys: hdmirx: add HDMI audio capture support

From: Dmitry Osipenko

Date: Sat Jul 25 2026 - 13:59:05 EST


Hi,

On 7/24/26 02:47, Igor Paunovic wrote:
> Hi Dmitry,
>
> Thank you -- and thank you for reviewing the whole series and testing
> 2/4. It went through a lot of back-and-forth since the RFC, so having
> it land with your Tested-by means a lot.
>
> I'll prepare the follow-ups as separate patches once this series is in:
>
> - The video_device lifetime issue on the V4L2 side (the devm-allocated
> struct with video_device_release_empty that the automated review
> flagged) -- as a standalone fix for the existing driver, since it's
> independent of the audio support.
> - An atomicity fix for the GLOBAL_SWENABLE read-modify-write, now that
> the audio path adds a second writer to that register alongside the
> CEC code.
>
> The repeated-suspend wedge I mentioned in the cover letter I'd rather
> send only once I have a clean, reproducible trigger for it -- it's
> still under investigation and I don't want to send a fix ahead of a
> solid repro.
>
> The dynamic codec registration you suggested (bind on the plug event,
> read the actual wire sample rate and restrict the codec's rate) is the
> direction I'd like to explore after these, once I've looked at what it
> needs from hdmi_codec_ops.

Good plan

RE the sample rate restriction, hdmi_codec_ops has get_eld() that
restricts rate based on HDMI ELD [1]. For RX we could tell the exact
rate to CODEC without ELD or we could generate ELD in the driver, either
way should require extension of CODEC driver with support of RX rate
restriction. This way userspace will see that there is only one rate
available for capture, so it won't be able to choose wrong rate and will
resample audio itself as it needs.

HDMI plug event -> signal stable -> gate audio rate from ACR -> register
CODEC device -> ops.get_eld() returns our ELD

[1]
https://elixir.bootlin.com/linux/v7.1.3/source/sound/soc/codecs/hdmi-codec.c#L477

--
Best regards,
Dmitry