Repository navigation
audio: iadk: implement KPB service - #11307
serhiy-katsyuba-intel wants to merge 3 commits into
Conversation
Declare KpbInterface and KpbInterfaceV2 for the KPB service so that IADK modules can use the SOF KPB module. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com> Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Add an independent KPB notifier option and use it to guard the notifier API. This allows notifier and AMS transport support to be enabled separately or together. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Implement the KPB service, which provides KpbInterface and KpbInterfaceV2 interfaces so that IADK modules can use the SOF KPB module. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com> Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
There was a problem hiding this comment.
🟡 Changes recommended
The public token is incomplete, and the userspace bridge directly invokes an asynchronous kernel notifier without a validated boundary or reliable registration result.
6 open findings
Scope registrations and events to the target KPB instance · New Prevent reuse of in-flight cross-core notifier payloads · New Route notifier_event through a validated userspace syscall · New Expose complete KpbToken type in the public header · New Validate history depth against supported KPB limits · New Report registration success only after KPB acknowledgment · New
What changed in this PR
Adds IADK KPB service interfaces and connects them to SOF’s KPB component.
Changes:
- Implements KPB v1/v2 interfaces and client operations.
- Exposes interfaces through the native system service.
- Adds notifier transport, unregister handling, and build configuration.
| File | Description |
|---|---|
src/include/sof/audio/module_adapter/library/native_system_service.h |
Declares KPB interface providers. |
src/include/sof/audio/module_adapter/library/kpb_service.h |
Defines the C bridge API. |
src/include/sof/audio/module_adapter/iadk/kpb_interface.h |
Defines IADK KPB interfaces. |
src/audio/module_adapter/library/native_system_service.c |
Resolves versioned KPB interfaces. |
src/audio/module_adapter/library/kpb_service.cpp |
Implements C++ interface adapters. |
src/audio/module_adapter/library/kpb_service_bridge.c |
Bridges clients to KPB notifications. |
src/audio/module_adapter/Kconfig |
Enables notifier support for Intel modules. |
src/audio/module_adapter/CMakeLists.txt |
Builds KPB service sources. |
src/audio/kpb.c |
Generalizes notifier handling and unregisters clients. |
src/audio/Kconfig |
Adds the KPB notifier option. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| AdspErrorCode error = kpb_service_register_client( | ||
| current_history_depth, | ||
| max_history_depth, | ||
| output_pin, &client); |
| notifier_event(client, NOTIFIER_ID_KPB_CLIENT_EVT, NOTIFIER_TARGET_CORE_ALL_MASK, | ||
| &client->event, sizeof(client->event)); |
| notifier_event(client, NOTIFIER_ID_KPB_CLIENT_EVT, NOTIFIER_TARGET_CORE_ALL_MASK, | ||
| &client->event, sizeof(client->event)); |
| { | ||
| class ModuleHandle; | ||
|
|
||
| struct KpbToken; |
| if (!client || output_pin >= KPB_MAX_NO_OF_CLIENTS || | ||
| current_history_depth > UINT32_MAX || max_history_depth > UINT32_MAX) | ||
| return ADSP_INVALID_PARAMETERS; |
| kpb_service_send_event(new_client, KPB_EVENT_REGISTER_CLIENT); | ||
|
|
||
| *client = new_client; | ||
| return ADSP_NO_ERROR; |
lgirdwood
left a comment
There was a problem hiding this comment.
LGTM, just minor questions. We can come back and use native zephyr messaging once we have working wov 1/2 merged if needed.
|
|
||
| #if CONFIG_KPB_NOTIFIER | ||
| /* Register KPB for notification *on the current core* */ | ||
| ret = notifier_register(dev, NULL, NOTIFIER_ID_KPB_CLIENT_EVT, kpb_event_handler); |
There was a problem hiding this comment.
This is going away for a more Zephyr native approach, we can probably catch this as we update WOV. Btw commit message says AMS ?
| namespace intel_adsp | ||
| { | ||
|
|
||
| struct KpbToken { |
There was a problem hiding this comment.
Can we doxygen all structs, types, classes etc ?
PR 11307: test resultsRun date: 2026-10-14 13:39 UTC Tested commit: cfbccb819609729971976755fa1f818ff4c6ab43 |


Implement the KPB service, which provides KpbInterface and KpbInterfaceV2 interfaces so that IADK modules can use the SOF KPB module.