Open Bug 1606875 Opened 5 years ago Updated 1 year ago

replaceTrack of an enabled track with a disabled one (and vice versa) doesn't work reliably

Categories

(Core :: WebRTC: Signaling, defect, P2)

defect

Tracking

()

People

(Reporter: bwc, Assigned: bwc)

References

Details

(Keywords: regressionwindow-wanted, steps-wanted)

Attachments

(1 file)

2.52 MB, application/octet-stream
Details

Note this try push:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=60b488b977d69701ae9ad59dc59dfb75f6ef847b&selectedJob=283371382

I've dug into this a bit, and there seem to be multiple problems, but I have not figured how to fix them all.

Firstly, this code only forces black frames if the listener has been disabled due to privacy rules:

https://searchfox.org/mozilla-central/rev/053826b10f838f77c27507e5efecc96e34718541/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp#1248

It needs to take into account whether mFrame.GetForceBlack() is true also, since that is how frames are "blacked out" for direct listeners:

https://searchfox.org/mozilla-central/rev/053826b10f838f77c27507e5efecc96e34718541/dom/media/MediaTrackListener.cpp#28-30

Additionally, the way we are updating the track does not seem to result in the direct listeners learning anything about whether the new track is enabled or not.

Right now I am classifying this as a webrtc bug, but it might be a bug in MTG.

Priority: -- → P2
See Also: → 1608118

Is this a regression? Bug 1608118 was regressed by bug 1601034, so if they're dupes their regression ranges should match.

Can you provide me with a method to reproduce this issue of yours? I am attempting to find when it was introduced.
Otherwise, can you do that yourself?
https://mozilla.github.io/mozregression/

Thank you for your contribution!

Flags: needinfo?(docfaraday)

I think this is likely a dupe of bug 1608118. I'll check to see once I'm back in the office.

Ok, bug 1608118 did not fix this. However, it may have been part of the necessary work. I will investigate.

https://treeherder.mozilla.org/#/jobs?repo=try&revision=db97255ce15bb05077623c99491d73b76f02a520&selectedJob=286723897

Assignee: nobody → docfaraday
Flags: needinfo?(docfaraday)
Has Regression Range: --- → no
Has STR: --- → no
Keywords: steps-wanted

Hi Byron Campen,

I'm facing the same issue that sometimes replaceTrack is not working. As of now, I have identified one scenario where reproducibility is higher:
For first time user of Firefox, meaning fresh installation of Firefox, for some feature, I've to create the fake audio stream and which is made fakeStream.getTracks()[0].enabled=false as it is fake. And then later in the call, we need to replace the fakeStream's track with whatever we get from microphone. And here, we are facing issue that some times audio track is not being replaced properly and Firefox does not send the audio to farend.
Further, we attached the new audio stream to video element manually to test if new stream is proper or not, we found that audio plays.

For me, it looks like that by replaceTrack, somehow, RTPSender is not able to pick up the audio packets from new streams.
I'm not sure why I'm not facing issue with video fake stream as doing same for video as of audio too.
Attaching logs as NotWorkingFF

Attached file NotWorkingFF.log

Comment on attachment 9123649 [details]
NotWorkingFF.log

For testing I usually run "/Applications/Firefox.app/Contents/MacOS/firefox --MOZ_LOG=timestamp,signaling:5,mtransport:5,MediaManager:5,GetUserMedia:4,jsep:5,RtpLogger:5,webrtc_trace:5,VP8TrackEncoder:5,VP8TrackDecoder:5 --MOZ_LOG_FILE=/tmp/ff71.log" , And attached log have the output of this one. If you need anything else I can do that as I can reproduce the issue more often.

Sorry to disappoint you that still I'm facing the issue. I used OS X build.

Flags: needinfo?(itpandey.88)

I am setting this NI to make sure that the issue is addressed. Thank you.

Flags: needinfo?(docfaraday)

Bug is confirmed, and I'm assigned, so no need for a needinfo.

Flags: needinfo?(docfaraday)

Setting the [qa-regression-triage] flag, considering that this bug is assigned and being addressed.
Please provide some sort of steps to reproduce and NI me if this bug needs verification.
Thank you for your contribution!

QA Whiteboard: [qa-regression-triage]
Severity: normal → S3
See Also: → 1812293
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: