Skip to content

Handle WoV phrase detection notification and kcontrols - #5903

Open
naveen-manohar wants to merge 2 commits into
thesofproject:topic/sof-devfrom
naveen-manohar:ww356_wov-kcontrol
Open

Handle WoV phrase detection notification and kcontrols#5903
naveen-manohar wants to merge 2 commits into
thesofproject:topic/sof-devfrom
naveen-manohar:ww356_wov-kcontrol

Conversation

@naveen-manohar

@naveen-manohar naveen-manohar commented Aug 29, 2026

Copy link
Copy Markdown

Add SOF_IPC4_NOTIFY_PHRASE_DETECTED notification handler for WoV.
When DSP FW reports keyword detection, unblock the WoV capture stream
via snd_pcm_period_elapsed()
Notify topology-defined kcontrols ('wov_trigger_id', 'wov_event') for userspace polling.

V2: snd_pcm_period_elapsed -> snd_sof_pcm_period_elapsed, word_id bit correction

@lgirdwood

Copy link
Copy Markdown
Member

@jsarha pls review - it may be that your IPC4 wov wakeup PR overlaps here.

@jsarha jsarha left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think it would be best to use snd_sof_pcm_period_elapsed(), but other than that I do not see anything alarming here. Of course the final judge is, does it work?

Comment thread sound/soc/sof/ipc4-wov.c Outdated
Copilot AI lite review requested due to automatic review settings September 1, 2026 04:08
@naveen-manohar

Copy link
Copy Markdown
Author

I think it would be best to use snd_sof_pcm_period_elapsed(), but other than that I do not see anything alarming here. Of course the final judge is, does it work?

Done !!
Thanks

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.

Pull request overview

Adds IPC4 Wake-on-Voice (WoV) phrase detection handling to the SOF driver so firmware keyword events can wake the system, notify user-space via kcontrol events, and unblock the WoV capture stream.

Changes:

  • Add a new IPC4 notification handler for SOF_IPC4_NOTIFY_PHRASE_DETECTED.
  • Introduce IPC4 WoV helper implementation to notify topology-defined kcontrols and trigger capture progress.
  • Hook the new code into the SOF IPC4 build and notification dispatch path.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
sound/soc/sof/Makefile Adds ipc4-wov.o to the IPC4 build.
sound/soc/sof/ipc4.c Dispatches PHRASE_DETECTED notifications to the WoV handler.
sound/soc/sof/ipc4-wov.h Declares the WoV phrase-detected handler API.
sound/soc/sof/ipc4-wov.c Implements kcontrol notifications and capture unblocking on phrase detection.

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

Comment thread sound/soc/sof/ipc4-wov.c
Comment on lines +13 to +17
/* IPC4 PHRASE_DETECTED primary/extension field layout */
#define SOF_IPC4_PHRASE_WORD_ID_MASK GENMASK(31, 24)
#define SOF_IPC4_PHRASE_WORD_ID_SHIFT 24
#define SOF_IPC4_PHRASE_SV_SCORE_MASK GENMASK(15, 0)

Comment thread sound/soc/sof/ipc4-wov.c
Comment on lines +89 to +92
list_for_each_entry(spcm, &sdev->pcm_list, list) {
if (spcm->pcm.pcm_id != SOF_WOV_PCM_ID)
continue;

Add SOF_IPC4_NOTIFY_PHRASE_DETECTED notification handler,
sent by DSP FW when a keyword is detected by WoV pipeline.

Handler parses PCM list to find WoV capture PCM pcm_id 11,
calls snd_sof_pcm_period_elapsed() to unblock waiting capture
stream.

Signed-off-by: Naveen Manohar <naveen.m@intel.com>
When DSP reports keyword detection, notify topology-defined
WoV kcontrols so that user space can poll for value changes.

Checked for 2 kcontrols in loaded topology:
- 'wov_trigger_id': RO enum reporting winner slot(0/1/2)
- 'wov_event': control that user space polls via POLLPRI

Signed-off-by: Naveen Manohar <naveen.m@intel.com>
Copilot AI review requested due to automatic review settings September 1, 2026 04:43

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Suppressed comments (1)

sound/soc/sof/ipc4-wov.c:105

  • The "PCM not found" warning can become noisy if firmware reports phrase detections while the WoV topology/PCM isn't present. Consider making this warning ratelimited to avoid log spam.
	dev_warn(sdev->dev, "WoV: PHRASE_DETECTED but PCM %d not found\n",
		 SOF_WOV_PCM_ID);

Comment thread sound/soc/sof/ipc4-wov.c
Comment on lines +18 to +20
/* PCM ID for WoV keyword detection capture stream */
#define SOF_WOV_PCM_ID 11

Comment thread sound/soc/sof/ipc4-wov.c
Comment on lines +94 to +98
if (!substream || !substream->runtime) {
dev_warn(sdev->dev, "WoV: PCM %d not open\n",
SOF_WOV_PCM_ID);
return;
}
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.

4 participants