Skip to content

drm/vc4: hdmi: Reset the MAI FIFO when preparing audio - #7751

Open
popcornmix wants to merge 1 commit into
raspberrypi:rpi-6.18.yfrom
popcornmix:issue7750
Open

popcornmix wants to merge 1 commit into
raspberrypi:rpi-6.18.yfrom
popcornmix:issue7750

Conversation

@popcornmix

Copy link
Copy Markdown
Collaborator

The MAI FIFO is only reset (and DLATE/error flags cleared) in audio startup, i.e. on open.
Recovery from an underrun, or a stop/prepare/start by e.g. PipeWire, only calls prepare,
so the FIFO restarts without a reset. That leaves DLATE set and an 8 channel stream shifted
by 4 channels (FL/FR carry RL/RR, ...) until the device is reopened.

Reset and flush the FIFO and clear the flags in prepare too.

Tested on a Pi 5 with an HDMI analyser, 8ch at 48kHz and 192kHz, forced underruns:
without the patch every run is rotated by 4 channels and MAI_CTL reads 0xb088;
with it the channel order is correct and MAI_CTL stays 0x3088.

Fixes: #7750

The MAI FIFO is only reset, and its DLATE/error flags cleared, in
vc4_hdmi_audio_startup, which runs when the PCM is opened. Recovery
from an xrun (and a stop/prepare/start by e.g. PipeWire) only calls
prepare, so the FIFO is restarted without being reset.

After an underrun this leaves DLATE set and the multichannel audio
shifted by half a frame: on an 8 channel stream FL/FR carry RL/RR and
so on, until the device is closed and reopened.

Reset and flush the FIFO and clear the status flags in prepare too.

Checked with an HDMI analyser, 8 channels at 48kHz and 192kHz, with
forced underruns: without this every run is rotated by 4 channels,
with it the channel order is correct.

Link: raspberrypi#7750
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
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.

[Raspberry Pi 5 / VC6 HDMI] HDMI multichannel audio speaker channels randomly rotate during playback

1 participant