Firefox 68.0b8 - WebRTC not sending video after block and unblock video
Categories
(Core :: WebRTC: Audio/Video, defect, P3)
Tracking
()
People
(Reporter: ychoo, Unassigned)
Details
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
Steps to reproduce:
Scenario:
- User A performs video call (sendrecv direction) to User B
- User A blocks video (recvonly direction)
- User A unblocks video (sendrecv direction)
Actual results:
After User A unblocks video in step (3), User B is not receiving remote video from user A. We confirm user A is not sending video via User A call statistics and Wireshark dump.
Expected results:
After User A unblocks video in step (3), user B should be able to receive remote video from user A.
Note: The same flow works for Firefox 67 or older.
Add'l notes.
The unblock problem happens if User A temporarily disable local video mediastream track in step (2), and re-enable the local video mediastream track in step (3). It works if we DO NOT temporarily disable and re-enable the local video track.
Comment 2•6 years ago
|
||
Moving to hopefully a better component.
Comment 3•6 years ago
|
||
Thank you for the report. In the test gUM page [1], I do a temporary disable of video track and then re-enable and I cannot reproduce it. Can you please try in the latest Nightly? Can you please provide a link that reproduces the issue?
I just tried with the latest nightly build and it is not working. It only fails iff video track is enabled/disabled and SDP offer/answer negotiation are performed. I'm not able to provide a test link due to the use of non public media server usage.
Note: If I replace the video mediastream track enable/disable with transceiver direction then the video works fine. Also the existing code is using addTrack instead of addTransceiver.
Comment 5•6 years ago
|
||
Byron, do you mind helping to triage this one? Thanks!
Comment 6•6 years ago
|
||
This works fine in our tests, so we're going to need a link to a test-case that reproduces this bug.
Comment 7•5 years ago
•
|
||
Ychoo, I'm also unable to reproduce. I'm using the following steps. Are you able to repro with these steps?
- Open https://blog.mozilla.org/webrtc/rtcrtptransceiver-explored/
- Scroll down to the text "You can try out this remote-control below in Firefox (59): "
- Click the
Resultbutton immediately below it, and allow camera - Click the
transceiver = pc.addTransceiver(trackA, {streams})button - (Optionally, how I interpret comment 1) click the
transceiver.sender.track.enabled = falsebutton - Click the button labeled
transceiver.direction = "recvonly"button - Click the buttonlabeled
transceiver.direction = "sendrecv"button - (Optionally, how I interpret comment 1) click the
transceiver.sender.track.enabled = truebutton
When I do this, I see remote video appear, pause, and resume respectively from steps 4-8, with or without the optional steps. Does it work for you?
I'm not sure I got the exact steps right based on comment 1 and comment 4, so feel free to rearrange the steps any way needed to reproduce the problem. Thanks!
Updated•5 years ago
|
Comment 8•5 years ago
|
||
(In reply to ychoo from comment #4)
Note: If I replace the video mediastream track enable/disable with transceiver direction then the video works fine. Also the existing code is using addTrack instead of addTransceiver.
So my steps in comment 7 do not use addTrack. Can you elaborate on exactly what steps are needed on the API?
addTrack has very different semantics: it always adds a new m-line, which fires a new track event with a different track. So if you do:
const senderA = pc.addTrack(trackA), then laterpc.removeTrack(senderA), then laterconst senderA2 = pc.addTrack(trackA)
...then video won't resume automatically on the other end's existing track. IOW senderA and senderA2 are different. Makes sense?
The original flow is
- senderVideoA = pc.addTrack(videoTrackA, mediaStream);
- senderVideoA.track.enable = false; // block
- senderVideoA.track.enable = true; // unblock
| Reporter | ||
Comment 10•5 years ago
|
||
More details
- senderVideoA = pc.addTrack(videoTrackA, mediaStream);
- senderVideoA.track.enable = false; // block
Renegotiate media with recvonly video with media server - senderVideoA.track.enable = true; // unblock
Renegotiate media with sendrecv video with media server
Comment 11•5 years ago
|
||
Ychoo, here's a modified version of the fiddle in comment 7 that uses addTrack. Are you able to reproduce the issue by clicking the various buttons in the order that matches your steps?
Comment 12•5 years ago
|
||
Do we understand what the reporter is seeing here? jib, do you believe it is a bug, or a misunderstanding of the APIs? I'm not sure, but I think that's what you imply in comment 8?
Comment 13•5 years ago
|
||
Based on the statement that it worked in 67 but not 68, and similar 68 regressions like bug 1576771 comment 7 in this area, I don't think it's a misunderstanding.
That said, I can't repro it. Here's a fiddle https://jsfiddle.net/jib1/209ankft/ based on comment 10.
It's possible there are timing differences with a media server involved. I say that because my local-loop fiddle is clearly too quick to be practical, renegotiating "recvonly" before the black frame from track.enabled = false even makes it to playback on the other end, so I see a freeze-frame rather than the clearly intended black. If I add some delays I get black, but still can't repro the symptom.
Byron, have you discovered anything new that looks like it could explain this one?
Comment 14•5 years ago
|
||
I might think this was related to bug 1606875, except reporter said they verified no network media flow with wireshark in the initial report, which is not part of bug 1606875.
Comment 15•5 years ago
|
||
My understanding from the comments above is that it looks like a real error. I am gonna confirm it but give it a small priority because the reported hasn't responded for a long time and the error does not reproduce locally (according to the reports). Feel free to upgrade when you know more.
| Reporter | ||
Comment 16•5 years ago
|
||
For now, our workaround is to change the transceiver direction. The original problem was due to enabling/disabling the video track via RTCRtpSender from rtcPeerConnection.addTrack(). I think the problem will not happen with the newer transceiver flow.
rtpSender.track.enable = false; // temporarily disable local video track
// Perform video renegotiation (RECV_ONLY) with media server
rtpSenderTrack.enable = true; // re-enable local video track
// Perform video renegotiation (SEND_RECV) with media server
Comment 17•5 years ago
|
||
(In reply to ychoo from comment #16)
For now, our workaround is to change the transceiver direction. The original problem was due to enabling/disabling the video track via RTCRtpSender from rtcPeerConnection.addTrack(). I think the problem will not happen with the newer transceiver flow.
rtpSender.track.enable = false; // temporarily disable local video track
// Perform video renegotiation (RECV_ONLY) with media server
rtpSenderTrack.enable = true; // re-enable local video track
// Perform video renegotiation (SEND_RECV) with media server
So, MediaStreamTrack.enable doesn't have any effect on transceiver direction. It would be interesting to know whether this works for you, however, since we have some problems around MediaStreamTrack.enable (see bug 1606875).
Updated•3 years ago
|
Description
•