@@ -551,23 +551,26 @@ static int google_rtc_audio_processing_prepare(struct processing_module *mod,
551551 /* check IBS/OBS in streams */
552552 if (cd -> num_frames * source_get_frame_bytes (sources [cd -> raw_microphone_source ]) !=
553553 source_get_min_available (sources [cd -> raw_microphone_source ])) {
554- comp_warn (dev , "Incorrect IBS on microphone source: %d, expected %u" ,
554+ comp_err (dev , "Incorrect IBS on microphone source: %d, expected %u" ,
555555 source_get_min_available (sources [cd -> raw_microphone_source ]),
556556 cd -> num_frames *
557557 source_get_frame_bytes (sources [cd -> raw_microphone_source ]));
558+ return - EINVAL ;
558559 }
559560 if (cd -> num_frames * sink_get_frame_bytes (sinks [0 ]) !=
560561 sink_get_min_free_space (sinks [0 ])) {
561- comp_warn (dev , "Incorrect OBS on sink :%d, expected %u" ,
562+ comp_err (dev , "Incorrect OBS on sink :%d, expected %u" ,
562563 sink_get_min_free_space (sinks [0 ]),
563564 cd -> num_frames * sink_get_frame_bytes (sinks [0 ]));
565+ return - EINVAL ;
564566 }
565567 if (cd -> num_frames * source_get_frame_bytes (sources [cd -> aec_reference_source ]) !=
566568 source_get_min_available (sources [cd -> aec_reference_source ])) {
567- comp_warn (dev , "Incorrect IBS on reference source: %d, expected %u" ,
569+ comp_err (dev , "Incorrect IBS on reference source: %d, expected %u" ,
568570 source_get_min_available (sources [cd -> aec_reference_source ]),
569571 cd -> num_frames *
570572 source_get_frame_bytes (sources [cd -> aec_reference_source ]));
573+ return - EINVAL ;
571574 }
572575
573576 /* Blobs sent during COMP_STATE_READY is assigned to blob_handler->data
@@ -733,37 +736,6 @@ static int google_rtc_audio_processing_process(struct processing_module *mod,
733736 return 0 ;
734737}
735738
736- bool google_rtc_audio_is_ready_to_process (struct processing_module * mod ,
737- struct sof_source * * sources , int num_of_sources ,
738- struct sof_sink * * sinks , int num_of_sinks )
739- {
740- struct google_rtc_audio_processing_comp_data * cd = module_get_private_data (mod );
741- struct sof_source * ref_stream , * mic_stream ;
742- struct sof_sink * out_stream ;
743- size_t min_ref_bytes ;
744-
745-
746- /* check if both input streams and output stream have enough data/space */
747- mic_stream = sources [cd -> raw_microphone_source ];
748- ref_stream = sources [cd -> aec_reference_source ];
749- out_stream = sinks [0 ];
750-
751- /* this should source_get_min_available(ref_stream)!!!
752- * Currently the topology sets IBS incorrectly
753- */
754- if (source_get_data_available (ref_stream ) < cd -> num_frames *
755- source_get_frame_bytes (ref_stream ))
756- return false;
757-
758- if (source_get_data_available (mic_stream ) < source_get_min_available (mic_stream ))
759- return false;
760-
761- if (sink_get_free_size (out_stream ) < sink_get_min_free_space (out_stream ))
762- return false;
763-
764- return true;
765- }
766-
767739static struct module_interface google_rtc_audio_processing_interface = {
768740 .init = google_rtc_audio_processing_init ,
769741 .free = google_rtc_audio_processing_free ,
@@ -772,7 +744,6 @@ static struct module_interface google_rtc_audio_processing_interface = {
772744 .set_configuration = google_rtc_audio_processing_set_config ,
773745 .get_configuration = google_rtc_audio_processing_get_config ,
774746 .reset = google_rtc_audio_processing_reset ,
775- .is_ready_to_process = google_rtc_audio_is_ready_to_process ,
776747};
777748
778749DECLARE_MODULE_ADAPTER (google_rtc_audio_processing_interface ,
0 commit comments