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
1 change: 1 addition & 0 deletions src/arch/xtensa/configs/apollolake_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ CONFIG_PERFORMANCE_COUNTERS=y
CONFIG_COMP_SRC_SMALL=y
CONFIG_COMP_TDFB=n
CONFIG_COMP_TONE=n
CONFIG_COMP_LEGACY_INTERFACE=y
1 change: 1 addition & 0 deletions src/arch/xtensa/configs/baytrail_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ CONFIG_OPTIMIZE_FOR_SIZE=y
CONFIG_HAVE_AGENT=n
CONFIG_DEBUG_MEMORY_USAGE_SCAN=n
CONFIG_TRACE_FILTERING_ADAPTIVE=n
CONFIG_COMP_LEGACY_INTERFACE=y
1 change: 1 addition & 0 deletions src/arch/xtensa/configs/baytrail_gcc_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ CONFIG_HAVE_AGENT=n
CONFIG_DEBUG_MEMORY_USAGE_SCAN=n
CONFIG_TRACE_FILTERING_ADAPTIVE=n
CONFIG_OPTIMIZE_FOR_SIZE=y
CONFIG_COMP_LEGACY_INTERFACE=y
1 change: 1 addition & 0 deletions src/arch/xtensa/configs/cannonlake_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ CONFIG_INTEL_ALH=y
CONFIG_LP_MEMORY_BANKS=1
CONFIG_HP_MEMORY_BANKS=47
CONFIG_PERFORMANCE_COUNTERS=y
CONFIG_COMP_LEGACY_INTERFACE=y
1 change: 1 addition & 0 deletions src/arch/xtensa/configs/cannonlake_gcc_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ CONFIG_INTEL_ALH=y
CONFIG_CAVS_LPS=y
CONFIG_LP_MEMORY_BANKS=1
CONFIG_HP_MEMORY_BANKS=47
CONFIG_COMP_LEGACY_INTERFACE=y
1 change: 1 addition & 0 deletions src/arch/xtensa/configs/cherrytrail_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ CONFIG_OPTIMIZE_FOR_SIZE=y
CONFIG_HAVE_AGENT=n
CONFIG_DEBUG_MEMORY_USAGE_SCAN=n
CONFIG_TRACE_FILTERING_ADAPTIVE=n
CONFIG_COMP_LEGACY_INTERFACE=y
1 change: 1 addition & 0 deletions src/arch/xtensa/configs/cherrytrail_gcc_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ CONFIG_HAVE_AGENT=n
CONFIG_DEBUG_MEMORY_USAGE_SCAN=n
CONFIG_TRACE_FILTERING_ADAPTIVE=n
CONFIG_OPTIMIZE_FOR_SIZE=y
CONFIG_COMP_LEGACY_INTERFACE=y
1 change: 1 addition & 0 deletions src/arch/xtensa/configs/icelake_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ CONFIG_INTEL_SSP=y
CONFIG_INTEL_ALH=y
CONFIG_LP_MEMORY_BANKS=1
CONFIG_HP_MEMORY_BANKS=47
CONFIG_COMP_LEGACY_INTERFACE=y
1 change: 1 addition & 0 deletions src/arch/xtensa/configs/jasperlake_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ CONFIG_INTEL_SSP=y
CONFIG_CORE_COUNT=2
CONFIG_LP_MEMORY_BANKS=1
CONFIG_HP_MEMORY_BANKS=16
CONFIG_COMP_LEGACY_INTERFACE=y
7 changes: 2 additions & 5 deletions src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ if(NOT CONFIG_LIBRARY)
buffer.c
channel_map.c
)
if(CONFIG_COMP_VOLUME)
add_subdirectory(volume)
endif()
if(CONFIG_COMP_SRC)
add_subdirectory(src)
endif()
Expand Down Expand Up @@ -178,10 +175,10 @@ check_optimization(fma -mfma -ftree-vectorize -DOPS_FMA)
check_optimization(hifi2ep -mhifi2ep "" -DOPS_HIFI2EP)
check_optimization(hifi3 -mhifi3 "" -DOPS_HIFI3)

