diff --git a/app/overlays/lnl/module_overlay.conf b/app/overlays/lnl/module_overlay.conf index 172a8ea28e82..88006880acd9 100644 --- a/app/overlays/lnl/module_overlay.conf +++ b/app/overlays/lnl/module_overlay.conf @@ -1 +1,2 @@ CONFIG_SAMPLE_SMART_AMP=m +CONFIG_COMP_DRC=m diff --git a/app/overlays/mtl/module_overlay.conf b/app/overlays/mtl/module_overlay.conf index 45babe736c53..1fb5549e9d82 100644 --- a/app/overlays/mtl/module_overlay.conf +++ b/app/overlays/mtl/module_overlay.conf @@ -1,3 +1,4 @@ CONFIG_SAMPLE_SMART_AMP=m CONFIG_COMP_MIXIN_MIXOUT=m CONFIG_COMP_IIR=m +CONFIG_COMP_DRC=m diff --git a/src/audio/drc/Kconfig b/src/audio/drc/Kconfig index 9e6aaf6388ed..56e3c4d9e6fc 100644 --- a/src/audio/drc/Kconfig +++ b/src/audio/drc/Kconfig @@ -3,7 +3,7 @@ rsource "Kconfig.simd" config COMP_DRC - bool "Dynamic Range Compressor component" + tristate "Dynamic Range Compressor component" select CORDIC_FIXED select MATH_LUT_SINE_FIXED select NUMBERS_NORM diff --git a/src/audio/drc/drc.c b/src/audio/drc/drc.c index 7080fdea55f1..9beb5112b597 100644 --- a/src/audio/drc/drc.c +++ b/src/audio/drc/drc.c @@ -203,8 +203,6 @@ static int drc_free(struct processing_module *mod) { struct drc_comp_data *cd = module_get_private_data(mod); - comp_info(mod->dev, "drc_free()"); - comp_data_blob_handler_free(cd->model_handler); rfree(cd); return 0; @@ -370,8 +368,6 @@ static int drc_reset(struct processing_module *mod) { struct drc_comp_data *cd = module_get_private_data(mod); - comp_info(mod->dev, "drc_reset()"); - drc_reset_state(&cd->state); return 0; @@ -389,3 +385,22 @@ static const struct module_interface drc_interface = { DECLARE_MODULE_ADAPTER(drc_interface, drc_uuid, drc_tr); SOF_MODULE_INIT(drc, sys_comp_module_drc_interface_init); + +#if CONFIG_COMP_DRC_MODULE +/* modular: llext dynamic link */ + +#include +#include +#include + +#define UUID_DRC 0xda, 0xe4, 0x6e, 0xb3, 0x6f, 0x00, 0xf9, 0x47, \ + 0xa0, 0x6d, 0xfe, 0xcb, 0xe2, 0xd8, 0xb6, 0xce + +SOF_LLEXT_MOD_ENTRY(drc, &drc_interface); + +static const struct sof_man_module_manifest mod_manifest __section(".module") __used = + SOF_LLEXT_MODULE_MANIFEST("DRC", drc_llext_entry, 1, UUID_DRC, 40); + +SOF_LLEXT_BUILDINFO; + +#endif diff --git a/src/audio/drc/drc.toml b/src/audio/drc/drc.toml index 29ee8d856cbb..4c0b25601425 100644 --- a/src/audio/drc/drc.toml +++ b/src/audio/drc/drc.toml @@ -1,3 +1,7 @@ +#ifndef LOAD_TYPE +#define LOAD_TYPE "0" +#endif + REM # DRC module config [[module.entry]] name = "DRC" @@ -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/drc/llext/CMakeLists.txt b/src/audio/drc/llext/CMakeLists.txt new file mode 100644 index 000000000000..5a59b9bade98 --- /dev/null +++ b/src/audio/drc/llext/CMakeLists.txt @@ -0,0 +1,13 @@ +# Copyright (c) 2024 Intel Corporation. +# SPDX-License-Identifier: Apache-2.0 + +# Hard-coded .text address to be moved to a common place +sof_llext_build("drc" + SOURCES ../drc.c + ../drc_generic.c + ../drc_math_generic.c + ../drc_hifi3.c + ../drc_hifi4.c + ../drc_math_hifi3.c + TEXT_ADDR 0xa068a000 +) diff --git a/src/audio/drc/llext/llext.toml.h b/src/audio/drc/llext/llext.toml.h new file mode 100644 index 000000000000..89469d54fffb --- /dev/null +++ b/src/audio/drc/llext/llext.toml.h @@ -0,0 +1,6 @@ +#include +#define LOAD_TYPE "2" +#include "../drc.toml" + +[module] +count = __COUNTER__ diff --git a/src/audio/multiband_drc/Kconfig b/src/audio/multiband_drc/Kconfig index 175a6bf09c48..d9e61c915ccd 100644 --- a/src/audio/multiband_drc/Kconfig +++ b/src/audio/multiband_drc/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause config COMP_MULTIBAND_DRC - depends on COMP_IIR && COMP_CROSSOVER && COMP_DRC + depends on COMP_IIR && COMP_CROSSOVER && COMP_DRC = y bool "Multiband Dynamic Range Compressor component" select CORDIC_FIXED select COMP_BLOB diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 6c98bc212c68..b34829ad883c 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -755,14 +755,20 @@ zephyr_library_sources_ifdef(CONFIG_COMP_CROSSOVER ${SOF_AUDIO_PATH}/crossover/crossover_${ipc_suffix}.c ) -zephyr_library_sources_ifdef(CONFIG_COMP_DRC - ${SOF_AUDIO_PATH}/drc/drc.c - ${SOF_AUDIO_PATH}/drc/drc_generic.c - ${SOF_AUDIO_PATH}/drc/drc_math_generic.c - ${SOF_AUDIO_PATH}/drc/drc_hifi3.c - ${SOF_AUDIO_PATH}/drc/drc_hifi4.c - ${SOF_AUDIO_PATH}/drc/drc_math_hifi3.c -) +if(CONFIG_COMP_DRC STREQUAL "m") + add_subdirectory(${SOF_AUDIO_PATH}/drc/llext + ${PROJECT_BINARY_DIR}/drc_llext) + add_dependencies(app drc) +elseif(CONFIG_COMP_DRC) + zephyr_library_sources( + ${SOF_AUDIO_PATH}/drc/drc.c + ${SOF_AUDIO_PATH}/drc/drc_generic.c + ${SOF_AUDIO_PATH}/drc/drc_math_generic.c + ${SOF_AUDIO_PATH}/drc/drc_hifi3.c + ${SOF_AUDIO_PATH}/drc/drc_hifi4.c + ${SOF_AUDIO_PATH}/drc/drc_math_hifi3.c + ) +endif() zephyr_library_sources_ifdef(CONFIG_COMP_MULTIBAND_DRC ${SOF_AUDIO_PATH}/multiband_drc/multiband_drc.c