Skip to content

Commit afe706a

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 afe706a

15 files changed

+815
-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: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,61 @@ config GOOGLE_RTC_AUDIO_PROCESSING_MOCK
8787
It allows for compilation check and basic audio flow checking.
8888

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

91147
endmenu

0 commit comments

Comments
 (0)