Commit Graph

306 Commits

Author SHA1 Message Date
Miriam Zimmerman
31a3397e96 Merge remote-tracking branch 'upstream/branch-heads/7778' into mutexlox/webrtc-148
Merge conflicts resolved in:
* api/neteq/neteq.h
* audio/channel_receive.cc
* audio/channel_receive.h
* media/engine/simulcast_encoder_adapter.cc
* modules/audio_coding/BUILD.gn
* modules/audio_coding/acm2/acm_resampler.cc
* modules/audio_coding/acm2/acm_resampler_unittest.cc
* modules/audio_processing/audio_processing_impl.h
* modules/video_coding/BUILD.gn
* p2p/base/p2p_transport_channel_unittest.cc
* pc/jsep_transport_controller.cc
* pc/rtp_transport.h
* pc/rtp_transport_internal.h
* unsafe_buffers_paths.txt
2026-05-08 13:42:18 -04:00
Adel Lahlou
d46d62e9eb Merge remote branch 'upstream/branch-heads/7680' 2026-04-06 00:16:11 -07:00
Danil Chapovalov
1f9fdd2bc2 Replace ArrayView with std::span in modules/audio_processing
ArrayView is an alias to std::span. This change switch to use
std::span directly instead of through the alias.

Search&Replace MakeArrayView and ArrayView with std::span
Search&Replace include "api/array_view.h" with include <span>
Remove <span> include where std::span is not mentioned in the file
Remove build dependencies on array_view target

Replace ExpectArrayViewEquality helper with ElementsAreArray matcher
in pffft_wrapper_unittest.cc

Bug: webrtc:439801349
Change-Id: I9503bc9003ee6a7e349459989b03f59a7de37ea6
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/460320
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#47270}
2026-03-26 10:42:00 -07:00
Sam Zackrisson
2836729ee0 Add APM config string to aecdump config message
The aecdump config message requires a lot of duplication and boilerplate
in exchange for being able to read the config back at offline simulation
time. The message tends to slip out of sync with APM configuration,
missing many important parameters which hampers reproducibility.

This CL adds many recently added parameters to the dump message, and
makes the message more likely to contain future parameters as well.

This creates some redundancy with older params. They are kept in, to
maintain the ability to parse old aecdumps and to keep our existing
(limited) reproducibility with audioproc_f.

Bug: webrtc:42224259, webrtc:442444736, b:428638881
Change-Id: Ib6e57435a58b0ed417c83ecc627678adb0d0164f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/444260
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46771}
2026-01-29 05:38:33 -08:00
Lionel Koenig Gélas
8cd8620980 Remove the possibility to run AECm
This change removes the possibility to run AEC mobile version. AEC3 is a
suitable and better alternative.

Follow up changes will remove the actual code.

Bug: webrtc:379762006
Change-Id: I370081af9222093a09ef77076e12195392bf97cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/442200
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Lionel Koenig <lionelk@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46691}
2026-01-19 05:31:23 -08:00
Harald Alvestrand
97b46e1258 Run tools_webrtc/apply-clang-tidy on the repo
This uncovered the fact that its descent into third_party was
not yet prevented; added running gclient sync -f to the script so that
changes outside our repo would be reverted.

Bug: None
Change-Id: I18f4e75c57174b765ed941a062ed00613874f324
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/441061
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46602}
2026-01-09 10:26:41 -08:00
Miriam Zimmerman
a2eba8223d Merge remote-tracking branch 'upstream/branch-heads/7444' into mutexlox/m142-merge 2025-12-04 14:36:56 -05:00
Jim Gustafson
b07b4549f2 Merge remote-tracking branch 'upstream/branch-heads/7339' 2025-09-16 15:28:07 -07:00
Harald Alvestrand
5efb280e2b Reland "Mark deprecated features with [[deprecated]]"
This reverts commit 7e1a12d6ff.

Reason for revert: Removed the problematic deprecation

