diff --git a/app/configs/lnl/modules.conf b/app/configs/lnl/modules.conf index 7deff6e2d9a6..fbef3ae182c7 100644 --- a/app/configs/lnl/modules.conf +++ b/app/configs/lnl/modules.conf @@ -5,6 +5,7 @@ CONFIG_COMP_MIXIN_MIXOUT=m CONFIG_COMP_FIR=m CONFIG_COMP_IIR=m CONFIG_COMP_DRC=m +CONFIG_COMP_MUX=m CONFIG_COMP_SEL=m CONFIG_COMP_SRC=m CONFIG_COMP_ARIA=m diff --git a/app/configs/mtl/modules.conf b/app/configs/mtl/modules.conf index 7deff6e2d9a6..fbef3ae182c7 100644 --- a/app/configs/mtl/modules.conf +++ b/app/configs/mtl/modules.conf @@ -5,6 +5,7 @@ CONFIG_COMP_MIXIN_MIXOUT=m CONFIG_COMP_FIR=m CONFIG_COMP_IIR=m CONFIG_COMP_DRC=m +CONFIG_COMP_MUX=m CONFIG_COMP_SEL=m CONFIG_COMP_SRC=m CONFIG_COMP_ARIA=m diff --git a/src/audio/mux/Kconfig b/src/audio/mux/Kconfig index ab5051707c6f..953e65ad59db 100644 --- a/src/audio/mux/Kconfig +++ b/src/audio/mux/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause config COMP_MUX - bool "MUX component" + tristate "MUX component" select COMP_BLOB depends on COMP_MODULE_ADAPTER default y diff --git a/src/audio/mux/llext/CMakeLists.txt b/src/audio/mux/llext/CMakeLists.txt new file mode 100644 index 000000000000..c17801d9af67 --- /dev/null +++ b/src/audio/mux/llext/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright (c) 2024 Intel Corporation. +# SPDX-License-Identifier: Apache-2.0 + +sof_llext_build("mux" + SOURCES ../mux.c + ../mux_generic.c + ../mux_ipc4.c +) diff --git a/src/audio/mux/llext/llext.toml.h b/src/audio/mux/llext/llext.toml.h new file mode 100644 index 000000000000..27a629e46f78 --- /dev/null +++ b/src/audio/mux/llext/llext.toml.h @@ -0,0 +1,6 @@ +#include +#define LOAD_TYPE "2" +#include "../mux.toml" + +[module] +count = __COUNTER__ diff --git a/src/audio/mux/mux.c b/src/audio/mux/mux.c index 9ac9365297e6..f98cf83934f0 100644 --- a/src/audio/mux/mux.c +++ b/src/audio/mux/mux.c @@ -5,8 +5,6 @@ // Author: Liam Girdwood // Artur Kloniecki -#if CONFIG_COMP_MUX - #include #include #include @@ -486,4 +484,25 @@ static const struct module_interface demux_interface = { DECLARE_MODULE_ADAPTER(demux_interface, demux_uuid, demux_tr); SOF_MODULE_INIT(demux, sys_comp_module_demux_interface_init); -#endif /* CONFIG_COMP_MUX */ +#if CONFIG_COMP_VOLUME_MODULE +/* modular: llext dynamic link */ + +#include +#include +#include + +#define UUID_MUX 0x35, 0x6E, 0xCE, 0x64, 0x7A, 0x85, 0x78, 0x48, 0xE8, 0xAC, \ + 0xE2, 0xA2, 0xF4, 0x2E, 0x30, 0x69 +SOF_LLEXT_MOD_ENTRY(mux, &mux_interface); + +#define UUID_DEMUX 0x68, 0x68, 0xB2, 0xC4, 0x30, 0x14, 0x0E, 0x47, 0x89, 0xA0, \ + 0x15, 0xD1, 0xC7, 0x7F, 0x85, 0x1A +SOF_LLEXT_MOD_ENTRY(demux, &demux_interface); + +static const struct sof_man_module_manifest mod_manifest[] __section(".module") __used = { + SOF_LLEXT_MODULE_MANIFEST("MUX", mux_llext_entry, 1, UUID_MUX, 15), + SOF_LLEXT_MODULE_MANIFEST("DEMUX", demux_llext_entry, 1, UUID_DEMUX, 15), +}; + +SOF_LLEXT_BUILDINFO; +#endif diff --git a/src/audio/mux/mux.h b/src/audio/mux/mux.h index 1f46e358dd18..f3b2cbc50a89 100644 --- a/src/audio/mux/mux.h +++ b/src/audio/mux/mux.h @@ -14,8 +14,6 @@ #ifndef __SOF_AUDIO_MUX_H__ #define __SOF_AUDIO_MUX_H__ -#if CONFIG_COMP_MUX - #include #include #include @@ -230,6 +228,4 @@ int mux_params(struct processing_module *mod); #endif extern const struct sof_uuid MUX_UUID; -#endif /* CONFIG_COMP_MUX */ - #endif /* __SOF_AUDIO_MUX_H__ */ diff --git a/src/audio/mux/mux.toml b/src/audio/mux/mux.toml index e9fa8b7dbd36..76a50383d0bc 100644 --- a/src/audio/mux/mux.toml +++ b/src/audio/mux/mux.toml @@ -1,10 +1,14 @@ +#ifndef LOAD_TYPE +#define LOAD_TYPE "0" +#endif + [[module.entry]] name = "MUX" - uuid = "64ce6e35-857a-4878-ace8-e2a2f42e3069" + uuid = "64CE6E35-857A-4878-ACE8-E2A2F42E3069" affinity_mask = "0x1" instance_count = "15" domain_types = "0" - load_type = "0" + load_type = LOAD_TYPE module_type = "6" auto_start = "0" sched_caps = [1, 0x00008000] diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 2df56cc11d51..58fb38915543 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -1005,11 +1005,17 @@ zephyr_library_sources_ifdef(CONFIG_COMP_UP_DOWN_MIXER ${SOF_AUDIO_PATH}/up_down_mixer/up_down_mixer_hifi3.c ) -zephyr_library_sources_ifdef(CONFIG_COMP_MUX - ${SOF_AUDIO_PATH}/mux/mux.c - ${SOF_AUDIO_PATH}/mux/mux_generic.c - ${SOF_AUDIO_PATH}/mux/mux_${ipc_suffix}.c -) +if(CONFIG_COMP_MUX STREQUAL "m") + add_subdirectory(${SOF_AUDIO_PATH}/mux/llext + ${PROJECT_BINARY_DIR}/mux_llext) + add_dependencies(app mux) +elseif(CONFIG_COMP_MUX) + zephyr_library_sources_ifdef(CONFIG_COMP_MUX + ${SOF_AUDIO_PATH}/mux/mux.c + ${SOF_AUDIO_PATH}/mux/mux_generic.c + ${SOF_AUDIO_PATH}/mux/mux_${ipc_suffix}.c + ) +endif() if(CONFIG_COMP_MFCC STREQUAL "m") add_subdirectory(${SOF_AUDIO_PATH}/mfcc/llext