diff --git a/src/audio/google/google_rtc_audio_processing.c b/src/audio/google/google_rtc_audio_processing.c index 181e883fafa3..8eaac3d5a0cb 100644 --- a/src/audio/google/google_rtc_audio_processing.c +++ b/src/audio/google/google_rtc_audio_processing.c @@ -594,6 +594,9 @@ static int google_rtc_audio_processing_prepare(struct processing_module *mod, ret = -EINVAL; } + cd->num_aec_reference_channels = MIN(ref_chan, REF_CHAN_MAX); + cd->num_capture_channels = MIN(mic_chan, MIC_CHAN_MAX); + if (ref_rate != mic_rate || ref_rate != out_rate || ref_rate != CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_SAMPLE_RATE_HZ) { comp_err(dev, "Incorrect source/sink sample rate, expect %d\n", @@ -629,6 +632,11 @@ static int google_rtc_audio_processing_prepare(struct processing_module *mod, source_get_channels(sources[cd->aec_reference_source]); cd->out_frame_bytes = cd->ref_frame_bytes; + ret = GoogleRtcAudioProcessingSetStreamFormats(cd->state, mic_rate, + cd->num_capture_channels, + cd->num_capture_channels, + ref_rate, cd->num_aec_reference_channels); + /* Blobs sent during COMP_STATE_READY is assigned to blob_handler->data * directly, so comp_is_new_data_blob_available always returns false. */