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 authored and Eddy Hsu committed Jul 25, 2024
1 parent 6382963 commit f5535e7
Show file tree
Hide file tree
Showing 15 changed files with 881 additions and 0 deletions.
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
25 changes: 25 additions & 0 deletions src/audio/google/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,31 @@ 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_IPC_MAJOR_3)
add_local_sources(sof google_ctc_audio_processing_ipc3.c)
elseif(CONFIG_IPC_MAJOR_4)
add_local_sources(sof google_ctc_audio_processing_ipc4.c)
endif()
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()

64 changes: 64 additions & 0 deletions src/audio/google/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,68 @@ config GOOGLE_RTC_AUDIO_PROCESSING_MOCK

endif # COMP_GOOGLE_RTC_AUDIO_PROCESSING

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.

if COMP_GOOGLE_CTC_AUDIO_PROCESSING

config COMP_GOOGLE_CTC_AUDIO_PROCESSING_NUM_FRAMES
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
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
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
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_CHUNK_FRAMES
int "Chunk frames to process for Google Crosstalk Cancellation Audio processing"
default 48
help
Sets the chunk frames to process in the Google crosstalk
cancellation audio processing.

config COMP_GOOGLE_CTC_AUDIO_PROCESSING_SAMPLE_RATE
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.

endif

config GOOGLE_CTC_AUDIO_PROCESSING_MOCK
bool "Google Crosstalk Cancellation Audio processing mock"
default y if COMP_STUBS
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 f5535e7

Please sign in to comment.