Commit graph

209 commits

Author SHA1 Message Date
Jim Gustafson
16dbd7a436 Remove support for setting mobile aec 2024-06-28 14:28:54 -07:00
Jim Gustafson
99c102adad m126 merge fixes 2024-06-25 14:25:19 -07:00
Tommi
57b09eca64 Update AudioFrameOperations to require ArrayView
Bug: chromium:335805780
Change-Id: I14d97315f4cffa21bcc11b063e86c5adcebe78ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/348800
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Olga Sharonova <olka@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42204}
2024-04-30 21:26:56 +00:00
Tommi
1f3679884c Start using ArrayView in AudioFrame, update PushResampler
Start introducing ArrayView to AudioFrame and code that flows down
from there.  In this first step:
* Add `data_view()` that returns a read-only ArrayView for the
  audio buffer. When AudioFrame is not initialized however, data_view()
  will return a nullptr whereas the current data() method never returns
  nullptr.
* Add `mutable_data()` that requires two arguments for properly setting
  the samples per channel and number of channels that's required for
  accurately reserving the returned mutable ArrayView.
  A notable behavior change is that if the requested number of channels
  is larger than supported or the calculated buffer size is too large,
  the function will trigger a check.
* Add TODOs for following work.

Bug: chromium:335805780
Change-Id: I2937de800422589ebe6a3840b3caadf3d9ff8b00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347982
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42202}
2024-04-30 15:33:08 +00:00
Tommi
b2b6166dc4 Make AudioFrame::channel_layout_ private and check for valid values
Bug: chromium:335805780
Change-Id: Ida671d317c07983cc51faa1a498642747dbb810c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349322
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42199}
2024-04-30 11:02:40 +00:00
Florent Castelli
f4673f97ed Move webrtc::AudioDeviceModule include to api/ folder
Bug: webrtc:15874
Change-Id: I5bdb19d5e710838b41e6ca283d406c9f1f21286b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/348060
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42137}
2024-04-22 08:56:31 +00:00
Florent Castelli
0afde7614d Move webrtc::AudioProcessing include to api/ folder
Bug: webrtc:15874
Change-Id: Ie8a6e031c0f0505cfe238f7d252c47e9c34408d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347983
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42128}
2024-04-20 07:02:50 +00:00
Sam Zackrisson
2e1f16d55c Make AEC3 json parsing code testonly
Reasons:
- the code is no longer used in Chrome
- it is conceptually weird for WebRTC to have JSON parsing in its API
- there are concerns around the reliability of the underlying JSON library

Additionally, this CL removes the rtc_json "poisonous" attribute: the scheme is incompatible and redundant with testonly.

Bug: webrtc:1493351
Change-Id: I0b621b0e3f183df7315919d9c89242fbe387928f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325062
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41014}
2023-10-26 12:03:02 +00:00
Lionel Koenig
9707f579ae delay estrimator: Enable looking for early reverberation
Enable by default the look for the first echo.

Bug: webrtc:14205
Change-Id: Iae904679c1432f3a0766263907cf376903685b97
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278043
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38452}
2022-10-24 08:35:52 +00:00
Lionel Koenig
8783c678a5 delay estimator: Look for early reverberation
Look for first echo (and not only the strongest one) on the same matched
filter.

This change is bit exact with previous version when `pre_echo` is false.

Author: Jesús de Vicente Peña <devicentepena@webrtc.org>

Bug: webrtc:14205
Change-Id: I6782eaa1d690b0df78d00f6d425a85c951b2ca9d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266321
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37360}
2022-06-28 15:16:03 +00:00
Niels Möller
7c8c4db8ea Add rtc::make_ref_counted to api/
This cl adds a forwarding header, a build target, and migrates headers
in api/ to use it.

Moving actual implementation, will follow, in
https://webrtc-review.googlesource.com/c/src/+/265390.

