Repository navigation
drm/vc4: hdmi: Reset the MAI FIFO when preparing audio - #7751
Open
popcornmix wants to merge 1 commit into
Open
popcornmix wants to merge 1 commit into
popcornmix wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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