Skip to content

Commit

Permalink
dcblock: enable building as an llext module
Browse files Browse the repository at this point in the history
Add support for LLEXT building to dcblock.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
  • Loading branch information
lyakh committed Sep 10, 2024
1 parent 3b69e92 commit 541d682
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 9 deletions.
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace15_mtpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y
CONFIG_COMP_SRC_LITE=y
CONFIG_COMP_DRC=m
CONFIG_COMP_CROSSOVER=m
CONFIG_COMP_DCBLOCK=m
CONFIG_COMP_SEL=m
CONFIG_COMP_MULTIBAND_DRC=y
CONFIG_COMP_MFCC=y
Expand Down
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace20_lnl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CONFIG_COMP_SRC=y
CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y
CONFIG_COMP_DRC=m
CONFIG_COMP_CROSSOVER=m
CONFIG_COMP_DCBLOCK=m
CONFIG_COMP_SEL=m

# power settings
Expand Down
2 changes: 1 addition & 1 deletion src/audio/dcblock/Kconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause

config COMP_DCBLOCK
bool "DC Blocking Filter component"
tristate "DC Blocking Filter component"
default y
help
Select for DC Blocking Filter component. This component filters out
Expand Down
19 changes: 19 additions & 0 deletions src/audio/dcblock/dcblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,3 +257,22 @@ static const struct module_interface dcblock_interface = {

DECLARE_MODULE_ADAPTER(dcblock_interface, dcblock_uuid, dcblock_tr);
SOF_MODULE_INIT(dcblock, sys_comp_module_dcblock_interface_init);

#if CONFIG_COMP_DCBLOCK_MODULE
/* modular: llext dynamic link */

#include <module/module/api_ver.h>
#include <module/module/llext.h>
#include <rimage/sof/user/manifest.h>

#define UUID_DCBLOCK 0xAF, 0xEF, 0x09, 0xB8, 0x81, 0x56, 0xB1, 0x42, 0xD6, 0x9E, \
0x04, 0xBB, 0x01, 0x2D, 0xD3, 0x84

SOF_LLEXT_MOD_ENTRY(dcblock, &dcblock_interface);

static const struct sof_man_module_manifest mod_manifest __section(".module") __used =
SOF_LLEXT_MODULE_MANIFEST("DCBLOCK", dcblock_llext_entry, 1, UUID_DCBLOCK, 40);

SOF_LLEXT_BUILDINFO;

#endif
6 changes: 5 additions & 1 deletion src/audio/dcblock/dcblock.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#ifndef LOAD_TYPE
#define LOAD_TYPE "0"
#endif

REM # DCblock module config
[[module.entry]]
name = "DCBLOCK"
uuid = "B809EFAF-5681-42B1-9ED6-04BB012DD384"
affinity_mask = "0x1"
instance_count = "40"
domain_types = "0"
load_type = "0"
load_type = LOAD_TYPE
module_type = "9"
auto_start = "0"
sched_caps = [1, 0x00008000]
Expand Down
10 changes: 10 additions & 0 deletions src/audio/dcblock/llext/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2024 Intel Corporation.
# SPDX-License-Identifier: Apache-2.0

sof_llext_build("dcblock"
SOURCES ../dcblock.c
../dcblock_generic.c
../dcblock_hifi3.c
../dcblock_hifi4.c
../dcblock_ipc4.c
)
6 changes: 6 additions & 0 deletions src/audio/dcblock/llext/llext.toml.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <tools/rimage/config/platform.toml>
#define LOAD_TYPE "2"
#include "../dcblock.toml"

[module]
count = __COUNTER__
20 changes: 13 additions & 7 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,19 @@ zephyr_library_sources_ifdef(CONFIG_COMP_ASRC
${SOF_AUDIO_PATH}/asrc/asrc_${ipc_suffix}.c
)

zephyr_library_sources_ifdef(CONFIG_COMP_DCBLOCK
${SOF_AUDIO_PATH}/dcblock/dcblock_generic.c
${SOF_AUDIO_PATH}/dcblock/dcblock.c
${SOF_AUDIO_PATH}/dcblock/dcblock_hifi3.c
${SOF_AUDIO_PATH}/dcblock/dcblock_hifi4.c
${SOF_AUDIO_PATH}/dcblock/dcblock_${ipc_suffix}.c
)
if(CONFIG_COMP_DCBLOCK STREQUAL "m")
add_subdirectory(${SOF_AUDIO_PATH}/dcblock/llext
${PROJECT_BINARY_DIR}/dcblock_llext)
add_dependencies(app dcblock)
elseif(CONFIG_COMP_DCBLOCK)
zephyr_library_sources(
${SOF_AUDIO_PATH}/dcblock/dcblock_generic.c
${SOF_AUDIO_PATH}/dcblock/dcblock.c
${SOF_AUDIO_PATH}/dcblock/dcblock_hifi3.c
${SOF_AUDIO_PATH}/dcblock/dcblock_hifi4.c
${SOF_AUDIO_PATH}/dcblock/dcblock_${ipc_suffix}.c
)
endif()

if(CONFIG_COMP_SEL STREQUAL "m")
add_subdirectory(${SOF_AUDIO_PATH}/selector/llext
Expand Down

0 comments on commit 541d682

Please sign in to comment.