Skip to content

audio: microwakeword: add TFLM submanifest and microWakeWord DP detector - #11511

Draft
lgirdwood wants to merge 11 commits into
thesofproject:mainfrom
lgirdwood:wov-pr6-microwakeword
Draft

lgirdwood wants to merge 11 commits into
thesofproject:mainfrom
lgirdwood:wov-pr6-microwakeword

Conversation

@lgirdwood

Copy link
Copy Markdown
Member

Split from #11471 (wov-d0i3).

Stacked Draft PR — Prerequisites: Depends on #11504 (wov-pr1-pcan), #11507 (wov-pr4-wov-arbiter), and #11510 (wov-pr5-mfcc-pcan). Currently stacked on wov-pr1-pcan + wov-pr5-mfcc-pcan + wov-pr4-wov-arbiter (11 commits ahead of main: 7 prerequisite commits + 4 MWW/TFLM commits 275d756c3..888f4e570). Will be rebased onto main once the prerequisite PRs are merged.

Summary

  • Add TFLM submanifest (submanifests/tflm.yml) and C++/LLEXT toolchain support (src/lib/cpp_new_export.cpp, scripts/mww_shim_flatten.py).
  • Add built-in keyword models (banana, hey_jarvis, hi_intel, orange, strawberry) and IPC4 tools/ctl/ipc4/mww/ control blobs.
  • Add microWakeWord DP keyword detector module (src/audio/microwakeword/, CONFIG_COMP_MWW).
  • Add model training and mtrace tuning scripts under src/audio/microwakeword/tune/.

Testing

  • Compiled PTL firmware (intel_adsp/ace30/ptl) with CONFIG_SOF_STAGING=y, CONFIG_CPP=y, CONFIG_STD_CPP17=y, CONFIG_COMP_MWW=y, CONFIG_COMP_MFCC=y, CONFIG_COMP_WOV_ARBITER=y, and CONFIG_MATH_PCAN=y, and verified scripts/check_kernel_includes.py --strict.

singalsu and others added 11 commits November 21, 2026 13:49
Add fixed-point Per-Channel AGC Normalization (PCAN) math library under
src/math/pcan/ with Octave reference scripts and a Zephyr ztest unit
test suite. Extend mel_filterbank_32.c and auditory.h for 32-bit Mel
output scaling needed by PCAN.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Unset GTK_PATH in scripts/host-testbench.sh to avoid snap or desktop
Octave library conflicts when generating or verifying reference vectors.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Extend the MFCC component with selectable output data types at setup,
including 8-bit PCAN normalization and 8-bit soft AGC (AGC8) Mel
spectrum output modes used by microWakeWord topologies.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Add NOTIFIER_ID_WOV_DETECT, NOTIFIER_ID_WOV_CTRL, and
NOTIFIER_ID_D0IX_STATE notifier IDs along with the D0iX state payload
and WOV arbiter notifier/control ABI header. Dispatch
NOTIFIER_ID_D0IX_STATE from ipc4_module_process_d0ix() so components
such as microWakeWord can switch to low-power D0i3 operation.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…le rates

Support multiple downstream WOV detector pipelines sharing a single KPB
history buffer:
- Support multi-sink topology binding, dynamic sample rates, and
  synchronous IPC4 reset.
- Fix drain boundary copy, cross-core drain request coherency, and buffer
  parameter configuration races.
- Continue history buffering when a selector sink is full, and disable
  synchronous draining mode blocking.
- Increase KPB_MAX_NO_OF_CLIENTS default to 4 and KPB_MAX_BUFF_TIME to
  6000 ms on ACE 3.0+.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Co-authored-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Add the WOV arbiter component (CONFIG_COMP_WOV_ARBITER) to arbitrate
between multiple concurrent keyword detector slots sharing a single host
WoV capture PCM:
- First-wins slot arbitration on NOTIFIER_ID_WOV_DETECT, broadcasting
  NOTIFIER_ID_WOV_CTRL pause/resume to sibling detectors.
