Skip to content

Commit cfd27fb

Browse files
lyakhkv2019i
authored andcommitted
src: convert to a loadable module
Build src as a loadable llext module. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 0c3be86 commit cfd27fb

11 files changed

Lines changed: 89 additions & 18 deletions

File tree

app/boards/intel_adsp_ace15_mtpm.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ CONFIG_METEORLAKE=y
22
CONFIG_IPC_MAJOR_4=y
33
CONFIG_IPC4_BASE_FW_INTEL=y
44

5-
CONFIG_COMP_SRC=y
65
CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y
76
CONFIG_COMP_SRC_LITE=y
87
CONFIG_COMP_DRC=m

app/boards/intel_adsp_ace20_lnl.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ CONFIG_LUNARLAKE=y
22
CONFIG_IPC_MAJOR_4=y
33
CONFIG_IPC4_BASE_FW_INTEL=y
44

5-
CONFIG_COMP_SRC=y
65
CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y
76
CONFIG_COMP_DRC=m
87

app/configs/lnl/modules.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
CONFIG_SAMPLE_SMART_AMP=m
12
CONFIG_COMP_MIXIN_MIXOUT=m
23
CONFIG_COMP_IIR=m
3-
CONFIG_SAMPLE_SMART_AMP=m
44
CONFIG_COMP_DRC=m
5+
CONFIG_COMP_SRC=m

app/configs/mtl/modules.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ CONFIG_SAMPLE_SMART_AMP=m
22
CONFIG_COMP_MIXIN_MIXOUT=m
33
CONFIG_COMP_IIR=m
44
CONFIG_COMP_DRC=m
5+
CONFIG_COMP_SRC=m

src/audio/src/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
config COMP_SRC
44
tristate "SRC component"
5+
default m if LIBRARY_DEFAULT_MODULAR
56
default y
67
help
78
Select for SRC component

src/audio/src/llext/CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2024 Intel Corporation.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(CONFIG_COMP_SRC_LITE)
5+
sof_llext_build("src"
6+
SOURCES ../src_hifi2ep.c
7+
../src_generic.c
8+
../src_hifi3.c
9+
../src_hifi4.c
10+
../src.c
11+
../src_common.c
12+
../src_ipc4.c
13+
../src_lite.c
14+
)
15+
else()
16+
sof_llext_build("src"
17+
SOURCES ../src_hifi2ep.c
18+
../src_generic.c
19+
../src_hifi3.c
20+
../src_hifi4.c
21+
../src.c
22+
../src_common.c
23+
../src_ipc4.c
24+
)
25+
endif()

src/audio/src/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 "../src.toml"
4+
5+
[module]
6+
count = __COUNTER__

src/audio/src/src.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,31 @@ static const struct module_interface src_interface = {
8181

8282
DECLARE_MODULE_ADAPTER(src_interface, SRC_UUID, src_tr);
8383
SOF_MODULE_INIT(src, sys_comp_module_src_interface_init);
84+
85+
#if CONFIG_COMP_SRC_MODULE
86+
/* modular: llext dynamic link */
87+
88+
#include <module/module/api_ver.h>
89+
#include <module/module/llext.h>
90+
#include <rimage/sof/user/manifest.h>
91+
92+
#define UUID_SRC 0x8D, 0xB2, 0x1B, 0xE6, 0x9A, 0x14, 0x1F, 0x4C, \
93+
0xB7, 0x09, 0x46, 0x82, 0x3E, 0xF5, 0xF5, 0xAE
94+
SOF_LLEXT_MOD_ENTRY(src, &src_interface);
95+
96+
#if CONFIG_COMP_SRC_LITE
97+
#define UUID_SRC_LITE 0x51, 0x10, 0x44, 0x33, 0xCD, 0x44, 0x6A, 0x46, \
98+
0x83, 0xA3, 0x17, 0x84, 0x78, 0x70, 0x8A, 0xEA
99+
extern const struct module_interface src_lite_interface;
100+
SOF_LLEXT_MOD_ENTRY(src_lite, &src_lite_interface);
101+
#endif
102+
103+
static const struct sof_man_module_manifest mod_manifest[] __section(".module") __used = {
104+
SOF_LLEXT_MODULE_MANIFEST("SRC", src_llext_entry, 1, UUID_SRC, 1),
105+
#if CONFIG_COMP_SRC_LITE
106+
SOF_LLEXT_MODULE_MANIFEST("SRC_LITE", src_lite_llext_entry, 1, UUID_SRC_LITE, 1),
107+
#endif
108+
};
109+
110+
SOF_LLEXT_BUILDINFO;
111+
#endif

src/audio/src/src.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 = "SRC"
37
uuid = "E61BB28D-149A-4C1F-B709-46823EF5F5AE"
48
affinity_mask = "0x1"
59
REM #instance_count = "10"
610
domain_types = "0"
7-
load_type = "0"
11+
load_type = LOAD_TYPE
812
module_type = "7"
913
auto_start = "0"
1014
sched_caps = [1, 0x00008000]
@@ -77,7 +81,7 @@
7781
affinity_mask = "0x1"
7882
REM #instance_count = "10"
7983
domain_types = "0"
80-
load_type = "0"
84+
load_type = LOAD_TYPE
8185
module_type = "0x1F"
8286
auto_start = "0"
8387
sched_caps = [1, 0x00008000]

src/audio/src/src_lite.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static int src_lite_prepare(struct processing_module *mod,
5353
return src_prepare_general(mod, sources[0], sinks[0]);
5454
}
5555

56-
static const struct module_interface src_lite_interface = {
56+
const struct module_interface src_lite_interface = {
5757
.init = src_init,
5858
.prepare = src_lite_prepare,
5959
.process = src_process,

0 commit comments

Comments
 (0)