Skip to content

WIP: ASoC: SDCA: Initial SmartMic wake-on-voice support - #6039

Draft
rfvirgil wants to merge 1 commit into
thesofproject:topic/sof-devfrom
CirrusLogic:topic/sdca-wov-prototype
Draft

rfvirgil wants to merge 1 commit into
thesofproject:topic/sof-devfrom
CirrusLogic:topic/sdca-wov-prototype

Conversation

@rfvirgil

Copy link
Copy Markdown

Add state machine control for SmartMic voice trigger and an ALSA compressed stream to report the trigger event.

This is initial support with the following limitations:

  • The compressed stream is currently a dummy implementation. It will report data available when there is a trigger event but the returned data is only a buffer of '.' characters. The plumbing into a SoundWire data stream is still to-do.

  • The voice trigger functionality is expected to be provided by the "SMPU 16" and "MFPU 16" entities, and a streaming output terminal connected directly to SMPU 16.

  • Detection is one-shot; stop and restart the stream to arm it again. Continuous triggers and concurrect triggers are not supported.

  • Only required MFPU algorithms are managed, and they must already be prepared and ready before arming.

Add state machine control for SmartMic voice trigger and an ALSA
compressed stream to report the trigger event.

This is initial support with the following limitations:

- The compressed stream is currently a dummy implementation. It will
  report data available when there is a trigger event but the returned
  data is only a buffer of '.' characters. The plumbing into a SoundWire
  data stream is still to-do.

- The voice trigger functionality is expected to be provided by the
  "SMPU 16" and "MFPU 16" entities, and a streaming output terminal
  connected directly to SMPU 16.

- Detection is one-shot; stop and restart the stream to arm it again.
  Continuous triggers and concurrect triggers are not supported.

- Only required MFPU algorithms are managed, and they must already be
  prepared and ready before arming.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>

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.

🟡 Changes recommended

A close-path race with IRQ notification can cause a NULL dereference, while fragment-parameter validation and START/probe failure cleanup also remain incomplete.

4 open issues
What changed in this PR

Introduces initial SDCA SmartMic wake-on-voice support in ASoC, reporting one-shot trigger events through an ALSA compressed capture stream. Capture data remains a placeholder; SoundWire audio transport is not yet implemented.

Changes:

  • Add voice/speech trigger handling, readiness checks, and MFPU algorithm control.
  • Parse behavior sets and bit mappings to identify supported triggers and algorithms.
  • Integrate compressed capture interfaces, audio power routes, interrupt cleanup, and build dependencies.
File Description
sound/​soc/​sdca/​sdca_wov.c Implements trigger control and dummy compressed capture.
sound/​soc/​sdca/​sdca_interrupts.c Registers and dispatches wake-on-voice interrupts.
sound/​soc/​sdca/​sdca_functions.c Parses behavior sets and readiness metadata; adds bit-mapping helpers.
sound/​soc/​sdca/​sdca_class_function.c Passes interrupt context and defers cleanup until after component removal.
sound/​soc/​sdca/​sdca_asoc.c Adds wake-on-voice capture interfaces and power routes.
sound/​soc/​sdca/​Makefile Builds wake-on-voice support with SDCA interrupts.
sound/​soc/​sdca/​Kconfig Selects ASoC compressed-stream support.
include/​sound/​sdca_wov.h Declares wake-on-voice APIs, constants, and disabled-feature stubs.
include/​sound/​sdca_function.h Defines behavior-set, bit-mapping, and readiness data structures.
include/​sound/​sdca_asoc.h Extends component initialization to accept interrupt context.

Review effort: Balanced

Comment thread sound/soc/sdca/sdca_wov.c
Comment on lines +788 to +794
struct sdca_wov_state *state = stream->runtime->private_data;

state->stream = NULL;
stream->runtime->private_data = NULL;

/* Cancel the outstanding arm before ASoC can power down the stream's DAPM path. */
return sdca_wov_cancel_voice_trigger(state->interrupt);
*/
ret = devm_add_action_or_reset(dev, class_function_irq_cleanup_late, drv);
if (ret)
return ret;
Comment thread sound/soc/sdca/sdca_wov.c
dev_err(interrupt->dev,
"wov: %s: failed to drain trigger status before arming: %d\n",
interrupt->entity->label, ret);
return ret;
Comment thread sound/soc/sdca/sdca_wov.c
Comment on lines +890 to +893
static const struct snd_compress_ops sdca_wov_compress_ops = {
.open = sdca_wov_compr_open,
.free = sdca_wov_compr_free,
.trigger = sdca_wov_compr_trigger,
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