Skip to content

media: synopsys: hdmirx: add HDMI audio capture support

Igor Paunovic linux-arm-kernel linux-devicetree linux-media linux-rockchip lkml sashiko-reviews 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 13 repliesIn review
  2. v34 patches 15 repliesSuperseded
  3. v22 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC2 patches9 repliesSuperseded

Changes in v4 from the cover letter

- Driver: support system suspend instead of the -EBUSY guard discussed on the v3 thread (Dmitry Osipenko's preference). The worker is stopped before the controller clocks are gated; resume fully resets the controller, so the audio path is re-programmed from the last known sample rate and the worker re-armed while a capture stream is active, through a hdmirx_audio_setup() helper shared with hw_params(). Validated with an active capture stream across the suspend/resume cycle.
- Driver: use swab32() for the ACR word reversal; readl() already abstracts bus endianness, so the reversal must be unconditional (automated review, valid finding)
- dts: the sound card is now a shared, disabled-by-default "RK3588 HDMI-IN" node in rk3588-extra.dtsi, mirroring the HDMI TX sound cards; the board patch only flips it on (Sebastian Reichel)
- binding: reference dai-common.yaml, switch to
unevaluatedProperties: false, and drop the consumer comment from the example (Krzysztof Kozlowski)

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4dt-bindings: media: snps,dw-hdmi-rx: add #sound-dai-cellsDocumentation/devicetree/bindings/media/snps,dw-hdmi-rx.yaml+12 -13 replies
2/4media: synopsys: hdmirx: add HDMI audio capture supportdrivers/media/platform/synopsys/hdmirx/snps_hdmirx.c drivers/media/platform/synopsys/hdmirx/snps_hdmirx.h+314 -03 replies
3/4arm64: dts: rockchip: add HDMI RX audio on RK3588arch/arm64/boot/dts/rockchip/rk3588-extra.dtsi+18 -02 replies
4/4arm64: dts: rockchip: enable HDMI RX audio capture on Orange Pi 5 Plusarch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts+8 -02 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchSebastian ReichelKrzysztof KozlowskiDmitry Osipenko
1/4R-b R-b R-b
2/4R-b T-b
3/4R-b R-b
4/4R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/4] media: synopsys: hdmirx: add HDMI audio capture support

This series adds audio capture support to the Synopsys DesignWare HDMI RX controller used on the Rockchip RK3588: the controller's audio FIFO is exposed through an ASoC hdmi-codec device, with a periodic worker that keeps the local audio clock locked to the incoming stream by tracking the FIFO fill level. Together with the two dts patches this yields a capture-only ALSA card fed by the HDMI input.

Validated on the Orange Pi 5 Plus against multiple HDMI sources:
capture follows the source sample rate (44.1/48 kHz switches included), survives repeated stream start/stop cycles and SIGKILL of the capturing process, stays free of FIFO under/overruns via the clock tracking, and now also survives system suspend with an active capture stream: audio resumes flowing on its own after the cycle.

Changes in v4:
- Driver: support system suspend instead of the -EBUSY guard discussed on the v3 thread (Dmitry Osipenko's preference). The worker is stopped before the controller clocks are gated; resume fully resets the controller, so the audio path is re-programmed from the last known sample rate and the worker re-armed while a capture stream is active, through a hdmirx_audio_setup() helper shared with hw_params(). Validated with an active capture stream across the suspend/resume cycle.
- Driver: use swab32() for the ACR word reversal; readl() already abstracts bus endianness, so the reversal must be unconditional (automated review, valid finding)
- dts: the sound card is now a shared, disabled-by-default "RK3588 HDMI-IN" node in rk3588-extra.dtsi, mirroring the HDMI TX sound cards; the board patch only flips it on (Sebastian Reichel)
- binding: reference dai-common.yaml, switch to
unevaluatedProperties: false, and drop the consumer comment from the example (Krzysztof Kozlowski)

Known limitation, noted on the v3 thread and under investigation as a
follow-up: a second suspend/resume cycle in the same boot can leave the audio datapath silent until reboot. It reproduces with no-stream suspend cycles as well, so it is independent of the suspend handling added here, and looks related to the cold-start behavior described in the v3 testing notes.

Link to v3: https://lore.kernel.org/linux-media/[email protected]/
Link to v2: https://lore.kernel.org/linux-media/[email protected]/
Link to v1 (RFC): https://lore.kernel.org/linux-media/[email protected]/

Igor Paunovic (4):
dt-bindings: media: snps,dw-hdmi-rx: add #sound-dai-cells
media: synopsys: hdmirx: add HDMI audio capture support
arm64: dts: rockchip: add HDMI RX audio on RK3588
arm64: dts: rockchip: enable HDMI RX audio capture on Orange Pi 5 Plus

 .../bindings/media/snps,dw-hdmi-rx.yaml       |  13 +-
 .../arm64/boot/dts/rockchip/rk3588-extra.dtsi |  18 ++
 .../dts/rockchip/rk3588-orangepi-5-plus.dts   |   8 +
 .../platform/synopsys/hdmirx/snps_hdmirx.c    | 306 ++++++++++++++++++
 .../platform/synopsys/hdmirx/snps_hdmirx.h    |   8 +
 5 files changed, 352 insertions(+), 1 deletion(-)
Signature · 1 line
2.53.0