WebAudio API is playing silence all the time
Categories
(Core :: Web Audio, task)
Tracking
()
People
(Reporter: estemal, Unassigned)
References
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Steps to reproduce:
- Open Duolingo website (https://www.duolingo.com/learn, you need a free account). I heard that Soundcloud also does that while playback is paused, but I can neither confirm nor deny it.
- Run a command line tool to see if there is any running stream. I'm using pipewire, so I run
pw-dump | grep -C 10 running, but with pulseaudio you can runpacmd list-sink-inputsand see if there are streams withstate: RUNNING.
Actual results:
I have a stream named "AudioCallbackDriver", that has always "running" state even when no sound is played, which means it plays silence. This causes issues like this https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1079
Expected results:
All the streams should me idle when no sound is played.
| Reporter | ||
Updated•5 years ago
|
Comment 1•5 years ago
|
||
I haven't had a chance to investigate yet, but I see https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1079#note_890831 confirms that this also occurs with Chromium, so it's likely this is a case where the web app (DuoLingo) needs to use AudioContext::suspend when idle.
| Reporter | ||
Comment 2•5 years ago
|
||
I don't know if there is a problem with webapp or not, but I think, it's just wrong when incorrect webapp on my PC can mess up bluetooth audio playback on my phone.
Comment 3•5 years ago
|
||
This is a problem of the web app. I've contacted SoundCloud and DuoLingo also have been contacted. I will report back when I have news. This happens on all OSes and not only Firefox (all browsers that implement the Web Audio API).
Updated•5 years ago
|
Comment 4•5 years ago
|
||
Not closing this to keep tracking it, but moving to a "task" so it's out of the triage lists.
| Reporter | ||
Comment 5•4 years ago
|
||
Easy way to reproduce this:
-
input any word into the translate box
-
press the "Listen" button
after this the browser continues playing silence until you close this tab or reload the page
| Reporter | ||
Comment 6•3 years ago
|
||
On firefox-102 the problem remains even though bug #1743834 was fixed.
Confirmed in 111.0.1 (64-bit) Canonical Snap for Ubuntu (canonical-002 - 1.0), running on Ubuntu Studio 23.04 with the latest patch set as of now.
Playing audio from the BBC News website also has the same effect. To be honest, I suspect most sites will.
| Reporter | ||
Comment 8•2 years ago
|
||
The problem is still not fixed.
| Reporter | ||
Comment 9•1 year ago
|
||
The problem is still pesent. I just found out that even aliexpress has this problem. I don't even know what it uses WebAudio API for, but it just hangs there and plays silence, making me unable to listen anything on my phone.
Comment 10•1 year ago
|
||
This bug just costs me too much notebook battery and the silent whitenoise sound my speakers make is annoying.
Popular sites like discord, x.com, outlook web and (I suspect a lot more) open AudioContexts without ever suspending them.
That's why I created an extension to autosuspends new AudioContexts after two seconds. The extension also tries to detect if the .start() method is called on an audiobuffer and then auto resumes the AudioContext for another 2 seconds.
https://addons.mozilla.org/en-US/firefox/addon/audiocontext-suspender/
Comment 11•1 year ago
|
||
As much as these sites are buggy it is clear that this is a widespread issue and we can't rely on websites to behave properly.
It seems that some heuristic is needed to suspend audio contexts when unused. A simple idle timer is probably sufficient but more complexity can be imagined such as if the website has suspended context on its own in the past.
| Reporter | ||
Comment 12•10 months ago
|
||
I also found that aliexpress does this. For no reason at all. At the very least Firefox should have indication for the tabs that do this.
Description
•