Skip to content

Commit

Permalink
audio: dts: move dts code to standalone folder
Browse files Browse the repository at this point in the history
This was suggested in PR#8389. Since the module uses
module_interface, it doesn't have to put it under module_adaper/module/.
Move dts codes from src/audo/module_adapter/module/ to src/audio/codec.

Signed-off-by: Joe Cheng <[email protected]>
  • Loading branch information
joechengxperi authored and kv2019i committed Dec 1, 2023
1 parent 9dfe9c1 commit ce4acfd
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 32 deletions.
3 changes: 3 additions & 0 deletions src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
if(CONFIG_COMP_CHAIN_DMA)
add_local_sources(sof chain_dma.c)
endif()
if(CONFIG_DTS_CODEC)
add_subdirectory(codec)
endif()

return()
endif()
Expand Down
2 changes: 2 additions & 0 deletions src/audio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ rsource "rtnr/Kconfig"

rsource "mfcc/Kconfig"

rsource "codec/Kconfig"

endmenu # "Audio components"

menu "Data formats"
Expand Down
12 changes: 12 additions & 0 deletions src/audio/codec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-License-Identifier: BSD-3-Clause

if(CONFIG_DTS_CODEC)
add_local_sources(sof dts/dts.c)
target_compile_definitions(sof PRIVATE -DDTS_MATH_INT32 -DDTS_XTENSA)
if (CONFIG_DTS_CODEC_STUB)
add_local_sources(sof dts/dts_stub.c)
else()
sof_add_static_library(DtsCodec
${SOF_ROOT_SOURCE_DIRECTORY}/third_party/lib/libdts-sof-interface-i32.a)
endif()
endif()
20 changes: 20 additions & 0 deletions src/audio/codec/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-License-Identifier: BSD-3-Clause

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
must be provided by DTS for your target platform. If this library is not present
then compilation errors will occur.
For more information, please contact [email protected]

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.
File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions src/audio/module_adapter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,5 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
# folder with Waves API must be among include directories
endif()

if(CONFIG_DTS_CODEC)
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
${SOF_ROOT_SOURCE_DIRECTORY}/third_party/lib/libdts-sof-interface-i32.a)
endif()
endif()

return()
endif()
19 changes: 0 additions & 19 deletions src/audio/module_adapter/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -176,25 +176,6 @@ endif # Cadence
Select to build the waves codec with a stub file. This should only be used for
testing or CI.

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
must be provided by DTS for your target platform. If this library is not present
then compilation errors will occur.
For more information, please contact [email protected]

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
Expand Down
4 changes: 2 additions & 2 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,12 @@ zephyr_library_sources_ifdef(CONFIG_COMP_GOOGLE_HOTWORD_DETECT
)

zephyr_library_sources_ifdef(CONFIG_DTS_CODEC
${SOF_AUDIO_PATH}/module_adapter/module/dts/dts.c
${SOF_AUDIO_PATH}/codec/dts/dts.c
)
if (CONFIG_DTS_CODEC)
if (CONFIG_DTS_CODEC_STUB)
zephyr_library_sources(
${SOF_AUDIO_PATH}/module_adapter/module/dts/dts_stub.c
${SOF_AUDIO_PATH}/codec/dts/dts_stub.c
)
else()
zephyr_library_import(DtsCodec
Expand Down

0 comments on commit ce4acfd

Please sign in to comment.