Original change's description:
> Revert "Mark deprecated features with [[deprecated]]"
>
> This reverts commit 3cf5dc1bec.
>
> Reason for revert: Broke downstream project (Nearby)
>
> Original change's description:
> > Mark deprecated features with [[deprecated]]
> >
> > This was the result of asking Gemini
> > "Consider the interfaces in @api. There are comments that indicate that certain methods are deprecated, but the methods don't have [[deprecated]] on them. Make a CL that adds [[deprecated]] to those methods"
> >
> > followed by a few rounds of reverting and working around errors.
> >
> > Bug: None
> > Change-Id: I5d7b1f89fff01277ce96e940aa7340cdfcb728cc
> > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407441
> > Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> > Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> > Cr-Commit-Position: refs/heads/main@{#45623}
>
> Bug: None
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Change-Id: Ib5c58e36e94b915a01514455c8a2ad561b61a5c9
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/409000
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#45629}

Bug: None
Change-Id: If8a4e8d6ec5455d892eb3fbb3243417e1a1712b9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/408942
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45632}
2025-09-12 02:03:36 -07:00
Harald Alvestrand
7e1a12d6ff Revert "Mark deprecated features with [[deprecated]]"
This reverts commit 3cf5dc1bec.

Reason for revert: Broke downstream project (Nearby)

Original change's description:
> Mark deprecated features with [[deprecated]]
>
> This was the result of asking Gemini
> "Consider the interfaces in @api. There are comments that indicate that certain methods are deprecated, but the methods don't have [[deprecated]] on them. Make a CL that adds [[deprecated]] to those methods"
>
> followed by a few rounds of reverting and working around errors.
>
> Bug: None
> Change-Id: I5d7b1f89fff01277ce96e940aa7340cdfcb728cc
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407441
> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
> Commit-Queue: Harald Alvestrand <hta@webrtc.org>
> Cr-Commit-Position: refs/heads/main@{#45623}

Bug: None
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Ib5c58e36e94b915a01514455c8a2ad561b61a5c9
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/409000
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45629}
2025-09-11 22:38:28 -07:00
Harald Alvestrand
3cf5dc1bec Mark deprecated features with [[deprecated]]
This was the result of asking Gemini
"Consider the interfaces in @api. There are comments that indicate that certain methods are deprecated, but the methods don't have [[deprecated]] on them. Make a CL that adds [[deprecated]] to those methods"

followed by a few rounds of reverting and working around errors.

Bug: None
Change-Id: I5d7b1f89fff01277ce96e940aa7340cdfcb728cc
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/407441
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#45623}
2025-09-11 02:19:44 -07:00
Jim Gustafson
a7ebbabdfe Merge remote-tracking branch 'upstream/branch-heads/7204' 2025-07-11 15:20:30 -07:00
Philipp Hancke
e10dfc9fa9 IWYU modules/audio_processing
using
  find modules/audio_processing/ -name "*.h" -o -name "*.cc" | grep -v "aecm_core_neon.cc" | grep -v aecm_core_mips.cc | xargs tools_webrtc/iwyu/apply-include-cleaner
followed by
  tools_webrtc/gn_check_autofix.py -C out/Default/
and git cl format

Manual changes:
- changes to AECM caused linker errors. Reverted aecm/
- manual modifications in PS 9..12: https://webrtc-review.googlesource.com/c/src/+/387680/9..12
- rebase and follow-up in https://webrtc-review.googlesource.com/c/src/+/387680/14..18
- rebase and follow-up in https://webrtc-review.googlesource.com/c/src/+/387680/19..24
- moved generated debug.pb.h to protobuf_utils.h and exported
- agc2 target visibility changes
- stringstream TODOs

