Skip to content

Commit 369ad4a

Browse files
committed
[DEBUG] google_aec: Add debug logs
Adding more logs. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent adf9726 commit 369ad4a

File tree

1 file changed

+40
-3
lines changed

1 file changed

+40
-3
lines changed

src/audio/google/google_rtc_audio_processing.c

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -766,12 +766,17 @@ static int trigger_handler(struct processing_module *mod, int cmd)
766766

767767
static int google_rtc_audio_processing_reset(struct processing_module *mod)
768768
{
769-
comp_dbg(mod->dev, "google_rtc_audio_processing_reset()");
769+
comp_info(mod->dev, "google_rtc_audio_processing_reset()");
770770
return 0;
771771
}
772772

773-
static inline void execute_aec(struct google_rtc_audio_processing_comp_data *cd)
773+
static inline void execute_aec(struct google_rtc_audio_processing_comp_data *cd,
774+
struct comp_dev *dev)
774775
{
776+
/* DEBUG: Log AEC execution start */
777+
comp_info(dev, "AEC execute: processing %d channels, %d frames",
778+
cd->num_capture_channels, cd->num_frames);
779+
775780
/* Note that reference input and mic output share the same
776781
* buffer for efficiency
777782
*/
@@ -780,6 +785,10 @@ static inline void execute_aec(struct google_rtc_audio_processing_comp_data *cd)
780785
GoogleRtcAudioProcessingProcessCapture_float32(cd->state,
781786
(const float **)cd->raw_mic_buffers,
782787
cd->refout_buffers);
788+
789+
/* DEBUG: Log AEC execution complete */
790+
comp_info(dev, "AEC execute complete: processed %d channels", cd->num_capture_channels);
791+
783792
cd->buffered_frames = 0;
784793
}
785794

@@ -814,9 +823,23 @@ static int mod_process(struct processing_module *mod, struct sof_source **source
814823
int frames = ref_ok ? MIN(fmic, fref) : fmic;
815824
int n, frames_rem;
816825

826+
/* DEBUG: Log data flow information */
827+
comp_info(mod->dev, "AEC process: fmic=%d, fref=%d, frames=%d, ref_ok=%d, buffered=%d/%d",
828+
fmic, fref, frames, ref_ok, cd->buffered_frames, cd->num_frames);
829+
830+
if (frames == 0) {
831+
comp_warn(mod->dev, "AEC: No input frames available (fmic=%d, fref=%d)",
832+
fmic, fref);
833+
return 0;
834+
}
835+
817836
for (frames_rem = frames; frames_rem; frames_rem -= n) {
818837
n = MIN(frames_rem, cd->num_frames - cd->buffered_frames);
819838

839+
/* DEBUG: Log copy operations */
840+
comp_info(mod->dev, "AEC copying: n=%d frames, buffered_frames=%d",
841+
n, cd->buffered_frames);
842+
820843
cd->mic_copy(mic, n, cd->raw_mic_buffers, cd->buffered_frames);
821844

822845
if (ref_ok)
@@ -830,8 +853,22 @@ static int mod_process(struct processing_module *mod, struct sof_source **source
830853
break;
831854
}
832855

833-
execute_aec(cd);
856+
/* DEBUG: Log AEC execution and output */
857+
comp_info(mod->dev, "AEC executing: processing %d frames, sink_free_size=%zu",
858+
cd->num_frames, sink_get_free_size(out));
859+
860+
execute_aec(cd, mod->dev);
861+
862+
/* DEBUG: Log output operation with detailed info */
863+
comp_info(mod->dev, "AEC output: copying %d frames to sink, chan=%d, nsrc=%d",
864+
cd->num_frames, sink_get_channels(out),
865+
MIN(sink_get_channels(out), CHAN_MAX));
866+
834867
cd->out_copy(out, cd->num_frames, cd->refout_buffers);
868+
869+
/* DEBUG: Verify output was written (should be reduced) */
870+
comp_info(mod->dev, "AEC output complete: sink_free_size=%zu after copy",
871+
sink_get_free_size(out));
835872
}
836873
}
837874
cd->last_ref_ok = ref_ok;

0 commit comments

Comments
 (0)