Skip to content

Commit b95fc72

Browse files
lyakhlgirdwood
authored andcommitted
waves: add support for IPC4 compilation, including as LLEXT
With this waves can be built as a part of IPC4 configuration - either linked into the base image or as a LLEXT module. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 9b55f48 commit b95fc72

7 files changed

Lines changed: 84 additions & 9 deletions

File tree

src/audio/module_adapter/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,9 @@ endif # Cadence
174174
files specific to PASSTHROUGH base codecs.
175175

176176
config WAVES_CODEC
177-
bool "Waves codec"
177+
tristate "Waves codec"
178178
select WAVES_CODEC_STUB if COMP_STUBS
179+
default m if LIBRARY_DEFAULT_MODULAR
179180
default n
180181
help
181182
Select to include Waves codec. Waves codec implements MaxxEffect API.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2025 Intel Corporation.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(CONFIG_WAVES_CODEC_STUB)
5+
sof_llext_build("waves"
6+
SOURCES ../waves.c
7+
../maxx_stub.c
8+
)
9+
else()
10+
message(FATAL_ERROR "Add library linking support in src/audio/module_adapter/module/waves/llext/CMakeLists.txt")
11+
endif()
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 "../waves.toml"
4+
5+
[module]
6+
count = __COUNTER__

src/audio/module_adapter/module/waves/waves.c

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
#define NUM_IO_STREAMS (1)
2020

2121
SOF_DEFINE_REG_UUID(waves);
22+
2223
DECLARE_TR_CTX(waves_tr, SOF_UUID(waves_uuid), LOG_LEVEL_INFO);
24+
LOG_MODULE_REGISTER(waves, CONFIG_SOF_LOG_LEVEL);
2325

2426
struct waves_codec_data {
2527
uint32_t sample_rate;
@@ -248,7 +250,8 @@ static int waves_effect_check(struct comp_dev *dev)
248250

249251
/* different interleaving is not supported */
250252
if (audio_stream_get_buffer_fmt(src_fmt) != audio_stream_get_buffer_fmt(snk_fmt)) {
251-
comp_err(dev, "waves_effect_check() source %d sink %d buffer format mismatch");
253+
comp_err(dev, "waves_effect_check() source %d sink %d buffer format mismatch",
254+
audio_stream_get_buffer_fmt(src_fmt), audio_stream_get_buffer_fmt(snk_fmt));
252255
return -EINVAL;
253256
}
254257

@@ -896,3 +899,24 @@ static const struct module_interface waves_interface = {
896899

897900
DECLARE_MODULE_ADAPTER(waves_interface, waves_uuid, waves_tr);
898901
SOF_MODULE_INIT(waves, sys_comp_module_waves_interface_init);
902+
903+
#if CONFIG_WAVES_CODEC_MODULE && CONFIG_WAVES_CODEC_STUB
904+
/* modular: llext dynamic link */
905+
906+
#include <module/module/api_ver.h>
907+
#include <module/module/llext.h>
908+
#include <rimage/sof/user/manifest.h>
909+
910+
/* d944281a-afe9-4695-a043-d7f62b89538e */
911+
#define UUID_WAVES_CODEC 0x1A, 0x28, 0x44, 0xD9, 0xE9, 0xAF, 0x95, 0x46, \
912+
0xA0, 0x43, 0xD7, 0xF6, 0x2B, 0x89, 0x53, 0x8E
913+
914+
SOF_LLEXT_MOD_ENTRY(waves, &waves_interface);
915+
916+
static const struct sof_man_module_manifest mod_manifest __section(".module") __used =
917+
SOF_LLEXT_MODULE_MANIFEST("WAVES", waves_llext_entry,
918+
7, UUID_WAVES_CODEC, 8);
919+
920+
SOF_LLEXT_BUILDINFO;
921+
922+
#endif
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#ifndef LOAD_TYPE
2+
#define LOAD_TYPE "0"
3+
#endif
4+
5+
REM # waves module config
6+
[[module.entry]]
7+
name = "WAVES"
8+
uuid = "D944281A-AFE9-4695-A043-D7F62B89538E"
9+
affinity_mask = "0x1"
10+
instance_count = "4"
11+
domain_types = "0"
12+
load_type = LOAD_TYPE
13+
module_type = "13"
14+
auto_start = "0"
15+
sched_caps = [1, 0x00008000]
16+
17+
REM # pin = [dir, type, sample rate, size, container, channel-cfg]
18+
pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff,
19+
1, 0, 0xfeef, 0xf, 0xf, 0x1ff]
20+
21+
REM # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS]
22+
mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0]
23+
24+
index = __COUNTER__

tools/rimage/config/mtl.toml.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@
134134
#include <audio/module_adapter/module/cadence.toml>
135135
#endif
136136

137+
#if defined(CONFIG_WAVES_CODEC) || defined(LLEXT_FORCE_ALL_MODULAR)
138+
#include <audio/module_adapter/module/waves/waves.toml>
139+
#endif
140+
137141
#if defined(CONFIG_COMP_RTNR) || defined(LLEXT_FORCE_ALL_MODULAR)
138142
#include <audio/rtnr/rtnr.toml>
139143
#endif

zephyr/CMakeLists.txt

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,13 +1139,18 @@ elseif(CONFIG_DTS_CODEC)
11391139
endif()
11401140
endif()
11411141

1142-
zephyr_library_sources_ifdef(CONFIG_WAVES_CODEC
1143-
${SOF_AUDIO_PATH}/module_adapter/module/waves/waves.c
1144-
)
1145-
1146-
zephyr_library_sources_ifdef(CONFIG_WAVES_CODEC_STUB
1147-
${SOF_AUDIO_PATH}/module_adapter/module/waves/maxx_stub.c
1148-
)
1142+
if(CONFIG_WAVES_CODEC STREQUAL "m")
1143+
add_subdirectory(${SOF_AUDIO_PATH}/module_adapter/module/waves/llext
1144+
${PROJECT_BINARY_DIR}/waves_llext)
1145+
add_dependencies(app waves)
1146+
elseif(CONFIG_WAVES_CODEC)
1147+
zephyr_library_sources(
1148+
${SOF_AUDIO_PATH}/module_adapter/module/waves/waves.c
1149+
)
1150+
zephyr_library_sources_ifdef(CONFIG_WAVES_CODEC_STUB
1151+
${SOF_AUDIO_PATH}/module_adapter/module/waves/maxx_stub.c
1152+
)
1153+
endif()
11491154

11501155
if(CONFIG_PROBE STREQUAL "m")
11511156
add_subdirectory(${SOF_SRC_PATH}/probe/llext

0 commit comments

Comments
 (0)