Skip to content

Commit ab415cc

Browse files
Eddy HsuEddy Hsu
authored andcommitted
comp: Add initial Google CTC component
Introduce a new component to perform crosstalk-cancellation on the playback path. Signed-off-by: Eddy Hsu <eddyhsu@google.com>
1 parent 6382963 commit ab415cc

15 files changed

+816
-0
lines changed

src/arch/host/configs/library_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ CONFIG_COMP_DCBLOCK=y
44
CONFIG_COMP_DRC=y
55
CONFIG_COMP_FIR=y
66
CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING=y
7+
CONFIG_COMP_GOOGLE_CTC_AUDIO_PROCESSING=y
78
CONFIG_COMP_IIR=y
89
CONFIG_COMP_IGO_NR=y
910
CONFIG_COMP_MFCC=y

src/audio/google/CMakeLists.txt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,31 @@ if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC)
2929
target_link_libraries(sof PRIVATE c)
3030
endif()
3131
endif()
32+
33+
if(CONFIG_COMP_GOOGLE_CTC_AUDIO_PROCESSING)
34+
target_include_directories(sof PRIVATE ${CMAKE_SOURCE_DIR}/third_party/include)
35+
add_local_sources(sof
36+
google_ctc_audio_processing.c
37+
)
38+
if(CONFIG_IPC_MAJOR_3)
39+
add_local_sources(sof google_ctc_audio_processing_ipc3.c)
40+
elseif(CONFIG_IPC_MAJOR_4)
41+
add_local_sources(sof google_ctc_audio_processing_ipc4.c)
42+
endif()
43+
if(CONFIG_GOOGLE_CTC_AUDIO_PROCESSING_MOCK)
44+
add_local_sources(sof
45+
google_ctc_audio_processing_mock.c
46+
)
47+
else()
48+
message(INFO "Link with google_ctc_audio_processing")
49+
target_link_directories(sof PRIVATE ${CMAKE_SOURCE_DIR}/third_party/lib)
50+
target_link_libraries(sof PRIVATE google_ctc_audio_processing)
51+
target_link_libraries(sof PRIVATE c++)
52+
target_link_libraries(sof PRIVATE c++abi)
53+
target_link_libraries(sof PRIVATE m)
54+
target_link_libraries(sof PRIVATE c)
55+
endif()
56+
endif()
3257
return()
3358
endif()
3459

src/audio/google/Kconfig

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,61 @@ config GOOGLE_RTC_AUDIO_PROCESSING_MOCK
8888

8989
endif # COMP_GOOGLE_RTC_AUDIO_PROCESSING
9090

91+
config COMP_GOOGLE_CTC_AUDIO_PROCESSING
92+
bool "Google Crosstalk Cancellation Audio processing"
93+
select COMP_BLOB
94+
select GOOGLE_CTC_AUDIO_PROCESSING_MOCK if COMP_STUBS
95+
default n
96+
help
97+
Select for Google crosstalk cancellation audio processing. It
98+
uses the Google real-time audio processing library to perform
99+
crosstalk cancellation.
100+
101+
if COMP_GOOGLE_CTC_AUDIO_PROCESSING
102+
103+
config COMP_GOOGLE_CTC_AUDIO_PROCESSING_NUM_FRAMES
104+
int "Number of frames to process for Google Crosstalk Cancellation Audio processing"
105+
default 48
106+
help
107+
Sets the number of frames to process in the Google crosstalk
108+
cancellation audio processing.
109+
110+
config COMP_GOOGLE_CTC_AUDIO_PROCESSING_MAX_NUM_CHANNELS
111+
int "Max number of channels to process for Google Crosstalk Cancellation Audio processing"
112+
default 2
113+
help
114+
Sets the max number of channels to process in the Google crosstalk
115+
cancellation audio processing.
116+
117+
config COMP_GOOGLE_CTC_AUDIO_PROCESSING_PARTITION_SIZE
118+
int "Partition size to process for Google Crosstalk Cancellation Audio processing"
119+
default 64
120+
help
121+
Sets the partition size to process in the Google crosstalk
122+
cancellation audio processing.
123+
124+
config COMP_GOOGLE_CTC_AUDIO_PROCESSING_IMPULSE_SIZE
125+
int "Impulse size to process for Google Crosstalk Cancellation Audio processing"
126+
default 256
127+
help
128+
Sets the impulse size to process in the Google crosstalk
129+
cancellation audio processing.
130+
131+
config COMP_GOOGLE_CTC_AUDIO_PROCESSING_SAMPLE_RATE
132+
int "Sample rate to process for Google Crosstalk Cancellation Audio processing"
133+
default 48000
134+
help
135+
Sets the sample rate to process in the Google crosstalk
136+
cancellation audio processing.
137+
138+
endif
139+
140+
config GOOGLE_CTC_AUDIO_PROCESSING_MOCK
141+
bool "Google Crosstalk Cancellation Audio processing mock"
142+
default y if COMP_STUBS
143+
depends on COMP_GOOGLE_CTC_AUDIO_PROCESSING
144+
help
145+
Mock Google crosstalk cancellation audio processing.
146+
It allows for compilation check and basic audio flow checking.
147+
91148
endmenu

0 commit comments

Comments
 (0)