Skip to content

Commit ed65e22

Browse files
lyakhkv2019i
authored andcommitted
eq-fir: enable building as an llext module
Add support for LLEXT building to eq-fir. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent c7bbfed commit ed65e22

8 files changed

Lines changed: 61 additions & 12 deletions

File tree

app/configs/lnl/modules.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CONFIG_SAMPLE_SMART_AMP=m
22
CONFIG_COMP_MIXIN_MIXOUT=m
3+
CONFIG_COMP_FIR=m
34
CONFIG_COMP_IIR=m
45
CONFIG_COMP_DRC=m
56
CONFIG_COMP_SRC=m

app/configs/mtl/modules.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CONFIG_SAMPLE_SMART_AMP=m
22
CONFIG_COMP_MIXIN_MIXOUT=m
3+
CONFIG_COMP_FIR=m
34
CONFIG_COMP_IIR=m
45
CONFIG_COMP_DRC=m
56
CONFIG_COMP_SRC=m

src/audio/eq_fir/Kconfig

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

33
config COMP_FIR
4-
bool "FIR component"
4+
tristate "FIR component"
55
select MATH_FIR
66
select COMP_BLOB
77
depends on COMP_MODULE_ADAPTER
8+
default m if LIBRARY_DEFAULT_MODULAR
89
default y
910
help
1011
Select for FIR component. FIR performance can differ between DSP

src/audio/eq_fir/eq_fir.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static int eq_fir_free(struct processing_module *mod)
309309
{
310310
struct comp_data *cd = module_get_private_data(mod);
311311

312-
comp_info(mod->dev, "eq_fir_free()");
312+
comp_dbg(mod->dev, "eq_fir_free()");
313313

314314
eq_fir_free_delaylines(cd);
315315
comp_data_blob_handler_free(cd->model_handler);
@@ -456,7 +456,7 @@ static int eq_fir_reset(struct processing_module *mod)
456456
int i;
457457
struct comp_data *cd = module_get_private_data(mod);
458458

459-
comp_info(mod->dev, "eq_fir_reset()");
459+
comp_dbg(mod->dev, "eq_fir_reset()");
460460

461461
comp_data_blob_set_validator(cd->model_handler, NULL);
462462

@@ -481,3 +481,22 @@ static const struct module_interface eq_fir_interface = {
481481

482482
DECLARE_MODULE_ADAPTER(eq_fir_interface, eq_fir_uuid, eq_fir_tr);
483483
SOF_MODULE_INIT(eq_fir, sys_comp_module_eq_fir_interface_init);
484+
485+
#if CONFIG_COMP_FIR_MODULE
486+
/* modular: llext dynamic link */
487+
488+
#include <module/module/api_ver.h>
489+
#include <module/module/llext.h>
490+
#include <rimage/sof/user/manifest.h>
491+
492+
#define UUID_EQFIR 0xe7, 0x0c, 0xa9, 0x43, 0xa5, 0xf3, 0xdf, 0x41, \
493+
0xac, 0x06, 0xba, 0x98, 0x65, 0x1a, 0xe6, 0xa3
494+
495+
SOF_LLEXT_MOD_ENTRY(eq_fir, &eq_fir_interface);
496+
497+
static const struct sof_man_module_manifest mod_manifest __section(".module") __used =
498+
SOF_LLEXT_MODULE_MANIFEST("EQFIR", eq_fir_llext_entry, 1, UUID_EQFIR, 40);
499+
500+
SOF_LLEXT_BUILDINFO;
501+
502+
#endif

src/audio/eq_fir/eq_fir.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
#ifndef LOAD_TYPE
2+
#define LOAD_TYPE "0"
3+
#endif
4+
15
REM # eq fir module config
26
[[module.entry]]
37
name = "EQFIR"
4-
uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3"
8+
uuid = "43A90CE7-F3A5-41DF-AC06-BA98651AE6A3"
59
affinity_mask = "0x1"
610
instance_count = "40"
711
domain_types = "0"
8-
load_type = "0"
12+
load_type = LOAD_TYPE
913
module_type = "9"
1014
auto_start = "0"
1115
sched_caps = [1, 0x00008000]
@@ -15,6 +19,7 @@
1519
1, 0, 0xfeef, 0xf, 0xf, 0x1ff]
1620

1721
REM # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS]
22+
REM # identical for MTL and LNL
1823
mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0]
1924

2025
index = __COUNTER__
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2024 Intel Corporation.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
sof_llext_build("eq_fir"
5+
SOURCES ../eq_fir_hifi3.c
6+
../eq_fir_hifi2ep.c
7+
../eq_fir_generic.c
8+
../eq_fir.c
9+
../eq_fir_ipc4.c
10+
)
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 "../eq_fir.toml"
4+
5+
[module]
6+
count = __COUNTER__

zephyr/CMakeLists.txt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -568,13 +568,19 @@ elseif(CONFIG_IPC_MAJOR_4)
568568
set(ipc_suffix ipc4)
569569
endif()
570570

571-
zephyr_library_sources_ifdef(CONFIG_COMP_FIR
572-
${SOF_AUDIO_PATH}/eq_fir/eq_fir_hifi3.c
573-
${SOF_AUDIO_PATH}/eq_fir/eq_fir_hifi2ep.c
574-
${SOF_AUDIO_PATH}/eq_fir/eq_fir_generic.c
575-
${SOF_AUDIO_PATH}/eq_fir/eq_fir.c
576-
${SOF_AUDIO_PATH}/eq_fir/eq_fir_${ipc_suffix}.c
577-
)
571+
if(CONFIG_COMP_FIR STREQUAL "m")
572+
add_subdirectory(${SOF_AUDIO_PATH}/eq_fir/llext
573+
${PROJECT_BINARY_DIR}/eq_fir_llext)
574+
add_dependencies(app eq_iir)
575+
elseif(CONFIG_COMP_FIR)
576+
zephyr_library_sources(
577+
${SOF_AUDIO_PATH}/eq_fir/eq_fir_hifi3.c
578+
${SOF_AUDIO_PATH}/eq_fir/eq_fir_hifi2ep.c
579+
${SOF_AUDIO_PATH}/eq_fir/eq_fir_generic.c
580+
${SOF_AUDIO_PATH}/eq_fir/eq_fir.c
581+
${SOF_AUDIO_PATH}/eq_fir/eq_fir_${ipc_suffix}.c
582+
)
583+
endif()
578584

579585
if(CONFIG_COMP_IIR STREQUAL "m")
580586
add_subdirectory(${SOF_AUDIO_PATH}/eq_iir/llext

0 commit comments

Comments
 (0)