- Rate-limited PHRASE_DETECTED host notifications (sent once per
  detection) and active slot reset without requiring pipeline teardown.
- Support mixed 16/32-bit sample widths, single active WoV PCM gating, and
  call-state gate control.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Co-authored-by: Naveen Manohar <naveen.m@intel.com>
Signed-off-by: Naveen Manohar <naveen.m@intel.com>
Co-authored-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Co-authored-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Extend the detect_test sample component to support multi-slot WOV
operation alongside wov_arbiter (slot ID configuration, DP thread
batching, and WOV_CTRL pause/resume handling).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Co-authored-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
…port

Add submanifests/tflm.yml to track tflite-micro, flatbuffers,
nnlib-hifi4, gemmlowp, and ruy via west (replacing
scripts/tensorflow-clone.sh). Add C++ operator new/delete LLEXT exports,
scripts/mww_shim_flatten.py, Xtensa longcalls/text-section-literals, and
LLEXT C++ linker discovery.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add versioned built-in TFLite Micro keyword model headers and matching
IPC4 large-config control blobs for banana, hey_jarvis, hi_intel,
orange, and strawberry.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Co-authored-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the TensorFlow Lite Micro microWakeWord (CONFIG_COMP_MWW) DP
keyword spotting module:
- Integrates multi-slot MWW with 10 ms DP period, 2 Hz scoring kcontrols,
  D0i3 low-power listening via NOTIFIER_ID_D0IX_STATE, VAD speech gating,
  and versioned ABI model blob loading.
- Uses static storage for the op resolver/interpreter and optional HiFi4
  nnlib acceleration under xt-clang.
- Coordinates with wov_arbiter and KPB for multi-slot detection and
  pre-roll draining.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Co-authored-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Co-authored-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Add dataset generation, Piper TTS synthesis, PCAN/MFCC training, model
verification, and mtrace feature plotting utilities under
src/audio/microwakeword/tune/.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Co-authored-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Code Review Summary (MWW / TFLM Commits 4d1f01b217..b022552994)

Focused this review on the 4 MWW/TFLM commits specific to #11511 (4d1f01b217..b022552994), skipping the 7 stacked prerequisite commits from #11504 / #11507 / #11510.

