Skip to content

media: rockchip: hdmirx: fix audio corruption for layouts with an emp… - #613

Open
graham8 wants to merge 1 commit into
radxa:linux-6.1-stan-rkr4.1from
graham8:hdmirx-audio-empty-lane
Open

graham8 wants to merge 1 commit into
radxa:linux-6.1-stan-rkr4.1from
graham8:hdmirx-audio-empty-lane

Conversation

@graham8

@graham8 graham8 commented Oct 3, 2026

Copy link
Copy Markdown

…ty lane

PR #608 improves multi-channel audio capture but there remain some issues which this patch solves.

…ty lane

Since commit cd3a74e ("media: rockchip: hdmirx: fix 5.1-channel
audio capture") stopped overriding the speaker allocation,
layouts whose Audio InfoFrame CA leaves a whole sample lane unused but
whose source still transmits that lane are corrupted, e.g.

  CA 0x04  FL FR -  -  RC         (3.0 with back centre)
  CA 0x08  FL FR -  -  RL RR      (quad)

AUDIO_FIFO_STATUS2 then reports underflow and overflow together
(0x3000000) with a fill level of 0 on every poll, and the FIFO never
recovers. AUD_SAMPLE_PRESENT shows lanes 0-2 (or 0-3) present.

The previous fixed override (AUDIO_PROC_CONFIG3 = 0xffffffff) avoided
this but starved the FIFO whenever fewer than four lanes are sent,
e.g. 5.1 (lanes 0x7), which is what that commit fixed.

AUDIO_PROC_CONFIG3 behaves as a per-channel-slot mask. Override the
speaker allocation with a mask that marks both slots of every lane the
source actually sends, read from AUD_SAMPLE_PRESENT. Stereo and the
case where no lane is reported present keep the current behaviour.

Tested on ROCK 5B+ with test clips for 20 CTA-861 speaker allocations,
plus variants of CA 0x08-0x15 with side instead of rear speakers: no
corruption, and every channel in its CTA-861 position.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Graham Horner <graham@hornercs.co.uk>
@graham8

graham8 commented Oct 3, 2026

Copy link
Copy Markdown
Author

@liangyuanjinradxa please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant