microsoft / MixedReality-WebRTC

MixedReality-WebRTC is a collection of components to help mixed reality app developers integrate audio and video real-time communication into their application and improve their collaborative experience
https://microsoft.github.io/MixedReality-WebRTC/
MIT License
909 stars 283 forks source link

Failed to set remote offer sdp: The order of m-lines in subsequent offer doesn't match order from previous offer/answer. #801

Open KarthikRichie opened 3 years ago

KarthikRichie commented 3 years ago

Describe the bug I get an incoming audio call from an UWP app and attending in an UWP app (that uses MR webrtc 2.0.2). Now, the call is connected and I turn on my video. This video is visible in the remote. Now, when internet goes down and reconnects back, I'm pulling the remote offer. While setting the remote description I get the error "Failed to set remote offer sdp: The order of m-lines in subsequent offer doesn't match order from previous offer/answer." I checked the m-lines in the offer and compared with previous offer and it was looking good. Any pointers on what I'm missing here?

Any pointers ? Thanks in advance

Expected behavior Ideally, the call should connect gracefully after reconnection.

SDP messages Remote offer sdp:- v=0 o=- 6504926088748691161 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=msid-semantic: WMS local_av_stream m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126 c=IN IP4 0.0.0.0 a=rtcp:9 IN IP4 0.0.0.0 a=ice-ufrag:r4Nx a=ice-pwd:al+WZIRjfs4WHbBZZ+cJfkyn a=ice-options:trickle a=fingerprint:sha-256 26:1E:F7:2A:CA:C1:6D:DD:0F:D7:FC:DE:7C:0D:7A:39:E4:53:40:F1:98:E9:B0:B8:FC:14:74:F1:68:0C:C1:EB a=setup:actpass a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid a=sendrecv a=msid:local_av_stream 3cee9e62-8bca-4836-bdc5-b8b4f4903929 a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:102 ILBC/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:610657962 cname:Vwz/MloH+J/VoEZq a=ssrc:610657962 msid: 3cee9e62-8bca-4836-bdc5-b8b4f4903929 a=ssrc:610657962 mslabel: a=ssrc:610657962 label:3cee9e62-8bca-4836-bdc5-b8b4f4903929

Answer sdp:- v=0 o=- 7577259829082090324 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=msid-semantic: WMS local_av_stream m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126 c=IN IP4 0.0.0.0 a=rtcp:9 IN IP4 0.0.0.0 a=ice-ufrag:oHWq a=ice-pwd:PpdDpT6zFPfyT+8E2Dv8Nzwq a=ice-options:trickle a=fingerprint:sha-256 69:2C:43:46:E8:9A:7B:92:0F:6B:FB:3C:69:C5:7C:95:9C:36:3A:51:97:FC:A0:66:FD:CD:46:CE:20:49:49:44 a=setup:active a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid a=sendrecv a=msid:local_av_stream 2da1043f-5ad8-42d2-a00b-9a006694ce1a a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:102 ILBC/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:3815874130 cname:52AKkhmyFYT6CAJH

