Commit graph

24 commits

Author SHA1 Message Date
Per Åhgren
db5d728878 Add refined handling of the internal scaling of the audio in APM
This CL adds functionality that allows adjusting the audio levels
internally in APM. The main purpose of the functionality is to allow
APM to optionally be moved to an integration that does not provide an
analog gain to control, and the implementation of this has been
tailored specifically to meet the requirements for that.

More specifically, this CL does
-Add a new variant of the pre-amplifier gain that is intended to replace
 the pre-amplifier gain (but at the moment can coexist with that). The
 main differences with the pre-amplifier gain is that an attenuating
 gain is allowed, the gain is applied jointly with any emulated analog
 gain, and that its packaging fits better with the post gain.
-Add an emulation of an analog microphone gain. The emulation is
 designed to match the analog mic gain functionality in Chrome OS (which
 is digital) but should be usable also on other platforms.
-Add a post-gain which is applied after all processing has been applied.
 The purpose of this gain is for it to work well with the integration
 in ChromeOS, and be used to compensate for the offset that there is
 applied on some USB audio devices.


Bug: b/177830918
Change-Id: I0f312996e4088c9bd242a713a703eaaeb17f188a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/209707
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33466}
2021-03-15 19:12:02 +00:00
Per Åhgren
68c225d76d Make 48 kHz maximum rate default for all devices
Bug: b/169918549
Change-Id: I2f4b7ced5ae6efcae3cd59c0a42610a54f5e2dc7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/203260
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33192}
2021-02-08 15:06:05 +00:00
Alessio Bazzica
6f75f6b3bd APM: add AGC2 SIMD kill switches in AudioProcessing::Config::ToString()
Bug: webrtc:7494
Change-Id: Icba5f6be689a57ef4748ae816565349fd1ad2108
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/205322
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33146}
2021-02-03 12:31:56 +00:00
Alessio Bazzica
42eef86c4f Remove unused code in APM
- The injection of the AGC2 level estimator into `AgcManagerDirect`
  is not used anymore
- `ExperimentalAgc::enabled_agc2_level_estimator` can also be removed
- 3 ctors of `ExperimentalAgc` are unused
- `AgcManagerDirectStandaloneTest::AgcMinMicLevelExperiment` can be
  split into separate unit tests (better code clarity)

Bug: webrtc:7494
Change-Id: I5843147c38cf7cb5ee484b0a72fe13dcf363efaf
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/202025
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33027}
2021-01-18 13:40:27 +00:00
Hua, Chunbo
dbcaff0925 Fix AudioProcessing::Config::ToString() implementation.
residual_echo_detector and level_estimation is not part of gain_controller2
in AudioProcessing::Config.

Bug: None
Change-Id: Ic31b8c6bb4d9ed59b4f337e5dc8b8c587ae54202
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/200924
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32972}
2021-01-14 10:27:18 +00:00
Alessio Bazzica
08d2a703fc AGC2 limiter stats + config ToString missing param
Bug: webrtc:7494
Change-Id: Icb6a164882af5c15c9400eb869dccbfda20b3da7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/194324
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32653}
2020-11-20 17:03:05 +00:00
Karl Wiberg
c95b939667 Introduce RTC_CHECK_NOTREACHED(), an always-checking RTC_NOTREACHED()
And use it in a few places that were using RTC_CHECK(false) or FATAL()
to do the exact same job. There should be no change in behavior.

Bug: none
Change-Id: I36d5e6bcf35fd41534e08a8c879fa0811b4f1967
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/191963
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32567}
2020-11-09 10:47:55 +00:00
Fabien Vallée
f8b5bfeaf2 Fix "control reaches end of non-void function" warnings
"warning: control reaches end of non-void function [-Wreturn-type]"
Reported by gcc (8.3)

In all the reported cases, the end of function is never actually
reached. Add RTC_CHECK(false) to ensure the compiler is aware that
this path is a dead-end.

