Uprev of APM and changes to allow running the AGC and NS effects

This CL uprevs the CrAS APM to match that of WebRTC commit

The main motivation behind the uprev is to include
-The ability to emulate an analog mic gain, which is a
 prerequisite for activating APM in CrAS on all Chrome OS
-The ability to reduce the complexity of APM when the
 client is muted.

Apart from the uprev, the CL also
-adds some missing APM parameter settings and sorts the settings to
 match that of the APM config struct.
-changes the default parameter values of the
 fixed_capture_delay_samples AEC parameter and the noise
 suppression level to match what should be used i CrAS.
-adds functionality allowing the AEC, NS and AGC effects to be
 forced to be on, disregarding any settings already present in the
 .ini config files.
-adds functionality that activates the analog AGC emulation code in
 APM when the AGC is activated.

TEST=Manually tested in calls on a Buddy and an Atlas device.

Change-Id: Ib1b333536efab700fe23216fe61f6cba86750b7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/webrtc-apm/+/2792582
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Reviewed-by: Per Åhgren <peah@chromium.org>
Tested-by: Per Åhgren <peah@chromium.org>
Auto-Submit: Per Åhgren <peah@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
560 files changed
tree: 780acc9803fb0b81758d3e4da90eff2deb7b0d10
  1. Makefile
  3. README.md
  4. absl/
  5. api/
  6. audio/
  7. common.mk
  8. common_audio/
  9. common_types.h
  10. cras-config/
  11. libwebrtc_apm.pc.template
  12. modules/
  13. pc_utils.mk
  14. rtc_base/
  15. script/
  16. system_wrappers/
  17. third_party/
  18. typedefs.h
  19. webrtc_apm.cc
  20. webrtc_apm.h


APM is the audio processing module of WebRTC project in charge of effects like echo cancellation, noise suppression, etc. The purpose of this project is to build a standalone library for Chrome OS system side audio processing.

Files content

  • scripts to copy over folders and files from upstream WebRTC project for APM and its dependencies.
  • Copied files from upstream WebRTC project. For example: common_audio, modules, rtc_base and system_wrappers.
  • webrtc_apm.cc/h C wrappers to access APM functions.
  • common-mk based makefiles to build shared library libwebrtc_apm.so


To update this package to latest upstream WebRC:

  • Run ./script/sync-apm.sh path/to/webrtc-checkout/src .
  • emerge webrtc-apm to see if anything breaks.
  • If emerge success, then we're good.
  • Otherwise look into the emerge failure, and then possibly:
    • Update sync-apm.sh to copy more files if upstream directory structure changes.
    • Update makefiles if upstream build files has changed.
    • Update webrtc-apm ebuild file if dependencies changed.
  • Create a new commit