Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions app/overlays/mtl/dax_overlay.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@ CONFIG_COMP_MODULE_ADAPTER=y
CONFIG_COMP_DOLBY_DAX_AUDIO_PROCESSING=y
CONFIG_COMP_DOLBY_DAX_AUDIO_PROCESSING_MOCK=n
CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL=n
CONFIG_SOF_STACK_SIZE=8192

# LLEXT
CONFIG_LLEXT_HEAP_SIZE=32
# Disabled due to issues encountered on the MTL platform.
# See https://github.com/thesofproject/sof/issues/10370
CONFIG_LLEXT_EXPERIMENTAL=n
25 changes: 16 additions & 9 deletions src/audio/module_adapter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,24 @@ if(zephyr) ### Zephyr ###
endif()

if (CONFIG_COMP_DOLBY_DAX_AUDIO_PROCESSING)
zephyr_library_sources(
module/dolby/dax.c
)
if (CONFIG_COMP_DOLBY_DAX_AUDIO_PROCESSING_MOCK)
if(CONFIG_COMP_DOLBY_DAX_AUDIO_PROCESSING STREQUAL "m" AND DEFINED CONFIG_LLEXT)
add_subdirectory(module/dolby/llext
${PROJECT_BINARY_DIR}/dolby_dax_audio_processing_llext)
add_dependencies(app dolby_dax_audio_processing)
else()
zephyr_library_sources(
module/dolby/dax_mock.c
module/dolby/dax.c
)
else()
target_link_libraries(SOF INTERFACE m)
target_link_libraries(SOF INTERFACE c)
zephyr_library_import(dax_effect ${sof_top_dir}/third_party/lib/libdax.a)
if (CONFIG_COMP_DOLBY_DAX_AUDIO_PROCESSING_MOCK)
zephyr_library_sources(
module/dolby/dax_mock.c
)
else()
target_link_libraries(SOF INTERFACE m)
target_link_libraries(SOF INTERFACE c)
zephyr_library_import(dax_effect
${sof_top_dir}/third_party/lib/libdax.a)
endif()
endif()
endif()

Expand Down
3 changes: 1 addition & 2 deletions src/audio/module_adapter/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ if CADENCE_CODEC
endif # Cadence

config COMP_DOLBY_DAX_AUDIO_PROCESSING
bool "Dolby DAX audio processing component"
default n
tristate "Dolby DAX audio processing component"
help
Select to include Dolby DAX component. Dolby DAX component implements DAX API.
API definition together with pre-compiled library is shared by Dolby.
Expand Down
27 changes: 27 additions & 0 deletions src/audio/module_adapter/module/dolby/dax.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,34 @@ static const struct module_interface dolby_dax_audio_processing_interface = {
.free = sof_dax_free,
};

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

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

static const struct sof_man_module_manifest main_manifest __section(".module") __used = {
.module = {
.name = "DAX",
.uuid = SOF_REG_UUID(dolby_dax_audio_processing),
.entry_point = (uint32_t)(&dolby_dax_audio_processing_interface),
.instance_max_count = 1,
.type = {
.load_type = SOF_MAN_MOD_TYPE_LLEXT,
.domain_dp = 1,
},
.affinity_mask = 7,
}
};

SOF_LLEXT_BUILDINFO;

#else

DECLARE_MODULE_ADAPTER(dolby_dax_audio_processing_interface, dolby_dax_audio_processing_uuid,
dolby_dax_audio_processing_tr);
SOF_MODULE_INIT(dolby_dax_audio_processing,
sys_comp_module_dolby_dax_audio_processing_interface_init);

#endif
75 changes: 75 additions & 0 deletions src/audio/module_adapter/module/dolby/llext-wrap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2025 Intel Corporation. All rights reserved.

#include <stdint.h>
#include <errno.h>
#include <assert.h>
#include <rtos/symbol.h>

/*
* Stubs that are needed for linkage of some applications or libraries
* that come from porting userspace code. Anyone porting should
* make sure that any code does not depend on working copies of these
* reentrant functions. We will fail for any caller.
*/

struct stat;
struct _reent;

size_t _read_r(struct _reent *ptr, int fd, char *buf, size_t cnt)
{
errno = -ENOTSUP;
return -ENOTSUP;
}

size_t _write_r(struct _reent *ptr, int fd, char *buf, size_t cnt)
{
errno = -ENOTSUP;
return -ENOTSUP;
}

void *_sbrk_r(struct _reent *ptr, ptrdiff_t incr)
{
errno = -ENOTSUP;
return NULL;
}

int _lseek_r(struct _reent *ptr, int fd, int pos, int whence)
{
errno = -ENOTSUP;
return -ENOTSUP;
}

int _kill_r(struct _reent *ptr, int pid, int sig)
{
errno = -ENOTSUP;
return -ENOTSUP;
}

int _getpid_r(struct _reent *ptr)
{
errno = -ENOTSUP;
return -ENOTSUP;
}

int _fstat_r(struct _reent *ptr, int fd, struct stat *pstat)
{
errno = -ENOTSUP;
return -ENOTSUP;
}

int _close_r(struct _reent *ptr, int fd)
{
errno = -ENOTSUP;
return -ENOTSUP;
}

void _exit(int status)
{
assert(0);
while (1) {
/* spin forever */
}
/* NOTREACHED */
}
17 changes: 17 additions & 0 deletions src/audio/module_adapter/module/dolby/llext/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright(c) 2025 Dolby Laboratories.
# SPDX-License-Identifier: Apache-2.0

if(CONFIG_COMP_DOLBY_DAX_AUDIO_PROCESSING_MOCK)
sof_llext_build("dolby_dax_audio_processing"
SOURCES ../dax.c
../dax_mock.c
INCLUDES ${sof_top_dir}/third_party/include
)
else()
sof_llext_build("dolby_dax_audio_processing"
SOURCES ../dax.c ../llext-wrap.c
INCLUDES ${sof_top_dir}/third_party/include
LIBS_PATH ${sof_top_dir}/third_party/lib/
LIBS dax m c gcc
)
endif()
10 changes: 10 additions & 0 deletions src/audio/module_adapter/module/dolby/llext/llext.toml.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2025 Dolby Laboratories. All rights reserved.
*/
#include <tools/rimage/config/platform.toml>
#define LOAD_TYPE "2"
#include "../dax.toml"

[module]
count = __COUNTER__
Loading