On Mon, 2016-01-18 at 13:06 +0530, arun at accosted.net wrote: > From: Arun Raghavan <git at arunraghavan.net> > > This creates a longer filter that is more complex and less sensitive to > incorrect delay reporting from the hardware. There is also a > delay-agnostic mode that can eventually be enabled if required. > > In some very quick testing, not enabling this seems to provide better > results during double-talk. > --- > Â src/modules/echo-cancel/webrtc.cc | 16 ++++++++++++++-- > Â 1 file changed, 14 insertions(+), 2 deletions(-) > > diff --git a/src/modules/echo-cancel/webrtc.cc b/src/modules/echo-cancel/webrtc.cc > index 3e5a144..f4f1395 100644 > --- a/src/modules/echo-cancel/webrtc.cc > +++ b/src/modules/echo-cancel/webrtc.cc > @@ -46,6 +46,7 @@ PA_C_DECL_END > Â #define DEFAULT_ROUTING_MODE "speakerphone" > Â #define DEFAULT_COMFORT_NOISE true > Â #define DEFAULT_DRIFT_COMPENSATION false > +#define DEFAULT_EXTENDED_FILTER false > Â > Â static const char* const valid_modargs[] = { > Â Â Â Â Â "high_pass_filter", > @@ -56,6 +57,7 @@ static const char* const valid_modargs[] = { > Â Â Â Â Â "routing_mode", > Â Â Â Â Â "comfort_noise", > Â Â Â Â Â "drift_compensation", > +Â Â Â Â "extended_filter", > Â Â Â Â Â NULL > Â }; > Â > @@ -81,7 +83,8 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec, > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â uint32_t *nframes, const char *args) { > Â Â Â Â Â webrtc::AudioProcessing *apm = NULL; > Â Â Â Â Â webrtc::ProcessingConfig pconfig; > -Â Â Â Â bool hpf, ns, agc, dgc, mobile, cn; > +Â Â Â Â webrtc::Config config; > +Â Â Â Â bool hpf, ns, agc, dgc, mobile, cn, ext_filter; > Â Â Â Â Â int rm = -1; > Â Â Â Â Â pa_modargs *ma; > Â > @@ -154,7 +157,16 @@ bool pa_webrtc_ec_init(pa_core *c, pa_echo_canceller *ec, > Â Â Â Â Â Â Â Â Â } > Â Â Â Â Â } > Â > -Â Â Â Â apm = webrtc::AudioProcessing::Create(); > +Â Â Â Â ext_filter = DEFAULT_EXTENDED_FILTER; > +Â Â Â Â if (pa_modargs_get_value_boolean(ma, "extended_filter", &ext_filter) < 0) { > +Â Â Â Â Â Â Â Â pa_log("Failed to parse extended_filter value"); > +Â Â Â Â Â Â Â Â goto fail; > +Â Â Â Â } > + > +Â Â Â Â if (ext_filter) > +Â Â Â Â Â Â Â Â config.Set<webrtc::ExtendedFilter>(new webrtc::ExtendedFilter(true)); Could these last two lines be replaced with config.Set<webrtc::ExtendedFilter>(new webrtc::ExtendedFilter(ext_filter)); ? Otherwise the patch looks good. -- Tanu