Skip to content

Commit

Permalink
audio: volume: move volume out from module adapter
Browse files Browse the repository at this point in the history
move volume from module adapter to src/audio directory, it is a
critical audio component.

Signed-off-by: Baofeng Tian <[email protected]>
  • Loading branch information
btian1 authored and lgirdwood committed Aug 30, 2023
1 parent 550968b commit 7d9a3ca
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 44 deletions.
9 changes: 5 additions & 4 deletions src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC)
if(CONFIG_COMP_MFCC)
add_subdirectory(mfcc)
endif()
if(CONFIG_COMP_VOLUME)
add_subdirectory(volume)
endif()
subdirs(pipeline)
add_subdirectory(google)
if(CONFIG_COMP_CHAIN_DMA)
Expand Down Expand Up @@ -164,11 +167,9 @@ set(sof_audio_modules mixer volume src asrc eq-fir eq-iir dcblock crossover tdfb

# sources for each module
if(CONFIG_IPC_MAJOR_3)
set(volume_sources module_adapter/module/volume/volume.c module_adapter/module/volume/volume_generic.c
module_adapter/module/volume/volume_ipc3.c)
set(volume_sources volume/volume.c volume/volume_generic.c volume/volume_ipc3.c)
elseif(CONFIG_IPC_MAJOR_4)
set(volume_sources module_adapter/module/volume/volume.c module_adapter/module/volume/volume_generic.c
module_adapter/module/volume/volume_ipc4.c)
set(volume_sources volume/volume.c volume/volume_generic.c volume/volume_ipc4.c)
endif()
set(mixer_sources ${mixer_src})
set(src_sources src/src.c src/src_generic.c)
Expand Down
16 changes: 0 additions & 16 deletions src/audio/module_adapter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,6 @@
add_local_sources(sof module_adapter.c module/generic.c)

if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC)
if(CONFIG_COMP_VOLUME)
add_local_sources(sof
module/volume/volume_generic.c
module/volume/volume_hifi3.c
module/volume/volume_hifi4.c
module/volume/volume_generic_with_peakvol.c
module/volume/volume_hifi3_with_peakvol.c
module/volume/volume_hifi4_with_peakvol.c
module/volume/volume.c)
if(CONFIG_IPC_MAJOR_3)
add_local_sources(sof module/volume/volume_ipc3.c)
elseif(CONFIG_IPC_MAJOR_4)
add_local_sources(sof module/volume/volume_ipc4.c)
endif()
endif()

if(CONFIG_CADENCE_CODEC)
add_local_sources(sof module/cadence.c)

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

if(CONFIG_COMP_VOLUME)
add_local_sources(sof
volume_generic.c
volume_hifi3.c
volume_hifi4.c
volume_generic_with_peakvol.c
volume_hifi3_with_peakvol.c
volume_hifi4_with_peakvol.c
volume.c)
if(CONFIG_IPC_MAJOR_3)
add_local_sources(sof volume_ipc3.c)
elseif(CONFIG_IPC_MAJOR_4)
add_local_sources(sof volume_ipc4.c)
endif()
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions test/cmocka/src/audio/volume/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ target_include_directories(volume_process PRIVATE ${PROJECT_SOURCE_DIR}/src/audi
add_compile_options(-DUNIT_TEST)

add_library(audio_for_volume STATIC
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/volume/volume.c
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/volume/volume_ipc3.c
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/volume/volume_generic.c
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/volume/volume_hifi3.c
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/volume/volume_hifi4.c
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/volume/volume_generic_with_peakvol.c
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/volume/volume_hifi3_with_peakvol.c
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/volume/volume_hifi4_with_peakvol.c
${PROJECT_SOURCE_DIR}/src/audio/volume/volume.c
${PROJECT_SOURCE_DIR}/src/audio/volume/volume_ipc3.c
${PROJECT_SOURCE_DIR}/src/audio/volume/volume_generic.c
${PROJECT_SOURCE_DIR}/src/audio/volume/volume_hifi3.c
${PROJECT_SOURCE_DIR}/src/audio/volume/volume_hifi4.c
${PROJECT_SOURCE_DIR}/src/audio/volume/volume_generic_with_peakvol.c
${PROJECT_SOURCE_DIR}/src/audio/volume/volume_hifi3_with_peakvol.c
${PROJECT_SOURCE_DIR}/src/audio/volume/volume_hifi4_with_peakvol.c
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter.c
${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/generic.c
${PROJECT_SOURCE_DIR}/src/audio/buffer.c
Expand Down
32 changes: 16 additions & 16 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -499,25 +499,25 @@ zephyr_library_sources_ifdef(CONFIG_SAMPLE_KEYPHRASE

if(CONFIG_IPC_MAJOR_3)
zephyr_library_sources_ifdef(CONFIG_COMP_VOLUME
${SOF_AUDIO_MODULES_PATH}/volume/volume_hifi4.c
${SOF_AUDIO_MODULES_PATH}/volume/volume_hifi3.c
${SOF_AUDIO_MODULES_PATH}/volume/volume_generic.c
${SOF_AUDIO_MODULES_PATH}/volume/volume_hifi4_with_peakvol.c
${SOF_AUDIO_MODULES_PATH}/volume/volume_hifi3_with_peakvol.c
${SOF_AUDIO_MODULES_PATH}/volume/volume_generic_with_peakvol.c
${SOF_AUDIO_MODULES_PATH}/volume/volume.c
${SOF_AUDIO_MODULES_PATH}/volume/volume_ipc3.c
${SOF_AUDIO_PATH}/volume/volume_hifi4.c
${SOF_AUDIO_PATH}/volume/volume_hifi3.c
${SOF_AUDIO_PATH}/volume/volume_generic.c
${SOF_AUDIO_PATH}/volume/volume_hifi4_with_peakvol.c
${SOF_AUDIO_PATH}/volume/volume_hifi3_with_peakvol.c
${SOF_AUDIO_PATH}/volume/volume_generic_with_peakvol.c
${SOF_AUDIO_PATH}/volume/volume.c
${SOF_AUDIO_PATH}/volume/volume_ipc3.c
)
elseif(CONFIG_IPC_MAJOR_4)
zephyr_library_sources_ifdef(CONFIG_COMP_VOLUME
${SOF_AUDIO_MODULES_PATH}/volume/volume_hifi4.c
${SOF_AUDIO_MODULES_PATH}/volume/volume_hifi3.c
${SOF_AUDIO_MODULES_PATH}/volume/volume_generic.c
${SOF_AUDIO_MODULES_PATH}/volume/volume_hifi4_with_peakvol.c
${SOF_AUDIO_MODULES_PATH}/volume/volume_hifi3_with_peakvol.c
${SOF_AUDIO_MODULES_PATH}/volume/volume_generic_with_peakvol.c
${SOF_AUDIO_MODULES_PATH}/volume/volume.c
${SOF_AUDIO_MODULES_PATH}/volume/volume_ipc4.c
${SOF_AUDIO_PATH}/volume/volume_hifi4.c
${SOF_AUDIO_PATH}/volume/volume_hifi3.c
${SOF_AUDIO_PATH}/volume/volume_generic.c
${SOF_AUDIO_PATH}/volume/volume_hifi4_with_peakvol.c
${SOF_AUDIO_PATH}/volume/volume_hifi3_with_peakvol.c
${SOF_AUDIO_PATH}/volume/volume_generic_with_peakvol.c
${SOF_AUDIO_PATH}/volume/volume.c
${SOF_AUDIO_PATH}/volume/volume_ipc4.c
)
endif()

Expand Down

0 comments on commit 7d9a3ca

Please sign in to comment.