diff --git a/app/boards/intel_adsp_ace15_mtpm.conf b/app/boards/intel_adsp_ace15_mtpm.conf index c3e4109fe51c..cf0d657de037 100644 --- a/app/boards/intel_adsp_ace15_mtpm.conf +++ b/app/boards/intel_adsp_ace15_mtpm.conf @@ -7,6 +7,7 @@ CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y CONFIG_COMP_SRC_LITE=y CONFIG_COMP_DRC=m CONFIG_COMP_CROSSOVER=m +CONFIG_COMP_DCBLOCK=m CONFIG_COMP_SEL=m CONFIG_COMP_MULTIBAND_DRC=y CONFIG_COMP_MFCC=y diff --git a/app/boards/intel_adsp_ace20_lnl.conf b/app/boards/intel_adsp_ace20_lnl.conf index 4e386272cbc7..6db9fc1ef44d 100644 --- a/app/boards/intel_adsp_ace20_lnl.conf +++ b/app/boards/intel_adsp_ace20_lnl.conf @@ -6,6 +6,7 @@ CONFIG_COMP_SRC=y CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y CONFIG_COMP_DRC=m CONFIG_COMP_CROSSOVER=m +CONFIG_COMP_DCBLOCK=m CONFIG_COMP_SEL=m # power settings diff --git a/src/audio/dcblock/Kconfig b/src/audio/dcblock/Kconfig index 1b38cdf7ff54..af6eae1c3c7e 100644 --- a/src/audio/dcblock/Kconfig +++ b/src/audio/dcblock/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause config COMP_DCBLOCK - bool "DC Blocking Filter component" + tristate "DC Blocking Filter component" default y help Select for DC Blocking Filter component. This component filters out diff --git a/src/audio/dcblock/dcblock.c b/src/audio/dcblock/dcblock.c index 6b7c23edd906..9029139355c3 100644 --- a/src/audio/dcblock/dcblock.c +++ b/src/audio/dcblock/dcblock.c @@ -257,3 +257,22 @@ static const struct module_interface dcblock_interface = { DECLARE_MODULE_ADAPTER(dcblock_interface, dcblock_uuid, dcblock_tr); SOF_MODULE_INIT(dcblock, sys_comp_module_dcblock_interface_init); + +#if CONFIG_COMP_DCBLOCK_MODULE +/* modular: llext dynamic link */ + +#include +#include +#include + +#define UUID_DCBLOCK 0xAF, 0xEF, 0x09, 0xB8, 0x81, 0x56, 0xB1, 0x42, 0xD6, 0x9E, \ + 0x04, 0xBB, 0x01, 0x2D, 0xD3, 0x84 + +SOF_LLEXT_MOD_ENTRY(dcblock, &dcblock_interface); + +static const struct sof_man_module_manifest mod_manifest __section(".module") __used = + SOF_LLEXT_MODULE_MANIFEST("DCBLOCK", dcblock_llext_entry, 1, UUID_DCBLOCK, 40); + +SOF_LLEXT_BUILDINFO; + +#endif diff --git a/src/audio/dcblock/dcblock.toml b/src/audio/dcblock/dcblock.toml index 69796d3a67e3..8ad98ed54d5b 100644 --- a/src/audio/dcblock/dcblock.toml +++ b/src/audio/dcblock/dcblock.toml @@ -1,3 +1,7 @@ +#ifndef LOAD_TYPE +#define LOAD_TYPE "0" +#endif + REM # DCblock module config [[module.entry]] name = "DCBLOCK" @@ -5,7 +9,7 @@ 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] diff --git a/src/audio/dcblock/llext/CMakeLists.txt b/src/audio/dcblock/llext/CMakeLists.txt new file mode 100644 index 000000000000..9aa677d05be4 --- /dev/null +++ b/src/audio/dcblock/llext/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2024 Intel Corporation. +# SPDX-License-Identifier: Apache-2.0 + +sof_llext_build("dcblock" + SOURCES ../dcblock.c + ../dcblock_generic.c + ../dcblock_hifi3.c + ../dcblock_hifi4.c + ../dcblock_ipc4.c +) diff --git a/src/audio/dcblock/llext/llext.toml.h b/src/audio/dcblock/llext/llext.toml.h new file mode 100644 index 000000000000..ad7917a3d16b --- /dev/null +++ b/src/audio/dcblock/llext/llext.toml.h @@ -0,0 +1,6 @@ +#include +#define LOAD_TYPE "2" +#include "../dcblock.toml" + +[module] +count = __COUNTER__ diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 8e765b88bc62..a49fd7b12ae9 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -614,13 +614,19 @@ zephyr_library_sources_ifdef(CONFIG_COMP_ASRC ${SOF_AUDIO_PATH}/asrc/asrc_${ipc_suffix}.c ) -zephyr_library_sources_ifdef(CONFIG_COMP_DCBLOCK - ${SOF_AUDIO_PATH}/dcblock/dcblock_generic.c - ${SOF_AUDIO_PATH}/dcblock/dcblock.c - ${SOF_AUDIO_PATH}/dcblock/dcblock_hifi3.c - ${SOF_AUDIO_PATH}/dcblock/dcblock_hifi4.c - ${SOF_AUDIO_PATH}/dcblock/dcblock_${ipc_suffix}.c -) +if(CONFIG_COMP_DCBLOCK STREQUAL "m") + add_subdirectory(${SOF_AUDIO_PATH}/dcblock/llext + ${PROJECT_BINARY_DIR}/dcblock_llext) + add_dependencies(app dcblock) +elseif(CONFIG_COMP_DCBLOCK) + zephyr_library_sources( + ${SOF_AUDIO_PATH}/dcblock/dcblock_generic.c + ${SOF_AUDIO_PATH}/dcblock/dcblock.c + ${SOF_AUDIO_PATH}/dcblock/dcblock_hifi3.c + ${SOF_AUDIO_PATH}/dcblock/dcblock_hifi4.c + ${SOF_AUDIO_PATH}/dcblock/dcblock_${ipc_suffix}.c + ) +endif() if(CONFIG_COMP_SEL STREQUAL "m") add_subdirectory(${SOF_AUDIO_PATH}/selector/llext