Bug 1641842 - Port bug 1628779: Add an entry in about:support for the roundtrip audio latency of default devices. r=mkmelin
authorRichard Marti <richard.marti@gmail.com>
Fri, 29 May 2020 14:36:33 +0200
changeset 39282 b7dc8d39df5624c9812ea5a22cff3b15b61d69c4
parent 39281 37b8335f94dc8ffef42d8278819270a5ea916bb9
child 39283 a637a794de332ef4732caae59627fcb2e6a0a645
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersmkmelin
bugs1641842, 1628779
Bug 1641842 - Port bug 1628779: Add an entry in about:support for the roundtrip audio latency of default devices. r=mkmelin Port of https://hg.mozilla.org/mozilla-central/rev/5e0b79c5f7e1
mail/components/about-support/content/aboutSupport.js
--- a/mail/components/about-support/content/aboutSupport.js
+++ b/mail/components/about-support/content/aboutSupport.js
@@ -981,16 +981,29 @@ var snapshotFormatters = {
         });
       }
     }
 
     // Basic information
     insertBasicInfo("audio-backend", data.currentAudioBackend);
     insertBasicInfo("max-audio-channels", data.currentMaxAudioChannels);
     insertBasicInfo("sample-rate", data.currentPreferredSampleRate);
+    insertBasicInfo("roundtrip-latency", "...");
+    window.windowUtils
+      .defaultDevicesRoundTripLatency()
+      .then(latency => {
+        var latencyString = `${(latency[0] * 1000).toFixed(2)}ms (${(
+          latency[1] * 1000
+        ).toFixed(2)})`;
+        data.defaultDevicesRoundTripLatency = latencyString;
+        document.querySelector(
+          'th[data-l10n-id="roundtrip-latency"]'
+        ).nextSibling.textContent = latencyString;
+      })
+      .catch(e => {});
 
     // Output devices information
     insertDeviceInfo("output", data.audioOutputDevices);
 
     // Input devices information
     insertDeviceInfo("input", data.audioInputDevices);
 
     // Media Capabilitites