Bug: webrtc:12701
Change-Id: Id950725d7d054de8a83b3800b9c9a6437344de86
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265660
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37200}
2022-06-13 15:53:27 +00:00
Florent Castelli
c3e6e3a3e8 Remove dependency on rtc_base_approved from most targets
Bug: webrtc:9838
Change-Id: Ibd0199803597eff48ca139a5cecdc3209c62c5d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/259873
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36643}
2022-04-25 12:15:30 +00:00
Sam Zackrisson
cf7f7f9fa0 AEC3: Add hysteresis period before entering stereo processing
Even if playout audio is only very briefly stereo, the AEC will enter stereo processing mode. To save CPU and improve AEC performance, this CL adds a hysteresis period before treating playout as stereo.

The feature is enabled by default in the AEC3 config.

Bug: chromium:1295710
Change-Id: I29116ab2e7823e25a02aa3b66a1c619f1d966d9e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258479
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36503}
2022-04-08 17:01:08 +00:00
Sam Zackrisson
fa07b43074 AEC3: Add fallback to mono processing if no stereo is detected for some time
If playout audio is temporarily stereo, the AEC will currently enter stereo processing mode indefinitely. To save CPU and improve AEC performance, this CL adds support for falling back to mono after a period of no stereo.

The feature is enabled by default in the AEC3 config.

Bug: chromium:1295710
Change-Id: I690b5b22f8407f950bf41f3bcaa9ca0138452157
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258421
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36502}
2022-04-08 16:43:14 +00:00
Sam Zackrisson
64cdcc0792 AEC3: Add multichannel configuration and multichannel detection
The features have two safety fallbacks:
- multichannel config has a killswitch WebRTC-Aec3SetupSpecificDefaultConfigDefaultsKillSwitch
- stereo detection has a killswitch WebRTC-Aec3StereoContentDetectionKillSwitch

Both features are enabled by default in the AEC3 config.

Tested: Bitexact on a large number of aecdumps.
Bug: chromium:1295710
Change-Id: I340cdc9140dacd4ca22d0911eb9f732b6cf8b226
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258129
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36482}
2022-04-07 14:58:02 +00:00
Florent Castelli
dd837e28fa Remove //rtc_base:timeutils from public deps
Bug: webrtc:8603
Change-Id: Iaca9356d16275a02e8842c783f259131d72ef010
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257914
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36460}
2022-04-06 11:23:21 +00:00
Florent Castelli
57aa81bce7 Remove //rtc_base:stringutils from public deps
Bug: webrtc:8603
Change-Id: Ic2dfbe28d310cb4b35983b73e895fc95e8439669
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257913
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36453}
2022-04-05 22:42:19 +00:00
Florent Castelli
f86f6f9afd Remove //rtc_base:refcount from public deps
Bug: webrtc:8603
Change-Id: Ib27a107ae809df739492846175f0e9c4af40d21a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257910
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36447}
2022-04-05 15:32:29 +00:00
Florent Castelli
4467ad7835 Remove //rtc_base:macromagic from public deps
Bug: webrtc:8603
Change-Id: I9708df48c9bde9f86ba2d1a92a278bb0d09f3865
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257909
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36444}
2022-04-05 12:36:12 +00:00
Florent Castelli
0af55ba60d Remove //rtc_base:logging from public deps
Bug: webrtc:8603
Change-Id: I2704da8618f88032adac7ae9eb2a0f47fce4a836
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/257908
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36443}
2022-04-05 10:31:19 +00:00
Byoungchan Lee
c065e739e2 Remove RTC_DISALLOW_COPY_AND_ASSIGN more.
Bug: webrtc:13555, webrtc:13082
Change-Id: I9c07708108da0a26f5e228384fd56cef4d1540b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/247300
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: (Daniel.L) Byoungchan Lee <daniel.l@hpcnt.com>
Cr-Commit-Position: refs/heads/main@{#35749}
2022-01-20 11:00:18 +00:00
Jesús de Vicente Peña
875df7e140 AEC3: Changing the default for the use_conservative_tail_frequency_response flag.
Bug: webrtc:13173
Change-Id: If53ca45b28690d7d2ed744508b5a2ef7c8448172
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/241783
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35561}
2021-12-21 17:35:26 +00:00
Sam Zackrisson
03cb7e5a61 APM: Make echo detector an optionally compilable and injectable component
Important: This change does not in any way affect echo cancellation or standardized stats. The user audio experience is unchanged. Only non-standard stats are affected. Echo return loss metrics are unchanged. Residual echo likelihood {recent max} will no longer be computed by default.

