]> code.delx.au - pulseaudio/commitdiff
echo-cancel: Speex preprocessor has to run *after* the AEC.
authorBart Cerneels <bart.cerneels@kde.org>
Sat, 28 May 2011 02:26:00 +0000 (07:56 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Sat, 28 May 2011 02:26:00 +0000 (07:56 +0530)
This is how it is expected to be run.

src/modules/echo-cancel/module-echo-cancel.c

index e83839a988028c3ebb2e2dbebe4c4fc08b10db1a..90577d4cbcab092c0dcb15dff043f8212a6579a4 100644 (file)
@@ -726,12 +726,13 @@ static void source_output_push_cb(pa_source_output *o, const pa_memchunk *chunk)
                         fwrite(pdata, 1, u->blocksize, u->played_file);
                 }
 
-                if (u->ec->pp_state)
-                    speex_preprocess_run(u->ec->pp_state, (spx_int16_t *) rdata);
-
                 /* perform echo cancelation */
                 u->ec->run(u->ec, rdata, pdata, cdata);
 
+                /* preprecessor is run after AEC. This is not a mistake! */
+                if (u->ec->pp_state)
+                    speex_preprocess_run(u->ec->pp_state, (spx_int16_t *) cdata);
+
                 if (u->save_aec) {
                     if (u->canceled_file)
                         fwrite(cdata, 1, u->blocksize, u->canceled_file);