Make the argument speech_probability non-optional in
InputVolumeController::Process() and
MonoInputVolumeController::Process().
Additional clean-up: Remove the flag enabled in the
config. Add unit tests for MonoInputVolumeController.
Bug: webrtc:7494
Change-Id: Ie28af77dc628bf71d09ce1ff033d39031f77a21e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283700
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38710}
when volume emulation is used or when neither an input volume
controller nor volume emulation are used.
This CL adds 3 tests, 2 of which currently fail because APM
behaves in an undesired way. In [1] the behavior is fixed and
the tests are enabled.
A DCHECK in `AudioProcessingImpl::set_stream_analog_level` has
been removed since a more robust behavior can be obtained - namely,
that expected in the disabled unit tests added in this CL.
[1] https://webrtc-review.googlesource.com/c/src/+/281185
Bug: webrtc:14581
Change-Id: I29d2c000cd1baf90606487afd9a4042e6f487834
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281184
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38696}
Make speech probability threshold configurable by replacing
kSpeechProbabilitySilenceThreshold with speech_probability_threshold in
InputVolumeController::Config.
Make the processing more robust against outliers in speech probability
estimaton by computing an aggregate speech activity over a speech
segment. In MonoInputVolumeController::Process(), use the passed
non-empty speech probabilities to compute the speech activity over the
speech segment and only allow updates for segments with a high enough
ratio of speech frames. Pass RMS error and speech probability for every
frame in Process(): If rms_error_dbfs is empty, volume updates are not
allowed; if speech_probability is empty, the frame counts as a non-
speech frame.
Remove startup_min_volume from the config since it's no longer used
after https://webrtc-review.googlesource.com/c/src/+/282821.
Bug: webrtc:7494
Change-Id: I0ab81b03371496315348f552133aa9909bd36f26
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/283523
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38685}
This CL adds more explicit tests for unsupported sample rates in the WebRTC audio processing module (APM). Rates are restricted to the range [8000, 384000] Hz. Rates outside this range are handled as best as possible, depending on the format.
Tested: bitexact on a large number of aecdumps
Bug: chromium:1332484, chromium:1334991
Change-Id: I9639d03dc837e1fdff64d1f9d1fff0edc0fb299f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/276920
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38663}
Replace kUpdateInputVolumeWaitFrames with
update_input_volume_wait_frames in InputVolumeController::Config.
Also, fix an off-by-one error in the frame count to give a better
readability for non-zero wait frames. Now
update_input_volume_wait_frames_ = 100 allows updates every 100 frames
instead of every 101 frames. Effectively, this makes
update_input_volume_wait_frames = 0 and 1 to behave similarly (i.e.,
they now both allow updates after every frame).
Bug: webrtc:7494
Change-Id: I597f7e88895a4dcd365dc6dee526acb9d971b2fc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282863
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38648}
Replace the use of MonoInputController::min_mic_level() with
MonoInputVolumeController::clipped_level_min() when estimating input
volume adjustment from clipping prediction. The adjustment is later
capped in MonoInputVolumeController::HandleClipping() using
clipped_level_min_ so no audio changes are expected from this change.
Bug: webrtc:7494
Change-Id: Ie26d0aa5cce3eeef06f70a281504889519bb5aca
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282840
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38593}
Remove function declarations, members, and friend tests that are
no longer used. Reorder the member variables.
Bug: webrtc:7494
Change-Id: I8c24e2f4b9d9846e6d3fef4e2c998aa26f49f8c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/282180
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38570}
Replace the use of speech level target and digital gain maximum with speech level target range parameters.
Bug: webrtc:7494
Change-Id: I703756c5a3fbd330ed585e3f5b4ac3141d9ea6e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280943
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38563}
In InputVolumeController/MonoInputVolumeController, set
min_digital_gain_db_ and disable_digital_adaptive_ to fixed values
ahead of replacing speech level target as well as digital gain
minimum and maximum with target range parameters.
In InputVolumeController, remove digital_adaptive_follows and
min_digital_gain_db from the config as they are no longer needed.
Bug: webrtc:7494
Change-Id: I1378b6e182224c41038c6d8c649e7a28961f73d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280962
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38554}
Modify unit tests ahead of changes that will replace the minimum
digital gain with a fixed value 0 and always enable digital gain
compensation.
Bug: webrtc:7494
Change-Id: I9df95667b831d5b68e70aaba22f631b398edf8e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280960
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38553}
Rename constants and arguments reflecting the old naming with RMS error
overriding the error calculated by the analog AGC. Rename the related
unit tests and helper functions.
Bug: webrtc:7494
Change-Id: I9a1d972e9ff7ab5cdd43ca3568379d511801adee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280481
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38552}
Add InputVolumeController as a member in GainController2 (not created
by default). Add a method GainController2::Analyze() to update the
applied input volume and run the pre-processing steps in
InputVolumeController. Add a call InputVolumeController::Process() in
GainController2::Process().
Bug: webrtc:7494
Change-Id: Idf4111ac5e19a620b6421c7f23fd642f169c7b5a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279822
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38548}
Implement InputVolumeController and RecommendedInputVolumeEstimator based on the copy of agc classes AgcManagerDirect and MonoAgc.
Copies of the original files created in https://webrtc-review.googlesource.com/c/src/+/278624.
Bug: webrtc:7494
Change-Id: I74acee57b0db5cc8a6b666be9ba619c6c98a1773
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278625
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38533}
Copy AgcManagerDirect files from agc to agc2. Rename the newly
created files and classes ahead of refactoring. Add a build
target.
This change is done to enable creating a class
InputVolumeController based on AgcManagerDirect. The added
temporary dependency on files in agc will be removed
in https://webrtc-review.googlesource.com/c/src/+/278625.
The exact copy of the files happened in the 1st patchset and it
has been verified as follows:
Checksum check:
```
$ git checkout main && git pull
# Go back to the tree state before [1] landed
$ git new-branch tmp
$ git reset --hard 2235776597
$ cd modules/audio_processing/agc/
$ md5 agc_manager_direct*
MD5 (agc_manager_direct.cc) = e661481a85f72596cae4599b62907f5b
MD5 (agc_manager_direct.h) = bf68280e2d0f689b4ebcd665b5db6052
MD5 (agc_manager_direct_unittest.cc) = 6bf0bf45ff5e940b1a3bb37154f09269
```
Patchset 1 (see [2])
```
$ cd modules/audio_processing/agc2/
$ md5 input_volume_controlle*
MD5 (input_volume_controller.cc) = e661481a85f72596cae4599b62907f5b
MD5 (input_volume_controller.h) = bf68280e2d0f689b4ebcd665b5db6052
MD5 (input_volume_controller_unittest.cc) = 6bf0bf45ff5e940b1a3bb37154f09269
```
[1] https://webrtc-review.googlesource.com/c/src/+/278781
[2] https://webrtc-review.googlesource.com/c/src/+/278624/1
Bug: webrtc:7494
Change-Id: I7804da899d18adf556b089c76a567ce27c299a62
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278624
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38512}
This is a reland of commit 8d7273357d
Root cause:
audioproc_f doesn't call `metrics::Enable()` and therefore the stats
reporter crashed when `metrics::HistogramFactoryGetCountsLinear()`
returned a nullptr.
Bug fix:
Added `InputVolumeStatsReporter::cannot_log_stats_`, a const flag
that is set to true if any histogram factory returns a nullptr.
When true, the class does nothing.
This CL also includes other code readability improvements that were
not part of the original CL.
Original change's description:
> APM: log both applied and recommended input volume stats
>
> This CL replaces the existing `WebRTC.Audio.ApmAnalogGain.*` stats
> with `WebRTC.Audio.Apm.AppliedInputVolume.*` and adds the
> `WebRTC.Audio.Apm.RecommendedInputVolume.*` stats.
>
> Bug: webrtc:7494
> Change-Id: I70be710d20b1589fc814cbce3d3329ac1500686f
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280220
> Reviewed-by: Hanna Silen <silen@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#38468}
Bug: webrtc:7494
Change-Id: I8373d16beb06b84f439d2c2274ededea7c5e95b0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280661
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38484}
This CL replaces the existing `WebRTC.Audio.ApmAnalogGain.*` stats
with `WebRTC.Audio.Apm.AppliedInputVolume.*` and adds the
`WebRTC.Audio.Apm.RecommendedInputVolume.*` stats.
Bug: webrtc:7494
Change-Id: I70be710d20b1589fc814cbce3d3329ac1500686f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280220
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38468}
Adopt the new naming convention, which replaces "analog gain" and
"mic level" with "input volume", in the input volume stats reporter.
Bug: webrtc:7494
Change-Id: Ia24876151f51dd1dcc4e4f9db56c64d11ae3b442
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279840
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38467}
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}
Tested: Chromium built with this change; verified that the
behavior at the beginning of the call has not changed with
both low (< 12) and high (> 12) input volumes.
Bug: webrtc:7494
Change-Id: Ie184c994d46bf6fd1cb209873383b911beb766e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278787
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38420}
The parameter is unused and it will be removed in [1]. This CL
isolates the necessary unit test changes from [1].
[1] https://webrtc-review.googlesource.com/c/src/+/278787
Bug: webrtc:7494
Change-Id: Ic1179d335926fba8ff1b65b494b538cf849724bb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279100
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38416}
This CL:
- makes it easier to understand the (nontrivial) metric interpretation
- corrects the computation of BufferDelay to use 0 for absent delay
- deletes metric MaxSkewShiftCount, unused since https://webrtc-review.googlesource.com/c/src/+/119701
- updates the unit test to directly test metric reporting
Corresponding update to histograms.xml:
https://crrev.com/c/3944909
Previous revert:
https://webrtc-review.googlesource.com/c/src/+/279040
This CL is identical to the original, except:
- the test is updated to spam fewer EXPECT_EQ failures on failure (EXPECT_EQs moved out of inner loop)
- the test not resets metrics (metrics::Reset()) at the beginning, like other histogram tests
Bug: webrtc:8671, chromium:1349051
Change-Id: Ie802e1f9d03a22ff7018f522a63b19e0b6eec2e8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/279046
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38376}
- Set the initial input volume to that forced by startup min volume
since the latter is removed in a follow-up CL
- Remove unwanted expectations
Bug: webrtc:7494
Change-Id: I2df28f5bfaf4e592dfeae5e03b157268473cc822
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278784
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38370}
This CL:
- makes it easier to understand the (nontrivial) metric interpretation
- corrects the computation of BufferDelay to use 0 for absent delay
- deletes metric MaxSkewShiftCount, unused since https://webrtc-review.googlesource.com/c/src/+/119701
- updates the unit test to directly test metric reporting
Corresponding update to histograms.xml:
https://crrev.com/c/3944909
Bug: webrtc:8671, chromium:1349051
Change-Id: If73b6fca4de7343bff2c53f72cedda458d36c599
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278782
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38362}
This CL adds #includes to header files in order to make them
self contained after the preprocessor pass.
Bug: b/251890128
Change-Id: I81c3ba38fb8ab8a2bbd151ba99aa871fae9f1b1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278422
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38327}
Remove the evaluation of clipping prediction. The result is not used.
Bug: webrtc:7494
Change-Id: I18d2c1f50ed675a9653d518095f69ed263a34041
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278361
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38320}
Add passing optional speech level and speech probability to Process().
This enables computing an override for the RMS error from
Agc::GetRmsErrorDb(). Currently no speech level or probability are
passed outside the tests and no override happens elsewhere.
Bug: webrtc:7494
Change-Id: I0a7b1204aa51bcde8588963a5af023410405e83d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277560
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38318}
Add a buffer class to store speech probabilities and to estimate speech
activity. Follows the implementation of speech activity computation in
LoudnessHistogram but uses floats for computations.
Bug: webrtc:7494
Change-Id: I6ee72ec52919904ea4e1fbe51d61993aa7813c9f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277801
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38309}
MaybeInitializeCapture may overwrite the render configuration of a concurrent render reinitialization, leading to a second render reinitialization on the next render processing call.
See bug description for details.
Tested: Verified bitexactness offline (single-threaded) on a large number of aecdumps.
Bug: webrtc:14495
Change-Id: I9b70b454ce1c27859c3414c9c9ec89b7bbe35559
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/277380
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38241}
Main changes:
- `AgcManagerDirectTestHelper::FirstProcess()` replaced by
`CallAgcSequence()`, which is API contract compliant
- `ExpectCheckVolumeAndReset()`, `SetVolumeAndProcess()` and
`ExpectInitialize() `removed
- TODOs added for the next batch of improvements
- `AgcManagerDirectTestHelper::mock_agc` now using `NiceMock`
- `AgcManagerDirect::(AnalyzePre)Process()` now receives a
const ref
- `AnalyzePreProcess(const float* const*,size_t )` removed
Bug: webrtc:7494
Change-Id: Ie5bbaa590586dd806b30494fb00ca9c742c241e2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273490
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38056}
The current design of the modified getter is error-prone since the
returned value changes meaning based on when (which point in the code)
the getter is called - namely, before `ProcessStream()` is called the
getter returns the stream analog level, after it returns the
recommended level.
Plus, the new implementation, which essentially returns a local
member, removes the risks that the non-trivial implementation
is computationally expensive.
Bug: webrtc:7494, b/241923537
Change-Id: I6714444df27bcc055ae693974ecd1f77f79e6ec0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271580
Reviewed-by: Hanna Silen <silen@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38055}
The `recommended_stream_analog_level()` getter is used to retrieve
both the applied and the recommended input volume. This behavior is
error-prone since the caller must know what is returned based on
the point in the code (namely, before/after the AGC has changed
the last applied input volume into a recommended level).
This CL is a first step to make clarity on which input volume is
handled in different parts of APM. Next in the pipeline: make
`recommended_stream_analog_level()` a trivial getter that always
returns the recommended level.
Main changes:
- When `recommended_stream_analog_level()` is called but
`set_stream_analog_level()` is not called, APM logs an error
and returns a fall-back volume (which should not be applied
since, when `set_stream_analog_level()` is not called, no
external input volume is expected to be present
- When APM is used without calling the `*_stream_analog_level()`
methods (e.g., when the caller does not provide any input volume),
the recorded AEC dumps won't store `Stream::applied_input_level`
Other changes:
- Removed `AudioProcessingImpl::capture_::prev_analog_mic_level`
- Removed redundant code in `GainController2` around detecting
input volume changes (already done by APM)
- Adapted the `audioproc_f` and `unpack_aecdump` tools
- Data dumps clean-up: the applied and the recommended input
volumes are now recorded in an AGC implementation agnostic way
Bug: webrtc:7494, b/241923537
Change-Id: I3cb4a731fd9f3dc19bf6ac679b7ed8c969ea283b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271544
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38054}
Switching to an AGC implementation agnostic solution for the input
volume emulation functionality offered by the
`capture_levels_adjuster` sub-module.
This CL also fixes a (silent) bug due to which, when the input
volume is emulated via the capture adjuster sub-module, AGC2
reads an incorrect value for the applied input volume.
Tested: audioproc_f with `--analog_mic_gain_emulation 1` used
to verify bit-exactness for one Wav file and one AEC dump for
which the input volume varies.
Bug: webrtc:7494, b/241923537
Change-Id: Ide3085f9a5dfd85888ad812ebd56faa175fb2ba7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273902
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38053}
`EchoControllerObservesAnalogAgc1EchoPathGainChange` is incorrect
since it does not call `set_stream_analog_level()`,
`ProcessCapture()` and `recommended_stream_analog_level()`
according to the contract.
`EchoControllerObservesNoDigitalAgc2EchoPathGainChange` is
useless since AGC2 doesn't have any analog controller at the
moment and the test is not written to explictly trigger digital
gain adaptations.
Bug: webrtc:7494, b/241923537
Change-Id: I56203c736448ec060077b00b57e98cd4c29fa737
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271541
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38052}
Making it clear that the field is used to store the applied input
volume and not the recommended input volume.
Bug: webrtc:7494, b/241923537
Change-Id: Ib91bc1a12348f63e3a4ba6e068ed02e40786a87b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271342
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38051}
Fixing a bug due to which the analog controller could not be disabled.
AudioProcessing::Config::GainController1::AnalogGainController::enabled
was ignored and therefore `recommended_stream_analog_level_locked()` in
APM was returning the level recommended by `AgcManagerDirect`.
When the analog controller is disabled, `stream_analog_level()` now
returns the last value set via `set_stream_analog_level()`.
However, the analog controller code is still running and, in particular,
the existing metrics are reported as if the controller were enabled.
This choice was made to reduce the risks of adding bugs in the digital
compression gain selection part, which is tied to the analog
controller. The metric drawback will be solved in a follow-up CL.
Additional changes:
- log `WebRTC.Audio.GainController.Analog.Enabled` when
AGC1 is created or when its config changes
- first step to replace "analog level" with "input volume"
Bug: webrtc:7909, b/180019868
Change-Id: I28ce9556dd98f3dd9ad546799406c55478730435
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270663
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38044}
Instead of showing individual byte differences, this CL detects
differences in the expected and actual byte streams of the evaluated
AEC dump and, if detected, parses the `audioproc::Event` proto lite
messages and calls EXPECT_EQ() for a subset of individual (sub-)fields.
Note that messages are parsed only if the byte streams of each message
pair do not match, so with no failures the test runs at no extra cost.
Plus, the the added funcionality can only be enabled for local
debugging by flipping the `kDumpWhenExpectMessageEqFails` flag - a
code change cannot land if the flag is set to true.
Note that `MessageDifferencer` (see [1]) could not be used because
it is not implemented for `MessageLite` protos.
[1] https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.util.message_differencer
Bug: b/241923537
Change-Id: I8e0eda3b1ecfe06945b6dad5ee8871f8200d76d7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/270922
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37765}
Sample rates not divisible by 100, in particular 11025 Hz and 22050 Hz, have long been used with APM in Chrome, but the support has never been stated explicitly.
This CL makes minor modifications to the APM API to clarify how rates are handled when 10 ms is not an integer number of samples. Unit tests are also extended to cover this case better.
This does not update all references to 10 ms and implicit floor(sample_rate/100) computations, but it does at least take us closer to a correct API.
Note that not all code needs to support these sample rates. For example, audio processing submodules only need to operate on the native APM rates 16000, 32000, 48000.
Bug: chromium:1332484
Change-Id: I1dad15468f6ccb9c0d4d09c5819fe87f8388d5b8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268769
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37682}
This is the first step of migrating
AudioProcessing::CreateAndAttachAecDump() from using std::string to
absl::string_view.
Bug: webrtc:13579
Change-Id: I8fc373e7ac55fd8e96bb0b01d1a30e28883ac9a2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269400
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37631}
It is now easier to fully test `AgcManagerDirect` with different values
for the used field trials. In particular, this CL adds tests for the
field trial named `WebRTC-Audio-2ndAgcMinMicLevelExperiment`.
1. `UnmutingRaisesTooLowVolume` and `MicVolumeIsLimited`
The expectations for the lowest input volume are not hard-coded anymore
since the parametrized tests use different values for the enforced
minimum.
2. `RecoveryAfterManualLevelChangeBelowMin`
The recovery behavior after manual input volume change depends on
whether the minimum input volume is overridden. When that's the case,
the minimum volume is applied immediately after the manual adjustment.
Hence, the existing test is left and a parametrized version of it has been added to test the "instant recovery" behavior. The latter test is
skipped when the minimum input volume is not overridden since that case
is covered by the existing test.
Bug: chromium:1275566
Change-Id: Ib0d4427b32b88f33138d4062b365916a3c47a406
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268900
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37577}
Stop using TEST_F; that will make it easier to switch to parametric
tests that are needed to correctly test `AgcManagerDirect`.
"Avoid fixtures where reasonable."
Source: https://abseil.io/tips/122
Bug: chromium:1275566
Change-Id: I2d73a0913eb2349144f63bd17ab4d6efa245e472
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268766
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37556}
This reverts commit d0a6fd239c.
Reason for revert: reland the bug fix
Original change's description:
> Revert "`AgcManagerDirect`: stop enforcing min mic level override with 0 level"
>
> This reverts commit e76daab8b3.
>
> Reason for revert: revert required to revert the parent CL
>
> Original change's description:
> > `AgcManagerDirect`: stop enforcing min mic level override with 0 level
> >
> > https://webrtc-review.googlesource.com/c/src/+/250141 introduced a bug
> > due to which the min mic level override is always enforced, if specified
> > even if the user manually adjusts the mic level to zero.
> >
> > This CL fixes that bug, the changes run behind a kill switch.
> >
> > TESTED=Test video call on Chromium on Mac; input volume not adjusted after zeroing it from the system preferences UI
> >
> > Bug: chromium:1275566
> > Change-Id: I18ce2e5970d3002b301f51f84544583c64982d57
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267844
> > Reviewed-by: Hanna Silen <silen@webrtc.org>
> > Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#37460}
>
> Bug: chromium:1275566
> Change-Id: I6d22d8f3fafdc7da3814827b9b69146a506595db
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268468
> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37515}
Bug: chromium:1275566
Change-Id: I7198587dec2a153270e8beb714e9dacccdaae806
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268544
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37530}
This reverts commit c9cad23274.
Reason for revert: add back field trial
Original change's description:
> Min mic analog level: override minimum and behavior on Mac
>
> This CL removes the `WebRTC-Audio-AgcMinMicLevelExperiment` field trial
> and always enables the code path behind that flag on Mac. In summary,
> the analog AGC behaves as follows on Mac:
> 1. the minimum level is overridden to 20
> 2. the minimum is applied even when clipping is detected
> 3. when the level is manually adjusted to 0, the minimum level is
> enforced - i.e., 20
>
> Note that the 3rd property had been unintentionally added when the
> changes were added behind the aforementioned field trial. This will
> be fixed in a follow-up CL.
>
> Bug: chromium:1275566
> Change-Id: If184c4455a0780fcd94f55141af34460c152e3c3
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266488
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Reviewed-by: Hanna Silen <silen@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37459}
Bug: chromium:1275566
Change-Id: I00a37ad9e16efc49f721558d25af16efd5f3db8c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268540
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37521}
This reverts commit e76daab8b3.
Reason for revert: revert required to revert the parent CL
Original change's description:
> `AgcManagerDirect`: stop enforcing min mic level override with 0 level
>
> https://webrtc-review.googlesource.com/c/src/+/250141 introduced a bug
> due to which the min mic level override is always enforced, if specified
> even if the user manually adjusts the mic level to zero.
>
> This CL fixes that bug, the changes run behind a kill switch.
>
> TESTED=Test video call on Chromium on Mac; input volume not adjusted after zeroing it from the system preferences UI
>
> Bug: chromium:1275566
> Change-Id: I18ce2e5970d3002b301f51f84544583c64982d57
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267844
> Reviewed-by: Hanna Silen <silen@webrtc.org>
> Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#37460}
Bug: chromium:1275566
Change-Id: I6d22d8f3fafdc7da3814827b9b69146a506595db
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268468
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37515}
https://webrtc-review.googlesource.com/c/src/+/250141 introduced a bug
due to which the min mic level override is always enforced, if specified
even if the user manually adjusts the mic level to zero.
This CL fixes that bug, the changes run behind a kill switch.
TESTED=Test video call on Chromium on Mac; input volume not adjusted after zeroing it from the system preferences UI
Bug: chromium:1275566
Change-Id: I18ce2e5970d3002b301f51f84544583c64982d57
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267844
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37460}
This CL removes the `WebRTC-Audio-AgcMinMicLevelExperiment` field trial
and always enables the code path behind that flag on Mac. In summary,
the analog AGC behaves as follows on Mac:
1. the minimum level is overridden to 20
2. the minimum is applied even when clipping is detected
3. when the level is manually adjusted to 0, the minimum level is
enforced - i.e., 20
Note that the 3rd property had been unintentionally added when the
changes were added behind the aforementioned field trial. This will
be fixed in a follow-up CL.
Bug: chromium:1275566
Change-Id: If184c4455a0780fcd94f55141af34460c152e3c3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266488
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37459}
This CL duplicates a few lines of utility code from
//modules/audio_processing:audioproc_test_utils (which contains more
testonly things) and allows the possibility to remove testonly from
the unpack_aecdump tool.
Bug: b/237526033
Change-Id: If2e1dd4cc825429c496091cf8640c67069fb6e6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/267701
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37437}
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}
When the `WebRTC-Audio-TransientSuppressorVadMode-RnnVad` field trial
is set, APM now uses (i) its RNN VAD sub-module to compute the voice
probability, (ii) that probability for TS and (iii) a temporally
delayed version of it for AGC2 (the delay introduced by TS is taken
into account).
Bug: webrtc:13663
Change-Id: Ic0f245c3f00d318c19bb01d3dbc2d5176c90f851
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/266362
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37291}
Add a VoiceActivityDetectorWrapper submodule in AudioProcessingImpl
and enable injecting speech probability into GainController2.
Bug: webrtc:13663
Change-Id: I05e13b737d085b45ac8ce76660191867c56834c2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265166
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37275}
Puts the whole block in contiguous memory and reduce pointer look-up.
The change has been verified to be bit-exact.
Bug: webrtc:14089
Change-Id: I264aaf764bf53a29f23249105f704b2fdbd7e51c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263203
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36983}
The high-band gain is corrected by fixing the computation of the
low-band energy
Bug: webrtc:14108
Change-Id: I5033287de57aedcd91bb71623ca2862519ffb35b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263201
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36972}
This change adds a Block class to reduce the need for std::vector<std::vector<std::vector<float>>>. This make the code
easier to read and less error prone.
It also enables future changes to the underlying data structure of a
block. For instance, the data of all bands and channels could be stored
in a single vector.
The change has been verified to be bit-exact.
Bug: webrtc:14089
Change-Id: Ied9a78124c0bbafe0e912017aef91f7c311de2ae
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/262252
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36968}
To quote rfc6464:
The audio level for digital silence -- for a muted audio source, for
example -- MUST be represented as 127 (-127 dBov), regardless of the
dynamic range of the encoded audio format.
The behavior in webrtc is correct that digital silence is represented
with 127, but it is also possible to get a value of 127 for not quite
digitally silent audio buffer (as in, not strictly 0s).
Bug: webrtc:14029
Change-Id: I7ff8698a7e4d5c0960c667fd1cc961838e269456
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261244
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36793}
* Structs with user-declared constructors are no longer considered
aggregates, so remove the declarations when possible
* Types of both arguments to "==" must match to avoid "ambiguous
function call" warning
* Various types of math involving enums are deprecated, so replace with
constexprs where necessary
* ABSL_CONST_INIT must be used on definition as well as declaration
* volatile memory may no longer be read from and written to by the same
operator, so replace e.g. "n++" with "n = n + 1"
* Replace an outdated check for no_unique_address support with
__has_cpp_attribute
* std::result_of(f(x)) has been removed, replace with
std::invoke_result(f, x)
Bug: chromium:1284275
Change-Id: I77b366ab1da7eb2c1e4c825b2714417c31ee5903
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261221
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: Tomas Gunnarsson <tommi@google.com>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36786}
While the target has a restricted visibility, since it was in rtc_base_approved
public deps, a lot of targets were able to bypass the visibility check.
So we remove the visibility restrictions and use the dependency explicitely
everywhere instead.
Bug: webrtc:8603
Change-Id: I94a03fdf7f94c54ab72081a58dd648e2cca73d17
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258944
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36566}
Adds two metrics for stereo detection:
- An enum indicating whether the last 10 seconds contained persistent stereo content or not, logged every 10 seconds.
- An enum indicating whether any persistent stereo content at all has been detected, logged at the end of the AEC lifetime.
These metrics allow us to assess:
- What proportion of all audio is treated as stereo.
- What proportion of sessions encounter any significant stereo content. If this is unexpectedly high, the stereo detection code may need fine tuning.
Metrics are only logged for component lifetimes exceeding 5 seconds: This is to avoid brief AEC lifetimes due to internal resets etc within APM.
Corresponding Chrome CL for XML histogram declarations:
https://crrev.com/c/3579317
Bug: chromium:1295710
Change-Id: I93e2bf74588cf4bb2a8922dbfad079bccab01456
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258760
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36537}
During temporary stereo content when the AEC3 uses a mono reference signal, the signal is downmixed by averaging instead of using only the left channel.
Additionally, temporary stereo content is flagged as an echo path change.
Tested: Modified local build: Verified stereo mode entered / left in accordance with hysteresis and timeout thresholds. Verified temporary stereo detected during temporary stereo playout. Made an aecdump and inspected content.
Bug: chromium:1295710
Change-Id: I6bd53e615dfb3ec39bc1c73275b7d6d599ac7c57
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258481
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36504}
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}
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}
This CL adds a component in the TS implementation to return a delayed
version of the voice probability values observed when `Suppress()` is
called. That is needed in order to temporally align the voice
probability values to the processed audio since TS adds algorithmic
delay.
Bug: webrtc:13663
Change-Id: I5041ace3939d2ce7ba084ae703428e66f1aa06be
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255860
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36496}
The values returned by `TransientSuppressor::Initialize()` and by
`TransientSuppressor::Suppress()` are never used.
Bug: webrtc:13663
Change-Id: I20b8afb5a66f49e5ebaf132acf8bcd1c4292a5f8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255822
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36492}
More robust API option that allows to fully initialize TS when created.
Bug: webrtc:13663
Change-Id: I42c38612ef772eb6d0bbde49d04ea39332a0e3c7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255821
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36490}
Adding a delay unit to be used in the APM Transient Suppressor (TS)
sub-module through which the observerd voice probabilities are
temporally aligned to the audio processed by TS, which introduces
algorithmic delay.
Bug: webrtc:13663
Change-Id: I2136c303914580851c742d8db89478a13b06dacb
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255680
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36487}
It is now required to specify which VAD is used to compute the speech
probability passed when `TransientSuppressor::Suppress()` is called.
In this way, it is possible to adapt parameters and/or logic of a
`TransientSuppressor` implementation to the behavior of the used
VAD. This CL also adds a "no VAD" mode option, which ignores the speech
probability argument passed when `Suppress()` and always applies mild
suppression to preserve transparency.
Finally, this CL adds a field trial to choose which VAD is used by
APM for transient suppression. Wiring the RNN VAD to TS will be done
in a follow-up CL.
Bug: webrtc:13663
Change-Id: I21ed49f91875a4ee0f04db97ea87c0dbc3db7f8a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250962
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36485}
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}
Apart from making the construction more straightforward, this change allows recreating the BlockProcessor at runtime. This is used to change parameterization at runtime in an upcoming CL [1].
[1] https://webrtc-review.googlesource.com/c/src/+/258129
Tested: Bitexact on a large number of aecdumps.
Bug: chromium:1295710
Change-Id: I2e0275c5c97044cb4370042633266b193c06b960
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258100
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36473}
Motivation: never used.
Follow-up CL of https://webrtc-review.googlesource.com/c/src/+/250680.
Tested on a custom chromium build by making a video call and with
keyboard activity. The expected logs from the APM transient suppressor
sub-module were shown.
Bug: webrtc:11226
Change-Id: I4186994412dd8ba2e71ed8f9dcc9cf8f8e40fbd3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250667
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36300}
Add a flag to override the key pressed state when simulating APM.
The current behavior changes as follows:
- Wav files simulation: instead of simulating continuous key press
events only if the transient suppressor (TS) sub-module is active,
allow to simulate the events regardless of whether TS is used;
the default key pressed state is used if the command line flag is
unspecified, otherwise it is overridden (either always false or
always true)
- AEC dump simulation: instead of simulating continuous key press
events when `--ts 2` is specified, allow to simulate the events
regardless of whether TS is used; the state recorded in the AEC
dump is used if the command line flag is unspecified, otherwise
it is overridden (either always false or always true)
- The `--ts 2` option (continuous key events) is now equivalent to
`--ts 1`.
Bug: webrtc:13663
Change-Id: I5ebe96283db73ee235ec2b2795d91d4e241a3527
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/256003
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36247}
Increase the history size of clipping_predictor_evaluator_. Use one-sample
accuracy in clipping detection for the evaluator.
Bug: webrtc:12774
Change-Id: I8c1bbfe69fe55af73ce14992e49ef7295b3ce926
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/241602
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36218}
- missing negation causes the opposite behavior when
`analog_agc_disable_digital_adaptive` is used
- flag replaced with `analog_agc_use_digital_adaptive_controller`
which is less error-prone
Bug: webrtc:7494
Change-Id: If9e0ba4fc9e539c73269faf9096ca782620dac6d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251322
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36113}
Also test the field trial with valid parameter and non-empty suffix.
Bug: webrtc:7494
Change-Id: I3d871b41dd71c951ac56e180b3c09cda4c3627d4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251441
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36031}
This enum is no longer needed. Also moving the last piece of code from
common.h to audio_processing_impl.h, allowing to delete common.h.
Bug: chromium:1271981, b/217349489
Change-Id: If115336c36d6d7b5845a903e421c18aebfe434ee
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251242
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35946}
When the minimum mic level is overridden via the field trial named
WebRTC-Audio-AgcMinMicLevelExperiment, AGC1 can still lower the gain
beyond the minimum value (namely, when clipping is observed).
This CL changes the behavior of the field trial. When specified, the
override always applies and therefore the mic level is guaranteed to
never become lower than what the field trial specifies.
Tested: RTC call in Chromium with and without --force-fieldtrials="
WebRTC-Audio-AgcMinMicLevelExperiment/Enabled-255"
Bug: chromium:1275566
Change-Id: I42ff45add54c11084f5ca6a2b95887c627c3c3aa
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250141
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35914}
- Switch from ptr+size to rtc::ArrayView
- Remove `AgcManagerDirect::sample_rate_hz_` since it's always 16 kHz
- Stop passing nullptr in agc_manager_direct_unittest.cc when
`AgcManagerDirect::Process()` is called
- Allow to correctly run the tests added in the child CL (see [1])
[1] https://webrtc-review.googlesource.com/c/src/+/250141
Bug: webrtc:7494
Change-Id: I0292d7038d6510ca7c58af32b6003a1e4b121b00
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250541
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35910}
The 6-parameter Initialize method is removed. The has_keyboard parameter
in the StreamConfig constructor is removed together with the underlying
member and helper functions.
Bug: chromium:1271981, b/217349489
Change-Id: I7259a114a395f74f735a9c06510c0fc0f0f008e3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/250221
Reviewed-by: Sam Zackrisson <saza@google.com>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Auto-Submit: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35908}
This CL removes even more top-level const from parameters in function
declarations. This change is safe because top-level const in function
declarations (not function definitions) are ignored by the compiler
and so change is just a no-op cleanup.
Bug: webrtc:13610
Change-Id: Icf6868c27b1fdb9d9915b3a7020eb34bdcf07a09
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/249989
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35866}