Skip to content

Commit

Permalink
comp: Add initial Google CTC component
Browse files Browse the repository at this point in the history
Introduce a new component to perform crosstalk-cancellation on
the playback path.

Signed-off-by: Eddy Hsu <eddyhsu@google.com>
  • Loading branch information
Eddy Hsu committed Mar 27, 2024
1 parent 7507b32 commit e67ecbc
Show file tree
Hide file tree
Showing 12 changed files with 818 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/overlays/mtl/ctc_overlay.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CONFIG_COMP_STUBS=n
CONFIG_COMP_MODULE_ADAPTER=y
CONFIG_COMP_GOOGLE_CTC_AUDIO_PROCESSING=y
CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING=n
1 change: 1 addition & 0 deletions src/arch/host/configs/library_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CONFIG_COMP_DCBLOCK=y
CONFIG_COMP_DRC=y
CONFIG_COMP_FIR=y
CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING=y
CONFIG_COMP_GOOGLE_CTC_AUDIO_PROCESSING=y
CONFIG_COMP_IIR=y
CONFIG_COMP_IGO_NR=y
CONFIG_COMP_MFCC=y
Expand Down
20 changes: 20 additions & 0 deletions src/audio/google/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,26 @@ if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC)
target_link_libraries(sof PRIVATE c)
endif()
endif()

if(CONFIG_COMP_GOOGLE_CTC_AUDIO_PROCESSING)
target_include_directories(sof PRIVATE ${CMAKE_SOURCE_DIR}/third_party/include)
add_local_sources(sof
google_ctc_audio_processing.c
)
if(CONFIG_GOOGLE_CTC_AUDIO_PROCESSING_MOCK)
add_local_sources(sof
google_ctc_audio_processing_mock.c
)
else()
message(INFO "Link with google_ctc_audio_processing")
target_link_directories(sof PRIVATE ${CMAKE_SOURCE_DIR}/third_party/lib)
target_link_libraries(sof PRIVATE google_ctc_audio_processing)
target_link_libraries(sof PRIVATE c++)
target_link_libraries(sof PRIVATE c++abi)
target_link_libraries(sof PRIVATE m)
target_link_libraries(sof PRIVATE c)
endif()
endif()
return()
endif()

57 changes: 57 additions & 0 deletions src/audio/google/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,61 @@ config GOOGLE_RTC_AUDIO_PROCESSING_MOCK
Mock Google real-time communication audio processing.
It allows for compilation check and basic audio flow checking.

config COMP_GOOGLE_CTC_AUDIO_PROCESSING
bool "Google Crosstalk Cancellation Audio processing"
select COMP_BLOB
select GOOGLE_CTC_AUDIO_PROCESSING_MOCK if COMP_STUBS
default n
help
Select for Google crosstalk cancellation audio processing. It
uses the Google real-time audio processing library to perform
crosstalk cancellation.

config COMP_GOOGLE_CTC_AUDIO_PROCESSING_NUM_FRAMES
depends on COMP_GOOGLE_CTC_AUDIO_PROCESSING
int "Number of frames to process for Google Crosstalk Cancellation Audio processing"
default 64
help
Sets the number of frames to process in the Google crosstalk
cancellation audio processing.

config COMP_GOOGLE_CTC_AUDIO_PROCESSING_MAX_NUM_CHANNELS
depends on COMP_GOOGLE_CTC_AUDIO_PROCESSING
int "Max number of channels to process for Google Crosstalk Cancellation Audio processing"
default 2
help
Sets the max number of channels to process in the Google crosstalk
cancellation audio processing.

config COMP_GOOGLE_CTC_AUDIO_PROCESSING_PARTITION_SIZE
depends on COMP_GOOGLE_CTC_AUDIO_PROCESSING
int "Partition size to process for Google Crosstalk Cancellation Audio processing"
default 64
help
Sets the partition size to process in the Google crosstalk
cancellation audio processing.

config COMP_GOOGLE_CTC_AUDIO_PROCESSING_IMPULSE_SIZE
depends on COMP_GOOGLE_CTC_AUDIO_PROCESSING
int "Impulse size to process for Google Crosstalk Cancellation Audio processing"
default 256
help
Sets the impulse size to process in the Google crosstalk
cancellation audio processing.

config COMP_GOOGLE_CTC_AUDIO_PROCESSING_SAMPLE_RATE
depends on COMP_GOOGLE_CTC_AUDIO_PROCESSING
int "Sample rate to process for Google Crosstalk Cancellation Audio processing"
default 48000
help
Sets the sample rate to process in the Google crosstalk
cancellation audio processing.

config GOOGLE_CTC_AUDIO_PROCESSING_MOCK
bool "Google Crosstalk Cancellation Audio processing mock"
default n
depends on COMP_GOOGLE_CTC_AUDIO_PROCESSING
help
Mock Google crosstalk cancellation audio processing.
It allows for compilation check and basic audio flow checking.
endmenu
Loading

0 comments on commit e67ecbc

Please sign in to comment.