Bug: webrtc:42226242
Change-Id: I9b87208b90f3a7e8f179c1038e6b4dabbcbbbf3c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/387680
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Philipp Hancke <phancke@meta.com>
Cr-Commit-Position: refs/heads/main@{#44809}
2025-06-03 00:08:10 -07:00
Tommi
4fd769cfb6 Add support to DeInterleavedView for channel pointers
This adds support for mapping distinct channel pointers into a view and
addresses the incompatibility with AudioFrameView where we receive
externally provided channel pointers.

Mapping a single buffer for multiple channels continues to be supported,
which is how some of the internal webrtc code manages multiple channels.

The implementation does not do any heap allocations and relies on
any buffers being externally owned.

Bug: chromium:409777951
Change-Id: I9929e89884d1037c90bda1c63038af054c058c08
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/392520
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44744}
2025-05-23 04:48:28 -07:00
Tommi
7d7dcb9650 [AudioProcessingImpl] Don't use AudioFrameView with aec dump
In AudioProcessingImpl we receive externally provided channel data
that may not be byte aligned (e.g AudioBus in chromium is aligned on
a 16 byte boundary).

Bug: chromium:409777951
Change-Id: I7ad9afda6f4bbfa67cfaf2ea89a40bebf4624e8b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/392322
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44717}
2025-05-21 06:51:33 -07:00
Evan Shrubsole
fdd9b8b2d5 Use webrtc name specifier instead of rtc/cricket in modules/audio_processing
WebRTC has unified all namespaces to webrtc, and the rtc:: and cricket::
name specifiers need to be replaced with webrtc::. This was generated using
a combination of clang AST rewriting tools and sed.

This CL was uploaded by git cl split.

Bug: webrtc:42232595
Change-Id: Icbbd42ead3f100bbd85ae66084bdbe1a0b13fa95
No-Iwyu: LSC
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/386646
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44407}
2025-04-17 00:50:57 -07:00
Mirko Bonadei
3672d60543 Migrate template alias nullability annotations to macros.
absl::Nonnull -> absl_nonnull, absl::Nullable -> absl_nullable,
and absl::NullabilityUnknown -> absl_nullability_unknown.

The new macros are positioned as a qualifier on the affected type,
similar to const, rather than as a templated type wrapping the affected
type.

Bug: webrtc:407433459
No-Iwyu: No regressions introduced by this CL
Change-Id: Id6b1a58296d52c86db3ae44e90849affc904d335
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/384220
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44301}
2025-04-04 15:23:56 -07:00
Miriam Zimmerman
8604cca7c6 Merge remote-tracking branch 'upstream/branch-heads/6834' into mutexlox/m132-merge 2025-01-07 12:25:28 -05:00
Danil Chapovalov
dc03d8731f Rename AudioProcessingFactory to Builder
To stress there is no intention to use each instance more than once.

Bug: webrtc:369904700
Change-Id: Id53ad804f39f8ee596ec0b45ff15393009fdfab0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366640
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43324}
2024-10-29 16:34:01 +00:00
Jim Gustafson
9280d4e8f0 Merge remote-tracking branch 'upstream/branch-heads/6723' 2024-10-17 09:03:43 -07:00
Danil Chapovalov
ad49112cd0 Introduce AudioProcessingFactory interface
This interface allows to delegate construction of AudioProcessing to
the PeerConnectionFactory where it can provide propagated field trials

Bug: webrtc:369904700
Change-Id: Ie05cd771e4a869fa5f43173e127256800ae0727f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/365320
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43233}
2024-10-14 10:56:07 +00:00
Florent Castelli
8037fc6ffa Migrate absl::optional to std::optional
Bug: webrtc:342905193
No-Try: True
Change-Id: Icc968be43b8830038ea9a1f5f604307220457807
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/361021
Auto-Submit: Florent Castelli <orphis@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42911}
2024-09-02 12:16:47 +00:00
Adel Lahlou
2888424bfd Merge remote-tracking branch 'upstream/branch-heads/6613' into 6613-testing 2024-08-31 02:18:43 -07:00
Jim Gustafson
49c96f3e79 Merge remote-tracking branch 'google/branch-heads/6478' 2024-06-21 16:31:45 -07:00
Tommi
6056976709 Updates to AudioFrameView and VectorFloatFrame
Using DeinterleavedView<> simplifies these two classes, so now the
classes are arguably thin wrappers on top of DeinterleavedView<> and
AudioFrameView<> can be replaced with DeinterleavedView<>.