Important: The echo detector is no longer enabled by default.

API change, PSA: https://groups.google.com/g/discuss-webrtc/c/mJV5cDysBDI/m/7PTPBjVHCgAJ

This CL removes the default usage of the residual echo detector in APM.
It can now only be used via injection and the helper function webrtc::CreateEchoDetector. See how the function audio_processing_unittest.cc:CreateApm() changed, for an example.

The echo detector implementation is marked poisonous, to avoid accidental dependencies.

Some cleanup is done:
- EchoDetector::PackRenderAudioBuffer is declared in one target but is defined in another target. It is not necessary to keep in the API. It is made an implementation detail, and the echo detector input is documented in the API.
- The internal state of APM is large and difficult to track. Submodule pointers that are set permanently on construction are now appropriately marked const.

Tested:
- existing + new unit tests
- audioproc_f is bitexact on a large number of aecdumps

Bug: webrtc:11539
Change-Id: I00cc2ee112fedb06451a533409311605220064d0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239652
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35550}
2021-12-16 17:39:11 +00:00
Artem Titov
d3251968d1 Prepare to rename RTC_NOTREACHED to RTC_DCHECK_NOTREACHED
Add implementation of RTC_DCHECK_NOTREACHED equal to the RTC_NOTREACHED.
The new macros will replace the old one when old one's usage will be
removed. The idea of the renaming to provide a clear signal that this
is debug build only macros and will be stripped in the production build.

Bug: webrtc:9065
Change-Id: I4c35d8b03e74a4b3fd1ae75dba2f9c05643101db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237802
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35348}
2021-11-15 21:44:59 +00:00
Jakob Ivarsson
4a97d7281f Remove NetEq extra delay option.
Bug: b/156734419
Change-Id: I787e6961ad283990d633029c0cf296e10b825875
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/237403
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35326}
2021-11-09 17:25:46 +00:00
Gustaf Ullberg
468bf9ac7f AEC3: Enable unbounded echo spectrum for dominant nearend detection by default
This change improves echo canceller transparency by enabling the use
of a non-capped ERLE when computing the residual echo spectrum for
dominant nearend detection.

Experimentation has shown that the feature improves echo canceller
transparency and user ratings.

Implementation CL:
https://webrtc-review.googlesource.com/c/src/+/221920

Bug: webrtc:12870
Change-Id: I7dc66810e8300cd35321bcd5b9fae9bc3386836d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234841
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35186}
2021-10-12 08:52:50 +00:00
Jesús de Vicente Peña
5eb5bb5007 AEC3: Using a more conservative frequency response representation of the tails.
Bug: webrtc:13173
Change-Id: Ic469f6226fe079c306cec6f941eeb70d6d9094f3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231682
Commit-Queue: Jesus de Vicente Pena <devicentepena@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34966}
2021-09-10 13:20:35 +00:00
Jesús de Vicente Peña
7d0203c723 AEC3: adding a milder exponential decay parameter that is used for dominant nearend regions when enabled.
Bug: webrtc:13143
Change-Id: Iedc6ff39ed5c7cd372b54a82c86354957c8852de
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/231131
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#34947}
2021-09-08 11:36:50 +00:00
Artem Titov
0e61fdd27c Use backticks not vertical bars to denote variables in comments for /api
Bug: webrtc:12338
Change-Id: Ib97b2c3d64dbd895f261ffa76a2e885bd934a87f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226940
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34554}
2021-07-26 18:27:34 +00:00
Mirko Bonadei
e99f6879f6 Move WebRTC to non deprecated jsoncpp APIs.
This will allow the removal of -Wno-deprecated-declarations from
WebRTC's BUILD.gn files even if [1] will still propagate in the
build graph, causing some ABSL_DEPRECATED to be ignored.

