Repository navigation
Conversation
… runtime IPC Remove all build-time per-codec #ifdef checks from get_codec_info() in base_fw.c and introduce a spinlock-protected dynamic codec registry declared in <sof/audio/codec_info.h>. Add IPC4_SOF_INFO_GET (base firmware parameter 37) and capability flag IPC4_SOF_CAP_RUNTIME_SOF_INFO under IPC4_SOF_CAPS so hosts can re-query SOF info TLVs at runtime after LLEXT libraries are loaded or unloaded. IPC4_FW_CONFIG continues to emit IPC4_SOF_CODEC_INFO (when populated) and IPC4_SOF_CAPS for backwards compatibility with older host drivers. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…ilities dynamically Parse the optional ".sof_codec_info" ELF section when loading or DRAM-restoring an LLEXT library and register its codec items with base_fw's runtime codec registry. Add lib_manager_unload_library() and llext_manager_remove_library() so idle LLEXT libraries can be safely unloaded and their codec entries unregistered. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
… LLEXT Move codec capability declarations out of base_fw.c into the respective codec modules (ffmpeg_dec, mfcc, cadence_ipc4): embed ".sof_codec_info" tables in LLEXT builds and register built-in codec tables during SOF_MODULE_INIT via sof_codec_info_register(). Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove build-time hardcoded per-codec
#ifdef CONFIG_*capability entries fromsrc/kernel/audio/base_fw.cand make firmware codec capabilities runtime-discoverable as built-in modules initialize and as LLEXT libraries are loaded or unloaded.Changes
Dynamic codec registry & runtime query IPC (
<sof/audio/codec_info.h>,ipc4/base_fw.h,src/kernel/audio/base_fw.c)codec_info_providersregistry (sof_codec_info_register()/sof_codec_info_unregister()) that deduplicates(codec, dir)items intosof_ipc4_codec_info_data(up toSOF_IPC4_CODEC_INFO_MAX_ITEMS = 64).IPC4_SOF_INFO_GET(37) toenum ipc4_base_fw_paramsandIPC4_SOF_CAPS(1) /IPC4_SOF_CAP_RUNTIME_SOF_INFO(BIT(0)) to allow the host to re-query SOF info TLVs at runtime.IPC4_FW_CONFIGemittingIPC4_SOF_CODEC_INFO(when non-empty) alongsideIPC4_SOF_CAPSfor backwards compatibility with older host drivers.LLEXT section discovery & library unload (
lib_manager,llext_manager).sof_codec_infoELF section lookup (llext_manager_elf_find_section()) and codec registration/unregistration on library load (llext_manager_add_library()) and DRAM restore (llext_manager_restore_from_dram()).llext_manager_remove_library()andlib_manager_unload_library()to safely unload inactive LLEXT libraries and unregister their codec entries.Per-module codec advertisement (
ffmpeg_dec,mfcc,cadence_ipc4)SOF_CODEC_INFO_ITEM(codec, dir)arrays in.sof_codec_info, while built-in builds register duringSOF_MODULE_INITviasof_codec_info_register().Backwards Compatibility
IPC4_FW_CONFIGstill emitsIPC4_SOF_CODEC_INFOfor built-in modules; older hosts ignoreIPC4_SOF_CAPS.FW_CONFIGwhenIPC4_SOF_CAP_RUNTIME_SOF_INFOis absent.Verification
west build -b intel_adsp/ace30/wclbuilt cleanly with exit code 0 for:CONFIG_LLEXT=y,CONFIG_COMP_FFMPEG_DEC=m,CONFIG_COMP_FFMPEG_DEC_STUB=y,CONFIG_COMP_MFCC=m)CONFIG_COMP_FFMPEG_DEC=y,CONFIG_COMP_FFMPEG_DEC_STUB=y,CONFIG_COMP_MFCC=y)scripts/check_kernel_includes.py --strictpassed with 0 violations on the WCL LLEXT build..sof_codec_infoELF sections inffmpeg_dec.llextandmfcc.llextviaobjdump.Companion Linux host driver PR: thesofproject/linux#6044