Now I turn on my video (ie:- at callee's end),

Offer sdp:- v=0 o=- 7577259829082090324 3 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 1 a=msid-semantic: WMS local_av_stream m=audio 18244 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126 c=IN IP4 119.81.194.150 a=rtcp:9 IN IP4 0.0.0.0 a=candidate:4278134664 1 udp 2122260223 192.168.1.8 62076 typ host generation 0 network-id 4 network-cost 10 a=candidate:1470146653 1 udp 1686052607 60.243.11.224 62076 typ srflx raddr 192.168.1.8 rport 62076 generation 0 network-id 4 network-cost 10 a=candidate:2960972664 1 tcp 1518280447 192.168.1.8 57739 typ host tcptype passive generation 0 network-id 4 network-cost 10 a=candidate:728942287 1 udp 41885695 119.81.194.150 18244 typ relay raddr 60.243.11.224 rport 62076 generation 0 network-id 4 network-cost 10 a=candidate:1710307903 1 udp 25108223 119.81.194.150 19485 typ relay raddr 60.243.11.224 rport 57738 generation 0 network-id 4 network-cost 10 a=ice-ufrag:oHWq a=ice-pwd:PpdDpT6zFPfyT+8E2Dv8Nzwq a=ice-options:trickle a=fingerprint:sha-256 69:2C:43:46:E8:9A:7B:92:0F:6B:FB:3C:69:C5:7C:95:9C:36:3A:51:97:FC:A0:66:FD:CD:46:CE:20:49:49:44 a=setup:actpass a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid a=sendrecv a=msid:local_av_stream 2da1043f-5ad8-42d2-a00b-9a006694ce1a a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:102 ILBC/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:3815874130 cname:52AKkhmyFYT6CAJH a=ssrc:3815874130 msid: 2da1043f-5ad8-42d2-a00b-9a006694ce1a a=ssrc:3815874130 mslabel: a=ssrc:3815874130 label:2da1043f-5ad8-42d2-a00b-9a006694ce1a m=video 9 UDP/TLS/RTP/SAVPF 96 c=IN IP4 0.0.0.0 a=rtcp:9 IN IP4 0.0.0.0 a=ice-ufrag:oHWq a=ice-pwd:PpdDpT6zFPfyT+8E2Dv8Nzwq a=ice-options:trickle a=fingerprint:sha-256 69:2C:43:46:E8:9A:7B:92:0F:6B:FB:3C:69:C5:7C:95:9C:36:3A:51:97:FC:A0:66:FD:CD:46:CE:20:49:49:44 a=setup:actpass a=mid:1 a=extmap:2 urn:ietf:params:rtp-hdrext:toffset a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:4 urn:3gpp:video-orientation a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing a=extmap:10 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07 a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid a=sendrecv a=msid:local_av_stream 6410093e-baa3-41fa-b443-5f9b4c01bb1d a=rtcp-mux a=rtcp-rsize a=rtpmap:96 VP8/90000 a=rtcp-fb:96 goog-remb a=rtcp-fb:96 transport-cc a=rtcp-fb:96 ccm fir a=rtcp-fb:96 nack a=rtcp-fb:96 nack pli a=ssrc-group:FID 2582551103 4159220877 a=ssrc:2582551103 cname:52AKkhmyFYT6CAJH a=ssrc:2582551103 msid: 6410093e-baa3-41fa-b443-5f9b4c01bb1d a=ssrc:2582551103 mslabel: a=ssrc:2582551103 label:6410093e-baa3-41fa-b443-5f9b4c01bb1d a=ssrc:4159220877 cname:52AKkhmyFYT6CAJH a=ssrc:4159220877 msid: 6410093e-baa3-41fa-b443-5f9b4c01bb1d a=ssrc:4159220877 mslabel: a=ssrc:4159220877 label:6410093e-baa3-41fa-b443-5f9b4c01bb1d

Answer sdp from remote:- v=0 o=- 6504926088748691161 3 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 1 a=msid-semantic: WMS local_av_stream m=audio 14664 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126 c=IN IP4 119.81.194.150 a=rtcp:9 IN IP4 0.0.0.0 a=candidate:1178812653 1 udp 2122260223 192.168.1.9 65019 typ host generation 0 network-id 7 network-cost 10 a=candidate:4011642680 1 udp 1686052607 60.243.11.224 65019 typ srflx raddr 192.168.1.9 rport 65019 generation 0 network-id 7 network-cost 10 a=candidate:146848797 1 tcp 1518280447 192.168.1.9 61669 typ host tcptype passive generation 0 network-id 7 network-cost 10 a=candidate:1710307903 1 udp 25108223 119.81.194.150 14664 typ relay raddr 60.243.11.224 rport 61668 generation 0 network-id 7 network-cost 10 a=candidate:728942287 1 udp 41885695 119.81.194.150 14916 typ relay raddr 60.243.11.224 rport 65019 generation 0 network-id 7 network-cost 10 a=ice-ufrag:r4Nx a=ice-pwd:al+WZIRjfs4WHbBZZ+cJfkyn a=ice-options:trickle a=fingerprint:sha-256 26:1E:F7:2A:CA:C1:6D:DD:0F:D7:FC:DE:7C:0D:7A:39:E4:53:40:F1:98:E9:B0:B8:FC:14:74:F1:68:0C:C1:EB a=setup:passive a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid a=sendrecv a=msid:local_av_stream 3cee9e62-8bca-4836-bdc5-b8b4f4903929 a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:102 ILBC/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:610657962 cname:Vwz/MloH+J/VoEZq m=video 9 UDP/TLS/RTP/SAVPF 96 c=IN IP4 0.0.0.0 a=rtcp:9 IN IP4 0.0.0.0 a=ice-ufrag:r4Nx a=ice-pwd:al+WZIRjfs4WHbBZZ+cJfkyn a=ice-options:trickle a=fingerprint:sha-256 26:1E:F7:2A:CA:C1:6D:DD:0F:D7:FC:DE:7C:0D:7A:39:E4:53:40:F1:98:E9:B0:B8:FC:14:74:F1:68:0C:C1:EB a=setup:passive a=mid:1 a=extmap:2 urn:ietf:params:rtp-hdrext:toffset a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a=extmap:4 urn:3gpp:video-orientation a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01 a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing a=extmap:10 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07 a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid a=recvonly a=rtcp-mux a=rtcp-rsize a=rtpmap:96 VP8/90000 a=rtcp-fb:96 goog-remb a=rtcp-fb:96 transport-cc a=rtcp-fb:96 ccm fir a=rtcp-fb:96 nack a=rtcp-fb:96 nack pli

When internet goes down and re-connects back, I'm pulling the offer (ie:- at callee's end) and the remote offer looks like below,