[1] - https://source.chromium.org/chromium/chromium/src/+/main:third_party/jsoncpp/BUILD.gn;l=15;drc=592d07510836410a1ec4833de342544d1b39ef08

Bug: webrtc:10770
Change-Id: I90193ac5cc3e41f00f1b5dd5dac3c462e4b5f9ef
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223666
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34375}
2021-06-28 12:09:14 +00:00
Per Åhgren
cbdbb8c166 Add ability to adjust the suppressor smoothing in AEC3
Bug: b/177359044
Change-Id: I5eddb6fa6f01aa14426161204e37a9097b182234
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217889
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34203}
2021-06-02 15:21:35 +00:00
Gustaf Ullberg
aeb8ce882f AEC3: Change adaptation speed of the matched filter after a delay is found
This change enables the use of two different adaptation speeds of the
matched filter of the delay estimator of AEC3.

One speed is used when no delay has been found, and one is used after a
reliable delay has been found. The purpose is to use a slower adaptation
speed to reduce the risk of divergence during double-talk without
slowing down the search for the initial delay.

The CL prepares for experimentation by adding field trials for
controlling the two adaptation speeds.

Bug: webrtc:12775
Change-Id: I817a1ab5ded0f78d20de45edcf04c708290173fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219083
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34055}
2021-05-19 13:37:13 +00:00
Per Åhgren
3de4067092 Increase the bound for the value of the filter reset block interval
Bug: b/177359044
Change-Id: Id42022b42cad81a3eb2ac42b565d84f691448605
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/217890
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34050}
2021-05-19 09:18:16 +00:00
Tomas Gunnarsson
c1d589146b Replace new rtc::RefCountedObject with rtc::make_ref_counted in a few files
Bug: webrtc:12701
Change-Id: Ie50225374f811424faf20caf4cf454b2fd1c4dc9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215930
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33818}
2021-04-23 12:04:39 +00:00
Gustaf Ullberg
437d129ef5 AEC3: Avoid overcompensating for render onsets during dominant nearend
The ERLE is used to estimate residual echo for echo suppression. The
ERLE is reduced during far-end offset to avoid echo leakage. When there
is a strong near-end present this can cause unnecessary transparency loss.

This change adds an ERLE estimation that does not compensate for onsets and
uses it for residual echo estimation when the suppressor considers the near-end to be dominant.

Bug: webrtc:12686
Change-Id: Ida78eeacf1f95c6e62403f86ba3f2ff055898a84
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215323
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33786}
2021-04-20 12:33:02 +00:00
Per Åhgren
652ada5029 Enabling a safe fall-back functionality for overruns in the runtime settings
Bug: b/177830919
Change-Id: I9369f6fc004ceb2b626d33b36262bc8aeabdb1a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206988
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33371}
2021-03-03 12:06:54 +00:00
Gustaf Ullberg
09226fc832 Disable high-pass filtering of the AEC reference
Currently the echo canceller reference signal is high-pass filtered to
avoid the need of modeling the capture-side high-pass filter as part of
the echo path.

This can lead to the lowest frequency bins of the linear filter
diverging as there is little low-frequency content available for
training. Over time the filter can output an increasing amount of
low-frequency power, which in turn affects the filter's ability to
adapt properly.

Disabling the high-pass filtering of the echo canceller reference solves
this issue, resulting in improved filter convergence.

Bug: webrtc:12265
Change-Id: Ic526a4b1b73e1808cfcd96a8cdee801b96a27671
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/208288
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33322}
2021-02-23 07:06:11 +00:00
Gustaf Ullberg
992a96f68e AEC3: Prevent diverging coarse filter from influencing the refined filter
After the refined filter has been determined to perform better than
the coarse filter, and the coefficients of the coarse filters are
overwritten by the ones from the refined filter, at least 100 ms have
to pass before the adaptation of the refined filter is allowed to speed
up due to good coarse filter performance.

