diff --git a/app/overlays/lnl/module_overlay.conf b/app/overlays/lnl/module_overlay.conf index e0926aca45b5..5355932bf3da 100644 --- a/app/overlays/lnl/module_overlay.conf +++ b/app/overlays/lnl/module_overlay.conf @@ -1,7 +1,8 @@ CONFIG_LIBRARY_BASE_ADDRESS=0xa0688000 CONFIG_SAMPLE_SMART_AMP=m CONFIG_COMP_MIXIN_MIXOUT=m +CONFIG_COMP_VOLUME=m CONFIG_COMP_IIR=m CONFIG_COMP_FIR=m CONFIG_COMP_SRC=m -CONFIG_COMP_VOLUME=m +CONFIG_COMP_ASRC=m diff --git a/app/overlays/mtl/module_overlay.conf b/app/overlays/mtl/module_overlay.conf index e0926aca45b5..5355932bf3da 100644 --- a/app/overlays/mtl/module_overlay.conf +++ b/app/overlays/mtl/module_overlay.conf @@ -1,7 +1,8 @@ CONFIG_LIBRARY_BASE_ADDRESS=0xa0688000 CONFIG_SAMPLE_SMART_AMP=m CONFIG_COMP_MIXIN_MIXOUT=m +CONFIG_COMP_VOLUME=m CONFIG_COMP_IIR=m CONFIG_COMP_FIR=m CONFIG_COMP_SRC=m -CONFIG_COMP_VOLUME=m +CONFIG_COMP_ASRC=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 8ce6c711dfc9..21e1c947daa5 100644 --- a/src/audio/asrc/asrc.c +++ b/src/audio/asrc/asrc.c @@ -879,3 +879,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 9e744452de20..909ff803da04 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..9b00a9552c46 --- /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 73d0bdf09f70..cd254314bbb5 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -582,15 +582,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