v=0 o=- 2229377676462142028 2 IN IP4 127.0.0.1 s=- t=0 0 a=group:BUNDLE 0 a=msid-semantic: WMS local_av_stream m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126 c=IN IP4 0.0.0.0 a=rtcp:9 IN IP4 0.0.0.0 a=ice-ufrag:HCWs a=ice-pwd:34z9wQSBDtWknTfR9wz2I819 a=ice-options:trickle a=fingerprint:sha-256 64:CB:F8:B8:2B:21:81:31:D4:B9:17:9B:94:29:A9:61:AA:30:74:C2:1A:2F:75:C5:4B:8B:55:A1:7C:AC:E0:26 a=setup:actpass a=mid:0 a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid a=sendrecv a=msid:local_av_stream 57869f8e-b2b9-4389-891a-7812f022dad0 a=rtcp-mux a=rtpmap:111 opus/48000/2 a=rtcp-fb:111 transport-cc a=fmtp:111 minptime=10;useinbandfec=1 a=rtpmap:103 ISAC/16000 a=rtpmap:104 ISAC/32000 a=rtpmap:9 G722/8000 a=rtpmap:102 ILBC/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:106 CN/32000 a=rtpmap:105 CN/16000 a=rtpmap:13 CN/8000 a=rtpmap:110 telephone-event/48000 a=rtpmap:112 telephone-event/32000 a=rtpmap:113 telephone-event/16000 a=rtpmap:126 telephone-event/8000 a=ssrc:2777831178 cname:4R4DQK8vkCUaHtYW a=ssrc:2777831178 msid: 57869f8e-b2b9-4389-891a-7812f022dad0 a=ssrc:2777831178 mslabel: a=ssrc:2777831178 label:57869f8e-b2b9-4389-891a-7812f022dad0

When setting this offer via SetRemoteDescription, I get the above error.

Environment (At both ends)