Closed Bug 1676740 Opened 5 years ago Closed 5 years ago

Cannot setup the audio output to 96KHz or 192KHz - max is 48KHz

Categories

(Core :: Web Audio, enhancement)

Firefox 84
Desktop
Linux
enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1675878
Tracking Status
firefox85 --- affected

People

(Reporter: davide.monge, Unassigned)

Details

Attachments

(1 file)

Attached file daemon.conf

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0

Steps to reproduce:

Hi!
Statement: Chrome based browsers (like chromium or Vivaldi) permit to obtain 96KHz or even 192KHz float 32bit audio output.

Any Firefox even the nightly 84.0a1 remain stuck at max float32le 48KHz from any source.

This is not sufficient for me. I have a Linux Manjaro Linux 20.0.2 (test branch) on a STRIX Z270G with an analog audio chip @ 96KHz and headsets like Sennheiser HD650 and GRADO RS1e, so able to perfectly perceive the effects of harmonics up to frequency my chip can produce (96KHz band pass).

Harmonics are very very important even for people old like me (62) that can ear max 8 KHz. Harmonics greatly (very! try it in some manner) affects the audible.

The engine on the 5.9.6-2 64bit kernel is the default pulseaudio.
The app pulseeffects is also installed.

I do NOT use WebRTC for security reasons so it is disabled via normal settings (you know it is a perfect door for intruders!).
I use HTML5 everywhere.

Actual results:

First:
Doing some digging i found this:
https://developer.mozilla.org/en-US/docs/Web/API/AudioConfiguration

