diff --git a/src/audio/module_adapter/CMakeLists.txt b/src/audio/module_adapter/CMakeLists.txt index ffaa78d06..6f2b7e0d2 100644 --- a/src/audio/module_adapter/CMakeLists.txt +++ b/src/audio/module_adapter/CMakeLists.txt @@ -77,10 +77,14 @@ if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC) endif() if(CONFIG_DTS_CODEC) - add_local_sources(sof module/dts.c) + add_local_sources(sof module/dts/dts.c) target_compile_definitions(sof PRIVATE -DDTS_MATH_INT32 -DDTS_XTENSA) + if (CONFIG_DTS_CODEC_STUB) + add_local_sources(sof module/dts/dts_stub.c) + else() sof_add_static_library(DtsCodec ${CMAKE_CURRENT_LIST_DIR}/lib/release/libdts-sof-interface-i32.a) endif() + endif() return() endif() diff --git a/src/audio/module_adapter/Kconfig b/src/audio/module_adapter/Kconfig index e4a5dd46f..1bd6da3e5 100644 --- a/src/audio/module_adapter/Kconfig +++ b/src/audio/module_adapter/Kconfig @@ -259,6 +259,7 @@ endif # volume config DTS_CODEC bool "DTS codec" default n + select DTS_CODEC_STUB if COMP_STUBS help Select to include DTS codec. In order to compile with this option enabled, a pre-compiled static library @@ -266,6 +267,14 @@ endif # volume then compilation errors will occur. For more information, please contact sales@xperi.com + config DTS_CODEC_STUB + bool "DTS codec stub" + depends on DTS_CODEC + default n + help + Select to include DTS codec stub library. This is meant for testing and CI + purposes only. + config INTEL_MODULES bool "Intel modules" default n diff --git a/src/audio/module_adapter/module/dts.c b/src/audio/module_adapter/module/dts/dts.c similarity index 100% rename from src/audio/module_adapter/module/dts.c rename to src/audio/module_adapter/module/dts/dts.c diff --git a/src/audio/module_adapter/module/dts/dts_stub.c b/src/audio/module_adapter/module/dts/dts_stub.c new file mode 100644 index 000000000..140ef2836 --- /dev/null +++ b/src/audio/module_adapter/module/dts/dts_stub.c @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2023 Google LLC. All rights reserved. +// +// Author: Curtis Malainey + +#include + +DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceInit( + DtsSofInterfaceInst **ppInst, + DtsSofInterfaceAllocateMemory pMemoryAllocationFn, + DtsSofInterfaceFreeMemory pMemoryFreeFn, + void *MemoryAllocationContext) DTS_SOF_INTERFACE_NOEXCEPT +{ + return DTS_SOF_INTERFACE_RESULT_SUCCESS; +} + +DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfacePrepare( + DtsSofInterfaceInst* pInst, + const DtsSofInterfaceBufferConfiguration* pBufferConfiguration, + void** ppSofInputBuffer, + unsigned int* pSofInputBufferSize, + void** ppSofOutputBuffer, + unsigned int* pSofOutputBufferSize) DTS_SOF_INTERFACE_NOEXCEPT +{ + return DTS_SOF_INTERFACE_RESULT_SUCCESS; +} + +DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceInitProcess( + DtsSofInterfaceInst* pInst) DTS_SOF_INTERFACE_NOEXCEPT +{ + return DTS_SOF_INTERFACE_RESULT_SUCCESS; +} + +DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceProcess( + DtsSofInterfaceInst* pInst, + unsigned int* pNumBytesProcessed) DTS_SOF_INTERFACE_NOEXCEPT +{ + return DTS_SOF_INTERFACE_RESULT_SUCCESS; +} + +DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceApplyConfig( + DtsSofInterfaceInst* pInst, + int parameterId, + const void *pData, + unsigned int dataSize) DTS_SOF_INTERFACE_NOEXCEPT +{ + return DTS_SOF_INTERFACE_RESULT_SUCCESS; +} + +DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceReset( + DtsSofInterfaceInst* pInst) DTS_SOF_INTERFACE_NOEXCEPT +{ + return DTS_SOF_INTERFACE_RESULT_SUCCESS; +} + +DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceFree( + DtsSofInterfaceInst* pInst) DTS_SOF_INTERFACE_NOEXCEPT +{ + return DTS_SOF_INTERFACE_RESULT_SUCCESS; +} + +DtsSofInterfaceResult DTS_SOF_INTERFACE_API dtsSofInterfaceGetVersion( + DtsSofInterfaceVersionInfo* pInterfaceVersion, + DtsSofInterfaceVersionInfo* pSdkVersion) DTS_SOF_INTERFACE_NOEXCEPT +{ + return DTS_SOF_INTERFACE_RESULT_SUCCESS; +} diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index acf5ed134..56ca7fa71 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -730,7 +730,11 @@ zephyr_library_sources_ifdef(CONFIG_COMP_GOOGLE_HOTWORD_DETECT ) zephyr_library_sources_ifdef(CONFIG_DTS_CODEC - ${SOF_AUDIO_PATH}/module_adapter/module/dts.c + ${SOF_AUDIO_PATH}/module_adapter/module/dts/dts.c +) + +zephyr_library_sources_ifdef(CONFIG_DTS_CODEC_STUB + ${SOF_AUDIO_PATH}/module_adapter/module/dts/dts_stub.c ) zephyr_library_sources_ifdef(CONFIG_WAVES_CODEC