[pulseaudio-discuss] [PATCH v3 02/24] echo-cancel: Allow enabling the extended filter in webrtc AEC
Arun Raghavan
arun at accosted.net
Sun Jan 24 20:04:00 PST 2016
On 23 January 2016 at 20:36, Tanu Kaskinen <tanuk at iki.fi> wrote:
> 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.
Sure, I can fix that up.
-- Arun
More information about the pulseaudio-discuss
mailing list