Closed Bug 1152184 Opened 11 years ago Closed 10 years ago

Firefox doesn't close cubebutils audio streams when the stream/page is closed.

Categories

(Core :: Audio/Video: cubeb, defect)

37 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: u460503, Unassigned, NeedInfo)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0 Build ID: 20150404092546 Steps to reproduce: Open a html5 video or audio stream, such as a html5 youtube video, and wait until you hear audio. Confirm that the stream is listed in pavucontrol (if on Linux, have not tested on Windows,) and then close the video. Open a different video/audio stream, and repeat. Actual results: Pavucontrol will collecrt "CubebUtils" audio stream- originating from firefox, long after the audio stops playing and the pages have been closed in the browser. In addition to this, and possibly related, there is always a playback stream in pavucontrol named "CubebUtils: AudioCallbackDriver" which never actually plays anything, and never goes away. Expected results: When a stream stops playing it should disappear from the list of playback streams in pavucontrol, keeping the list clean and each item easily identifiable as what it is.
Component: Untriaged → Video/Audio
Product: Firefox → Core
Flags: needinfo?(kinetik)
The AudioCallbackDriver is related to WebRTC and/or Web Audio, if you have something using either of those active you can expect one to show up. For regular video playback, I don't see the streams leaking on Fedora 21 with Firefox 37 (as shipped with Fedora) or a recently Nightly build in pavucontrol (or the Sound applet, but I assume they have the same data source anyway). After closing a tab playing video, the stream disappears from pavucontrol around 5 seconds later (whenever the GC runs and cleans up). What version of PulseAudio and any other relevant software are you running? Are you aware of anything non-standard/unusual about your configuration of PA?
Flags: needinfo?(kinetik)
Nothing unusual about my PA setup. After testing, the audio streams do appear to go away after a while, but no sooner than like a minute. It goes away instantly if I go to about:memory and trigger a GC via the "Minimise memory usage" button, but not via clicking the GC button. This doesn't fit in with what I was seeing the other day though, where I've seen tens of audio streams in pavucontrol at once, originating from Firefox, at any given time except right after launching. I considered that it may be through having paused videos in some tabs, except I checked and that's not the case (plus there are way too many.) When I tested just now, the streams disappeared after 30 seconds to a minute, but I have just opened firefox and it's possible this issue doesn't occur right away. Will continue testing throughout today.
Darn I forgot about your other question while I was writing that last comment. My PA version is.. Pulseaudio 6.0.
Component: Audio/Video → Audio/Video: MSG/cubeb/GMP
Component: Audio/Video: MediaStreamGraph → Audio/Video: cubeb
Is this still occurring? Waiting for a GC/CC to occur for the channel to close is expected, and the time until GC/CC can be variable. About:memory will let you trigger them at will
Flags: needinfo?(bensutton174)
There's nothing actionable here until we hear back from the reporter. Please reopen if we get more info.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INCOMPLETE
This bug still exists I'm using ubuntu 14.04, Firefox version 47.0 # Test case ```html <!DOCTYPE html> <html> <body> <audio controls autoplay> <source src="http://url_to_mp3.mp3" type="audio/mpeg"> </audio> </body> </html> ``` - Run `pavucontrol` - It might help you enable `always on top` - `Playback` tab - Scroll to the bottom. - Load the the contents of the test html into the browser. - let it play for a few seconds - `CubebUtils: AudioStream` shows up in playback list. We'll call this `cube1` - reload page `ctrl+r` - Another `CubebUtils: AudioStream` shows up in playback list below `cube1` let's call this `cube2` - reload page `ctrl+r` - - Another `CubebUtils: AudioStream` shows up in playback list below `cube2` let's call this `cube3` Expected result: Instances of `CubebUtil: AudioStreams` for `cube1` and `cube2` should be removed from pulseaudio playback streams (The correct term might be called `sink`) after refresh. Actual result: All instances of `CubebUtil: AudioStreams` remain. I also did more testing, and click the reload button on the address bar also yields the same result. Even if you `shift+click`. # Workaround I really don't see why firefox isn't doing something like this on the backend. ```javascript window.onunload = function() { var keys = ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied', 'ended', 'error', 'loadeddata', 'loadedmetadata', 'loadstart', 'pause', 'play', 'playing', 'progress', 'ratechange', 'seeked', 'seeking', 'stalled', 'suspend', 'timeupdate', 'volumechange', 'waiting'], noop = function(){}, loopEls = function(els) { if (!els) { return; } for (var i=0;i<els.length;i++) { var el = els[i]; for (var j=0;j<keys.length;j++) { var k = keys[j]; el["on"+k] = noop; } els[i].src = ""; } }; loopEls(document.getElementsByTagName("audio")); loopEls(document.getElementsByTagName("video")); }; ```
Does going to about:memory and clicking on "Minimize memory usage" trigger a clean up?
"Minimize memory usage" does not remove the lingering audio streams (Firefox 50.1.0 on Debian Jessie).
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: