Skip to content

audio: iadk: implement KPB service - #11307

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

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.

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 thread src/audio/module_adapter/iadk/kpb_service.cpp
Comment thread src/audio/module_adapter/library/kpb_service_bridge.c
Comment thread src/audio/module_adapter/library/kpb_service_bridge.c
Comment thread src/include/sof/audio/module_adapter/iadk/kpb_interface.h
Comment thread src/audio/module_adapter/library/kpb_service_bridge.c Outdated
Comment thread src/audio/module_adapter/library/kpb_service_bridge.c
@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
Comment thread src/audio/module_adapter/iadk/kpb_service.cpp
@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

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/CLI_Q transport support to be enabled
separately or together.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Comment thread src/audio/module_adapter/library/kpb_service_bridge.c Outdated
@softwarecki

Copy link
Copy Markdown
Collaborator

I think there is some terminology being mixed up here.

The System Service is intended for IADK modules and exposes a C++ interface. The native System Service variant was introduced for LMDK modules. It is reasonable for the IADK interface to internally call native functions, as both layers have to meet somewhere in the implementation. However, native APIs should not return a C++ classes. Returning a C++ interface from a native function breaks the separation between the native and IADK layers and blurs the original architectural boundary between them.

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>
@serhiy-katsyuba-intel

Copy link
Copy Markdown
Contributor Author

I think there is some terminology being mixed up here.

Fixed in a new push. To my defense those native_xxx() functions were added to IADK system agent long before this PR. Now replaced two of them with new iadk_system_service_get_interface() and iadk_system_service_get_interface_versioned().

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.

6 participants