The changes are:
* Make VectorFloatFrame not use a vector of vectors but rather
  just hold a one dimensional vector of samples and leaves the mapping
  into the buffer up to DeinterleavedView<>.
* Remove the `channel_ptrs_` vector which was required due to an
  issue with AudioFrameView.
* AudioFrameView is now a wrapper over DeinterleavedView<>. The most
  important change is to remove the `audio_samples_` pointer, which
  pointed into an externally owned pointer array (in addition to
  the array that holds the samples themselves). Now AudioFrameView
  can be initialized without requiring such a long-lived array.

Bug: chromium:335805780
Change-Id: I8f3c23c0ac4b5a337f68e9161fc3a97271f4e87d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352504
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42498}
2024-06-17 12:13:40 +00:00
Tommi
67fd83eae2 Use MonoView for deinterleaved channels in AudioFrameView
Allow skipping the deinterleaving steps in PushResampler
before resampling when deinterleaved buffers already exist.

Bug: chromium:335805780
Change-Id: I2080ce2624636cb743beef78f6f08887db01120f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/352202
Reviewed-by: Per Åhgren <peah@webrtc.org>
Auto-Submit: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42438}
2024-06-05 12:39:27 +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
Hanna Silen
7000b99384 Update GainController2 adaptive digital default parameters
Update the default parameters to match with the Chromium parameters in
https://chromium-review.googlesource.com/c/chromium/src/+/5272859.

Bug: webrtc:7494
Change-Id: Id405109cca4adaa6d21945ed89f84d7e27ad361b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/345923
Commit-Queue: Hanna Silen <silen@webrtc.org>
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42048}
2024-04-12 08:29:26 +00:00
Jim Gustafson
c37ca3fc86 Merge branch m122 2024-02-14 22:44:28 -08:00
Danil Chapovalov
02d9eceb3c Remove dependency on rtc::TaskQueue in AudioProcessing module
Bug: webrtc:14169
Change-Id: I703cd01a6fd013ae4d5236bb76686aab4aa89381
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/333960
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41551}
2024-01-17 18:12:16 +00:00
Danil Chapovalov
e052eee7a3 Deprecate rtc::TaskQueue variant of AudioProcessing::CreateAndAttachAecDump
Bug: webrtc:14169
Change-Id: I63f40ec18b72cba89eb0b9b298f448ce7f7c4634
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334201
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41528}
2024-01-15 13:36:35 +00:00
Danil Chapovalov
1ecf29c1ce Change AudioProcessing interface to allow not to require rtc::TaskQueue
rtc::TaskQueue is a wrapper of TaskQueueBase providing no extra functionality in this case

Bug: webrtc:14169
Change-Id: I5eb27a5dbb16f6097a9c71c2633c807808e50c05
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/333800
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41501}
2024-01-10 13:48:44 +00:00
Harald Alvestrand
78f905e5cc Move some users to use webrtc::RefCountInterface
Bug: webrtc:15622
Change-Id: I2d4c20c726af1a052e161b7689a73d1e5e3eb191
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325526
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41067}
2023-11-02 14:45:57 +00:00
inaqui-signal
c570368abc Merge branch 'm116' into 5845 2023-08-09 14:40:20 -05:00
Rashad Sookram
03ddb5df82 Merge branch 'm110' into 5481 2023-02-17 11:35:29 -05:00
Alessio Bazzica
dfba28e30e AGC2 adaptive digital controller config clean-up
- Remove dry-run option
- Hard-code `adjacent_speech_frames_threshold` and
  `vad_reset_period_ms`
- Expose `initial_gain_db` via field trial

