Skip to content

Commit

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

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
  • Loading branch information
lyakh committed Sep 13, 2024
1 parent 2206f01 commit 69208a2
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/audio/multiband_drc/Kconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: BSD-3-Clause

config COMP_MULTIBAND_DRC
depends on COMP_IIR && COMP_CROSSOVER && COMP_DRC = y
bool "Multiband Dynamic Range Compressor component"
depends on COMP_IIR && COMP_CROSSOVER && COMP_DRC
tristate "Multiband Dynamic Range Compressor component"
select CORDIC_FIXED
select COMP_BLOB
default n
Expand Down
8 changes: 8 additions & 0 deletions src/audio/multiband_drc/llext/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2024 Intel Corporation.
# SPDX-License-Identifier: Apache-2.0

sof_llext_build("multiband_drc"
SOURCES ../multiband_drc.c
../multiband_drc_generic.c
../multiband_drc_ipc4.c
)
6 changes: 6 additions & 0 deletions src/audio/multiband_drc/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 "../multiband_drc.toml"

[module]
count = __COUNTER__
19 changes: 19 additions & 0 deletions src/audio/multiband_drc/multiband_drc.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,3 +419,22 @@ static const struct module_interface multiband_drc_interface = {

DECLARE_MODULE_ADAPTER(multiband_drc_interface, multiband_drc_uuid, multiband_drc_tr);
SOF_MODULE_INIT(multiband_drc, sys_comp_module_multiband_drc_interface_init);

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

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

#define UUID_MULTIBAND_DRC 0x56, 0x22, 0x9F, 0x0D, 0x4F, 0x8E, 0xB3, 0x47, 0x48, 0x84, \
0x23, 0x9A, 0x33, 0x4F, 0x11, 0x91

SOF_LLEXT_MOD_ENTRY(multiband_drc, &multiband_drc_interface);

static const struct sof_man_module_manifest mod_manifest __section(".module") __used =
SOF_LLEXT_MODULE_MANIFEST("MB_DRC", multiband_drc_llext_entry, 1, UUID_MULTIBAND_DRC, 40);

SOF_LLEXT_BUILDINFO;

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

REM # Multiband-DRC module config
[[module.entry]]
name = "MB_DRC"
uuid = "0D9F2256-8E4F-47B3-8448-239A334F1191"
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
16 changes: 11 additions & 5 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -869,11 +869,17 @@ if(NOT CONFIG_COMP_DRC STREQUAL "n")
)
endif()

zephyr_library_sources_ifdef(CONFIG_COMP_MULTIBAND_DRC
${SOF_AUDIO_PATH}/multiband_drc/multiband_drc.c
${SOF_AUDIO_PATH}/multiband_drc/multiband_drc_generic.c
${SOF_AUDIO_PATH}/multiband_drc/multiband_drc_${ipc_suffix}.c
)
if(CONFIG_COMP_MULTIBAND_DRC STREQUAL "m")
add_subdirectory(${SOF_AUDIO_PATH}/multiband_drc/llext
${PROJECT_BINARY_DIR}/multiband_drc_llext)
add_dependencies(app multiband_drc)
elseif(CONFIG_COMP_MULTIBAND_DRC)
zephyr_library_sources_ifdef(CONFIG_COMP_MULTIBAND_DRC
${SOF_AUDIO_PATH}/multiband_drc/multiband_drc.c
${SOF_AUDIO_PATH}/multiband_drc/multiband_drc_generic.c
${SOF_AUDIO_PATH}/multiband_drc/multiband_drc_${ipc_suffix}.c
)
endif()

zephyr_library_sources_ifdef(CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING
${SOF_AUDIO_PATH}/google/google_rtc_audio_processing.c
Expand Down

0 comments on commit 69208a2

Please sign in to comment.