Repository navigation
iadk: API 4.5.2 support and service fixes - #11299
abonislawski wants to merge 10 commits into
Conversation
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>
There was a problem hiding this comment.
🟡 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.
PR 11299: test resultsRun date: 2026-10-13 08:56 UTC Tested commit: 522c6423d75d23875eb54920c038c7c9a9ae42ac |
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>
|
Copilot comment fixed, added SRAM_OUTPUT_SIZE check in lib_notif_msg_init().
@lgirdwood yes, and its already enabled in CI. |

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.