The officially official Devuan Forum!

You are not logged in.

#1 2025-10-04 16:32:31

igorzwx
Member
Registered: 2024-05-06
Posts: 337  

Firefox is playing crap to protect user privacy

Resist Fingerprinting
How to tell if you have Resist Fingerprinting enabled, and if so, disable it
_https://support.mozilla.org/en-US/kb/resist-fingerprinting

To disable Resist Fingerprinting:

    Type about:config in the address bar and press Enter.
    A warning page may appear. Click Accept the Risk and Continue to go to the about:config page.
    In the search bar at the top, search for privacy.resistFingerprinting.
    A number of preferences will appear but see if either privacy.resistFingerprinting or privacy.resistFingerprinting.pbMode have a value of true.
    To tell if an extension is controlling this preference, you can click toggle the value back to false and restart your browser. After restarting, visit about:config again, and see if the value has been returned to true.

If it has been, you will need to determine which of your extensions is controlling the preference and disable or remove them. One way to do this is to disable the installed extensions one by one, and restart the browser, seeing if the preference is changed upon restarting Firefox. Please be aware that, in rare cases, multiple extensions might be setting the preference.

Resisting Fingerprinting: By returning a standard sample rate of 44100 Hz when aShouldResistFingerprinting is true, the function PreferredSampleRate helps maintain user privacy.

Fingerprinting: In the context of web technologies, fingerprinting refers to the technique of tracking users based on their device and browser characteristics. The aShouldResistFingerprinting parameter suggests a consideration for privacy in audio playback decisions.

$ cat firefox/dom/media/CubebUtils.cpp | grep PreferredSampleRate\(bool -A14
uint32_t PreferredSampleRate(bool aShouldResistFingerprinting) {
  StaticMutexAutoLock lock(sMutex);
  if (sCubebForcedSampleRate) {
    return sCubebForcedSampleRate;
  }
  if (aShouldResistFingerprinting) {
    return 44100;
  }
  if (!InitPreferredSampleRate()) {
    return 44100;
  }
  MOZ_ASSERT(sPreferredSampleRate);
  return sPreferredSampleRate;
}

Absolute High Resolution Audio Test 32bit Floating Point
_https://youtu.be/v5swkCSvryE

[info] Available formats for v5swkCSvryE:
format code  extension  resolution note
249          webm       audio only audio_quality_low   56k , webm_dash container, opus  (48000Hz), 24.97MiB
250          webm       audio only audio_quality_low   74k , webm_dash container, opus  (48000Hz), 32.59MiB
140          m4a        audio only audio_quality_medium  129k , m4a_dash container, mp4a.40.2 (44100Hz), 56.74MiB
251          webm       audio only audio_quality_medium  142k , webm_dash container, opus  (48000Hz), 62.52MiB
...
140          m4a        audio (44100Hz), 56.74MiB
251          webm       audio (48000Hz), 62.52MiB

The PreferredSampleRate means exactly what it says - it's the sample rate that is preferred.

$ cat firefox/dom/media/VideoUtils.cpp | grep kSampleRate -A27
uint32_t DecideAudioPlaybackSampleRate(const AudioInfo& aInfo,
                                       bool aShouldResistFingerprinting) {
  bool resampling = StaticPrefs::media_resampling_enabled();

  uint32_t rate = 0;

  if (resampling) {
    rate = 48000;
  } else if (aInfo.mRate >= 44100) {
    // The original rate is of good quality and we want to minimize unecessary
    // resampling, so we let cubeb decide how to resample (if needed). Cap to
    // 384kHz for good measure.
    rate = std::min<unsigned>(aInfo.mRate, 384000u);
  } else {
    // We will resample all data to match cubeb's preferred sampling rate.
    rate = CubebUtils::PreferredSampleRate(aShouldResistFingerprinting);
    if (rate > 768000) {
      // bogus rate, fall back to something else;
      rate = 48000;
    }
  }
  MOZ_DIAGNOSTIC_ASSERT(rate, "output rate can't be 0.");
    
  return rate;
}

Best Audiophile Vocal 24 bit - Hi-Res Music 2025 - Audiophile Voices
_https://youtu.be/uO6jfQ5tQHM
Absolute High Resolution Audio Test 32bit Floating Point
_https://youtu.be/v5swkCSvryE
Hi-Res audio 32 bit floating point. Drums, acoustic guitar, bass guitar, trumpet, sax, violin
_https://youtu.be/YIHN0XUK2i8

One bug report to rule them all
_https://dev1galaxy.org/viewtopic.php?pid=58194#p58194

_https://bugzilla.mozilla.org/show_bug.cgi?id=1400731
Open Bug 1400731 Opened 8 years ago Updated 2 years ago
sample rate in Firefox limited to 48KHz

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20170917100334

Steps to reproduce:

When listen HiRes audio which have sample rate more than 48KHz browser uses 44.1KHz my DAC displayed it.
For reproduce you must use Hi-Fi Sublime+ subscription on service qobuz.
For example Grace album by Lizz Wright must played in 96KHz.
http://play.qobuz.com/album/0088807202871

P.S. Also you needed pulseaudio 11.0 with enabled 'avoid-resampling' option.
More detail here: https://bugs.freedesktop.org/show_bug.cgi?id=57503

Actual results:

Instead 96KHz browser used 44.1KHz.

Expected results:

Expected when played flac with sample rate 96KHz browser not limit sample rate

1. It is not difficult to disable resampling in Firefox.
2. Firefox is easy to compile.

Last edited by igorzwx (2025-10-05 13:03:57)

Offline

Board footer