Bug: webrtc:12008
Change-Id: I7f816fde3d1897ed2774057c7e05da66e1895e60
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/189784
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Fabien VALLÉE <fabien.vallee@netgem.com>
Cr-Commit-Position: refs/heads/master@{#32503}
2020-10-27 10:22:23 +00:00
Alessio Bazzica
3438a9383c AGC2 config change detection fixed
AGC2 is correctly (re)initialized when its config changes.
This CL also improves the `AudioProcessingImpl::ApplyConfig`
readability by defining operator!= also for the AGC1 config.

Bug: webrtc:7494
Change-Id: I62068de32c941e6b18d4618c656f569647042345
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187120
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32402}
2020-10-14 12:18:57 +00:00
Alessio Bazzica
0c83e15c6b Move AGC2 config ToString to the right place and update Validate()
The APM config to string mapping must be in one place (namely,
in `audio_processing.cc`). This CL moves the AGC2 config to string
impl to the right place.

This CL also updates `GainController2::Validate()` and adds the
missing unit tests for the parameters that have recently been added.

Stack buffer size in `AudioProcessing::Config::ToString()` increased
because of the extra params. Syntax near `multi_channel_capture` fixed.
Output string format verified with a JS linter.

Bug: webrtc:7494
Change-Id: I692e1549b7d40c970d88a14c8e83da16325fb54c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187080
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32400}
2020-10-14 12:00:54 +00:00
Sam Zackrisson
4b6ba7c207 Split out some dependencies from the monolith audio processing target
This is a first step to make the transient suppressor and voice detection optional.

Bug: webrtc:11226, webrtc:11292
Change-Id: I203125e11694a957a32bc7f98f3bec3ec8867839
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/166523
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30783}
2020-03-12 21:07:08 +00:00
Jonas Olsson
b2b2031457 Concatenate string literals at compile time.
This CL was generated by running:
git ls-files | grep ".cc" | xargs perl -i -ne 'BEGIN {undef $/}; s/("[\s\n]*<<[\s\n]*")/" "/g; print;'; git cl format

After that I manually edited modules/audio_processing/gain_controller2.cc to preserve its original
formatting.

This primary benefit of this change is a small reduction in binary size.

Bug: None
Change-Id: I689fa7ba9c717c314bb167e5d592c3c4e0871e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165961
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30251}
2020-01-14 14:47:48 +00:00
Per Åhgren
c0734715d1 APM: Move the TransientSuppression activation to the apm_config
This CL moves the activation of the transient suppression to the APM
config.

Bug: webrtc:5298
Change-Id: Iba7975bec4654c3df8834fd5b7d1082ff53641dd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/163985
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30137}
2020-01-03 08:48:54 +00:00
Per Åhgren
ded86c1ad8 Remove remaining settings for using legacy AEC
This CL removes the remaining settings for using the legacy AEC.

It also adds a missing printout of the enforce_high_pass_filtering
parameter in the ToString method.

Bug: webrtc:11165
Change-Id: I58f0861bf1c6cd24bd83f4d3e394653b2fab3d71
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/161683
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30050}
2019-12-10 10:31:07 +00:00
Per Åhgren
e14cb99408 Correct/update the activation of the multi-channel processing in APM
This CL removes the experimental status of the multi-channel processing
in APM, and accordingly updates the variable naming.

It also splits the activation of multi-channel processing to be separate
for render and capture.


Bug: webrtc:10859
Change-Id: I0e5d04dcb94b6637c33d97146231b8ddddbaea39
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/160707
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29926}
2019-11-27 10:15:25 +00:00
Sam Zackrisson
72cc71cd70 Harmonize APM config logging, update config ToString
It is unclear what configuration the APM is running with.
This CL helps some of that. Note that the webrtc::Config
is still not reported.

Bug: webrtc:5298
Change-Id: Icc2cf0b20634c04d567c0951a57ba6fe7aa5c5b4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157423
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29555}
2019-10-21 11:35:40 +00:00
Per Åhgren
fcbe4071ce Adding more refined control over choice of band-splitting
This CL allows the user to have more refined control over what band
splitting-scheme is used inside the audio processing module.


