[pulseaudio-discuss] [PATCH v3 12/24] echo-cancel: Allow enabling of the webrtc experimental AGC mechanism

arun at accosted.net arun at accosted.net
Sun Jan 17 23:36:26 PST 2016


From: Arun Raghavan <git at arunraghavan.net>

---
 src/modules/echo-cancel/webrtc.cc | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/modules/echo-cancel/webrtc.cc b/src/modules/echo-cancel/webrtc.cc
index 6431651..4aae3fa 100644
--- a/src/modules/echo-cancel/webrtc.cc
+++ b/src/modules/echo-cancel/webrtc.cc
@@ -49,6 +49,7 @@ PA_C_DECL_END
 #define DEFAULT_DRIFT_COMPENSATION false
 #define DEFAULT_EXTENDED_FILTER false
 #define DEFAULT_INTELLIGIBILITY_ENHANCER false
+#define DEFAULT_EXPERIMENTAL_AGC false
 #define DEFAULT_TRACE false
 
 #define WEBRTC_AGC_MAX_VOLUME 255
@@ -65,6 +66,7 @@ static const char* const valid_modargs[] = {
     "drift_compensation",
     "extended_filter",
     "intelligibility_enhancer",
+    "experimental_agc",
     "trace",
     NULL
 };
@@ -141,7 +143,7 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
     webrtc::AudioProcessing *apm = NULL;
     webrtc::ProcessingConfig pconfig;
     webrtc::Config config;
-    bool hpf, ns, agc, dgc, mobile, cn, ext_filter, intelligibility;
+    bool hpf, ns, agc, dgc, mobile, cn, ext_filter, intelligibility, experimental_agc;
     int rm = -1;
     pa_modargs *ma;
 
@@ -226,10 +228,18 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec,
         goto fail;
     }
 
+    experimental_agc = DEFAULT_EXPERIMENTAL_AGC;
+    if (pa_modargs_get_value_boolean(ma, "experimental_agc", &experimental_agc) < 0) {
+        pa_log("Failed to parse experimental_agc value");
+        goto fail;
+    }
+
     if (ext_filter)
         config.Set<webrtc::ExtendedFilter>(new webrtc::ExtendedFilter(true));
     if (intelligibility)
         config.Set<webrtc::Intelligibility>(new webrtc::Intelligibility(true));
+    if (experimental_agc)
+        config.Set<webrtc::ExperimentalAgc>(new webrtc::ExperimentalAgc(true, WEBRTC_AGC_START_VOLUME));
 
     ec->params.priv.webrtc.trace = DEFAULT_TRACE;
     if (pa_modargs_get_value_boolean(ma, "trace", &ec->params.priv.webrtc.trace) < 0) {
-- 
2.5.0



More information about the pulseaudio-discuss mailing list