Repository navigation
Conversation
The link DMA is reset on STOP trigger and it is expected to be configured again in the BE prepare before the next START. When a BE is shared by two FEs (FE1 and FE2) this is not guaranteed: FE1: hw_params, prepare, start FE2: hw_params, prepare (stays in PREPARED state) FE1: stop (BE is stopped, link DMA reset) At this point the BE is in STOP state while FE2 is still PREPARED, which leads to a BE START without prepare in these sequences: a) FE1: prepare, start The BE prepare is skipped by DPCM since FE2 is in PREPARED state. b) FE2: start No prepare is done at all. c) FE1: hw_params, prepare FE2: start FE1: start The BE prepare is skipped for FE1 since FE2 is in PREPARED state and the BE is started by FE2. The BE is started with an unconfigured link DMA and the streams stall after the host DMA has filled up the buffers. Run the prepare of the DAI on START if the link DMA is not prepared. Fixes: ab55937 ("ASoC: SOF: Intel: hda: Always clean up link DMA during stop") Closes: thesofproject/sof#11566 Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the shared-backend DMA restart change.
No open issues 🎉
What changed in this PR
This PR prevents audio streams from stalling when a shared backend restarts without DPCM preparing its link DMA after STOP.
Changes:
- Calls the DAI prepare callback on START when the link DMA is unprepared and the callback is available.
- Returns preparation errors before proceeding with the trigger.
- Documents why shared frontends can cause backend preparation to be skipped.
| File | Description |
|---|---|
sound/soc/sof/intel/hda-dai.c |
Adds conditional link DMA preparation on START to handle shared-backend restarts. |
Review effort: Balanced
bardliao
approved these changes
Dec 1, 2026
kv2019i
approved these changes
Dec 1, 2026
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 link DMA is reset on STOP trigger and it is expected to be configured again in the BE prepare before the next START.
When a BE is shared by two FEs (FE1 and FE2) this is not guaranteed:
FE1: hw_params, prepare, start
FE2: hw_params, prepare (stays in PREPARED state)
FE1: stop (BE is stopped, link DMA reset)
At this point the BE is in STOP state while FE2 is still PREPARED, which leads to a BE START without prepare in these sequences:
a) FE1: prepare, start
The BE prepare is skipped by DPCM since FE2 is in PREPARED state.
b) FE2: start
No prepare is done at all.
c) FE1: hw_params, prepare
FE2: start
FE1: start
The BE prepare is skipped for FE1 since FE2 is in PREPARED state and
the BE is started by FE2.
The BE is started with an unconfigured link DMA and the streams stall after the host DMA has filled up the buffers.
Run the prepare of the DAI on START if the link DMA is not prepared.
Fixes: ab55937 ("ASoC: SOF: Intel: hda: Always clean up link DMA during stop")
Closes: thesofproject/sof#11566