Skip to content

audio: iadk: implement KPB service - #11307

Draft
serhiy-katsyuba-intel wants to merge 3 commits into
thesofproject:mainfrom
serhiy-katsyuba-intel:kpb_iface
Draft

serhiy-katsyuba-intel wants to merge 3 commits into
thesofproject:mainfrom
serhiy-katsyuba-intel:kpb_iface

Conversation

@serhiy-katsyuba-intel

Copy link
Copy Markdown
Contributor

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

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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
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.

Comment on lines +26 to +29
AdspErrorCode error = kpb_service_register_client(
current_history_depth,
max_history_depth,
output_pin, &client);
Comment on lines +47 to +48
notifier_event(client, NOTIFIER_ID_KPB_CLIENT_EVT, NOTIFIER_TARGET_CORE_ALL_MASK,
&client->event, sizeof(client->event));
Comment on lines +47 to +48
notifier_event(client, NOTIFIER_ID_KPB_CLIENT_EVT, NOTIFIER_TARGET_CORE_ALL_MASK,
&client->event, sizeof(client->event));
{
class ModuleHandle;

struct KpbToken;
Comment on lines +57 to +59
if (!client || output_pin >= KPB_MAX_NO_OF_CLIENTS ||
current_history_depth > UINT32_MAX || max_history_depth > UINT32_MAX)
return ADSP_INVALID_PARAMETERS;
Comment on lines +74 to +77
kpb_service_send_event(new_client, KPB_EVENT_REGISTER_CLIENT);

*client = new_client;
return ADSP_NO_ERROR;
@serhiy-katsyuba-intel
serhiy-katsyuba-intel marked this pull request as draft October 14, 2026 12:43

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just minor questions. We can come back and use native zephyr messaging once we have working wov 1/2 merged if needed.

Comment thread src/audio/kpb.c

#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);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we doxygen all structs, types, classes etc ?

@intel-sofci

Copy link
Copy Markdown

PR 11307: test results

Run date: 2026-10-14 13:39 UTC

Tested commit: cfbccb819609729971976755fa1f818ff4c6ab43

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

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