Skip to content

ASoC: SOF: pcm/pm/Intel: Fix VoW during system suspend - #5951

Open
ujfalusi wants to merge 2 commits into
thesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/vow-flow-fix-01
Open

ujfalusi wants to merge 2 commits into
thesofproject:topic/sof-devfrom
ujfalusi:peter/sof/pr/vow-flow-fix-01

Conversation

@ujfalusi

Copy link
Copy Markdown
Collaborator

The Wake on Voice flow was broken (supported via IPC3 only atm) because on suspend we attempted to tear down the pipelines
and RESUME was not supported by the PCM:
We had errors on suspend due to failing to free widgets and the user space restarted to capture during resume.

To fix this:
If the target suspend level is SOF_DSP_PM_D0 then we must not tear down the pipelines
we need to set the SNDRV_PCM_INFO_RESUME for the VoW capture PCM, so applications can do the 'resume'
and on RESUME trigger we do nothing as the DSP was left on and everything has been left running as they were before.

Tested on sof-adl-max98357a-rt5682.tplg with:

arecord -Dhw:0,100 -M -N -c 2 -f S16_LE -r 16000 --buffer-size=96000 tmp.wav -d 10 -vvv

and

echo mem > /sys/power/state

then clapping to wake the device up: no errors observed anymore.

When a capture stream for WoV is active during suspend, we must not tear
down the pipelines as they must remain active while the system is
suspended.
In order to the WoV to work with system suspend, the PCM must have
SNDRV_PCM_INFO_RESUME set so applications will not try to re-start the
stream due to not supported resume trigger.
However on RESUME trigger there is nothing to do for the VoW PCM as it was
left running, but since system RESUME is not supported by default, for
other streams which have suspend_ignored=false we need to return error for
userspace to restart the stream.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
…treams

VoW streams can be identified with the d0i3_compatible flag and for the
Wake on Voice to work the SNDRV_PCM_INFO_RESUME flag must be set for the
PCM.
On system suspend the DSP will be left enabled, pipelines running and on
resume there will be no action needed to be done.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Copilot AI lite review requested due to automatic review settings September 23, 2026 11:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Resolve the HDA RESUME handling and restrict or implement resume support for non-retained suspend paths.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Fixes SOF Wake on Voice suspend/resume by retaining pipelines during D0 suspend and enabling ALSA resume support.

Changes:

  • Avoids pipeline teardown when suspending to D0.
  • Handles RESUME for retained streams.
  • Advertises RESUME for compatible HDA capture streams.
File Summary Review status
sound/​soc/​sof/​pm.c Preserves pipelines during D0 suspend. No issue noted.
sound/​soc/​sof/​pcm.c Handles RESUME for suspend-ignored streams. Moderate issue: the HDA DAI path can still return -EINVAL for RESUME.
sound/​soc/​sof/​intel/​hda-pcm.c Advertises resume capability for VoW capture streams. Moderate issue: capability is advertised for paths that do not reliably support RESUME.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +360 to +362
if (direction == SNDRV_PCM_STREAM_CAPTURE &&
spcm->stream[substream->stream].d0i3_compatible)
runtime->hw.info |= SNDRV_PCM_INFO_RESUME;
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.

2 participants