set(sof_audio_modules volume mixer src asrc eq-fir eq-iir dcblock crossover tdfb drc multiband_drc)
set(sof_audio_modules mixer volume src asrc eq-fir eq-iir dcblock crossover tdfb drc multiband_drc)

# sources for each module
set(volume_sources volume/volume.c volume/volume_generic.c)
set(volume_sources module_adapter/module_adapter.c module_adapter/module/generic.c module_adapter/module/volume/volume.c module_adapter/module/volume/volume_generic.c)
set(mixer_sources mixer.c)
set(src_sources src/src.c src/src_generic.c)
set(asrc_sources asrc/asrc.c asrc/asrc_farrow.c asrc/asrc_farrow_generic.c)
Expand Down
51 changes: 7 additions & 44 deletions src/audio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ config COMP_ARIA
Currently ARIA introduces gain transition and algorithmic
latency equal to 1 ms.

config COMP_VOLUME
bool "Volume component"
default y
help
Select for Volume component

config COMP_UP_DOWN_MIXER
bool "UP_DOWN_MIXER component"
default n
Expand All @@ -51,43 +45,6 @@ config COMP_UP_DOWN_MIXER
Downmixing for mono output:
4.0, Quatro, 3.1, 2 -> 1

if COMP_VOLUME

config COMP_VOLUME_WINDOWS_FADE
bool "Windows Fade shape volume transitions support"
help
This option enables volume ramp shape that follows
power of 1.75. The shape is not linear, not logarithmic.
The power function uses a lookup table that consumes
256 bytes. The topology must set volume ramp token to
SOF_VOLUME_WINDOWS_FADE for the volume instance to use
this ramp shape.

config COMP_VOLUME_LINEAR_RAMP
bool "Linear ramp volume transitions support"
default y
depends on IPC_MAJOR_3
help
This option enables volume linear ramp shape.

config COMP_PEAK_VOL
bool "Report peak vol data to host"
default y
depends on IPC_MAJOR_4
help
This option enables reporting to host peak vol regs.
See: struct ipc4_peak_volume_regs

config COMP_GAIN
bool "GAIN component"
default y
depends on IPC_MAJOR_4
help
This option enables gain to change volume. It works
as peak volume without updating peak vol to host

endif # volume

config COMP_SRC
bool "SRC component"
default y
Expand Down Expand Up @@ -448,7 +405,7 @@ config COMP_TDFB

config COMP_MODULE_ADAPTER
bool "Module adapter"
default n
default y
help
This component is an adapter between SoF components and any external third
party codecs/libraries. In order to make use of it the library itself should
Expand All @@ -457,6 +414,12 @@ config COMP_MODULE_ADAPTER
"src\include\sof\audio\module_adapter\interfaces.h". It is possible to link several
different codecs and use them in parallel.

config COMP_LEGACY_INTERFACE
bool "Use legacy component driver interface"
default n
help
Use the legacy component driver interface for component instead of the module adapter.

rsource "module_adapter/Kconfig"

config COMP_IGO_NR
Expand Down
100 changes: 55 additions & 45 deletions src/audio/module_adapter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,66 +1,76 @@
# SPDX-License-Identifier: BSD-3-Clause

add_local_sources(sof module_adapter.c module/generic.c)
if(NOT CONFIG_LIBRARY)
if (CONFIG_IPC_MAJOR_4 OR CONFIG_CADENCE_CODEC OR (NOT CONFIG_COMP_LEGACY_INTERFACE))
add_local_sources(sof module_adapter.c module/generic.c)
endif()

if(CONFIG_CADENCE_CODEC)
add_local_sources(sof module/cadence.c)
if(CONFIG_COMP_VOLUME)
add_local_sources(sof module/volume/volume_generic.c module/volume/volume_hifi3.c module/volume/volume.c)
endif()

