Conversation
There was a problem hiding this comment.
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
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.
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>
…s0ix Historically the CAPTURE_COMPATIBLE_D0I3 have been added to mark the WoV stream during IPC3 era. For symmetry the PLAYBACK_COMPATIBLE_D0I3 token was added as well. Later IPC4 declared that WoV is not supported and started to use the playback token to mark Deep Buffer streams (host can enter lower power state) and after that using this example a Deep Buffer support for capture was added - again, keeping the WoV unsupported by IPC4. To lift the WoV block for IPC4 and keeping the IPC3 support intact the definition of WoV stream is: a capture stream, CAPTURE_COMPATIBLE_D0I3 is set for the PCM, it is not a Deep Buffer stream. With this rule we can clearly identify the WoV stream and we can tell it apart from Deep Buffer capture. If Deep Buffer will be needed for WoV then we need bigger changes in firmware, topology (new token) and kernel. Co-Developed by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
VoW streams can be identified by: They are capture streams, the d0i3_compatible flag is set and they are not using Deep Buffer. 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>
a55afd6 to
2d0141a
Compare
|
Changes since v1:
|
| * Set the RESUME supported flag for WoV streams. The core will ignore | ||
| * the trigger but applications must not try to restart the WoV stream | ||
| * due to not supported RESUME. | ||
| * WoV streams can be indetified by: |
| * D0I3-compatible streams to keep the firmware pipeline running | ||
| * Set the suspend_ignored flag for D0I3-compatible streams used | ||
| * for WoV to keep the firmware pipeline running. | ||
| * WoV streams can be indetified by: |
|
Testing/updates/comments from Gemini. @ujfalusi some may be needed, tested both with ALSA and tinyalsa, depend on how you plan to upstream. Tested PR #5951 on Intel Panther Lake (PTL / ACE 3.0 DSP) using our Wake-on-Voice test suites (10-run S0 sequence, 10-run S2idle sleep/wake sequence, and audio capture validation suite). The general direction and cleanup of WoV stream definition in PR #5951 is great, but when tested on IPC4 hardware, several pieces are missing to make IPC4 WoV function across system suspend and wake. Issues Identified on IPC4 with PR #5951 Standalone:
Working Reference Branch:I have pushed a working branch rebased directly on With this branch on Panther Lake (PTL):
|
|
For additional context, here is the empirical pass vs fail breakdown from testing PR #5951 standalone on Panther Lake (PTL / ACE 3.0 DSP) before applying the IPC4 enablement delta: What Passed with PR #5951 Standalone:
What Failed with PR #5951 Standalone:
Summary:In S0 (awake), basic capture and initial WoV reads function. However, actual Wake-on-Voice from system sleep ( |

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:
and
then clapping to wake the device up: no errors observed anymore.