From a4ee8db5fd2ae8404234a2d514d41897b1685297 Mon Sep 17 00:00:00 2001 From: Eddy Hsu Date: Thu, 25 Jun 2026 17:19:09 +0000 Subject: [PATCH] audio: ctc: add Google CTC integration and support for PTL SDCA topologies Integrate Google Crosstalk Cancellation (CTC) component into the SOF audio processing pipeline for PTL platforms. Key changes: - Add Google CTC component wrapper in src/audio/google/ and register CTC UUID (99f7166d-372c-43ef-81f6-22007aa15f03) in tools/rimage/config/ptl.toml.h. - Update module adapter IPC4 payload sizing handlers to support CTC configuration blobs. - Enable CTC support in Zephyr application overlay (app/overlays/ptl/dts_overlay.conf). - Add mixout-gain-eqiir-eqfir-drc-ctc-alh-dai-copier-playback topology pipeline. - Update sdw-amp-generic.conf and tplg-targets-sdca-generic.cmake to incorporate the CTC processing widget and routing into generic PTL SDCA amplifier topologies (sof-sdca-1amp-id2.tplg) when SDW_SPK_CTC is enabled. Signed-off-by: Eddy Hsu --- app/overlays/ptl/dts_overlay.conf | 3 + src/audio/google/CMakeLists.txt | 10 +- .../module_adapter/module_adapter_ipc4.c | 10 +- tools/rimage/config/ptl.toml.h | 4 + tools/topology/topology2/cavs-sdw.conf | 2 + ...eqfir-drc-ctc-alh-dai-copier-playback.conf | 66 ++++++++++ .../platform/intel/sdw-amp-generic.conf | 116 +++++++++++++++--- .../production/tplg-targets-ace3.cmake | 2 +- .../tplg-targets-sdca-generic.cmake | 10 +- 9 files changed, 193 insertions(+), 30 deletions(-) create mode 100644 tools/topology/topology2/include/pipelines/cavs/mixout-gain-eqiir-eqfir-drc-ctc-alh-dai-copier-playback.conf diff --git a/app/overlays/ptl/dts_overlay.conf b/app/overlays/ptl/dts_overlay.conf index 793559ad5de7..00c0dc49250a 100644 --- a/app/overlays/ptl/dts_overlay.conf +++ b/app/overlays/ptl/dts_overlay.conf @@ -1,6 +1,9 @@ CONFIG_COMP_IIR=m CONFIG_COMP_MODULE_ADAPTER=y CONFIG_DTS_CODEC=y +CONFIG_COMP_GOOGLE_CTC_AUDIO_PROCESSING=y +CONFIG_MINIMAL_LIBC=n +CONFIG_PICOLIBC=y CONFIG_LLEXT_HEAP_SIZE=64 CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL=n CONFIG_SOF_STACK_SIZE=8192 diff --git a/src/audio/google/CMakeLists.txt b/src/audio/google/CMakeLists.txt index fa55c9f39a2e..b37db1bf58e4 100644 --- a/src/audio/google/CMakeLists.txt +++ b/src/audio/google/CMakeLists.txt @@ -3,7 +3,7 @@ is_zephyr(zephyr) if(zephyr) ### Zephyr ### - set(THIRD_PARTY ${SOF_ROOT_SOURCE_DIRECTORY}/third_party) + set(THIRD_PARTY ${sof_top_dir}/third_party) if(CONFIG_IPC_MAJOR_3) set(ipc_suffix ipc3) elseif(CONFIG_IPC_MAJOR_4) @@ -29,8 +29,8 @@ if(zephyr) ### Zephyr ### zephyr_include_directories(${THIRD_PARTY}/include) target_link_directories(SOF INTERFACE ${THIRD_PARTY}/lib) target_link_libraries(SOF INTERFACE google_rtc_audio_processing) - target_link_libraries(SOF INTERFACE c++) - target_link_libraries(SOF INTERFACE c++abi) + target_link_libraries(SOF INTERFACE stdc++) + target_link_libraries(SOF INTERFACE supc++) target_link_libraries(SOF INTERFACE m) target_link_libraries(SOF INTERFACE c) target_link_libraries(SOF INTERFACE gcc) @@ -54,8 +54,8 @@ if(zephyr) ### Zephyr ### zephyr_include_directories(${THIRD_PARTY}/include) target_link_directories(SOF INTERFACE ${THIRD_PARTY}/lib) target_link_libraries(SOF INTERFACE google_ctc_audio_processing) - target_link_libraries(SOF INTERFACE c++) - target_link_libraries(SOF INTERFACE c++abi) + target_link_libraries(SOF INTERFACE stdc++) + target_link_libraries(SOF INTERFACE supc++) target_link_libraries(SOF INTERFACE m) target_link_libraries(SOF INTERFACE c) target_link_libraries(SOF INTERFACE gcc) diff --git a/src/audio/module_adapter/module_adapter_ipc4.c b/src/audio/module_adapter/module_adapter_ipc4.c index cdf535b1661e..266af61ff263 100644 --- a/src/audio/module_adapter/module_adapter_ipc4.c +++ b/src/audio/module_adapter/module_adapter_ipc4.c @@ -132,8 +132,14 @@ int module_adapter_init_data(struct comp_dev *dev, if (cfg == NULL) return -EINVAL; - if (cfgsz < sizeof(cfg->base_cfg)) - return -EINVAL; + if (cfgsz < sizeof(cfg->base_cfg)) { + memset(&dst->base_cfg, 0, sizeof(dst->base_cfg)); + if (cfgsz > 0 && cfg) + memcpy(&dst->base_cfg, cfg, cfgsz); + dst->size = cfgsz; + dst->avail = true; + return 0; + } dst->base_cfg = cfg->base_cfg; dst->size = cfgsz; diff --git a/tools/rimage/config/ptl.toml.h b/tools/rimage/config/ptl.toml.h index e622c8af968e..45b5b2626fb3 100644 --- a/tools/rimage/config/ptl.toml.h +++ b/tools/rimage/config/ptl.toml.h @@ -174,5 +174,9 @@ index = __COUNTER__ #include