(CI note on stacked base: manifest-check, Zephyr Unit Tests (ZTest), doxygen including strict WARN_AS_ERROR=FAIL_ON_WARNINGS, and kernel-includes all pass here; the failing IPC3 / i.MX / LP64-WIP CI jobs all stem from src/audio/kpb.c:1076 redeclaration of 'sink' under IPC3 and %u vs %zu on LP64 in prerequisite commit 40695efaa8 / #11507.)

Blocking — Build, LLEXT & Global Toolchain Issues

  1. CONFIG_COMP_MWW=m LLEXT build broken (src/audio/microwakeword/llext/CMakeLists.txt:156-158): References three deleted .cc model files (../mww_model_data.cc, ../mww_model_data_hi_intel.cc, ../mww_model_data_orange.cc), breaking CMake configuration whenever CONFIG_COMP_MWW=m or LLEXT_FORCE_ALL_MODULAR is enabled.
  2. Unconditional -mlongcalls / -mtext-section-literals on all Xtensa builds (zephyr/CMakeLists.txt:681-684): Applied under if (CONFIG_XTENSA) even when CONFIG_COMP_MWW=n, changing call codegen, .text literal-pool placement, and icache footprint across every Xtensa platform image.
  3. src/lib/cpp_new_export.cpp portability & runtime safety: Hardcodes 32-bit Itanium mangling (_Znwj / _ZdlPvj, breaking 64-bit LP64 _Znwm / _ZdlPvm and missing unsized _ZdlPv), calls raw libc malloc() (returns NULL when CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=0, causing null-deref UB under -fno-exceptions), spins in while (1) {} instead of sof_panic(), and builds under if(CONFIG_CPP) even when CONFIG_LLEXT=n.

Runtime Bugs, Concurrency & Memory/IPC Safety

  1. LL-vs-DP race & LL latency in on_wov_ctrl() (mww.c:265-272): Synchronous notifier_event() callback sets cd->paused = false and calls MWW_Reset(&cd->mwc) (resource_variables->ResetAll()) from LL/IPC context concurrently with the preemptible DP thread running MicroInterpreter::Invoke().
  2. Stack buffer overflow in mww_log_summary_at_shutdown() (mww.c:406-419): Unclamped len += snprintk(summary_buf + len, sizeof(summary_buf) - len, ...) underflows sizeof(summary_buf) - len if 6 operator tags exceed 256 bytes.
  3. Out-of-bounds read/write in mww_get_config() (mww.c:1068-1096) & missing num_of_sources check in mww_process() (mww.c:704-715).
  4. Runtime sof-ctl model updates ignored after first prepare (mww.c:612): mww_prepare() checks if (!cd->initialized) without comp_is_new_data_blob_available(cd->model_handler), while mww_reset() leaves cd->initialized = true.
  5. mww_model.cc hardening: Silent slot aliasing (slot >= kMaxSlots -> slot = 0 clobbers Slot 0), unverified FlatBuffer offsets (flatbuffers::Verifier), missing inst->input->type == kTfLiteInt8 check & leaked placement-new destructors on error in MWW_InitOps(), and .init_array constructor on g_instances.

Kconfig, Docs & Commit Hygiene

  1. Dead CONFIG_COMP_MWW_MODEL_FROM_CONTROL & unguarded Xtensa asm in CONFIG_COMP_MWW_PROFILE (src/audio/microwakeword/Kconfig:34-49).
  2. Local workstation file:///home/lrg/... URLs, stale mww_instance snippet, and broken cross-PR doc link in src/audio/microwakeword/README.md, plus src/lib/README.md tier sync and Commit 4d1f01b217 subject prefix (submanifests, build: -> build: or submanifests:).

Comment on lines +155 to +160
${TFLM_PATH}/tensorflow/lite/micro/micro_interpreter.cc
../mww_model_data.cc
../mww_model_data_hi_intel.cc
../mww_model_data_orange.cc
../mww_model.cc
)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Blocking (CONFIG_COMP_MWW=m / LLEXT_FORCE_ALL_MODULAR build failure): mww_model_data*.cc were replaced by mww_model_data_*.h headers #included directly in mww_model.cc (matching src/audio/microwakeword/CMakeLists.txt:175). Leaving these three .cc paths here causes CMake configuration to fail when building MWW as an LLEXT:

Suggested change
${TFLM_PATH}/tensorflow/lite/micro/micro_interpreter.cc
../mww_model_data.cc
../mww_model_data_hi_intel.cc
../mww_model_data_orange.cc
../mww_model.cc
)
${TFLM_PATH}/tensorflow/lite/micro/micro_interpreter.cc
../mww_model.cc
)

Comment thread zephyr/CMakeLists.txt
Comment on lines +681 to +684
if (CONFIG_XTENSA)
target_compile_options(SOF INTERFACE -mlongcalls)
zephyr_compile_options(-mtext-section-literals)
endif()

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Architecture / global codegen impact: Enabling -mlongcalls and -mtext-section-literals unconditionally under if (CONFIG_XTENSA) alters call sequences (l32r + callx8 vs call8), .text literal placement, and icache footprint across every Xtensa platform build (tgl, mtl, lnl, ptl, wcl, nvl, imx8, imx8m, etc.) even when CONFIG_COMP_MWW=n. Gate this on if (CONFIG_XTENSA AND CONFIG_COMP_MWW) (or a dedicated Kconfig symbol selected only by large C++/TFLM builds):

Suggested change
if (CONFIG_XTENSA)
target_compile_options(SOF INTERFACE -mlongcalls)
zephyr_compile_options(-mtext-section-literals)
endif()
if (CONFIG_XTENSA AND CONFIG_COMP_MWW)
target_compile_options(SOF INTERFACE -mlongcalls)
zephyr_compile_options(-mtext-section-literals)
endif()

