Skip to content

iadk: API 4.5.2 support and service fixes - #11299

Open
abonislawski wants to merge 10 commits into
thesofproject:mainfrom
abonislawski:iadk_versioned_system_servic
Open

abonislawski wants to merge 10 commits into
thesofproject:mainfrom
abonislawski:iadk_versioned_system_servic

Conversation

@abonislawski

Copy link
Copy Markdown
Member

Add IADK API 4.5.2 compatibility, versioned system-service lookup, and instance BSS handling. Fix loadable-module initialization, support sinkless modules, and correct notification creation, payload sizing, and target validation.

TsaiGaggery and others added 9 commits October 13, 2026 08:59
Accept IADK module API 4.5.2 in addition to 4.5.0. Extend the
detector and system-agent vtables and append the versioned
system-service lookup slot without changing earlier slots.

This only establishes the 4.5.2 ABI. Services unavailable in the base
firmware return an error and clear the interface pointer.

Signed-off-by: Gaggery Tsai <gaggery.tsai@intel.com>
The current loadable-module entry point calls the system agent with a
null placeholder. Creating the module at that address corrupts memory
before its adapter can register.

Resolve a null placeholder to the instance BSS already allocated by
the library manager. Also propagate factory errors and reject a module
that did not register an adapter.

Signed-off-by: Gaggery Tsai <gaggery.tsai@intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
The system agent called Init() as soon as the module loaded. The module
adapter called it again from framework-owned module_init(). That could
allocate detector state and register services twice.

Remove the early call and keep module_init() as the single owner. Its
return value is propagated through iadk_wrapper_init().

Signed-off-by: Gaggery Tsai <gaggery.tsai@intel.com>
Detector endpoints can consume input without a connected audio sink.
Their process callback was skipped, prepare rejected the graph, and DP
period calculation left the deadline at UINT_MAX.

Allow sink/source modules without a sink, derive their DP period from
the source IBS, and pass at most one IBS to each process call. A
module without a sink still needs at least one connected source.

Signed-off-by: Gaggery Tsai <gaggery.tsai@intel.com>
Add the public IADK interface version values and aliases used by current modules

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Pass the module instance BSS address and size from
the library manager to the IADK system agent.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Initialize the IPC notification envelope and propagate
allocation failures when creating an IADK notification.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Allocate and transmit only the caller-provided payload size
when sending an IADK notification.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Accept host-bound IADK notifications while rejecting
unsupported notification targets.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 07:43

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

Notification payload validation permits writes beyond the allocated IPC transmission buffer.

1 open finding
What changed in this PR

Adds IADK API 4.5.2 compatibility, per-instance BSS support, sinkless processing, and corrected system-service behavior.

Changes:

  • Extends IADK interfaces and preserves API 4.5.0 compatibility.
  • Supports BSS-backed module creation and sinkless detector processing.
  • Improves notification sizing, target validation, and service lookup.
File Description
src/​library_manager/​lib_manager.c Supplies instance BSS and recognizes supported IADK versions.
src/​include/​sof/​audio/​module_adapter/​library/​native_system_service.h Declares versioned service lookup.
src/​include/​sof/​audio/​module_adapter/​library/​native_system_agent.h Adds BSS parameters.
src/​include/​sof/​audio/​module_adapter/​iadk/​system_agent.h Extends the system agent interface.
src/​include/​sof/​audio/​module_adapter/​iadk/​system_agent_interface.h Adds the version-three agent API.
src/​include/​sof/​audio/​module_adapter/​iadk/​processing_module_interface.h Adds detector pattern output support.
src/​include/​sof/​audio/​module_adapter/​iadk/​api_version.h Updates the API version to 4.5.2.
src/​include/​module/​module/​system_service.h Adds service versions and versioned lookup.
src/​include/​module/​iadk/​adsp_error_code.h Adds the unsupported-service-version error.
src/​audio/​module_adapter/​README.md Documents sinkless scheduling.
src/​audio/​module_adapter/​module_adapter.c Enables sinkless preparation and period calculation.
src/​audio/​module_adapter/​library/​native_system_service.c Revises notification and lookup handling.
src/​audio/​module_adapter/​iadk/​system_agent.cpp Implements BSS and newer agent behavior.
src/​audio/​module_adapter/​iadk/​README.md Documents API and sinkless-processing changes.
src/​audio/​module_adapter/​iadk/​iadk_module_adapter.cpp Processes input-only modules and limits input to one IBS.

🧠 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/library/native_system_service.c

@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, btw do we have a test stub or simple IADK module that can be added to test IADK infra in CI ?

Just 1 copilot comment.

@intel-sofci

Copy link
Copy Markdown

PR 11299: test results

Run date: 2026-10-13 08:56 UTC

Tested commit: 522c6423d75d23875eb54920c038c7c9a9ae42ac

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

Library notification payloads are allocated with SRAM_OUTBOX_SIZE bytes,
but the requested size was copied to msg->tx_size without checking that capacity.
An IADK module could therefore receive a payload pointer
advertising more writable bytes than were allocated.

Reject oversized requests before searching the notification pool
or allocating a new message. This protects both fresh and
reused buffers while keeping the IADK caller-buffer validation unchanged.

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
@abonislawski

Copy link
Copy Markdown
Member Author

Copilot comment fixed, added SRAM_OUTPUT_SIZE check in lib_notif_msg_init().

btw do we have a test stub or simple IADK module that can be added to test IADK infra in CI ?

@lgirdwood yes, and its already enabled in CI.
But its a very basic module which doesnt use any advanced system services or notifications.

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.

5 participants