Bug 1654112 - Update AudioProcessing config in MediaManager and MediaEngineWebRTCAudio (WIP)
authorDan Minor <dminor@mozilla.com>
Wed, 28 Oct 2020 15:18:18 -0400
changeset 4000594 382f62523626940174d22d5c2ec7b57ee7b5b20d
parent 4000593 f5daa0dcebb83fb835560580c131a5d97c1b4dab
child 4000595 290d2990ba4dd7d5cb67ad83b133d6f92a7e846c
push id736585
push userbcampen@mozilla.com
push dateMon, 04 Oct 2021 16:52:36 +0000
treeherdertry@dce10d2619ca [default view] [failures only]
bugs1654112
milestone94.0a1
Bug 1654112 - Update AudioProcessing config in MediaManager and MediaEngineWebRTCAudio (WIP) The old options to set echo control level and routing mode have been removed. There are now two gain controller implementations; this uses the original one, investigating switching to the newer one is best left until we land the update.
dom/media/MediaManager.cpp
dom/media/webrtc/MediaEnginePrefs.h
dom/media/webrtc/MediaEngineWebRTCAudio.cpp
dom/media/webrtc/MediaEngineWebRTCAudio.h
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -1989,47 +1989,41 @@ MediaManager::MediaManager(already_AddRe
   mPrefs.mUseAecMobile = false;
   mPrefs.mAgcOn = false;
   mPrefs.mHPFOn = false;
   mPrefs.mNoiseOn = false;
   mPrefs.mExtendedFilter = true;
   mPrefs.mDelayAgnostic = true;
   mPrefs.mFakeDeviceChangeEventOn = false;
 #ifdef MOZ_WEBRTC
-  mPrefs.mAec =
-      webrtc::EchoCancellation::SuppressionLevel::kModerateSuppression;
-  mPrefs.mAgc = webrtc::GainControl::Mode::kAdaptiveDigital;
-  mPrefs.mNoise = webrtc::NoiseSuppression::Level::kModerate;
-  mPrefs.mRoutingMode = webrtc::EchoControlMobile::RoutingMode::kSpeakerphone;
+  mPrefs.mAgc =
+      webrtc::AudioProcessing::Config::GainController1::Mode::kAdaptiveDigital;
+  mPrefs.mNoise =
+      webrtc::AudioProcessing::Config::NoiseSuppression::Level::kModerate;
 #else
-  mPrefs.mAec = 0;
   mPrefs.mAgc = 0;
   mPrefs.mNoise = 0;
-  mPrefs.mRoutingMode = 0;
 #endif
   mPrefs.mChannels = 0;  // max channels default
   nsresult rv;
   nsCOMPtr<nsIPrefService> prefs =
       do_GetService("@mozilla.org/preferences-service;1", &rv);
   if (NS_SUCCEEDED(rv)) {
     nsCOMPtr<nsIPrefBranch> branch = do_QueryInterface(prefs);
     if (branch) {
       GetPrefs(branch, nullptr);
     }
   }
   LOG("%s: default prefs: %dx%d @%dfps, %dHz test tones, aec: %s,"
-      "agc: %s, hpf: %s, noise: %s, aec level: %d, agc level: %d, noise level: "
-      "%d, aec mobile routing mode: %d,"
-      "extended aec %s, delay_agnostic %s "
-      "channels %d",
+      "agc: %s, hpf: %s, noise: %s, agc level: %d, noise level: "
+      "%d, extended aec %s, delay_agnostic %s, channels %d",
       __FUNCTION__, mPrefs.mWidth, mPrefs.mHeight, mPrefs.mFPS, mPrefs.mFreq,
       mPrefs.mAecOn ? "on" : "off", mPrefs.mAgcOn ? "on" : "off",
-      mPrefs.mHPFOn ? "on" : "off", mPrefs.mNoiseOn ? "on" : "off", mPrefs.mAec,
-      mPrefs.mAgc, mPrefs.mNoise, mPrefs.mRoutingMode,
-      mPrefs.mExtendedFilter ? "on" : "off",
+      mPrefs.mHPFOn ? "on" : "off", mPrefs.mNoiseOn ? "on" : "off", mPrefs.mAgc,
+      mPrefs.mNoise, mPrefs.mExtendedFilter ? "on" : "off",
       mPrefs.mDelayAgnostic ? "on" : "off", mPrefs.mChannels);
 }
 
 NS_IMPL_ISUPPORTS(MediaManager, nsIMediaManagerService, nsIMemoryReporter,
                   nsIObserver)
 
 /* static */
 StaticRefPtr<MediaManager> MediaManager::sSingleton;
@@ -3439,21 +3433,18 @@ void MediaManager::GetPrefs(nsIPrefBranc
   GetPref(aBranch, "media.navigator.audio.fake_frequency", aData,
           &mPrefs.mFreq);
 #ifdef MOZ_WEBRTC
   GetPrefBool(aBranch, "media.getusermedia.aec_enabled", aData, &mPrefs.mAecOn);
   GetPrefBool(aBranch, "media.getusermedia.agc_enabled", aData, &mPrefs.mAgcOn);
   GetPrefBool(aBranch, "media.getusermedia.hpf_enabled", aData, &mPrefs.mHPFOn);
   GetPrefBool(aBranch, "media.getusermedia.noise_enabled", aData,
               &mPrefs.mNoiseOn);
-  GetPref(aBranch, "media.getusermedia.aec", aData, &mPrefs.mAec);
   GetPref(aBranch, "media.getusermedia.agc", aData, &mPrefs.mAgc);
   GetPref(aBranch, "media.getusermedia.noise", aData, &mPrefs.mNoise);
-  GetPref(aBranch, "media.getusermedia.aecm_output_routing", aData,
-          &mPrefs.mRoutingMode);
   GetPrefBool(aBranch, "media.getusermedia.aec_extended_filter", aData,
               &mPrefs.mExtendedFilter);
   GetPrefBool(aBranch, "media.getusermedia.aec_aec_delay_agnostic", aData,
               &mPrefs.mDelayAgnostic);
   GetPref(aBranch, "media.getusermedia.channels", aData, &mPrefs.mChannels);
   bool oldFakeDeviceChangeEventOn = mPrefs.mFakeDeviceChangeEventOn;
   GetPrefBool(aBranch, "media.ondevicechange.fakeDeviceChangeEvent.enabled",
               aData, &mPrefs.mFakeDeviceChangeEventOn);
--- a/dom/media/webrtc/MediaEnginePrefs.h
+++ b/dom/media/webrtc/MediaEnginePrefs.h
@@ -25,37 +25,33 @@ class MediaEnginePrefs {
         mHeight(0),
         mFPS(0),
         mFreq(0),
         mAecOn(false),
         mUseAecMobile(false),
         mAgcOn(false),
         mHPFOn(false),
         mNoiseOn(false),
-        mAec(0),
         mAgc(0),
-        mRoutingMode(0),
         mNoise(0),
         mExtendedFilter(false),
         mDelayAgnostic(false),
         mFakeDeviceChangeEventOn(false),
         mChannels(0) {}
 
   int32_t mWidth;
   int32_t mHeight;
   int32_t mFPS;
   int32_t mFreq;  // for test tones (fake:true)
   bool mAecOn;
   bool mUseAecMobile;
   bool mAgcOn;
   bool mHPFOn;
   bool mNoiseOn;
-  int32_t mAec;
   int32_t mAgc;
-  int32_t mRoutingMode;
   int32_t mNoise;
   bool mExtendedFilter;
   bool mDelayAgnostic;
   bool mFakeDeviceChangeEventOn;
   int32_t mChannels;
 
   bool operator==(const MediaEnginePrefs& aRhs) {
     return memcmp(this, &aRhs, sizeof(MediaEnginePrefs)) == 0;
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -115,19 +115,19 @@ nsresult MediaEngineWebRTCMicrophoneSour
     prefs.mChannels = maxChannels;
   }
 
   // Get the number of channels asked for by content, and clamp it between the
   // pref and the maximum number of channels that the device supports.
   prefs.mChannels = c.mChannelCount.Get(std::min(prefs.mChannels, maxChannels));
   prefs.mChannels = std::max(1, std::min(prefs.mChannels, maxChannels));
 
-  LOG("Mic source %p Audio config: aec: %d, agc: %d, noise: %d, channels: %d",
-      this, prefs.mAecOn ? prefs.mAec : -1, prefs.mAgcOn ? prefs.mAgc : -1,
-      prefs.mNoiseOn ? prefs.mNoise : -1, prefs.mChannels);
+  LOG("Audio config: agc: %d, noise: %d, channels: %d",
+      prefs.mAgcOn ? prefs.mAgc : -1, prefs.mNoiseOn ? prefs.mNoise : -1,
+      prefs.mChannels);
 
   *aOutPrefs = prefs;
 
   return NS_OK;
 }
 
 nsresult MediaEngineWebRTCMicrophoneSource::Reconfigure(
     const dom::MediaTrackConstraints& aConstraints,
@@ -156,86 +156,78 @@ nsresult MediaEngineWebRTCMicrophoneSour
 
   ApplySettings(outputPrefs);
 
   mCurrentPrefs = outputPrefs;
 
   return NS_OK;
 }
 
-void MediaEngineWebRTCMicrophoneSource::UpdateAECSettings(
-    bool aEnable, bool aUseAecMobile, EchoCancellation::SuppressionLevel aLevel,
-    EchoControlMobile::RoutingMode aRoutingMode) {
+void MediaEngineWebRTCMicrophoneSource::UpdateAECSettings(bool aEnable,
+                                                          bool aUseAecMobile) {
   AssertIsOnOwningThread();
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
   NS_DispatchToMainThread(NS_NewRunnableFunction(
-      __func__,
-      [that, track = mTrack, aEnable, aUseAecMobile, aLevel, aRoutingMode] {
+      __func__, [that, track = mTrack, aEnable, aUseAecMobile] {
         class Message : public ControlMessage {
          public:
           Message(AudioInputProcessing* aInputProcessing, bool aEnable,
-                  bool aUseAecMobile, EchoCancellation::SuppressionLevel aLevel,
-                  EchoControlMobile::RoutingMode aRoutingMode)
+                  bool aUseAecMobile)
               : ControlMessage(nullptr),
                 mInputProcessing(aInputProcessing),
                 mEnable(aEnable),
-                mUseAecMobile(aUseAecMobile),
-                mLevel(aLevel),
-                mRoutingMode(aRoutingMode) {}
+                mUseAecMobile(aUseAecMobile) {}
 
           void Run() override {
             TRACE("UpdateAECSettings");
-            mInputProcessing->UpdateAECSettings(mEnable, mUseAecMobile, mLevel,
-                                                mRoutingMode);
+            mInputProcessing->UpdateAECSettings(mEnable, mUseAecMobile);
           }
 
          protected:
           RefPtr<AudioInputProcessing> mInputProcessing;
           bool mEnable;
           bool mUseAecMobile;
-          EchoCancellation::SuppressionLevel mLevel;
-          EchoControlMobile::RoutingMode mRoutingMode;
         };
 
         if (track->IsDestroyed()) {
           return;
         }
 
-        track->GraphImpl()->AppendMessage(
-            MakeUnique<Message>(that->mInputProcessing, aEnable, aUseAecMobile,
-                                aLevel, aRoutingMode));
+        track->GraphImpl()->AppendMessage(MakeUnique<Message>(
+            that->mInputProcessing, aEnable, aUseAecMobile));
       }));
 }
 
 void MediaEngineWebRTCMicrophoneSource::UpdateAGCSettings(
-    bool aEnable, GainControl::Mode aMode) {
+    bool aEnable,
+    webrtc::AudioProcessing::Config::GainController1::Mode aMode) {
   AssertIsOnOwningThread();
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
   NS_DispatchToMainThread(
       NS_NewRunnableFunction(__func__, [that, track = mTrack, aEnable, aMode] {
         class Message : public ControlMessage {
          public:
           Message(AudioInputProcessing* aInputProcessing, bool aEnable,
-                  GainControl::Mode aMode)
+                  webrtc::AudioProcessing::Config::GainController1::Mode aMode)
               : ControlMessage(nullptr),
                 mInputProcessing(aInputProcessing),
                 mEnable(aEnable),
                 mMode(aMode) {}
 
           void Run() override {
             TRACE("UpdateAGCSettings");
             mInputProcessing->UpdateAGCSettings(mEnable, mMode);
           }
 
          protected:
           RefPtr<AudioInputProcessing> mInputProcessing;
           bool mEnable;
-          GainControl::Mode mMode;
+          webrtc::AudioProcessing::Config::GainController1::Mode mMode;
         };
 
         if (track->IsDestroyed()) {
           return;
         }
 
         track->GraphImpl()->AppendMessage(
             MakeUnique<Message>(that->mInputProcessing, aEnable, aMode));
@@ -270,49 +262,51 @@ void MediaEngineWebRTCMicrophoneSource::
         }
 
         track->GraphImpl()->AppendMessage(
             MakeUnique<Message>(that->mInputProcessing, aEnable));
       }));
 }
 
 void MediaEngineWebRTCMicrophoneSource::UpdateNSSettings(
-    bool aEnable, webrtc::NoiseSuppression::Level aLevel) {
+    bool aEnable,
+    webrtc::AudioProcessing::Config::NoiseSuppression::Level aLevel) {
   AssertIsOnOwningThread();
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
-  NS_DispatchToMainThread(
-      NS_NewRunnableFunction(__func__, [that, track = mTrack, aEnable, aLevel] {
-        class Message : public ControlMessage {
-         public:
-          Message(AudioInputProcessing* aInputProcessing, bool aEnable,
-                  webrtc::NoiseSuppression::Level aLevel)
-              : ControlMessage(nullptr),
-                mInputProcessing(aInputProcessing),
-                mEnable(aEnable),
-                mLevel(aLevel) {}
+  NS_DispatchToMainThread(NS_NewRunnableFunction(__func__, [that,
+                                                            track = mTrack,
+                                                            aEnable, aLevel] {
+    class Message : public ControlMessage {
+     public:
+      Message(AudioInputProcessing* aInputProcessing, bool aEnable,
+              webrtc::AudioProcessing::Config::NoiseSuppression::Level aLevel)
+          : ControlMessage(nullptr),
+            mInputProcessing(aInputProcessing),
+            mEnable(aEnable),
+            mLevel(aLevel) {}
 
           void Run() override {
             TRACE("UpdateHPFSettings");
             mInputProcessing->UpdateNSSettings(mEnable, mLevel);
           }
 
-         protected:
-          RefPtr<AudioInputProcessing> mInputProcessing;
-          bool mEnable;
-          webrtc::NoiseSuppression::Level mLevel;
-        };
+     protected:
+      RefPtr<AudioInputProcessing> mInputProcessing;
+      bool mEnable;
+      webrtc::AudioProcessing::Config::NoiseSuppression::Level mLevel;
+    };
 
-        if (track->IsDestroyed()) {
-          return;
-        }
+    if (track->IsDestroyed()) {
+      return;
+    }
 
-        track->GraphImpl()->AppendMessage(
-            MakeUnique<Message>(that->mInputProcessing, aEnable, aLevel));
-      }));
+    track->GraphImpl()->AppendMessage(
+        MakeUnique<Message>(that->mInputProcessing, aEnable, aLevel));
+  }));
 }
 
 void MediaEngineWebRTCMicrophoneSource::UpdateAPMExtraOptions(
     bool aExtendedFilter, bool aDelayAgnostic) {
   AssertIsOnOwningThread();
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
   NS_DispatchToMainThread(NS_NewRunnableFunction(
@@ -351,26 +345,25 @@ void MediaEngineWebRTCMicrophoneSource::
     const MediaEnginePrefs& aPrefs) {
   AssertIsOnOwningThread();
 
   MOZ_ASSERT(
       mTrack,
       "ApplySetting is to be called only after SetTrack has been called");
 
   if (mTrack) {
-    UpdateAGCSettings(aPrefs.mAgcOn,
-                      static_cast<webrtc::GainControl::Mode>(aPrefs.mAgc));
+    UpdateAGCSettings(
+        aPrefs.mAgcOn,
+        static_cast<webrtc::AudioProcessing::Config::GainController1::Mode>(
+            aPrefs.mAgc));
     UpdateNSSettings(
         aPrefs.mNoiseOn,
-        static_cast<webrtc::NoiseSuppression::Level>(aPrefs.mNoise));
-    UpdateAECSettings(
-        aPrefs.mAecOn, aPrefs.mUseAecMobile,
-        static_cast<webrtc::EchoCancellation::SuppressionLevel>(aPrefs.mAec),
-        static_cast<webrtc::EchoControlMobile::RoutingMode>(
-            aPrefs.mRoutingMode));
+        static_cast<webrtc::AudioProcessing::Config::NoiseSuppression::Level>(
+            aPrefs.mNoise));
+    UpdateAECSettings(aPrefs.mAecOn, aPrefs.mUseAecMobile);
     UpdateHPFSettings(aPrefs.mHPFOn);
 
     UpdateAPMExtraOptions(mExtendedFilter, mDelayAgnostic);
   }
 
   RefPtr<MediaEngineWebRTCMicrophoneSource> that = this;
   NS_DispatchToMainThread(
       NS_NewRunnableFunction(__func__, [that, track = mTrack, prefs = aPrefs] {
@@ -627,17 +620,17 @@ nsresult MediaEngineWebRTCMicrophoneSour
 void MediaEngineWebRTCMicrophoneSource::GetSettings(
     dom::MediaTrackSettings& aOutSettings) const {
   MOZ_ASSERT(NS_IsMainThread());
   aOutSettings = *mSettings;
 }
 
 AudioInputProcessing::AudioInputProcessing(
     uint32_t aMaxChannelCount, const PrincipalHandle& aPrincipalHandle)
-    : mAudioProcessing(AudioProcessing::Create()),
+    : mAudioProcessing(AudioProcessingBuilder().Create()),
       mRequestedInputChannelCount(aMaxChannelCount),
       mSkipProcessing(false),
       mInputDownmixBuffer(MAX_SAMPLING_FREQ * MAX_CHANNELS / 100),
       mLiveBufferingAppended(Nothing()),
       mPrincipal(aPrincipalHandle),
       mEnabled(false),
       mEnded(false) {}
 
@@ -682,102 +675,113 @@ void AudioInputProcessing::SetRequestedI
   do {                                             \
     int rv = fn;                                   \
     if (rv != AudioProcessing::kNoError) {         \
       MOZ_ASSERT_UNREACHABLE("APM error in " #fn); \
       return;                                      \
     }                                              \
   } while (0);
 
-void AudioInputProcessing::UpdateAECSettings(
-    bool aEnable, bool aUseAecMobile, EchoCancellation::SuppressionLevel aLevel,
-    EchoControlMobile::RoutingMode aRoutingMode) {
-  if (aUseAecMobile) {
-    HANDLE_APM_ERROR(mAudioProcessing->echo_control_mobile()->Enable(aEnable));
-    HANDLE_APM_ERROR(mAudioProcessing->echo_control_mobile()->set_routing_mode(
-        aRoutingMode));
-    HANDLE_APM_ERROR(mAudioProcessing->echo_cancellation()->Enable(false));
-  } else {
-    if (aLevel != EchoCancellation::SuppressionLevel::kLowSuppression &&
-        aLevel != EchoCancellation::SuppressionLevel::kModerateSuppression &&
-        aLevel != EchoCancellation::SuppressionLevel::kHighSuppression) {
+void AudioInputProcessing::UpdateAECSettings(bool aEnable, bool aUseAecMobile) {
+  /*
+    if (aUseAecMobile) {
+      HANDLE_APM_ERROR(mAudioProcessing->echo_control_mobile()->Enable(aEnable));
+      HANDLE_APM_ERROR(mAudioProcessing->echo_control_mobile()->set_routing_mode(
+          aRoutingMode));
+      HANDLE_APM_ERROR(mAudioProcessing->echo_cancellation()->Enable(false));
+    } else {
+      if (aLevel != EchoCancellation::SuppressionLevel::kLowSuppression &&
+          aLevel != EchoCancellation::SuppressionLevel::kModerateSuppression &&
+          aLevel != EchoCancellation::SuppressionLevel::kHighSuppression) {
+        LOG_ERROR(
+            "AudioInputProcessing %p Attempt to set invalid AEC suppression "
+            "level %d",
+            this, static_cast<int>(aLevel));
+
+        aLevel = EchoCancellation::SuppressionLevel::kModerateSuppression;
+      }
+
+      HANDLE_APM_ERROR(mAudioProcessing->echo_control_mobile()->Enable(false));
+      HANDLE_APM_ERROR(mAudioProcessing->echo_cancellation()->Enable(aEnable));
+      HANDLE_APM_ERROR(
+          mAudioProcessing->echo_cancellation()->set_suppression_level(aLevel));
+    }
+  */
+}
+
+void AudioInputProcessing::UpdateAGCSettings(
+    bool aEnable,
+    webrtc::AudioProcessing::Config::GainController1::Mode aMode) {
+  /*
+    if (aMode != GainControl::Mode::kAdaptiveAnalog &&
+        aMode != GainControl::Mode::kAdaptiveDigital &&
+        aMode != GainControl::Mode::kFixedDigital) {
+      LOG_ERROR("AudioInputProcessing %p Attempt to set invalid AGC mode %d",
+                this, static_cast<int>(aMode));
+
+      aMode = GainControl::Mode::kAdaptiveDigital;
+    }
+
+  #if defined(WEBRTC_IOS) || defined(ATA) || defined(WEBRTC_ANDROID)
+    if (aMode == GainControl::Mode::kAdaptiveAnalog) {
       LOG_ERROR(
-          "AudioInputProcessing %p Attempt to set invalid AEC suppression "
+          "AudioInputProcessing %p Invalid AGC mode kAgcAdaptiveAnalog on "
+          "mobile",
+          this);
+      MOZ_ASSERT_UNREACHABLE(
+          "Bad pref set in all.js or in about:config"
+          " for the auto gain, on mobile.");
+      aMode = GainControl::Mode::kFixedDigital;
+    }
+  #endif
+    HANDLE_APM_ERROR(mAudioProcessing->gain_control()->set_mode(aMode));
+    HANDLE_APM_ERROR(mAudioProcessing->gain_control()->Enable(aEnable));
+  */
+}
+
+void AudioInputProcessing::UpdateHPFSettings(bool aEnable) {
+  /*
+    HANDLE_APM_ERROR(mAudioProcessing->high_pass_filter()->Enable(aEnable));
+  */
+}
+
+void AudioInputProcessing::UpdateNSSettings(
+    bool aEnable,
+    webrtc::AudioProcessing::Config::NoiseSuppression::Level aLevel) {
+  /*
+    if (aLevel != NoiseSuppression::Level::kLow &&
+        aLevel != NoiseSuppression::Level::kModerate &&
+        aLevel != NoiseSuppression::Level::kHigh &&
+        aLevel != NoiseSuppression::Level::kVeryHigh) {
+      LOG_ERROR(
+          "AudioInputProcessing %p Attempt to set invalid noise suppression "
           "level %d",
           this, static_cast<int>(aLevel));
 
-      aLevel = EchoCancellation::SuppressionLevel::kModerateSuppression;
+      aLevel = NoiseSuppression::Level::kModerate;
     }
 
-    HANDLE_APM_ERROR(mAudioProcessing->echo_control_mobile()->Enable(false));
-    HANDLE_APM_ERROR(mAudioProcessing->echo_cancellation()->Enable(aEnable));
-    HANDLE_APM_ERROR(
-        mAudioProcessing->echo_cancellation()->set_suppression_level(aLevel));
-  }
-}
-
-void AudioInputProcessing::UpdateAGCSettings(bool aEnable,
-                                             GainControl::Mode aMode) {
-  if (aMode != GainControl::Mode::kAdaptiveAnalog &&
-      aMode != GainControl::Mode::kAdaptiveDigital &&
-      aMode != GainControl::Mode::kFixedDigital) {
-    LOG_ERROR("AudioInputProcessing %p Attempt to set invalid AGC mode %d",
-              this, static_cast<int>(aMode));
-
-    aMode = GainControl::Mode::kAdaptiveDigital;
-  }
-
-#if defined(WEBRTC_IOS) || defined(ATA) || defined(WEBRTC_ANDROID)
-  if (aMode == GainControl::Mode::kAdaptiveAnalog) {
-    LOG_ERROR(
-        "AudioInputProcessing %p Invalid AGC mode kAgcAdaptiveAnalog on "
-        "mobile",
-        this);
-    MOZ_ASSERT_UNREACHABLE(
-        "Bad pref set in all.js or in about:config"
-        " for the auto gain, on mobile.");
-    aMode = GainControl::Mode::kFixedDigital;
-  }
-#endif
-  HANDLE_APM_ERROR(mAudioProcessing->gain_control()->set_mode(aMode));
-  HANDLE_APM_ERROR(mAudioProcessing->gain_control()->Enable(aEnable));
-}
-
-void AudioInputProcessing::UpdateHPFSettings(bool aEnable) {
-  HANDLE_APM_ERROR(mAudioProcessing->high_pass_filter()->Enable(aEnable));
-}
-
-void AudioInputProcessing::UpdateNSSettings(
-    bool aEnable, webrtc::NoiseSuppression::Level aLevel) {
-  if (aLevel != NoiseSuppression::Level::kLow &&
-      aLevel != NoiseSuppression::Level::kModerate &&
-      aLevel != NoiseSuppression::Level::kHigh &&
-      aLevel != NoiseSuppression::Level::kVeryHigh) {
-    LOG_ERROR(
-        "AudioInputProcessing %p Attempt to set invalid noise suppression "
-        "level %d",
-        this, static_cast<int>(aLevel));
-
-    aLevel = NoiseSuppression::Level::kModerate;
-  }
-
-  HANDLE_APM_ERROR(mAudioProcessing->noise_suppression()->set_level(aLevel));
-  HANDLE_APM_ERROR(mAudioProcessing->noise_suppression()->Enable(aEnable));
+    HANDLE_APM_ERROR(mAudioProcessing->noise_suppression()->set_level(aLevel));
+    HANDLE_APM_ERROR(mAudioProcessing->noise_suppression()->Enable(aEnable));
+  */
 }
 
 #undef HANDLE_APM_ERROR
 
 void AudioInputProcessing::UpdateAPMExtraOptions(bool aExtendedFilter,
                                                  bool aDelayAgnostic) {
-  webrtc::Config config;
-  config.Set<webrtc::ExtendedFilter>(
-      new webrtc::ExtendedFilter(aExtendedFilter));
-  config.Set<webrtc::DelayAgnostic>(new webrtc::DelayAgnostic(aDelayAgnostic));
+  /*
+    webrtc::Config config;
+    config.Set<webrtc::ExtendedFilter>(
+        new webrtc::ExtendedFilter(aExtendedFilter));
+    config.Set<webrtc::DelayAgnostic>(new
+    webrtc::DelayAgnostic(aDelayAgnostic));
 
-  mAudioProcessing->SetExtraOptions(config);
+    mAudioProcessing->SetExtraOptions(config);
+  */
 }
 
 void AudioInputProcessing::Start() {
   mEnabled = true;
   mLiveBufferingAppended = Nothing();
 }
 
 void AudioInputProcessing::Stop() { mEnabled = false; }
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.h
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.h
@@ -85,22 +85,24 @@ class MediaEngineWebRTCMicrophoneSource 
    * From settings output by EvaluateSettings, send those settings to the
    * AudioInputProcessing instance and the main thread (for use in GetSettings).
    */
   void ApplySettings(const MediaEnginePrefs& aPrefs);
 
   /**
    * Sent the AudioProcessingModule parameter for a given processing algorithm.
    */
-  void UpdateAECSettings(bool aEnable, bool aUseAecMobile,
-                         webrtc::EchoCancellation::SuppressionLevel aLevel,
-                         webrtc::EchoControlMobile::RoutingMode aRoutingMode);
-  void UpdateAGCSettings(bool aEnable, webrtc::GainControl::Mode aMode);
+  void UpdateAECSettings(bool aEnable, bool aUseAecMobile);
+  void UpdateAGCSettings(
+      bool aEnable,
+      webrtc::AudioProcessing::Config::GainController1::Mode aMode);
   void UpdateHPFSettings(bool aEnable);
-  void UpdateNSSettings(bool aEnable, webrtc::NoiseSuppression::Level aLevel);
+  void UpdateNSSettings(
+      bool aEnable,
+      webrtc::AudioProcessing::Config::NoiseSuppression::Level aLevel);
   void UpdateAPMExtraOptions(bool aExtendedFilter, bool aDelayAgnostic);
 
   PrincipalHandle mPrincipal = PRINCIPAL_HANDLE_NONE;
 
   const RefPtr<AudioDeviceInfo> mDeviceInfo;
   const bool mDelayAgnostic;
   const bool mExtendedFilter;
   const nsString mDeviceName;
@@ -179,22 +181,24 @@ class AudioInputProcessing : public Audi
   void SetRequestedInputChannelCount(MediaTrackGraphImpl* aGraph,
                                      uint32_t aRequestedInputChannelCount);
   // This is true when all processing is disabled, we can skip
   // packetization, resampling and other processing passes.
   bool PassThrough(MediaTrackGraphImpl* aGraphImpl) const;
 
   // This allow changing the APM options, enabling or disabling processing
   // steps.
-  void UpdateAECSettings(bool aEnable, bool aUseAecMobile,
-                         webrtc::EchoCancellation::SuppressionLevel aLevel,
-                         webrtc::EchoControlMobile::RoutingMode aRoutingMode);
-  void UpdateAGCSettings(bool aEnable, webrtc::GainControl::Mode aMode);
+  void UpdateAECSettings(bool aEnable, bool aUseAecMobile);
+  void UpdateAGCSettings(
+      bool aEnable,
+      webrtc::AudioProcessing::Config::GainController1::Mode aMode);
   void UpdateHPFSettings(bool aEnable);
-  void UpdateNSSettings(bool aEnable, webrtc::NoiseSuppression::Level aLevel);
+  void UpdateNSSettings(
+      bool aEnable,
+      webrtc::AudioProcessing::Config::NoiseSuppression::Level aLevel);
   void UpdateAPMExtraOptions(bool aExtendedFilter, bool aDelayAgnostic);
 
   void End();
 
   TrackTime NumBufferedFrames(MediaTrackGraphImpl* aGraph) const;
 
  private:
   ~AudioInputProcessing() = default;