Change `outputLatency` and `getOutputTimestamp` when `resistFingerPrinting` is enabled

RESOLVED FIXED in Firefox 70

Status

()

enhancement
P2
normal
RESOLVED FIXED
Last month
Last month

People

(Reporter: padenot, Assigned: padenot)

Tracking

(Blocks 1 bug)

Trunk
mozilla70
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox70 fixed)

Details

Attachments

(2 attachments)

In bug 1324552 and bug 1324545, outputLatency and getOutputTimestamp can expose the audio output latency of a particular setup (computer+audio hardware+driver combination).

In general, in Firefox, the audio output latency is fixed for each OS. However, in some cases, it can be different:

  • If the audio output is routed to a higher-latency device (such as a bluetooth device), the number can be higher
  • In the future (after we implement it), on Windows 10 with recent driver, the latency can be lower
  • If the user has tweaked some hidden prefs in about:config, this can change also

I was going to report a fixed output latency (that is sensible) for those number when resistFingerprinting is enabled. This means that some Audio/Video sync will be off when using bluetooth, but strictly better still than when we didn't have those attributes. This does not affect regular audio/video playback, nor webrtc, it's for more advanced scenarios.

Tom, does this sound good?

Flags: needinfo?(tom)

That sounds, great, thanks so much for flagging this.

Flags: needinfo?(tom)
Pushed by padenot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/707956090735
Remove expectation file, audionode-connect-method-chaining.html now passes.
Priority: -- → P2
Status: NEW → RESOLVED
Closed: Last month
Resolution: --- → FIXED
Target Milestone: --- → mozilla70

Wrong bug number in a follow-up.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

When Firefox is configured to resist fingerprinting, the latency figure returned
is the most commonly found on a particular OS.

For Android, I got data from 0, roughly copy/pasted the table into a file and
did:

cat file | cut -d $'\t' -f4 | grep "^[[:digit:]]" | cut -d ' ' -f 1 | sort -h
| uniq -c | sort -h

which indicated that 40ms was a good number for round trip latency (input to
output). Since this is for output latency only and the audio path
is roughly symmetrical in terms of duration, we report 20ms.

For OSX, 512 is always used with the default hardware in Firefox, with this
patch, it's always 512 regardless of the setup.

On Linux/Pulse, we use 25ms 1 always, and this is adjusted by PulseAudio. This
makes it always return 25ms.

On Windows, there is a wide variety of configurations, but it's common to be in
the ballpark of 80ms output (this is very empirical, by testing a bunch of
hardware over the years).

For other OSes, we use 1024 frames (adjusted to the sample-rate).

Pushed by padenot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c96e81ba64f3
Change `outputLatency` and `getOutputTimestamp` when `resistFingerPrinting` is enabled. r=tjr
Status: REOPENED → RESOLVED
Closed: Last monthLast month
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.