This change solves the vicious circle described in webrtc:12265, where
the coarse and refined filters can diverge over time.

This feature can be disabled remotely via a kill-switch. When disabled
the AEC output is bit-exact to before the change.

Bug: webrtc:12265,chromium:1155477
Change-Id: Iacd6e325e987dd8a475bb3e8163fee714c65b20a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/196501
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32801}
2020-12-08 15:05:23 +00:00
Gustaf Ullberg
7e4ad828d6 Increased high frequency transparency
Avoid excessive echo suppression in frequencies above 2 kHz when
there is a dominant nearend. Calls with clock drift will not be affected
by this change as they tend to have less accurate linear filters.

Bug: webrtc:11985
Change-Id: Iddc628da5e2ba572c1b47acd87dd3be35260dca1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/188580
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32533}
2020-11-02 10:42:10 +00:00
Per Åhgren
f9f53316f5 Reland "Reduce the amount of howling reduction in AEC3"
This is a reland of 2978abb88c

Original change's description:
> Reduce the amount of howling reduction in AEC3
>
> This CL backs off the howling protection functionality in AEC3.
> The effect is increased transparency in some cases. No negative effects
> have been identified in the hands-on testing.
>
>
> A kill-switch is added that can be used to turn off the functionality.
>
> Bug: b/150764764
> Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32258}

Bug: b/150764764,chromium:1134939
Change-Id: I5eea60b35e6d09003ec2fee3865513df8bdd5823
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186260
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32304}
2020-10-03 23:28:33 +00:00
Sam Zackrisson
389bf0feb8 AEC3: Move option for reverb model in nonlinaer mode into AEC3 config
This adds a config parameter for reverb modelling in nonlinear mode.
The killswitch is preserved, and will have the same effect before and after this CL.

Tested: Bitexact on a large number of aecdumps both with and without WebRTC-Aec3NonlinearModeReverbKillSwitch.
Bug: webrtc:8671
Change-Id: I7b2fa92307af5316dbe895392367abb8d15f06bf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/183541
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32298}
2020-10-02 20:27:47 +00:00
Olga Sharonova
09ceed2165 Async audio processing API
API to injecting a heavy audio processing operation into WebRTC audio capture pipeline

Bug: webrtc:12003
Change-Id: I9f6f58f468bd84efd0a9d53d703db6229a03959e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165788
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Olga Sharonova <olka@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32291}
2020-10-02 12:33:34 +00:00
Andrey Logvin
dba4db5668 Revert "Reland "Reduce the amount of howling reduction in AEC3""
This reverts commit 18515e2793.

Reason for revert: Continuation of previous revert https://webrtc-review.googlesource.com/c/src/+/186304

Original change's description:
> Reland "Reduce the amount of howling reduction in AEC3"
>
> This is a reland of 2978abb88c
>
> Original change's description:
> > Reduce the amount of howling reduction in AEC3
> >
> > This CL backs off the howling protection functionality in AEC3.
> > The effect is increased transparency in some cases. No negative effects
> > have been identified in the hands-on testing.
> >
> >
> > A kill-switch is added that can be used to turn off the functionality.
> >
> > Bug: b/150764764
> > Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
> > Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> > Commit-Queue: Per Åhgren <peah@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#32258}
>
> Bug: b/150764764
> Change-Id: I277f24eb3288ad0307e7463bad9aea6436cfe879
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186263
> Reviewed-by: Per Åhgren <peah@webrtc.org>
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32274}

TBR=gustaf@webrtc.org,peah@webrtc.org

Change-Id: I0596855e3bf910878aebcee90e03345d5db1105d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/150764764
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186269
Reviewed-by: Andrey Logvin <landrey@webrtc.org>
Commit-Queue: Andrey Logvin <landrey@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32276}
2020-10-01 14:48:58 +00:00
Per Åhgren
18515e2793 Reland "Reduce the amount of howling reduction in AEC3"
This is a reland of 2978abb88c

