top | item 43062546

Watt The Fox?

346 points| h43z | 1 year ago |h.43z.one

75 comments

order
[+] padenot|1 year ago|reply
This is planned, and important, and we'll fix it hopefully soon, it's long overdue. I'm sorry this hasn't happened yet, it's always a game of priorities that can never satisfy everybody on time. It however ranks fairly high on my personal list.

As one could imagine it's a bit (read: a lot) more complicated than just pausing the AudioContext after some time of silence, but we'll get it fixed regardless, it's possible because others did it. There are tradeoffs we're willing to do.

Source: Firefox implementer of a lot of things around this, editor of the Web Audio API standard.

[+] zoogeny|1 year ago|reply
Please don't take this kind of criticism personally. There was a recent blow up from an open source maintainer because he viewed this kind of criticism as a frustration.

Just know that most people understand everything you are saying here. Many things to do, finite amount of time.

I have personal experience of Firefox developers going above and beyond to make high-usage sites work for their users. I know first hand the lengths they will go to when issues affect users. Thank you and keep plugging away.

[+] JohnBooty|1 year ago|reply
Thanks for all of your hard work. Firefox is so important.
[+] darkwater|1 year ago|reply
Thank for your work, from a Firefox user. Also, the OP is probably already aware of this:

"It's not perfect as resuming takes a little bit of time and it may not always resume, as there are multiple paths to starting audio. But it's good enough for me."

[+] noah_buddy|1 year ago|reply
I would like to become a better use of Firefox by debugging issues I find locally. Any guidance on where to start?
[+] patcon|1 year ago|reply
Thank you for your words on this, and energy on everything else!
[+] EasyMark|1 year ago|reply
For every one person "complaining" there are 999 of us quiet ones out here that use and love your product hours out of every day . I hope devs at firefox can cut through gruff articles with click baity titles and extract nuggets of usefulness from them though.
[+] JoshTriplett|1 year ago|reply
Thank you for your work on this!

I think many people would be curious to hear about the additional complexity above and beyond "suspend when silent", if there's an already-written thing you could link to.

(I do know that resume-when-playback-starts sometimes causes the first bit of audio to get lost, or all of the audio for short things like notification sounds.)

[+] Centigonal|1 year ago|reply
I appreciate you and everybody else's work on Firefox! Thank you!
[+] moffkalast|1 year ago|reply
> we'll fix it hopefully soon, it's long overdue. I'm sorry this hasn't happened yet

If one could describe the state of Bugzilla in two sentences, that would be it :P

[+] h14h|1 year ago|reply
I hope this kind of thing can shoot up the priority queue! Battery-stealing and generally janky behavior is likely the main reason folks stop using a piece of software.

Thanks for your work, and for talking about the issue on a public forum! It's so critically important that Firefox maintains/increases relevancy. I'm sure it's unbelieveably difficult work given the resources behind Chromium & Blink.

