Closed Bug 1081843 Opened 10 years ago Closed 9 years ago

Media stream cleanup not working correctly after peer connection has been closed

Categories

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

34 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: marko.seidenglanz, Unassigned)

Details

(Whiteboard: dupme)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.13 Safari/537.36

Steps to reproduce:

1. Connected to Asterisk Telephony Server using testing URL (DIAL):
http://test.webrtc.24dial.com/web/index.html

2. Hungup call (CLIENT HANGUP)
2.1 Send SIP/BYE
2.2 Stop remote stream using stop() method of MediaStream
2.3 Close Peerconnection


Actual results:

The audio remains in an endless loop. When the Tab using the audio stream is closed, the audio disappears. When a new audio stream is created using gUM it reappears playing the same endless loop.


Expected results:

No audio should be played, after the stream was closed.
Is this bug present in 35?
I just tried from my Mac on 33, 34 and 35 and all work fine. As soon as I click the "Client Hangup" button the audio stops playing. And new connections start with silence.

Can you please confirm that this Linux and Firefox 34 specific?
If so, which Linux distribution is this on and which audio drivers do you use (OSS, Alsa, Pulse,...)?
Flags: needinfo?(marko.seidenglanz)
Please update: this is a bug (fallout from bug 848954) that has been fixed.
Whiteboard: dupme
It is 34 specific. FF <= 33 does not show such a behaviour. I updated to 34.0a2 (2014-10-13), and the problem still exists. 35 was not tested yet, because there is another problem to solve. The system uses Pulse Audio and ALSA, which is the standard for Linux Mint Installations. To be precise I use a Linux Mint 15.

I will test it on another system and check if the problem remains.
Thank you very much for your help!
Flags: needinfo?(marko.seidenglanz)
I've made a test on Windows XP 2002 SP 3 and had the same problem, but only in FF 34
If this is what I think it was, it was due to bug 1074420, which uplifted to Aurora/34 on 10/6 and likely would be in 10/7 and later builds of 34.

Also, if you set remote_media.mozSrcObject = null when the call ended, the bug above would repeat audio for "a while" unless you closed the tab or manually forced GC via about:memory.

When setting this call up, are you doing anything other than:
in onaddstream:

    remote_media.mozSrcObject = stream;
    remote_media.play();

Note: stop() on a remote mediastream does nothing.  It only affects local mediastreams (getUserMedia)
I do nothing with the stream after the call ended. Just leave it as it is.

I only do this in onaddstream:
self.remoteAudio.src = URL.createObjectURL(event.stream); (remoteAudio DOM element is set to autoplay)

And I hold the reference of the stream. I do not set it null after the call ended.
self.remoteStream = event.stream;


On the next call I set theses values again.
GC and CC does not work. Tab closing works, but it takes about 3 seconds until the play stops.
Try getting the latest build of 34 to see if the uplift for bug 1074420 fixed this.
(This should be beta now)
34 Beta1 won't be released until later this week after some testing (perhaps tomorrow).  You can download the latest TBPL (checkin) builds from http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-beta-<platform>
I tested FF from http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2014-10-12-00-40-01-mozilla-aurora/ but the problem exists. I think I will wait for the beta relase and test again.
I tested FF 34 Beta1. The sound problem after hangup is still there. Do I have to do anything with the stream  object after rtp stream breaks up or is it cleaned up automatically?
35.0a2 (2014-10-19) does not have the issue
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.