Original change's description:
> Reduce the amount of howling reduction in AEC3
>
> This CL backs off the howling protection functionality in AEC3.
> The effect is increased transparency in some cases. No negative effects
> have been identified in the hands-on testing.
>
>
> A kill-switch is added that can be used to turn off the functionality.
>
> Bug: b/150764764
> Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32258}

Bug: b/150764764
Change-Id: I277f24eb3288ad0307e7463bad9aea6436cfe879
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186263
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32274}
2020-10-01 13:44:23 +00:00
Mirko Bonadei
aa3d3b4793 Revert "Reduce the amount of howling reduction in AEC3"
This reverts commit 2978abb88c.

Reason for revert: Breaks ApmTest.Process.

After trying to enable AVX2, we increased the amount of error
we tolerate (kFloatNear) and this CL introduced a regression which
makes the test fail after we reverted the enabling of AVX2 (restoring
the old tolerance).

With this CL:
../../modules/audio_processing/audio_processing_unittest.cc:1779: Failure
The difference between test->rms_dbfs_average() and rms_dbfs_average is 0.00142669677734375, which exceeds kFloatNear, where
test->rms_dbfs_average() evaluates to 52.907142639160156,
rms_dbfs_average evaluates to 52.905715942382812, and
kFloatNear evaluates to 0.00050000000000000001.

[  FAILED  ] ApmTest.Process (5347 ms)
[----------] 1 test from ApmTest (5348 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (5350 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] ApmTest.Process

After reverting it:

[       OK ] ApmTest.Process (5345 ms)
[----------] 1 test from ApmTest (5347 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (5350 ms total)
[  PASSED  ] 1 test.

Original change's description:
> Reduce the amount of howling reduction in AEC3
>
> This CL backs off the howling protection functionality in AEC3.
> The effect is increased transparency in some cases. No negative effects
> have been identified in the hands-on testing.
>
>
> A kill-switch is added that can be used to turn off the functionality.
>
> Bug: b/150764764
> Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
> Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
> Commit-Queue: Per Åhgren <peah@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#32258}

TBR=gustaf@webrtc.org,peah@webrtc.org

Change-Id: I4723c5cd66e3046851089157ec586afab55c5ce8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: b/150764764
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186122
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32261}
2020-09-30 19:00:37 +00:00
Per Åhgren
2978abb88c Reduce the amount of howling reduction in AEC3
This CL backs off the howling protection functionality in AEC3.
The effect is increased transparency in some cases. No negative effects
have been identified in the hands-on testing.


A kill-switch is added that can be used to turn off the functionality.

Bug: b/150764764
Change-Id: I604c569c76f911799556a60bc8fd2fb43bbfe196
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186082
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32258}
2020-09-30 15:21:34 +00:00
Mirko Bonadei
2dcf348011 Use absl_deps in order to preapre to the Abseil component build release.
Bug: webrtc:1046390
Change-Id: Ia35545599de23b1a2c2d8be2d53469af7ac16f1d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/176502
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31463}
2020-06-08 12:59:40 +00:00
Henrik Lundin
c49e9c253f Adding a delay line to NetEq's output
This change adds an optional delay to NetEq's output. Note, this is not
equivalent to increasing the jitter buffer with the same extra length.

Bug: b/156734419
Change-Id: I8b70b6b3bffcfd3da296ccf29853864baa03d6bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/175110
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31343}
2020-05-25 12:03:39 +00:00
Sam Zackrisson
b0bd0708d6 Surface ResidualEchoDetector creation to API
This allows users to inject the residual echo detector, as a step toward making it an optional part of compilation.

Bug: webrtc:11292, webrtc:11539
Change-Id: I7fcc8dbaced67a82851cd6cdcbc115eb01c21fcf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/174040
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31222}
2020-05-12 10:56:18 +00:00
Per Åhgren
e156287855 AEC3: Remove deprecated parameter
Bug: webrtc:8671
Change-Id: Ia9bcfef9d626729b79fdcce5e8df82bf020dc9af
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173321
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31042}
2020-04-09 12:25:05 +00:00