Tested: adaptive digital controller bit-exactness verified

Bug: webrtc:7494
Change-Id: I6166611f91320b6c37de3f8e553c06c2ed95b772
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/287222
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Hanna Silen <silen@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38862}
2022-12-09 13:07:34 +00:00
Alessio Bazzica
4366c5469f AGC2: move fixed digital controller before limiter
Currently the fixed digital gain is applied after the input volume
controller and before the adaptive digital one. This CL moves its
application after the adaptive digital controller and before the
limiter.

Reasons:
- This change is safe: no production config where both adaptive and
  fixed digital controllers are jointly used
- More predictable behavior: when the fixed digital controller is
  used after the adaptive digital controller it is easier to describe
  the overall behavior - i.e., the fixed digital combined with the
  limiter can be used for digital compression
- Allow to remove an unwanted temporal dependency: in a follow-up CL
  the input volume controller will use the latest speech level
  estimation instead of that from the previously analyzed frame; this
  CL makes that change easier.

Bug: webrtc:7494
Change-Id: I2e9869081e0eba1e4f30f11ea93a973ca7fea28c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/286340
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38813}
2022-12-05 16:21:33 +00:00
Alessio Bazzica
504bd59422 Expose APM pipeline parameter to select downmixing method
Bug: b/257289030
Change-Id: I03a666a15752d7a1125af2f8d3edae530493618c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285473
Reviewed-by: Jesus de Vicente Pena <devicentepena@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38789}
2022-12-01 15:30:13 +00:00
Sam Zackrisson
5dd548261f APM: Signal error on unsupported sample rates
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}
2022-11-17 12:12:04 +00:00
Rashad Sookram
bd151651d3 Merge in M108 2022-11-11 17:02:35 -05:00
Hanna Silen
9f06ef1cc3 Implement InputVolumeController
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}
2022-11-02 11:31:59 +00:00
Alessio Bazzica
7afd698e0e APM AgcManagerDirect: unusued min startup volume param removed
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}
2022-10-17 16:51:38 +00:00
Alessio Bazzica
488f669724 APM: remove kClippedLevelMin from audio_processing.h
Bug: webrtc:7494
Change-Id: I91ed3b82592d9801b113ca72a2b2221b5abf20a3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/278788
Reviewed-by: Per Åhgren <peah@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38389}
2022-10-13 15:01:37 +00:00
Alessio Bazzica
fcf1af3049 APM: add AudioProcessingImpl::capture_::applied_input_volume(_changed)
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}
2022-09-09 17:36:05 +00:00
Alessio Bazzica
3153b363cd AEC dump Stream::level renamed
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}
2022-09-09 14:39:35 +00:00
Ali Tofigh
e2d829cf77 Remove unnecessary overload
Bug: webrtc:13579
Change-Id: Ib8e9f3fb085718a140b5a6199cb75e7da22e4fe5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271202
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37747}
2022-08-11 12:34:32 +00:00
Ali Tofigh
980ad0cd64 Remove unnecessary overloads of AudioProcessing::CreateAndAttachAecDump()
Bug: webrtc:13579
Change-Id: I2e121b5fd30de4ac1813483f00a51184ff861760
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/269623
Commit-Queue: Ali Tofigh <alito@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37723}
2022-08-09 13:32:59 +00:00
Sam Zackrisson
3bd444ffdb Clarify and extend test support for certain sample rates in audio processing
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}
2022-08-03 14:26:36 +00:00
Ali Tofigh
1fa87c44cb Adopt absl::string_view in AudioProcessing's interface
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}
2022-07-27 19:24:39 +00:00
Alessio Bazzica
866caeb62c AgcManagerDirect ctor API and doc string improved
Bug: chromium:1275566
Change-Id: Iedc8f5cbbf65fbf018da9df1aaa1f8ade1bbc063
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268840
Reviewed-by: Hanna Silen <silen@webrtc.org>
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37569}
2022-07-20 09:39:24 +00:00