[+] lknuth|1 year ago|reply
Thank you! Your work is keeping the web open.
[+] pentagrama|1 year ago|reply
Thank you for your work and also sharing the status here. There is a bugzilla link to follow the progress of the fix?
[+] Glyptodon|1 year ago|reply
On Linux there are weird audio issues that lead to speaker pop, and sometimes opening a new tab can make the audio running from other tabs permanently distorted and static-y until you reboot. (Not a complaint. I've always wondered if it was a browser or audio system issue.)
[+] zX41ZdbW|1 year ago|reply
Thanks! What the article does not tell is why it plays white noise (instead of silence).
[+] h43z|1 year ago|reply
Cool to hear. This should deserve to be a high priority bug. Thanks for your work on firefox.
[+] 4ndrewl|1 year ago|reply
Thank you for all your work on Firefox!
[+] mike_d|1 year ago|reply
The websites opening an audio context without using it to play anything are probably doing bot detection.

Different browser engines and operating systems implement audio processing differently, so if you play a completely inaudible sound and then record it back (from the API not the microphone) you end up with a signature.

You can use that signature to see if the browser is lying about its user agent, running in headless mode, or all sort of other interesting edge cases that are not a real user buying widgets.

https://github.com/fingerprintjs/fingerprintjs/blob/3201a7d6...

[+] zie|1 year ago|reply
Grrr. Browser/Web standard people went crazy with API's and never stopped to think how the world will abuse them to do crap like this.
[+] x0054|1 year ago|reply
There are even already plugins for bots running in the wild that simulate Audio Context to trick the boot detection. Crazy!
[+] czk|1 year ago|reply
can't wait for cloudflare to implement this to further disrupt my browsing freedoms and waste cpu cycles
[+] pianom4n|1 year ago|reply
Wow, this white noise has been driving me crazy for a long time but I could never track it down.

The tab doesn't show the "playing" icon, and muting the tab doesn't stop the noise.

Even using the Windows volume mixer to mute Firefox doesn't stop the noise.

Edit: The addon is actually pretty bad for a desktop user since the white noise starting/stopping constantly is far more annoying.

[+] sneak|1 year ago|reply
> Even using the Windows volume mixer to mute Firefox doesn't stop the noise.

Seems like this is a deeper bug than FF then, no?

[+] h43z|1 year ago|reply
I use the extension on desktop without problems. I guess it depends on what websites you visit. I would disable the extension for ones that do play/stop sounds a lot.
[+] cosmotic|1 year ago|reply
If the output idles, digital SPDIF signals lose sync. Re-syncing once playback starts is not instant, and you lose the first second of audio or so. I wrote a program that kept open an output withought dumping any data to the line, just to prevent the output from idling.

Doesnt make much sense in the context of a laptop though, so energy savings make sense there.

[+] russelg|1 year ago|reply
This annoyed me to no end with my FiiO K3 DAC on my Macbook. System sounds like dings etc would basically not play because of the delay.

On their Windows drivers, you have an option to set the stream as Always On. I wish this was available on macOS as well...

[+] PeakKS|1 year ago|reply
Hah yeah I used to do the same thing for my USB DAC, except I just did had `play -qn &` start when I logged in.
[+] brilee|1 year ago|reply
Oh! I think this explains the issue I had on Android Firefox where every so often my phone would randomly consume 10gb/day in data (costing me $stupid on phone bill). I believe a news site was playing audio and was loading new ads on repeat and the tab never went to sleep because of the audio! I had to switch to chrome because the repeating surprise data bills were becoming silly
[+] lxgr|1 year ago|reply
I've noticed this, or something very similar (not sure if sites are keeping audio contexts open actually, or if this is Firefox-internal, as it also happens on Youtube and other sites not using the Web Audio API) on macOS a while ago too (i.e. an audio-induced power drain, but no white noise): https://bugzilla.mozilla.org/show_bug.cgi?id=1821102

Right now, coreaudiod on my Mac is at 20% CPU with nothing playing whatsoever :( I'm close to switching to another browser until this is fixed, as it's really ruining battery life for me, but I really don't want to give up Firefox over something seemingly so trivial.

Update: This seems to be a related but different bug.

[+] DaleCurtis|1 year ago|reply
The code in Chromium which handles this suspension is here: https://source.chromium.org/chromium/chromium/src/+/main:med...

Basically after detecting silence for 30 seconds or so it switches from a sink backed by the OS audio device to a null sink.

Note: Since this uses a different clock than the audio device we have received some reports that when the context is finally used there can be some distortion at specific tones. The workaround is for sites to use the suspend resume API mentioned in the article.

[+] Already__Taken|1 year ago|reply
I don't know the ins-and outs of how audioContext is implemented but it's got a lot in there to be very clever and dynamic, playing a notification chime seems like that feels like drawing an svg with D3 instead of img href *.svg. I wonder if there's a serviceWorker hook that could register simple repeatable stuff like notification handlers much lower down on a more efficient API.
[+] martin_a|1 year ago|reply
Should I be able to actually hear something?

Firefox 134.0.1 on MacOS here, I don't hear anything.

[+] kkarpkkarp|1 year ago|reply
no sound for me, but indeed, when I click the button to play the sound on author's demo page, watt consumption increases by ~1
[+] TrianguloY|1 year ago|reply
Firefox on Android. I do hear a small white noise!
[+] Traubenfuchs|1 year ago|reply
…why is a non suspended AudioCntext that is currently not playing anything emitting white noise though?
[+] spiffyk|1 year ago|reply
The AudioContext itself is not the source of the white noise. It just causes the DAC (sound card) to power on, which probably emits some noise by itself.
[+] Jotalea|1 year ago|reply
I wonder if the same problem happens on Android devices too.
[+] NooneAtAll3|1 year ago|reply
I can already imagine "websites control minds via barely-hearable noise" conspiracies...
[+] immibis|1 year ago|reply
Abstraction layers are hard and have bugs. We should probably figure out a way to reduce the number of abstraction layers. Maybe instead of running the software in a virtual machine with an OS abstraction layer (which is itself a shitty OS), it could compile directly to machine-language instructions and interact with your real OS. You could download this once and run it many times.
[+] lxgr|1 year ago|reply
This has nothing to do with machine language vs. VMs. And yes, there are abstraction layers here, but for very good reasons:

You almost certainly don't want every browser tab gaining exclusive address to your sound hardware, for example, which would include things like volume control. It also would make mixing sound from multiple applications/tabs impossible, which is arguably a must-have.