if(CONFIG_CADENCE_CODEC_WRAPPER)
sof_add_static_library(codec_wrapper_lib ${CONFIG_CADENCE_CODEC_WRAPPER_LIB})
endif()
if(CONFIG_CADENCE_CODEC)
add_local_sources(sof module/cadence.c)

if(CONFIG_CADENCE_CODEC_AAC_DEC)
sof_add_static_library(xa_aac_dec ${CONFIG_CADENCE_CODEC_AAC_DEC_LIB})
endif()
if(CONFIG_CADENCE_CODEC_WRAPPER)
sof_add_static_library(codec_wrapper_lib ${CONFIG_CADENCE_CODEC_WRAPPER_LIB})
endif()

if(CONFIG_CADENCE_CODEC_BSAC_DEC)
sof_add_static_library(xa_bsac_dec ${CONFIG_CADENCE_CODEC_BSAC_DEC_LIB})
endif()
if(CONFIG_CADENCE_CODEC_AAC_DEC)
sof_add_static_library(xa_aac_dec ${CONFIG_CADENCE_CODEC_AAC_DEC_LIB})
endif()

if(CONFIG_CADENCE_CODEC_BSAC_DEC)
sof_add_static_library(xa_bsac_dec ${CONFIG_CADENCE_CODEC_BSAC_DEC_LIB})
endif()

if(CONFIG_CADENCE_CODEC_DAB_DEC)
sof_add_static_library(xa_dab_dec ${CONFIG_CADENCE_CODEC_DAB_DEC_LIB})
endif()

if(CONFIG_CADENCE_CODEC_DAB_DEC)
sof_add_static_library(xa_dab_dec ${CONFIG_CADENCE_CODEC_DAB_DEC_LIB})
endif()

if(CONFIG_CADENCE_CODEC_DRM_DEC)
sof_add_static_library(xa_drm_dec ${CONFIG_CADENCE_CODEC_DRM_DEC_LIB})
endif()

if(CONFIG_CADENCE_CODEC_DRM_DEC)
sof_add_static_library(xa_drm_dec ${CONFIG_CADENCE_CODEC_DRM_DEC_LIB})
endif()

if(CONFIG_CADENCE_CODEC_MP3_DEC)
sof_add_static_library(xa_mp3_dec ${CONFIG_CADENCE_CODEC_MP3_DEC_LIB})
endif()

if(CONFIG_CADENCE_CODEC_MP3_DEC)
sof_add_static_library(xa_mp3_dec ${CONFIG_CADENCE_CODEC_MP3_DEC_LIB})
endif()

if(CONFIG_CADENCE_CODEC_SBC_DEC)
sof_add_static_library(xa_sbc_dec ${CONFIG_CADENCE_CODEC_SBC_DEC_LIB})
endif()

if(CONFIG_CADENCE_CODEC_VORBIS_DEC)
sof_add_static_library(xa_vorbis_dec ${CONFIG_CADENCE_CODEC_VORBIS_DEC_LIB})
endif()
if(CONFIG_CADENCE_CODEC_SBC_DEC)
sof_add_static_library(xa_sbc_dec ${CONFIG_CADENCE_CODEC_SBC_DEC_LIB})
endif()

if(CONFIG_CADENCE_CODEC_SRC_PP)
sof_add_static_library(xa_src_pp ${CONFIG_CADENCE_CODEC_SRC_PP_LIB})
endif()
if(CONFIG_CADENCE_CODEC_VORBIS_DEC)
sof_add_static_library(xa_vorbis_dec ${CONFIG_CADENCE_CODEC_VORBIS_DEC_LIB})
endif()

endif()
if(CONFIG_CADENCE_CODEC_SRC_PP)
sof_add_static_library(xa_src_pp ${CONFIG_CADENCE_CODEC_SRC_PP_LIB})
endif()

if(CONFIG_PASSTHROUGH_CODEC)
add_local_sources(sof module/passthrough.c)
endif()
endif()

if(CONFIG_WAVES_CODEC)
add_local_sources(sof module/waves.c)
sof_add_static_library(MaxxChrome ${CMAKE_CURRENT_LIST_DIR}/lib/release/libMaxxChrome.a)
# folder with Waves API must be among include directories
target_include_directories(sof PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../../include/sof/audio/)
endif()
if(CONFIG_PASSTHROUGH_CODEC)
add_local_sources(sof module/passthrough.c)
endif()

if(CONFIG_WAVES_CODEC)
add_local_sources(sof module/waves.c)
sof_add_static_library(MaxxChrome ${CMAKE_CURRENT_LIST_DIR}/lib/release/libMaxxChrome.a)
# folder with Waves API must be among include directories
target_include_directories(sof PUBLIC ${CMAKE_CURRENT_LIST_DIR}/../../include/sof/audio/)
endif()

if(CONFIG_DTS_CODEC)
add_local_sources(sof module/dts.c)
target_compile_definitions(sof PRIVATE -DDTS_MATH_INT32 -DDTS_XTENSA)
target_include_directories(sof PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../../include/sof/audio/dts/)
sof_add_static_library(DtsCodec ${CMAKE_CURRENT_LIST_DIR}/lib/release/libdts-sof-interface-i32.a)
endif()

if(CONFIG_DTS_CODEC)
add_local_sources(sof module/dts.c)
target_compile_definitions(sof PRIVATE -DDTS_MATH_INT32 -DDTS_XTENSA)
target_include_directories(sof PRIVATE ${CMAKE_CURRENT_LIST_DIR}/../../include/sof/audio/dts/)
sof_add_static_library(DtsCodec ${CMAKE_CURRENT_LIST_DIR}/lib/release/libdts-sof-interface-i32.a)
return()
endif()
44 changes: 44 additions & 0 deletions src/audio/module_adapter/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,50 @@ menu "Processing modules"
This will cause codec adapter component to include header
files specific to CADENCE base codecs.

config COMP_VOLUME
bool "Volume component"
default y
depends on COMP_MODULE_ADAPTER
help
Select for Volume component

if COMP_VOLUME

config COMP_VOLUME_WINDOWS_FADE
bool "Windows Fade shape volume transitions support"
help
This option enables volume ramp shape that follows
power of 1.75. The shape is not linear, not logarithmic.
The power function uses a lookup table that consumes
256 bytes. The topology must set volume ramp token to
SOF_VOLUME_WINDOWS_FADE for the volume instance to use
this ramp shape.

config COMP_VOLUME_LINEAR_RAMP
bool "Linear ramp volume transitions support"
default y
depends on IPC_MAJOR_3
help
This option enables volume linear ramp shape.

config COMP_PEAK_VOL
bool "Report peak vol data to host"
default y
depends on IPC_MAJOR_4
help
This option enables reporting to host peak vol regs.
See: struct ipc4_peak_volume_regs

config COMP_GAIN
bool "GAIN component"
default y
depends on IPC_MAJOR_4
help
This option enables gain to change volume. It works
as peak volume without updating peak vol to host

endif # volume

if CADENCE_CODEC
config CADENCE_CODEC_WRAPPER
bool 'Cadence codec wrapper'
Expand Down
2 changes: 2 additions & 0 deletions src/audio/module_adapter/module/dts.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ static int dts_codec_free(struct processing_module *mod)
if (ret)
comp_err(dev, "dts_codec_free() failed %d %d", ret, dts_result);

module_free_all_memory(mod);

comp_dbg(dev, "dts_codec_free() done");

return ret;
Expand Down
2 changes: 0 additions & 2 deletions src/audio/module_adapter/module/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,6 @@ int module_free(struct processing_module *mod)
comp_warn(mod->dev, "module_free(): error: %d for %d",
ret, dev_comp_id(mod->dev));

/* Free all memory requested by module */
module_free_all_memory(mod);
/* Free all memory shared by module_adapter & module */
md->cfg.avail = false;
md->cfg.size = 0;
Expand Down
Loading