New issue
Advanced search Search tips

Issue 917501 link

Starred by 7 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Plan B PeerConnection will send the MID header extension if the remote offer specifies it

Reported by mmalava...@twilio.com, Dec 21

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

Steps to reproduce the problem:
Scenario:
1. Chrome Unified generates an offer with audio and video tracks.
2. SDP gets translated to Plan B.
3. Chrome PlanB applies the translated offer.
4. Chrome PlanB generates an answer with audio and video tracks.
5. SDP gets translated to Unified Plan.
6. Chrome Unified applies the translated answer.

NOTE: We are in the process of trying to reproduce this without our SDP translation mechanism. In the meantime, we have attached the WebRTC stats dump for the Chrome Unified RTCPeerConnection and the relevant SDPs.

What is the expected behavior?
Chrome Unified should play back Chrome PlanB's remote tracks.

What went wrong?
Chrome Unified does not play back Chrome PlanB's remote tracks.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 71.0.3578.98  Channel: stable
OS Version: OS X 10.13.6
Flash Version: 

While the RTCInboundRTPStreamStats for the corresponding RTCRtpReceivers shows "bytesReceived" to be 0, the RTCIceCandidatePairStats shows a monotonically increasing "bytesReceived" value. This most likely means that Chrome is not associating the RTP traffic with the remote SSRCs properly.
 
Screen Shot 2018-12-21 at 1.25.28 PM.png
58.1 KB View Download
For some reason, all the other attachments did not make it to the bug, so I'm adding them with this comment.
Screen Shot 2018-12-21 at 1.24.43 PM.png
39.3 KB View Download
cr-planb-cr-unified-sdps.rtf
23.0 KB Download
cr-unified-webrtc-dump.txt
621 KB View Download
Labels: Needs-Triage-M71
Components: -Blink>WebRTC Blink>WebRTC>PeerConnection
Owner: hbos@chromium.org
Status: Assigned (was: Unconfirmed)
Cc: steveanton@chromium.org
The Unified Plan client uses mid:0 and mid:1, but when you're translating you're changing this to a=audio and a=video, which means a different mid is being negotiated than the one the transceivers are actually using. I'm suspecting something like this is resulting in packets being dropped on arrival, not knowing which receiver to send them to. So the ICE bytes received increases but not the RTCInboundRtpStreamStats.

Unified Plan uses mids to distinguish packets, I'm not sure how this affects the significance of the SSRCs. Chrome-SDP uses both for backwards-compatibility.

Steve, do you have more input?
Labels: Needs-Feedback
mmalavalli@ what happens if you munge the local offer so that the a=mid is "audio" or "video"? Maybe the transceivers end up with the same mid as is negotiated?
Cc: -steveanton@chromium.org hbos@chromium.org
Owner: steveanton@chromium.org
I think there's two issues that are compounding to make this not work:

1. The a=mid lines are changed on the Plan B side (this shouldn't be necessary, Plan B works with any offered MID value, not just 'audio' and 'video').

2. The "send" header extensions are pulled from the remote description without modification, regardless of how they are negotiated in the answer (see https://codesearch.chromium.org/chromium/src/third_party/webrtc/pc/channel.cc?l=878&rcl=35a9c6df44461580966b6f6d725db493ff764bce).

So the Plan B side will send RTP packets with the MID header extension and payloads 'audio' and 'video' which are dropped by the Unified Plan side since it expects MIDs '0' and '1'. Funny enough the Unified Plan side will not send with the MID header extension since it gets negotiated out of the answer (which is the Unified Plan side's remote description).

In the mean time, a couple options to work around this:

1. Don't rewrite the MIDs for the Plan B side.

2. Remove the offered MID header extension line from the SDP (looks like a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid).

Comment 7 Deleted

Thank you so much for your suggestions. Removing the MID header extension line from the translated SDP (unified plan to plan b) did the trick.

However, it is interesting that if the Plan B client is Safari, then Chrome Unified Plan has no problem playing back the remote media without having to remove the MID header extension line from the SDP. I wonder if Safari is ignoring that line and not stamping the MID in the RTP header?
Another question I had was:

If the MID is not stamped in the RTP extension header, does Chrome use the m= line index to map RTP data to a particular receiver? I ask this because, once I removed the relevant SDP line, Chrome unified plan was able to play back remote media even with the  MIDs being changed from "audio" and "video" to "0" and "1" and vice versa.
What version of Safari are you using? It's likely using an older version of libWebRTC that doesn't support the MID header extension at all. That would also happen with older versions of Chrome.

Chrome will still use the a=ssrc lines to demux incoming streams, but it will prefer the MID header extension if it is present.
Labels: -Needs-Feedback -Needs-Triage-M71
Summary: Plan B PeerConnection will send the MID header extension if the remote offer specifies it (was: Chrome Unified fails to play back Chrome PlanB's remote media)
Updating summary to reflect the triage.
I used Safari 12.0, which is the latest stable version. That is why I was a bit surprised that Safari behaved differently than Chrome in Plan B mode.
So is Chrome dropping packets on arrival "working as intended" and we can close this bug, or do we need to update our code not to pull of header extensions or something else?
Owner: ----
Status: Available (was: Assigned)
Chrome dropping packets with MID values it does not know is required by BUNDLE, so that is working as intended.

The bug here is that a Plan B PeerConnection will send using the MID header extension if the remote side offers it, even though it will generate an answer without the MID header extension.
Labels: -Pri-2 Pri-3
OK, I'm lowering the priority since this can be worked around and Plan B is about to be considered legacy.

Sign in to add a comment