diff --git a/app/overlays/lnl/module_overlay.conf b/app/overlays/lnl/module_overlay.conf index 3237779fc7e6..7dd35cc66cf0 100644 --- a/app/overlays/lnl/module_overlay.conf +++ b/app/overlays/lnl/module_overlay.conf @@ -5,4 +5,5 @@ CONFIG_COMP_FIR=m CONFIG_COMP_IIR=m CONFIG_COMP_DRC=m CONFIG_COMP_SRC=m +CONFIG_COMP_ASRC=m CONFIG_COMP_VOLUME=m diff --git a/app/overlays/mtl/module_overlay.conf b/app/overlays/mtl/module_overlay.conf index 3237779fc7e6..7dd35cc66cf0 100644 --- a/app/overlays/mtl/module_overlay.conf +++ b/app/overlays/mtl/module_overlay.conf @@ -5,4 +5,5 @@ CONFIG_COMP_FIR=m CONFIG_COMP_IIR=m CONFIG_COMP_DRC=m CONFIG_COMP_SRC=m +CONFIG_COMP_ASRC=m CONFIG_COMP_VOLUME=m diff --git a/src/audio/asrc/Kconfig b/src/audio/asrc/Kconfig index 7bdbf68d2a94..b9b8604e667e 100644 --- a/src/audio/asrc/Kconfig +++ b/src/audio/asrc/Kconfig @@ -1,7 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause config COMP_ASRC - bool "ASRC component" + tristate "ASRC component" + default m if LIBRARY_DEFAULT_MODULAR default y help Select for Asynchronous sample rate conversion (ASRC) @@ -14,7 +15,7 @@ config COMP_ASRC not have pre-computed filter coefficients for every conversion fraction that SRC does. -if COMP_ASRC +if COMP_ASRC != n rsource "Kconfig.simd" diff --git a/src/audio/asrc/asrc.c b/src/audio/asrc/asrc.c index 4df5a5afd17f..b67ac3e8518d 100644 --- a/src/audio/asrc/asrc.c +++ b/src/audio/asrc/asrc.c @@ -318,7 +318,7 @@ static int asrc_free(struct processing_module *mod) struct comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; - comp_info(dev, "asrc_free()"); + comp_dbg(dev, "asrc_free()"); rfree(cd->buf); asrc_release_buffers(cd->asrc_obj); @@ -850,8 +850,7 @@ static int asrc_reset(struct processing_module *mod) struct comp_dev *dev = mod->dev; struct comp_data *cd = module_get_private_data(mod); - comp_info(dev, "asrc_reset(), skew_min=%d, skew_max=%d", cd->skew_min, cd->skew_max); - + comp_dbg(dev, "asrc_reset(), skew_min=%d, skew_max=%d", cd->skew_min, cd->skew_max); /* If any resources feasible to stop */ if (cd->track_drift) @@ -879,3 +878,21 @@ static const struct module_interface asrc_interface = { DECLARE_MODULE_ADAPTER(asrc_interface, ASRC_UUID, asrc_tr); SOF_MODULE_INIT(asrc, sys_comp_module_asrc_interface_init); + +#if CONFIG_COMP_ASRC_MODULE +/* modular: llext dynamic link */ + +#include +#include +#include + +#define UUID_ASRC 0x2d, 0x40, 0xb4, 0x66, 0x68, 0xb4, 0xf2, 0x42, \ + 0x81, 0xa7, 0xb3, 0x71, 0x21, 0x86, 0x3d, 0xd4 +SOF_LLEXT_MOD_ENTRY(asrc, &asrc_interface); + +static const struct sof_man_module_manifest mod_manifest[] __section(".module") __used = { + SOF_LLEXT_MODULE_MANIFEST("ASRC", asrc_llext_entry, 1, UUID_ASRC, 2), +}; + +SOF_LLEXT_BUILDINFO; +#endif diff --git a/src/audio/asrc/asrc.toml b/src/audio/asrc/asrc.toml index 0bf6ace59bd9..ace84d85e733 100644 --- a/src/audio/asrc/asrc.toml +++ b/src/audio/asrc/asrc.toml @@ -1,3 +1,7 @@ +#ifndef LOAD_TYPE +#define LOAD_TYPE "0" +#endif + [[module.entry]] name = "ASRC" uuid = "66B4402D-B468-42F2-81A7-B37121863DD4" @@ -5,7 +9,7 @@ instance_count = "2" 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/asrc/llext/CMakeLists.txt b/src/audio/asrc/llext/CMakeLists.txt new file mode 100644 index 000000000000..93f26a228913 --- /dev/null +++ b/src/audio/asrc/llext/CMakeLists.txt @@ -0,0 +1,10 @@ +# Copyright (c) 2024 Intel Corporation. +# SPDX-License-Identifier: Apache-2.0 + +sof_llext_build("asrc" + SOURCES ../asrc.c + ../asrc_farrow_hifi3.c + ../asrc_farrow.c + ../asrc_farrow_generic.c + ../asrc_ipc4.c +) diff --git a/src/audio/asrc/llext/llext.toml.h b/src/audio/asrc/llext/llext.toml.h new file mode 100644 index 000000000000..680a68ece6d8 --- /dev/null +++ b/src/audio/asrc/llext/llext.toml.h @@ -0,0 +1,6 @@ +#include +#define LOAD_TYPE "2" +#include "../asrc.toml" + +[module] +count = __COUNTER__ diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index c9925e8311a1..7f8d492d164f 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -611,15 +611,18 @@ zephyr_library_sources_ifdef(CONFIG_MATH_IIR_DF2T ${SOF_MATH_PATH}/iir_df2t.c ) -zephyr_library_sources_ifdef(CONFIG_COMP_ASRC - ${SOF_AUDIO_PATH}/asrc/asrc.c - ${SOF_AUDIO_PATH}/asrc/asrc_farrow_hifi3.c - ${SOF_AUDIO_PATH}/asrc/asrc_farrow.c - ${SOF_AUDIO_PATH}/asrc/asrc_farrow_generic.c -) - -if(CONFIG_COMP_ASRC) - zephyr_library_sources(${SOF_AUDIO_PATH}/asrc/asrc_${ipc_suffix}.c) +if(CONFIG_COMP_ASRC STREQUAL "m") + add_subdirectory(${SOF_AUDIO_PATH}/asrc/llext + ${PROJECT_BINARY_DIR}/asrc_llext) + add_dependencies(app asrc) +elseif(CONFIG_COMP_ASRC) + zephyr_library_sources( + ${SOF_AUDIO_PATH}/asrc/asrc.c + ${SOF_AUDIO_PATH}/asrc/asrc_farrow_hifi3.c + ${SOF_AUDIO_PATH}/asrc/asrc_farrow.c + ${SOF_AUDIO_PATH}/asrc/asrc_farrow_generic.c + ${SOF_AUDIO_PATH}/asrc/asrc_${ipc_suffix}.c + ) endif() zephyr_library_sources_ifdef(CONFIG_COMP_DCBLOCK