Bug: webrtc:6181
Change-Id: I236c3b1f96ab80cc4ffb8c39c045c034764567a1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152480
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29189}
2019-09-14 23:14:17 +00:00
Artem Titov
59bbd65561 Add ToString method for AudioProcessing::Config
Bug: webrtc:10138
Change-Id: Icc0b40596867fd6fb8c1de5ca209dbafb504e50d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/147726
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28745}
2019-08-02 10:01:56 +00:00
Yves Gerey
988cc0870b [Cleanup] Add missing #include. Remove useless ones.
This CL is the result of running include-what-you-use tool on part
of the code base (audio target and dependencies) plus manual fixes.

bug: webrtc:8311
Change-Id: I277d281ce943c3ecc1bd45fd8d83055931743604
Reviewed-on: https://webrtc-review.googlesource.com/c/106280
Commit-Queue: Yves Gerey <yvesg@google.com>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25311}
2018-10-23 11:32:56 +00:00
Sam Zackrisson
db38972eda Remove nonlinear beamformer API from APM
This CL removes the remaining beamformer parts from the APM.

Bug: webrtc:9402
Change-Id: I9ab2795bd2813d17166ed0925125257b82d98a74
Reviewed-on: https://webrtc-review.googlesource.com/83340
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23694}
2018-06-21 08:49:52 +00:00
Alex Loiko
73ec01977b Add RuntimeSettings to CustomProcessing.
CustomProcessing is the interface to injectable audio processing
submodules to AudioProcessing. This CL makes it possible to set
runtime settings on the injected render processing component.

Note that the current runtime setting handling happens on the capture
thread. Therefore, we add another SwapQueue to communicate with the
render thread.

Bug: webrtc:9138, webrtc:9262
Change-Id: I665ce2d83a2b35ca8b25cca813d2cef7bd0ba911
Reviewed-on: https://webrtc-review.googlesource.com/76123
Commit-Queue: Alex Loiko <aleloi@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23236}
2018-05-15 10:03:25 +00:00
Per Åhgren
b6b00dc180 Safe behavior of the initial echo removal in AEC3
This CL adds functionality to allow removal of any echo occurring
before the render and capture signals have been properly aligned.
The functionality is added in such a manner that the transparency
to nearend is maintained as much as possible.


Bug: webrtc:8883
Change-Id: I813cbbc4c48822e7dffcd9ab6233be4c222089de
Reviewed-on: https://webrtc-review.googlesource.com/49941
Commit-Queue: Per Åhgren <peah@webrtc.org>
Reviewed-by: Gustaf Ullberg <gustaf@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22107}
2018-02-20 22:01:36 +00:00
Mirko Bonadei
92ea95e34a Fixing WebRTC after moving from src/webrtc to src/
In https://webrtc-review.googlesource.com/c/src/+/1560 we moved WebRTC
from src/webrtc to src/ (in order to preserve an healthy git history).
This CL takes care of fixing header guards, #include paths, etc...

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org


Bug: chromium:611808
Change-Id: Iea91618212bee0af16aa3f05071eab8f93706578
Reviewed-on: https://webrtc-review.googlesource.com/1561
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19846}
2017-09-15 05:02:56 +00:00
Mirko Bonadei
bb547203bf Moving src/webrtc into src/.
In order to eliminate the WebRTC Subtree mirror in Chromium, 
WebRTC is moving the content of the src/webrtc directory up
to the src/ directory.

NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=tommi@webrtc.org

Bug: chromium:611808
Change-Id: Iac59c5b51b950f174119565bac87955a7994bc38
Reviewed-on: https://webrtc-review.googlesource.com/1560
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19845}
2017-09-15 04:25:06 +00:00
Renamed from webrtc/modules/audio_processing/include/audio_processing.cc (Browse further)