diff --git a/app/overlays/lnl/module_overlay.conf b/app/overlays/lnl/module_overlay.conf index 34f814e8d8b2..e0926aca45b5 100644 --- a/app/overlays/lnl/module_overlay.conf +++ b/app/overlays/lnl/module_overlay.conf @@ -2,5 +2,6 @@ CONFIG_LIBRARY_BASE_ADDRESS=0xa0688000 CONFIG_SAMPLE_SMART_AMP=m CONFIG_COMP_MIXIN_MIXOUT=m CONFIG_COMP_IIR=m +CONFIG_COMP_FIR=m CONFIG_COMP_SRC=m CONFIG_COMP_VOLUME=m diff --git a/app/overlays/mtl/module_overlay.conf b/app/overlays/mtl/module_overlay.conf index 34f814e8d8b2..e0926aca45b5 100644 --- a/app/overlays/mtl/module_overlay.conf +++ b/app/overlays/mtl/module_overlay.conf @@ -2,5 +2,6 @@ CONFIG_LIBRARY_BASE_ADDRESS=0xa0688000 CONFIG_SAMPLE_SMART_AMP=m CONFIG_COMP_MIXIN_MIXOUT=m CONFIG_COMP_IIR=m +CONFIG_COMP_FIR=m CONFIG_COMP_SRC=m CONFIG_COMP_VOLUME=m diff --git a/src/audio/eq_fir/Kconfig b/src/audio/eq_fir/Kconfig index 49ae33e98c81..0ac2074e499b 100644 --- a/src/audio/eq_fir/Kconfig +++ b/src/audio/eq_fir/Kconfig @@ -1,10 +1,11 @@ # SPDX-License-Identifier: BSD-3-Clause config COMP_FIR - bool "FIR component" + tristate "FIR component" select MATH_FIR select COMP_BLOB depends on COMP_MODULE_ADAPTER + default m if LIBRARY_DEFAULT_MODULAR default y help Select for FIR component. FIR performance can differ between DSP diff --git a/src/audio/eq_fir/eq_fir.c b/src/audio/eq_fir/eq_fir.c index b7402dba2207..46e35b3228d7 100644 --- a/src/audio/eq_fir/eq_fir.c +++ b/src/audio/eq_fir/eq_fir.c @@ -483,3 +483,22 @@ static const struct module_interface eq_fir_interface = { DECLARE_MODULE_ADAPTER(eq_fir_interface, eq_fir_uuid, eq_fir_tr); SOF_MODULE_INIT(eq_fir, sys_comp_module_eq_fir_interface_init); + +#if CONFIG_COMP_FIR_MODULE +/* modular: llext dynamic link */ + +#include +#include +#include + +#define UUID_EQFIR 0xe7, 0x0c, 0xa9, 0x43, 0xa5, 0xf3, 0xdf, 0x41, \ + 0xac, 0x06, 0xba, 0x98, 0x65, 0x1a, 0xe6, 0xa3 + +SOF_LLEXT_MOD_ENTRY(eq_fir, &eq_fir_interface); + +static const struct sof_man_module_manifest mod_manifest __section(".module") __used = + SOF_LLEXT_MODULE_MANIFEST("EQFIR", eq_fir_llext_entry, 1, UUID_EQFIR, 40); + +SOF_LLEXT_BUILDINFO; + +#endif diff --git a/src/audio/eq_fir/eq_fir.toml b/src/audio/eq_fir/eq_fir.toml index 2e647fe97ab8..416c068e95ce 100644 --- a/src/audio/eq_fir/eq_fir.toml +++ b/src/audio/eq_fir/eq_fir.toml @@ -1,11 +1,15 @@ +#ifndef LOAD_TYPE +#define LOAD_TYPE "0" +#endif + REM # eq fir module config [[module.entry]] name = "EQFIR" - uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" + uuid = "43A90CE7-F3A5-41DF-AC06-BA98651AE6A3" affinity_mask = "0x1" instance_count = "40" domain_types = "0" - load_type = "0" + load_type = LOAD_TYPE module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -15,6 +19,7 @@ 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] REM # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + REM # identical for MTL and LNL mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] index = __COUNTER__ diff --git a/src/audio/eq_fir/llext/CMakeLists.txt b/src/audio/eq_fir/llext/CMakeLists.txt new file mode 100644 index 000000000000..9b4f47308c49 --- /dev/null +++ b/src/audio/eq_fir/llext/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2024 Intel Corporation. +# SPDX-License-Identifier: Apache-2.0 + +sof_llext_build("eq_fir" + SOURCES ../eq_fir_hifi3.c + ../eq_fir_hifi2ep.c + ../eq_fir_generic.c + ../eq_fir.c + ../eq_fir_ipc4.c +) diff --git a/src/audio/eq_fir/llext/llext.toml.h b/src/audio/eq_fir/llext/llext.toml.h new file mode 100644 index 000000000000..4a73c827c860 --- /dev/null +++ b/src/audio/eq_fir/llext/llext.toml.h @@ -0,0 +1,6 @@ +#include +#define LOAD_TYPE "2" +#include "../eq_fir.toml" + +[module] +count = __COUNTER__ diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index e58920f6497e..73d0bdf09f70 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -538,13 +538,19 @@ elseif(CONFIG_IPC_MAJOR_4) set(ipc_suffix ipc4) endif() -zephyr_library_sources_ifdef(CONFIG_COMP_FIR - ${SOF_AUDIO_PATH}/eq_fir/eq_fir_hifi3.c - ${SOF_AUDIO_PATH}/eq_fir/eq_fir_hifi2ep.c - ${SOF_AUDIO_PATH}/eq_fir/eq_fir_generic.c - ${SOF_AUDIO_PATH}/eq_fir/eq_fir.c - ${SOF_AUDIO_PATH}/eq_fir/eq_fir_${ipc_suffix}.c -) +if(CONFIG_COMP_FIR STREQUAL "m") + add_subdirectory(${SOF_AUDIO_PATH}/eq_fir/llext + ${PROJECT_BINARY_DIR}/eq_fir_llext) + add_dependencies(app eq_iir) +elseif(CONFIG_COMP_FIR) + zephyr_library_sources( + ${SOF_AUDIO_PATH}/eq_fir/eq_fir_hifi3.c + ${SOF_AUDIO_PATH}/eq_fir/eq_fir_hifi2ep.c + ${SOF_AUDIO_PATH}/eq_fir/eq_fir_generic.c + ${SOF_AUDIO_PATH}/eq_fir/eq_fir.c + ${SOF_AUDIO_PATH}/eq_fir/eq_fir_${ipc_suffix}.c + ) +endif() if(CONFIG_COMP_IIR STREQUAL "m") add_subdirectory(${SOF_AUDIO_PATH}/eq_iir/llext