what if i try to test this code (please explain me how to do it since I'm not a developer anymore so if some brave can explain me how to do it would be very appreciated!) changing this line:

contentType : "audio/ogg", // valid content type
in
contentType : "audio/aac", // valid content type

and the subsequent parameters to match 96KHz float32le?

For simplicity i link here the AAC codec characteristics:
https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Audio_codecs#AAC

Second:
In about:config i found this boolean paramenter:

media.gmp.decoder.aac

Even modifying the default bool putting it = 1 doe not change the AAC and is not possible to valicate the 48KHz limit.

Expected results:

Expected Result: in about:config the audio should have the possibility to trim every single parameter.

In about:config does not exist the possibility to properly configure the audio output. At least i don't know which key to search to do it.

NOTE: even the HDMI audio output from a normal NVIDIA card can reach 128KHz... and not only on Linux.

I just filed some time ago a question about this in the support forum. This is the link to that post where the kind TyDraniu suggested me to file a bug (not a bug really but but just normal hardware performance for a few years now and not considered to be important to most users):
https://support.mozilla.org/en-US/questions/1293207

i'll attach my ~/.pulse/daemon.conf file.

Thanks a lot. At your disposal for anything i could be useful to test eventually.

This looks like a great idea to me, Im not sure if Web Audio the right component for this issue or maybe something more related to Preferences but this could help users get a better sound quality ? maybe even for users with 5.1 or 7.1 surround systems ?

Status: UNCONFIRMED → NEW
Component: Untriaged → Web Audio
Ever confirmed: true
OS: Unspecified → Linux
Product: Firefox → Core
Hardware: Unspecified → Desktop

(In reply to Rares Doghi from comment #1)

This looks like a great idea to me, Im not sure if Web Audio the right component for this issue or maybe something more related to Preferences but this could help users get a better sound quality ? maybe even for users with 5.1 or 7.1 surround systems ?

Hi, Rares Doghi for accepting this potential enhancement.

For example, ANY chromium derivate delivers the audio stream directly to the OS driver. So, on Chrome, i.e., you can have exactly what you have set in your audio config file (present in any OS, maybe not for all people) or in your default settings. The audio output device may vary, starting from a $5 headset to others at very different greater prices (and value). I suggest modestly to see how these browser (Chromium-based) communicate directly to the low-level audio driver of the OS and try to do some tests (having in mind the proverbial FF security of course!)

So, how is important to the software houses to keep up to the standard and enhanced hardware manufacturers if the medium user doesn't even understand the difference? When somebody ears their favourite music on my Linux box their reaction is one of astonishment. And I only tweaked a bit the config file!

FF is the BEST browser from starting. Why not excel even in audio?
I'm not aware how to do this but someone of you guys is.

David, thanks for the detailed report.

It so happens that I wrote a patch for this last Friday (to keep it short, to prefer using the sample-rate of the medium instead of hard-coding 44.1 or 48k sample-rate), and I'm about to add a quick comment to explain the change, and commit it to Firefox. You will be able to hopefully test it in Firefox Nightly from tomorrow (pre-release version of the browser that is released every day and auto-updates and installs alongside a regular Firefox).

It's likely to be in Firefox release in about 8 weeks time (give or take, sometimes release dates are moved around to not fall on holidays, etc.).

This work was done in bug 1675878, I'm marking your report as a duplicate since the patch is there and not here. Let us know however if you see anything that could be improved. My patch covers all platforms, not only platforms that use PulseAudio.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE

(In reply to Paul Adenot (:padenot) from comment #3)

David, thanks for the detailed report.

It so happens that I wrote a patch for this last Friday (to keep it short, to prefer using the sample-rate of the medium instead of hard-coding 44.1 or 48k sample-rate), and I'm about to add a quick comment to explain the change, and commit it to Firefox. You will be able to hopefully test it in Firefox Nightly from tomorrow (pre-release version of the browser that is released every day and auto-updates and installs alongside a regular Firefox).

It's likely to be in Firefox release in about 8 weeks time (give or take, sometimes release dates are moved around to not fall on holidays, etc.).

This work was done in bug 1675878, I'm marking your report as a duplicate since the patch is there and not here. Let us know however if you see anything that could be improved. My patch covers all platforms, not only platforms that use PulseAudio.

*** This bug has been marked as a duplicate of bug 1675878 ***

Hi Paul, thank you for your answer!

I'm on this version (last nightly just updated):

85.0a1 (2020-11-17) (64-bit)

Any audio in output do the same result (what i'm doing wrong?):

thor@thor ~/.pulse $ pacmd list-sink-inputs
2 sink input(s) available.
index: 0
driver: <protocol-native.c>
flags: START_CORKED
state: RUNNING
sink: 3 <PulseEffects_apps>
volume: front-left: 41285 / 63% / -12,04 dB, front-right: 41285 / 63% / -12,04 dB
balance 0,00
muted: no
current latency: 140,00 ms
requested latency: 50,00 ms
sample spec: float32le 2ch 48000Hz
channel map: front-left,front-right
Stereo
resample method: speex-float-1
module: 15
client: 7 <Nightly>
properties:
media.name = "AudioStream"
application.name = "Nightly"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "34"
application.process.id = "4753"
application.process.user = "thor"
application.process.host = "thor"
application.process.binary = "firefox-bin"
application.language = "en_US.UTF-8"
window.x11.display = ":0"
application.process.machine_id = "796d426491e648729f97a843c2ca4655"
application.process.session_id = "4"
module-stream-restore.id = "sink-input-by-application-name:Nightly"
index: 2
driver: <protocol-native.c>
flags: START_CORKED
state: RUNNING
sink: 2 <alsa_output.pci-0000_00_1f.3.analog-surround-51>
volume: front-left: 65536 / 100% / 0,00 dB, front-right: 65536 / 100% / 0,00 dB
balance 0,00
muted: no
current latency: 51,04 ms
requested latency: 90,00 ms
sample spec: float32le 2ch 96000Hz
channel map: front-left,front-right
Stereo
resample method: copy
module: 15
client: 8 <PulseEffects>
properties:
application.id = "com.github.wwmm.pulseeffects.sinkinputs"
media.name = "Playback Stream"
application.name = "PulseEffects"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "34"
application.icon_name = "pulseeffects"
application.process.id = "4064"
application.process.user = "thor"
application.process.host = "thor"
application.process.binary = "pulseeffects"
application.language = "en_US.UTF-8"
window.x11.display = ":0"
application.process.machine_id = "796d426491e648729f97a843c2ca4655"
application.process.session_id = "4"
module-stream-restore.id = "sink-input-by-application-id:com.github.wwmm.pulseeffects.sinkinputs"

What file are you using? We're not going to up-sample 44100Hz or 48000Hz files to higher rates, this is best done by the OS or even by the hardware itself, or the OS can also tell the device to output at 44100Hz or 48000Hz directly, it depends on what setup you're using or prefer. Playing http://www.lindberg.no/hires/test/2L-145/2L-45_stereo_01_FLAC_88k_24b.flac results in a 88200Hz stream here on Linux with the latest Nightly:

$ pacmd list-sink-inputs | grep  "sample spec"
	sample spec: float32le 2ch 88200Hz

To check that you're on the right build, you can go to about:buildconfig, that should say:

Built from https://hg.mozilla.org/mozilla-central/rev/31d67eef91da183d26334f42e78ae41d9b37ff90

or to about:support that should say:

Build ID: 20201117094406

(In reply to Paul Adenot (:padenot) from comment #5)

What file are you using? We're not going to up-sample 44100Hz or 48000Hz files to higher rates, this is best done by the OS or even by the hardware itself, or the OS can also tell the device to output at 44100Hz or 48000Hz directly, it depends on what setup you're using or prefer. Playing http://www.lindberg.no/hires/test/2L-145/2L-45_stereo_01_FLAC_88k_24b.flac results in a 88200Hz stream here on Linux with the latest Nightly:

$ pacmd list-sink-inputs | grep  "sample spec"
	sample spec: float32le 2ch 88200Hz

To check that you're on the right build, you can go to about:buildconfig, that should say:

Built from https://hg.mozilla.org/mozilla-central/rev/31d67eef91da183d26334f42e78ae41d9b37ff90

or to about:support that should say:

Build ID: 20201117094406

All confirmed for your flac. Thanks. That's a good news!
Nothing changed on Netflix btw - float32le/48000. (most audio source stream associated in the videos are @192KHz and on chromium-based browser the freq. is really effective in output....)

Something about the DRM plugins? or any interaction with the FF audio stack?
I disabled WebRTC (for my personal security reasons) have I to reeneble?
I forced all media to be seen in HTML5 - Am I wrong?

OpenH264 Video Codec provided by Cisco Systems, Inc.:
Version
1.8.1.1
Last Updated
June 12, 2020

Widevine Content Decryption Module provided by Google Inc.
Version
4.10.1582.2
Last Updated
September 2, 2020

Sorry, Paul... I do not want to be annoying or tedious. Answer me if you have time or you are in the mood to do it ;)
Thanks a lot!

most audio source stream associated in the videos

I don't find a source for this. When I look at the actual media being played back in Firefox it's 48kHz AAC. I'm doing my testing on the same machine as before, where I have a DAC that is 96kHz capable.

I found https://partnerhelp.netflixstudios.com/hc/en-us/articles/360001794307-Netflix-Sound-Mix-Specifications-Best-Practices-v1-1 that seem to indicate that the source material before encoding and distribution is required to be 48kHz, and this is also what I see when I browse around their catalog while looking at the source codec in use.

Maybe what you're seeing is Chrome up-sampling Netflix's audio before it hands it to PulseAudio.

I disabled WebRTC (for my personal security reasons) have I to reeneble?

Disabling WebRTC should not affect playback-type scenarios. If you find that it does, please inform us, as this would be a bug we'd have to fix.

I forced all media to be seen in HTML5 - Am I wrong?

No, this is also fine. We're actually removing Flash support in Firefox 85 so there will be no other way to play content.

Please don't worry about my time, I'd rather spend a few minutes typing an answer than missing a problem in Firefox.

Thank you very much, Paul.
All clear now.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: