Bug 1509842 - Re-enable AGC by default. r=dminor
authorPaul Adenot <paul@paul.cx>
Mon, 26 Nov 2018 13:51:27 +0000
changeset 504420 136df6dc6423ca3454e973a945d68460e34dc637
parent 504406 f2f2f8b59557b9cd3781222d2329039c031a6032
child 504421 f465eb378c1b5897357fa565699672b93bfa3beb
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdminor
bugs1509842
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1509842 - Re-enable AGC by default. r=dminor Differential Revision: https://phabricator.services.mozilla.com/D12898
dom/media/tests/mochitest/mochitest.ini
dom/media/tests/mochitest/test_defaultAudioConstraints.html
modules/libpref/init/all.js
--- a/dom/media/tests/mochitest/mochitest.ini
+++ b/dom/media/tests/mochitest/mochitest.ini
@@ -59,16 +59,17 @@ skip-if = os == 'linux' && debug # Bug 1
 [test_getUserMedia_audioConstraints.html]
 skip-if = os == 'mac' || os == 'win' || toolkit == 'android' # Bug 1404995, no loopback devices on some platforms
 [test_getUserMedia_audioConstraints_concurrentIframes.html]
 skip-if = os == 'mac' || os == 'win' || toolkit == 'android' || (os == 'linux' && debug)  # Bug 1404995, no loopback devices on some platforms # Bug 1481101
 [test_getUserMedia_audioConstraints_concurrentStreams.html]
 skip-if = os == 'mac' || os == 'win' || toolkit == 'android' # Bug 1404995, no loopback devices on some platforms
 [test_getUserMedia_basicAudio_loopback.html]
 skip-if = os == 'mac' || os == 'win' || toolkit == 'android' # Bug 1404995, no loopback devices on some platforms
+[test_defaultAudioConstraints.html]
 [test_getUserMedia_basicAudio.html]
 [test_getUserMedia_basicVideo.html]
 [test_getUserMedia_basicVideo_playAfterLoadedmetadata.html]
 [test_getUserMedia_basicScreenshare.html]
 skip-if = toolkit == 'android' || (os == 'win' && webrender) # no screenshare on android, see bug 1504162 for webrender on windows
 [test_getUserMedia_basicTabshare.html]
 skip-if = toolkit == 'android' # no windowshare on android
 [test_getUserMedia_basicWindowshare.html]
new file mode 100644
--- /dev/null
+++ b/dom/media/tests/mochitest/test_defaultAudioConstraints.html
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <script type="application/javascript" src="mediaStreamPlayback.js"></script>
+</head>
+<body>
+<pre id="test">
+<script type="application/javascript">
+"use strict";
+
+createHTML({
+  title: "Test that the audio constraints that observe at the audio constraints we expect.",
+  bug: "1509842"
+});
+
+runTest(async () => {
+  let audioDevice = SpecialPowers.getCharPref("media.audio_loopback_dev", "");
+  if (!audioDevice) {
+    ok(false, "No device set by framework. Try --use-test-media-devices");
+    return;
+  }
+
+  // Get a gUM track with the default settings, check that they are what we
+  // expect.
+  let stream = await navigator.mediaDevices.getUserMedia({ audio: true });
+  let track = stream.getAudioTracks()[0];
+  let defaultConstraints = track.getSettings();
+
+  is(defaultConstraints.echoCancellation, true,
+      "Echo cancellation should be ON by default.");
+  is(defaultConstraints.noiseSuppression, true,
+      "Noise suppression should be ON by default.");
+  is(defaultConstraints.autoGainControl, true,
+      "Automatic gain control should be ON by default.");
+
+  track.stop();
+});
+</script>
+</pre>
+</body>
+</html>
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -523,17 +523,17 @@ pref("media.getusermedia.noise_enabled",
 #else
 pref("media.getusermedia.aec_enabled", true);
 pref("media.getusermedia.noise_enabled", true);
 #endif
 pref("media.getusermedia.use_aec_mobile", false);
 pref("media.getusermedia.aec", 1); // kModerateSuppression
 pref("media.getusermedia.aec_extended_filter", true);
 pref("media.getusermedia.noise", 1); // kModerate
-pref("media.getusermedia.agc_enabled", false);
+pref("media.getusermedia.agc_enabled", true);
 pref("media.getusermedia.agc", 1); // kAdaptiveDigital
 // capture_delay: Adjustments for OS-specific input delay (lower bound)
 // playout_delay: Adjustments for OS-specific AudioStream+cubeb+output delay (lower bound)
 // full_duplex: enable cubeb full-duplex capture/playback
 pref("media.navigator.audio.full_duplex", true);
 #if defined(XP_MACOSX)
 pref("media.peerconnection.capture_delay", 50);
 #elif defined(XP_WIN)