Comment on lines +22 to +62
[[maybe_unused]] void *sof_operator_new(size_t size)
{
return malloc(size);
}

[[maybe_unused]] void sof_operator_delete(void *ptr, size_t size)
{
(void)size;
free(ptr);
}

/*
* Same problem as operator new/delete above, one level lower: an abstract
* class's vtable (e.g. TFLM's MicroOpResolver base) fills the slots for its
* pure virtual methods with the address of __cxa_pure_virtual, so any
* translation unit that references such a vtable needs this symbol
* resolvable even though it should never actually be called at runtime.
* zephyr/lib/cpp/minimal/cpp_virtual.c already defines a real
* __cxa_pure_virtual, but -- exactly like cpp_new.cpp above -- nothing in
* the base image build references it directly, so it is never pulled into
* the link or exported for LLEXT modules to resolve against. Provide our
* own and export it under the same name.
*/
[[maybe_unused]] void sof_cxa_pure_virtual(void)
{
while (1) {
}
}

} /* namespace */

extern "C" [[maybe_unused]] void __assert_no_args(void)
{
while (1) {
}
}

EXPORT_SYMBOL_NAMED(sof_operator_new, _Znwj);
EXPORT_SYMBOL_NAMED(sof_operator_delete, _ZdlPvj);
EXPORT_SYMBOL_NAMED(sof_cxa_pure_virtual, __cxa_pure_virtual);
EXPORT_SYMBOL(__assert_no_args);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Portability & runtime safety issues:

  1. LP64 / size_t mangling mismatch: _Znwj / _ZdlPvj hardcode 32-bit unsigned int size_t. On 64-bit targets (imx93_a55, 64-bit native_sim) or toolchains where size_t is unsigned long, C++ mangles operator new(size_t) / operator delete(void*, size_t) to _Znwm / _ZdlPvm — and unsized operator delete(void*) (_ZdlPv) is not exported.
  2. malloc() under Zephyr minimal libc + -fno-exceptions: When CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=0, malloc() returns NULL (or fails to link), and under -fno-exceptions returning nullptr from non-nothrow operator new causes immediate null-deref UB in C++ constructors. Route through SOF's heap (rballoc / sof_heap_alloc) — or sof_panic(SOF_IPC_PANIC_MEM) if this is strictly an unreachable linker stub — and call sof_panic(SOF_IPC_PANIC_EXCEPTION) / k_oops() instead of while (1) {} in sof_cxa_pure_virtual() and __assert_no_args().
  3. Build gating & doc sync: Gate add_local_sources(sof cpp_new_export.cpp) in src/lib/CMakeLists.txt:13 on if(CONFIG_CPP AND CONFIG_LLEXT) and mention cpp_new_export.cpp in src/lib/README.md.

