From 4f8c712ee719b8bf9a184cceccf0d3c14f0cb83a Mon Sep 17 00:00:00 2001 From: Tomasz Leman Date: Wed, 17 Sep 2025 10:27:07 +0200 Subject: [PATCH 1/2] audio: host: Add NULL check for local buffer retrieval Add NULL pointer check after calling `comp_dev_get_first_data_consumer` and `comp_dev_get_first_data_producer` functions in host_common_params. These functions can return NULL if no appropriate buffer is found in the component's connection list. Without this check, a NULL pointer would be assigned to hd->local_buffer and could cause crashes in subsequent operations that assume a valid buffer pointer. The error handling returns -EINVAL and logs an appropriate error message to help with debugging pipeline configuration issues. Signed-off-by: Tomasz Leman --- src/audio/host-legacy.c | 5 +++++ src/audio/host-zephyr.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/audio/host-legacy.c b/src/audio/host-legacy.c index 192686da3fdd..c6a1c1d4cdda 100644 --- a/src/audio/host-legacy.c +++ b/src/audio/host-legacy.c @@ -716,6 +716,11 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, else hd->local_buffer = comp_dev_get_first_data_producer(dev); + if (!hd->local_buffer) { + comp_err(dev, "no local buffer found"); + return -EINVAL; + } + period_bytes = dev->frames * audio_stream_frame_bytes(&hd->local_buffer->stream); diff --git a/src/audio/host-zephyr.c b/src/audio/host-zephyr.c index 5aec7ff1a4d4..8dcc8dbea562 100644 --- a/src/audio/host-zephyr.c +++ b/src/audio/host-zephyr.c @@ -903,6 +903,11 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, else hd->local_buffer = comp_dev_get_first_data_producer(dev); + if (!hd->local_buffer) { + comp_err(dev, "no local buffer found"); + return -EINVAL; + } + period_bytes = dev->frames * get_frame_bytes(params->frame_fmt, params->channels); if (!period_bytes) { From 8ec2219cc287bd5a77104c69a42e083c82a4b8c6 Mon Sep 17 00:00:00 2001 From: Tomasz Leman Date: Thu, 24 Jul 2025 13:22:20 +0200 Subject: [PATCH 2/2] boards: ptl: add Google RTC Audio Processing to PTL configuration This patch introduces the Google RTC Audio Processing component into the PTL configuration for the SOF firmware. The component is added as a loadable module (`m`). **Changes:** - Added `CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING=m` to enable Google RTC Audio Processing. - Included `CONFIG_GOOGLE_RTC_AUDIO_PROCESSING_MOCK=y` for mock testing support. Signed-off-by: Tomasz Leman --- app/boards/intel_adsp_ace30_ptl.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/boards/intel_adsp_ace30_ptl.conf b/app/boards/intel_adsp_ace30_ptl.conf index a90abefa38e5..999b9d1e9407 100644 --- a/app/boards/intel_adsp_ace30_ptl.conf +++ b/app/boards/intel_adsp_ace30_ptl.conf @@ -14,6 +14,12 @@ CONFIG_COMP_UP_DOWN_MIXER=y CONFIG_COMP_VOLUME_WINDOWS_FADE=y CONFIG_FORMAT_CONVERT_HIFI3=n +# SOF / audio modules / mocks +# This mock is part of official sof-bin releases because the CI that +# tests it can't use extra CONFIGs. See #9410, #8722 and #9386 +CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING=m +CONFIG_GOOGLE_RTC_AUDIO_PROCESSING_MOCK=y + # SOF / infrastructure CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL=n CONFIG_PROBE=y