Skip to content

ASoC: SOF: Fix suspend while paused corner case - #5054

Closed
ujfalusi wants to merge 8 commits into
thesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/suspend-while-paused-fix-02
Closed

ujfalusi wants to merge 8 commits into
thesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/suspend-while-paused-fix-02

Conversation

@ujfalusi

@ujfalusi ujfalusi commented Jun 11, 2024 •

Copy link
Copy Markdown
Collaborator

Hi,

Summary: this PR fixes the suspend while paused corner case for both IPC3 and IPC4 (was locking up Intel platforms)

The suspend while we have paused stream has been broken likely for several years (?). I cannot pin-point the exact commit, but there are several underlying issues contributing to the broken corner case:

  • wrong order of stopping the link DMA on the paused stream (set_hw_params_upon_resume did that)
  • IPC3 will not stop the host DMA on suspend if there were a paused stream.
  • IPC4 pipelines were not reset because the pipelines were in paused state, so unbind/free fails and the whole stack got confused.

This PR replaces #5040 with a more complicated and in SOF fix:

  • replace the set_hw_params_upon_resume() with suspend_early() and call it before we tear down the remaining pipelines:
  • the stream is paused, so we need to follow the same sequence as we have when we suspend while we have active audio
  • reset the started/paused count when we suspend the paused pipelines
  • stop the host DMA with IPC3 if we suspend while we have paused stream.

With this PR the system is no longer locks up and the paused aplay/arecord can be PAUSE_RELEASEd after the system resume.
Since we don't support the RESUME trigger, the stream is going to be re-started (like with active audio), but things work now correctly.

Fixes: #5035

Loading
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.

[HD-A] System does not wake up Playback/Capture-> pause -> suspend->resume scenario

3 participants