From 88dbb6c1537a48cce7cfa4075a4bf553680f76be Mon Sep 17 00:00:00 2001 From: Annemarie Porter Date: Wed, 6 Aug 2025 13:33:08 -0700 Subject: [PATCH 1/3] modules: Clean up pcm_converter build files Clean up pcm converter build file by compiling the iir and dynamic resamplers in their own build files, and linking them to the audioreach-engine library. This prevents the need to link the resampler libraries to the pcm converter directly. Signed-off-by: Annemarie Porter --- modules/CMakeLists.txt | 2 ++ modules/cmn/pcm_mf_cnv/build/CMakeLists.txt | 37 --------------------- 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index b23057e..46aac23 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -33,6 +33,8 @@ if(CONFIG_MSIIR) endif() if(CONFIG_PCM_CNV) add_subdirectory(cmn/pcm_mf_cnv/build) + add_subdirectory(processing/resamplers/dynamic_resampler/build) + add_subdirectory(processing/resamplers/iir_resampler/build) endif() if(CONFIG_DRC) add_subdirectory(processing/gain_control/drc/build) diff --git a/modules/cmn/pcm_mf_cnv/build/CMakeLists.txt b/modules/cmn/pcm_mf_cnv/build/CMakeLists.txt index dd377ff..65511e5 100644 --- a/modules/cmn/pcm_mf_cnv/build/CMakeLists.txt +++ b/modules/cmn/pcm_mf_cnv/build/CMakeLists.txt @@ -22,43 +22,6 @@ set(pcm_cnv_sources ${LIB_ROOT}/lib/src/pc_float/pc_float.cpp ) -include_directories( - ${LIB_ROOT}/capi/pcm_cnv/api - ${LIB_ROOT}/capi/pcm_cnv/inc - ${LIB_ROOT}/capi/pcm_cnv/src - ${LIB_ROOT}/capi/mfc/api - ${LIB_ROOT}/capi/mfc/inc - ${LIB_ROOT}/lib/inc - ${PROJECT_SOURCE_DIR}/modules/audio/pcm_encoder/api - ${PROJECT_SOURCE_DIR}/modules/audio/pcm_encoder/inc - ${PROJECT_SOURCE_DIR}/modules/audio/pcm_decoder/api - ${PROJECT_SOURCE_DIR}/modules/audio/pcm_decoder/inc - ${PROJECT_SOURCE_DIR}/modules/processing/channel_mixer/lib/inc - ${PROJECT_SOURCE_DIR}/modules/processing/channel_mixer/api/ - ${PROJECT_SOURCE_DIR}/modules/processing/resamplers/dynamic_resampler/inc - ${PROJECT_SOURCE_DIR}/modules/processing/resamplers/iir_resampler/inc - ${PROJECT_SOURCE_DIR}/fwk/spf/utils/cmn/inc - ${PROJECT_SOURCE_DIR}/fwk/spf/utils/interleaver/inc - ${PROJECT_SOURCE_DIR}/fwk/spf/utils/lpi_pool/inc - ${PROJECT_SOURCE_DIR}/fwk/spf/interfaces/fwk/api - ${PROJECT_SOURCE_DIR}/fwk/spf/containers/cmn/graph_utils/inc -) - -add_library(pcm_cnv ${pcm_cnv_sources}) - -#Link dynamic_resampler and iir_resampler binaries to pcm_cnv library -add_library(dynamic_resampler STATIC IMPORTED GLOBAL) -set(lib_abs_path ${CMAKE_CURRENT_SOURCE_DIR}/../../../processing/resamplers/dynamic_resampler/bin/arm/libdynamic_resampler.a) -set_target_properties(dynamic_resampler PROPERTIES IMPORTED_LOCATION ${lib_abs_path}) -target_link_libraries(pcm_cnv INTERFACE dynamic_resampler) - -add_library(iir_resampler STATIC IMPORTED GLOBAL) -set(lib_abs_path ${CMAKE_CURRENT_SOURCE_DIR}/../../../processing/resamplers/iir_resampler/bin/arm/libiir_resampler.a) -set_target_properties(iir_resampler PROPERTIES IMPORTED_LOCATION ${lib_abs_path}) -target_link_libraries(pcm_cnv INTERFACE iir_resampler) - -set_property(GLOBAL APPEND PROPERTY GLOBAL_SPF_LIBS_LIST pcm_cnv) - set(pcm_cnv_includes ${LIB_ROOT}/capi/pcm_cnv/api ${LIB_ROOT}/capi/pcm_cnv/inc From 3dc05105dcccb39ab2b578df4f9b6ddf7ef2a035 Mon Sep 17 00:00:00 2001 From: Annemarie Porter Date: Wed, 6 Aug 2025 13:34:32 -0700 Subject: [PATCH 2/3] modules: Prevent DRC from being compiled as a standalone module Prevent DRC from being compiled as a standalone module, because DRC is not available as a standalone module in AudioReach Creator. Instead, compile DRC as a dependency for other modules. Signed-off-by: Annemarie Porter --- arch/linux/configs/defconfig | 1 - modules/CMakeLists.txt | 9 +++++---- modules/Kconfig | 6 ------ 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/arch/linux/configs/defconfig b/arch/linux/configs/defconfig index f973058..a2eec83 100644 --- a/arch/linux/configs/defconfig +++ b/arch/linux/configs/defconfig @@ -20,7 +20,6 @@ CONFIG_PCM_CNV=y CONFIG_MFC=y CONFIG_PCM_DECODER=y CONFIG_PCM_ENCODER=y -CONFIG_DRC=n CONFIG_IIR_MBDRC=n CONFIG_GAIN=n CONFIG_SOFT_VOL=n diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 46aac23..1652aab 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -36,9 +36,6 @@ if(CONFIG_PCM_CNV) add_subdirectory(processing/resamplers/dynamic_resampler/build) add_subdirectory(processing/resamplers/iir_resampler/build) endif() -if(CONFIG_DRC) - add_subdirectory(processing/gain_control/drc/build) -endif() if(CONFIG_IIR_MBDRC) add_subdirectory(processing/gain_control/iir_mbdrc/build) endif() @@ -67,7 +64,11 @@ if(CONFIG_BASS_BOOST) add_subdirectory(processing/bassboost/build) endif() -#Build limiter if building other modules that depend on it +# The below modules are not standalone, so they should only be built if +# another module that is dependent on it is built. if(CONFIG_SAL OR CONFIG_IIR_MBDRC OR CONFIG_VIRTUALIZER OR CONFIG_BASS_BOOST) add_subdirectory(processing/gain_control/limiter/build) endif() +if(CONFIG_IIR_MBDRC OR CONFIG_BASS_BOOST) + add_subdirectory(processing/gain_control/drc/build) +endif() diff --git a/modules/Kconfig b/modules/Kconfig index c6a4e84..23bda37 100644 --- a/modules/Kconfig +++ b/modules/Kconfig @@ -36,13 +36,8 @@ config PCM_CNV select MSIIR default y -config DRC - tristate "Enable DRC Library" - default y - config IIR_MBDRC tristate "Enable IIR_MBDRC Library" - select DRC default y config GAIN @@ -80,7 +75,6 @@ config VIRTUALIZER config BASS_BOOST tristate "Enable BASS_BOOST Library" - select DRC select MSIIR default n endmenu From 4ea9946f66d6a2b7b13f0cbdf6c1b986d5f799db Mon Sep 17 00:00:00 2001 From: Annemarie Porter Date: Wed, 6 Aug 2025 13:37:02 -0700 Subject: [PATCH 3/3] modules: Create build folders for example modules Move the build files for the example modules into build folders to be consistent with the rest of the modules in the "modules" folder. Signed-off-by: Annemarie Porter --- modules/CMakeLists.txt | 6 +++--- .../{ => build}/CMakeLists.txt | 16 ++++++++-------- .../encoder/{ => build}/CMakeLists.txt | 18 +++++++++--------- .../examples/gain/{ => build}/CMakeLists.txt | 18 +++++++++--------- 4 files changed, 29 insertions(+), 29 deletions(-) rename modules/examples/echo_cancellation/{ => build}/CMakeLists.txt (64%) rename modules/examples/encoder/{ => build}/CMakeLists.txt (63%) rename modules/examples/gain/{ => build}/CMakeLists.txt (63%) diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 1652aab..c43b52c 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -17,13 +17,13 @@ include_directories( add_subdirectory(cmn/build cmn) if(CONFIG_ENCODER) - add_subdirectory(examples/encoder) + add_subdirectory(examples/encoder/build) endif() if(CONFIG_ECHO_CANCELLATION) - add_subdirectory(examples/echo_cancellation) + add_subdirectory(examples/echo_cancellation/build) endif() if(CONFIG_EXAMPLE_GAIN) - add_subdirectory(examples/gain) + add_subdirectory(examples/gain/build) endif() if(CONFIG_CHMIXER) add_subdirectory(processing/channel_mixer/build) diff --git a/modules/examples/echo_cancellation/CMakeLists.txt b/modules/examples/echo_cancellation/build/CMakeLists.txt similarity index 64% rename from modules/examples/echo_cancellation/CMakeLists.txt rename to modules/examples/echo_cancellation/build/CMakeLists.txt index a4c0b4e..c9c04af 100644 --- a/modules/examples/echo_cancellation/CMakeLists.txt +++ b/modules/examples/echo_cancellation/build/CMakeLists.txt @@ -2,15 +2,15 @@ # SPDX-License-Identifier: BSD-3-Clause-Clear set(echo_cancellation_sources - capi/src/capi_ecns_metadata_utils.c - capi/src/capi_ecns_utils.c - capi/src/capi_ecns_data_port_utils.c - capi/src/capi_ecns.c + ${LIB_ROOT}/capi/src/capi_ecns_metadata_utils.c + ${LIB_ROOT}/capi/src/capi_ecns_utils.c + ${LIB_ROOT}/capi/src/capi_ecns_data_port_utils.c + ${LIB_ROOT}/capi/src/capi_ecns.c ) set(echo_cancellation_includes - capi/src - capi/inc - api + ${LIB_ROOT}/capi/src + ${LIB_ROOT}/capi/inc + ${LIB_ROOT}/api ) spf_module_sources( @@ -26,6 +26,6 @@ spf_module_sources( AMDB_FMT_ID1 "MEDIA_FMT_ID_EXAMPLE" SRCS ${echo_cancellation_sources} INCLUDES ${echo_cancellation_includes} - H2XML_HEADERS "api/ecns_calibration_api.h" + H2XML_HEADERS "${LIB_ROOT}/api/ecns_calibration_api.h" CFLAGS "" ) diff --git a/modules/examples/encoder/CMakeLists.txt b/modules/examples/encoder/build/CMakeLists.txt similarity index 63% rename from modules/examples/encoder/CMakeLists.txt rename to modules/examples/encoder/build/CMakeLists.txt index d6515d5..2c6519b 100644 --- a/modules/examples/encoder/CMakeLists.txt +++ b/modules/examples/encoder/build/CMakeLists.txt @@ -2,17 +2,17 @@ # SPDX-License-Identifier: BSD-3-Clause-Clear set(example_encoder_sources - capi/src/capi_example_enc_module_utils.c - capi/src/capi_example_enc_module.c - lib/src/example_enc_lib.c + ${LIB_ROOT}/capi/src/capi_example_enc_module_utils.c + ${LIB_ROOT}/capi/src/capi_example_enc_module.c + ${LIB_ROOT}/lib/src/example_enc_lib.c ) set(example_encoder_includes - capi/inc - lib/inc - api - capi/src - lib/src + ${LIB_ROOT}/capi/inc + ${LIB_ROOT}/lib/inc + ${LIB_ROOT}/api + ${LIB_ROOT}/capi/src + ${LIB_ROOT}/lib/src ) spf_module_sources( @@ -28,6 +28,6 @@ spf_module_sources( AMDB_FMT_ID1 "MEDIA_FMT_ID_EXAMPLE" SRCS ${example_encoder_sources} INCLUDES ${example_encoder_includes} - H2XML_HEADERS "api/example_encoder_module_api.h" + H2XML_HEADERS "${LIB_ROOT}/api/example_encoder_module_api.h" CFLAGS "" ) diff --git a/modules/examples/gain/CMakeLists.txt b/modules/examples/gain/build/CMakeLists.txt similarity index 63% rename from modules/examples/gain/CMakeLists.txt rename to modules/examples/gain/build/CMakeLists.txt index 1813855..3e23b26 100644 --- a/modules/examples/gain/CMakeLists.txt +++ b/modules/examples/gain/build/CMakeLists.txt @@ -2,17 +2,17 @@ # SPDX-License-Identifier: BSD-3-Clause-Clear set(example_gain_sources - capi/src/capi_example_gain_module.c - capi/src/capi_example_gain_module_utils.c - lib/src/example_gain_module_lib.c + ${LIB_ROOT}/capi/src/capi_example_gain_module.c + ${LIB_ROOT}/capi/src/capi_example_gain_module_utils.c + ${LIB_ROOT}/lib/src/example_gain_module_lib.c ) set(example_gain_includes - capi/inc - lib/inc - api - capi/src - lib/src + ${LIB_ROOT}/capi/inc + ${LIB_ROOT}/lib/inc + ${LIB_ROOT}/api + ${LIB_ROOT}/capi/src + ${LIB_ROOT}/lib/src ) spf_module_sources( @@ -28,6 +28,6 @@ spf_module_sources( AMDB_FMT_ID1 "MEDIA_FMT_ID_EXAMPLE" SRCS ${example_gain_sources} INCLUDES ${example_gain_includes} - H2XML_HEADERS api/example_gain_module_api.h + H2XML_HEADERS ${LIB_ROOT}/api/example_gain_module_api.h CFLAGS "" )