Comment on lines +265 to +272
} else if (n->cmd == WOV_ARB_CMD_RESUME) {
comp_info(dev, "mww slot %u: resumed by arbiter", cd->wov_slot_id);
cd->paused = false;
cd->vad_active_hops = 0;
memset(cd->prob_hist, 0, sizeof(cd->prob_hist));
MWW_Reset(&cd->mwc);
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Concurrency bug & LL-context hazard: on_wov_ctrl() is invoked synchronously via notifier_event() from wov_arbiter (which runs in LL 1 ms context or IPC context), whereas mww_process() runs in its own preemptible DP thread:

  • Clearing cd->paused = false before MWW_Reset(&cd->mwc) — and calling MWW_Reset() (resource_variables->ResetAll()) directly from on_wov_ctrl() — races with an in-flight MicroInterpreter::Invoke() in the DP thread and zeroes tensor-arena ring buffers inside the 1 ms LL tick.
  • Instead, set an atomic pending_reset flag here (before clearing paused) and execute MWW_Reset() + prob_hist / vad_active_hops reset at the top of mww_process() on the DP thread.

Comment on lines +406 to +419
for (i = 0; (k = MWW_ProfileGet(&cd->mwc, i, &tag, &avg)) > 0; i++) {
n = k;
total += avg;
if (!len)
len = snprintk(summary_buf, sizeof(summary_buf),
"[MWW PROFILE Slot %u]", cd->wov_slot_id);
len += snprintk(summary_buf + len, sizeof(summary_buf) - len,
" %d:%s=%u", i, tag, avg);
if ((i % 6) == 5) {
if (dev)
comp_info(dev, "%s", summary_buf);
len = 0;
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Stack buffer overflow (CONFIG_COMP_MWW_PROFILE=y): snprintk() returns the number of characters that would have been formatted (not clamped to the remaining buffer size). If 6 operator names/counts exceed sizeof(summary_buf) (256), len becomes >= sizeof(summary_buf) and sizeof(summary_buf) - len underflows size_t to a huge value on the next iteration, writing past the end of summary_buf. Clamp or flush before len reaches sizeof(summary_buf).

Comment on lines +141 to +151
mww_instance() :
slot_id(0), arena(nullptr), arena_size(kArenaSize),
model(nullptr), input(nullptr), output(nullptr),
interpreter(nullptr), allocator(nullptr),
resource_variables(nullptr), op_resolver(nullptr)
{
}
};

static struct mww_instance g_instances[kMaxSlots];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

LLEXT / C++ static init: A user-provided non-constexpr constructor on static struct mww_instance g_instances[kMaxSlots] forces a .init_array runtime initializer (_GLOBAL__sub_I_mww_model.cc). Using inline default member initializers (uint8_t slot_id = 0; ... size_t arena_size = kArenaSize;) with constexpr mww_instance() = default; keeps g_instances constant-initialized in .data/.bss with zero .init_array dependency.

Comment on lines +220 to +238
uint8_t slot = mwc->slot_id;
if (slot >= kMaxSlots)
slot = 0;

struct mww_instance *inst = &g_instances[slot];
inst->slot_id = slot;
mwc->instance = inst;

if (!model_tflite || model_size == 0) {
mwc->error = "no model provided";
return -EINVAL;
}

inst->model = tflite::GetModel(model_tflite);
if (inst->model->version() != TFLITE_SCHEMA_VERSION) {
mwc->error = "failed to load model (schema mismatch)";
return -EINVAL;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Slot collision & FlatBuffer verification:

  1. if (slot >= kMaxSlots) slot = 0; silently aliases out-of-range slots onto g_instances[0] / g_arenas[0], clobbering an active Slot 0 interpreter. Return -EINVAL when slot >= kMaxSlots, and guard against two live module instances claiming the same slot.
  2. model_size is unused after the == 0 check, and mww_parse_model() accepts bare "TFL3" blobs without a header/CRC (mww.c:545). Run flatbuffers::Verifier verifier(model_tflite, model_size); if (!tflite::VerifyModelBuffer(verifier)) return -EINVAL; before tflite::GetModel() so malformed control blobs cannot read out of bounds.

Comment on lines +310 to +340
inst->input = inst->interpreter->input(0);
if (!inst->input) {
mwc->error = "input interpreter NULL";
return -EINVAL;
}

int in_elems = 1;
for (int i = 0; i < inst->input->dims->size; i++)
in_elems *= inst->input->dims->data[i];
if (kFeatureElementCount != in_elems) {
mwc->error = "input interpreter shape incompatible";
return -EINVAL;
}

inst->output = inst->interpreter->output(0);
if (!inst->output) {
mwc->error = "output interpreter NULL";
return -EINVAL;
}

if (inst->output->type != kTfLiteInt8 && inst->output->type != kTfLiteUInt8) {
mwc->error = "output tensor type != int8/uint8";
return -EINVAL;
}

/* LOGISTIC output scale is fixed to 1/256, so raw - zero_point is Q0.8 */
if (inst->output->params.zero_point != (inst->output->type == kTfLiteInt8 ? -128 : 0)) {
mwc->error = "output tensor is not a logistic probability";
return -EINVAL;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Missing input type check & leaked placement-new destructors on error:

  1. MWW_InitOps() validates inst->output->type (kTfLiteInt8 / kTfLiteUInt8) but never checks inst->input->type == kTfLiteInt8 (or inst->input->bytes == kFeatureElementCount), whereas MWW_ProcessClassify() unconditionally writes via tflite::GetTensorData<int8_t>(inst->input). Also guard in_elems *= inst->input->dims->data[i] against negative/overflowing dims.
  2. On all error returns in lines 313–339, inst->interpreter->~MicroInterpreter() and inst->op_resolver->~MwwOpResolver() are not called and inst->interpreter / inst->op_resolver remain non-null.

Comment on lines +34 to +49
config COMP_MWW_PROFILE
bool "Per-operator inference cycle profiling"
default n
help
Measure CCOUNT cycles spent in each TFLM operator of the MWW
model and log the per-inference averages in the stream shutdown
summary. Only effective for the static (non-LLEXT) build.

config COMP_MWW_MODEL_FROM_CONTROL
bool "Load MWW model from bytes control instead of built-in header"
default n
help
When enabled, the MWW wake-word model is loaded from a runtime
or topology configuration data blob via binary kcontrol (bytes control)
instead of using the static mww_model_data embedded in the firmware image.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Two Kconfig issues:

  1. COMP_MWW_PROFILE (line 34) has no depends on XTENSA, while mww_ccount() (mww_model.cc:55) executes raw Xtensa rsr.ccount inline assembly — either add depends on XTENSA here or use portable k_cycle_get_32() in mww_model.cc.
  2. COMP_MWW_MODEL_FROM_CONTROL (line 42) is never referenced anywhere in C/C++ or CMake, so enabling it still compiles all built-in mww_model_data_*.h arrays (~150 KB) into the image instead of omitting them.

Comment on lines +113 to +141
| Target Platform | Manifest File | Output Topology Binary | DMIC Driver Version |
|---|---|---|---|
| **Panther Lake (PTL / ACE 3.0)** | [`dmic-wov-multi-ptl-4ch-manifest.conf`](file:///home/lrg/work/sof-tgl/sof-wov/tools/topology/topology2/dmic-wov-multi-ptl-4ch-manifest.conf) | `sof-ptl-dmic-wov-multi-4ch.tplg` | 5 |
| **Tiger Lake (TGL / CAVS 2.5)** | [`dmic-wov-multi-4ch-manifest.conf`](file:///home/lrg/work/sof-tgl/sof-wov/tools/topology/topology2/dmic-wov-multi-4ch-manifest.conf) | `sof-tgl-dmic-wov-multi-4ch.tplg` | 1 |
| **Wildcat Lake (WCL / ACE 3.0)** | symlink to the PTL topology | `sof-wcl-dmic-wov-multi-4ch.tplg` | 5 |

---

## Multi-Instance Design & Memory Management

### 1. Single Codebase, Three Isolated Instances
Previous implementations relied on global static variables, limiting execution to one model. The updated `mww_model.cc` introduces explicit instance tracking:

```cpp
constexpr int kMaxSlots = 3;

struct mww_instance {
const tflite::Model* model = nullptr;
tflite::MicroInterpreter* interpreter = nullptr;
TfLiteTensor* input = nullptr;
TfLiteTensor* output = nullptr;
float input_scale = 0.0f;
int32_t input_zero_point = 0;
bool initialized = false;
};

static struct mww_instance g_instances[kMaxSlots];
```

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Doc cleanup:

  • Lines 115–116 contain hardcoded workstation file:///home/lrg/work/sof-tgl/sof-wov/... links — replace with relative repo paths (or plain code spans until #11508 lands).
  • Lines 129–138 show an outdated struct mww_instance definition (input_scale, input_zero_point, initialized) that no longer matches mww_model.cc:129-148.
  • Line 204 below links to ../../../doc/developer_guides/wov_ecns_integration_guide.md, which is in #11509 rather than this PR.

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.

3 participants