@@ -80,30 +80,6 @@ void GoogleRtcFree(void *ptr)
8080 return rfree (ptr );
8181}
8282
83- static void google_rtc_audio_processing_params (struct processing_module * mod ,
84- struct sof_source * ref ,
85- struct sof_source * mic ,
86- struct sof_sink * out )
87- {
88- struct google_rtc_audio_processing_comp_data * cd = module_get_private_data (mod );
89- struct sof_ipc_stream_params * params = mod -> stream_params ;
90- struct comp_buffer * sinkb , * sourceb ;
91- struct list_item * source_list ;
92- struct comp_dev * dev = mod -> dev ;
93-
94- ipc4_base_module_cfg_to_stream_params (& mod -> priv .cfg .base_cfg , params );
95- component_set_nearest_period_frames (dev , params -> rate );
96- /* TODO - it does not work, to be checked before merging!!
97- * ipc4_update_source_format(ref, &cd->config.reference_fmt);
98- */
99- source_set_channels (ref ,
100- CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_AEC_REFERENCE_CHANNELS );
101- /* ipc4_update_source_format(mic, &mod->priv.cfg.base_cfg.audio_fmt); */
102- source_set_channels (mic , CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_CHANNELS );
103- /* ipc4_update_sink_format(out, &mod->priv.cfg.base_cfg.audio_fmt); */
104- sink_set_channels (out , CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_CHANNELS );
105- }
106-
10783static int google_rtc_audio_processing_reconfigure (struct processing_module * mod )
10884{
10985 struct google_rtc_audio_processing_comp_data * cd = module_get_private_data (mod );
@@ -361,8 +337,8 @@ static int google_rtc_audio_processing_init(struct processing_module *mod)
361337 goto fail ;
362338 }
363339
364- cd -> num_aec_reference_channels = CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_AEC_REFERENCE_CHANNELS ;
365- cd -> num_capture_channels = CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_CHANNELS ;
340+ cd -> num_aec_reference_channels = cd -> config . reference_fmt . channels_count ;
341+ cd -> num_capture_channels = mod -> priv . cfg . base_cfg . audio_fmt . channels_count ;
366342 cd -> num_frames = CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_SAMPLE_RATE_HZ /
367343 GOOGLE_RTC_AUDIO_PROCESSING_FREQENCY_TO_PERIOD_FRAMES ;
368344
@@ -523,11 +499,12 @@ static int google_rtc_audio_processing_prepare(struct processing_module *mod,
523499 source_set_alignment_constants (sources [i ], 1 , 1 );
524500 }
525501
526- google_rtc_audio_processing_params (mod ,
527- sources [cd -> aec_reference_source ],
528- sources [cd -> raw_microphone_source ],
529- sinks [0 ]);
530-
502+ /* enforce format on pins */
503+ ipc4_update_source_format (sources [cd -> aec_reference_source ],
504+ & cd -> config .reference_fmt );
505+ ipc4_update_source_format (sources [cd -> raw_microphone_source ],
506+ & mod -> priv .cfg .base_cfg .audio_fmt );
507+ ipc4_update_sink_format (sinks [0 ], & mod -> priv .cfg .base_cfg .audio_fmt );
531508
532509 /* On some platform the playback output is left right left right due to a crossover
533510 * later on the signal processing chain. That makes the aec_reference be 4 channels
0 commit comments