Skip to content

Commit 096267e

Browse files
committed
mux: enable building as an llext module
Add support for LLEXT building to mux. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent d5a6d3f commit 096267e

9 files changed

Lines changed: 56 additions & 15 deletions

File tree

app/configs/lnl/modules.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CONFIG_COMP_MIXIN_MIXOUT=m
55
CONFIG_COMP_FIR=m
66
CONFIG_COMP_IIR=m
77
CONFIG_COMP_DRC=m
8+
CONFIG_COMP_MUX=m
89
CONFIG_COMP_SEL=m
910
CONFIG_COMP_SRC=m
1011
CONFIG_COMP_ARIA=m

app/configs/mtl/modules.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CONFIG_COMP_MIXIN_MIXOUT=m
55
CONFIG_COMP_FIR=m
66
CONFIG_COMP_IIR=m
77
CONFIG_COMP_DRC=m
8+
CONFIG_COMP_MUX=m
89
CONFIG_COMP_SEL=m
910
CONFIG_COMP_SRC=m
1011
CONFIG_COMP_ARIA=m

src/audio/mux/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: BSD-3-Clause
22

33
config COMP_MUX
4-
bool "MUX component"
4+
tristate "MUX component"
55
select COMP_BLOB
66
depends on COMP_MODULE_ADAPTER
77
default y

src/audio/mux/llext/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2024 Intel Corporation.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
sof_llext_build("mux"
5+
SOURCES ../mux.c
6+
../mux_generic.c
7+
../mux_ipc4.c
8+
)

src/audio/mux/llext/llext.toml.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <tools/rimage/config/platform.toml>
2+
#define LOAD_TYPE "2"
3+
#include "../mux.toml"
4+
5+
[module]
6+
count = __COUNTER__

src/audio/mux/mux.c

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
66
// Artur Kloniecki <arturx.kloniecki@linux.intel.com>
77

8-
#if CONFIG_COMP_MUX
9-
108
#include <sof/audio/module_adapter/module/generic.h>
119
#include <sof/audio/component.h>
1210
#include <sof/audio/data_blob.h>
@@ -486,4 +484,25 @@ static const struct module_interface demux_interface = {
486484
DECLARE_MODULE_ADAPTER(demux_interface, demux_uuid, demux_tr);
487485
SOF_MODULE_INIT(demux, sys_comp_module_demux_interface_init);
488486

489-
#endif /* CONFIG_COMP_MUX */
487+
#if CONFIG_COMP_VOLUME_MODULE
488+
/* modular: llext dynamic link */
489+
490+
#include <module/module/api_ver.h>
491+
#include <module/module/llext.h>
492+
#include <rimage/sof/user/manifest.h>
493+
494+
#define UUID_MUX 0x35, 0x6E, 0xCE, 0x64, 0x7A, 0x85, 0x78, 0x48, 0xE8, 0xAC, \
495+
0xE2, 0xA2, 0xF4, 0x2E, 0x30, 0x69
496+
SOF_LLEXT_MOD_ENTRY(mux, &mux_interface);
497+
498+
#define UUID_DEMUX 0x68, 0x68, 0xB2, 0xC4, 0x30, 0x14, 0x0E, 0x47, 0x89, 0xA0, \
499+
0x15, 0xD1, 0xC7, 0x7F, 0x85, 0x1A
500+
SOF_LLEXT_MOD_ENTRY(demux, &demux_interface);
501+
502+
static const struct sof_man_module_manifest mod_manifest[] __section(".module") __used = {
503+
SOF_LLEXT_MODULE_MANIFEST("MUX", mux_llext_entry, 1, UUID_MUX, 15),
504+
SOF_LLEXT_MODULE_MANIFEST("DEMUX", demux_llext_entry, 1, UUID_DEMUX, 15),
505+
};
506+
507+
SOF_LLEXT_BUILDINFO;
508+
#endif

src/audio/mux/mux.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
#ifndef __SOF_AUDIO_MUX_H__
1515
#define __SOF_AUDIO_MUX_H__
1616

17-
#if CONFIG_COMP_MUX
18-
1917
#include <sof/audio/module_adapter/module/generic.h>
2018
#include <sof/common.h>
2119
#include <sof/platform.h>
@@ -230,6 +228,4 @@ int mux_params(struct processing_module *mod);
230228
#endif
231229
extern const struct sof_uuid MUX_UUID;
232230

233-
#endif /* CONFIG_COMP_MUX */
234-
235231
#endif /* __SOF_AUDIO_MUX_H__ */

src/audio/mux/mux.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
#ifndef LOAD_TYPE
2+
#define LOAD_TYPE "0"
3+
#endif
4+
15
[[module.entry]]
26
name = "MUX"
3-
uuid = "64ce6e35-857a-4878-ace8-e2a2f42e3069"
7+
uuid = "64CE6E35-857A-4878-ACE8-E2A2F42E3069"
48
affinity_mask = "0x1"
59
instance_count = "15"
610
domain_types = "0"
7-
load_type = "0"
11+
load_type = LOAD_TYPE
812
module_type = "6"
913
auto_start = "0"
1014
sched_caps = [1, 0x00008000]

zephyr/CMakeLists.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,11 +1005,17 @@ zephyr_library_sources_ifdef(CONFIG_COMP_UP_DOWN_MIXER
10051005
${SOF_AUDIO_PATH}/up_down_mixer/up_down_mixer_hifi3.c
10061006
)
10071007

1008-
zephyr_library_sources_ifdef(CONFIG_COMP_MUX
1009-
${SOF_AUDIO_PATH}/mux/mux.c
1010-
${SOF_AUDIO_PATH}/mux/mux_generic.c
1011-
${SOF_AUDIO_PATH}/mux/mux_${ipc_suffix}.c
1012-
)
1008+
if(CONFIG_COMP_MUX STREQUAL "m")
1009+
add_subdirectory(${SOF_AUDIO_PATH}/mux/llext
1010+
${PROJECT_BINARY_DIR}/mux_llext)
1011+
add_dependencies(app mux)
1012+
elseif(CONFIG_COMP_MUX)
1013+
zephyr_library_sources_ifdef(CONFIG_COMP_MUX
1014+
${SOF_AUDIO_PATH}/mux/mux.c
1015+
${SOF_AUDIO_PATH}/mux/mux_generic.c
1016+
${SOF_AUDIO_PATH}/mux/mux_${ipc_suffix}.c
1017+
)
1018+
endif()
10131019

10141020
if(CONFIG_COMP_MFCC STREQUAL "m")
10151021
add_subdirectory(${SOF_AUDIO_PATH}/mfcc/llext

0 commit comments

Comments
 (0)