Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Cannot apply remote description Object not Initialized error #498

Closed
astaikos316 opened this issue Aug 4, 2020 · 10 comments
Closed

Cannot apply remote description Object not Initialized error #498

astaikos316 opened this issue Aug 4, 2020 · 10 comments
Labels
invalid User error or by design

Comments

@astaikos316
Copy link

Currently running the latest 2.0 preview release unity package that I downloaded the other day. I am running an application I built on a PC build and a Hololens 2 as the 2 endpoints. Built using Unity 2019.3. When starting a call from the PC to the Hololens 2, it runs well. When I start a call from the Hololens 2 to the PC I get an "Cannot apply remote description Object not Initialized" error on the Hololens 2 debug console. Sometimes the call will drop after that, sometimes it will persist. Using a websockets signaling server that I built and have been using since release 1.0. Below is a log of signaling messages when initiating call from Hololens 2 to PC:

{ MessageType: 1,
Data:
'v=0\r\no=- 6679170742028590061 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1 2\r\na=msid-semantic: WMS\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 103 9 102 0 8 105 13 110 113 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:WFT3\r\na=ice-pwd:TTPrOyfXX5y8bBqWZX4zM/af\r\na=ice-options:trickle\r\na=fingerprint:sha-256 87:FF:86:C3:22:2E:AD:DE:68:BD:A2:08:81:EB:92:78:77:55:C0:F0:0D:BE:0C:B3:9B:D8:C5:C0:06:3D:8F:D9\r\na=setup:actpass\r\na=mid:0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=sendrecv\r\na=msid:- d2ed5db5-dfdb-42f1-af0c-9e12b3fac00a\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:102 ILBC/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:110 telephone-event/48000\r\na=rtpmap:113 telephone-event/16000\r\na=rtpmap:126 telephone-event/8000\r\na=ssrc:3194508853 cname:qzZ14ztL+684tz+T\r\na=ssrc:3194508853 msid: d2ed5db5-dfdb-42f1-af0c-9e12b3fac00a\r\na=ssrc:3194508853 mslabel:\r\na=ssrc:3194508853 label:d2ed5db5-dfdb-42f1-af0c-9e12b3fac00a\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 127 125 104\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:WFT3\r\na=ice-pwd:TTPrOyfXX5y8bBqWZX4zM/af\r\na=ice-options:trickle\r\na=fingerprint:sha-256 87:FF:86:C3:22:2E:AD:DE:68:BD:A2:08:81:EB:92:78:77:55:C0:F0:0D:BE:0C:B3:9B:D8:C5:C0:06:3D:8F:D9\r\na=setup:actpass\r\na=mid:1\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=extmap:10 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07\r\na=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=sendrecv\r\na=msid:- 500596c8-81a6-49a7-ae2e-471a4ee6e911\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:98 VP9/90000\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=fmtp:98 x-google-profile-id=0\r\na=rtpmap:99 rtx/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:100 H264/90000\r\na=rtcp-fb:100 goog-remb\r\na=rtcp-fb:100 transport-cc\r\na=rtcp-fb:100 ccm fir\r\na=rtcp-fb:100 nack\r\na=rtcp-fb:100 nack pli\r\na=fmtp:100 packetization-mode=1\r\na=rtpmap:101 rtx/90000\r\na=fmtp:101 apt=100\r\na=rtpmap:127 red/90000\r\na=rtpmap:125 rtx/90000\r\na=fmtp:125 apt=127\r\na=rtpmap:104 ulpfec/90000\r\na=ssrc-group:FID 1773377052 387239877\r\na=ssrc:1773377052 cname:qzZ14ztL+684tz+T\r\na=ssrc:1773377052 msid: 500596c8-81a6-49a7-ae2e-471a4ee6e911\r\na=ssrc:1773377052 mslabel:\r\na=ssrc:1773377052 label:500596c8-81a6-49a7-ae2e-471a4ee6e911\r\na=ssrc:387239877 cname:qzZ14ztL+684tz+T\r\na=ssrc:387239877 msid: 500596c8-81a6-49a7-ae2e-471a4ee6e911\r\na=ssrc:387239877 mslabel:\r\na=ssrc:387239877 label:500596c8-81a6-49a7-ae2e-471a4ee6e911\r\nm=application 9 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:WFT3\r\na=ice-pwd:TTPrOyfXX5y8bBqWZX4zM/af\r\na=ice-options:trickle\r\na=fingerprint:sha-256 87:FF:86:C3:22:2E:AD:DE:68:BD:A2:08:81:EB:92:78:77:55:C0:F0:0D:BE:0C:B3:9B:D8:C5:C0:06:3D:8F:D9\r\na=setup:actpass\r\na=mid:2\r\na=sctpmap:5000 webrtc-datachannel 1024\r\n',
IceDataSeparator: '',
name: 'pcbuild',
type: '' }
Sending offer to: pcbuild
{ MessageType: 3,
Data:
'candidate:667043520 1 udp 2122260223 198.154.23.230 61558 typ host generation 0 ufrag WFT3 network-id 1 network-cost 10|0|0',
IceDataSeparator: '|',
name: 'pcbuild',
type: '' }
Sending candidate to: pcbuild
{ MessageType: 3,
Data:
'candidate:2961818892 1 udp 2122260223 198.154.23.246 60384 typ host generation 0 ufrag Oa6q network-id 1 network-cost 10|0|0',
IceDataSeparator: '|',
name: 'Maintainer',
type: '' }
Sending candidate to: Maintainer
{ MessageType: 2,
Data:
'v=0\r\no=- 8357421406018085528 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1 2\r\na=msid-semantic: WMS\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 103 9 102 0 8 105 13 110 113 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:Oa6q\r\na=ice-pwd:HqCtkCw705Qn3ZAxOZciM+fA\r\na=ice-options:trickle\r\na=fingerprint:sha-256 1C:EE:78:22:A1:28:DA:F5:7E:FA:9B:0F:85:50:21:7D:03:F4:8B:A4:0F:CA:8A:C8:DC:76:C8:2E:B2:8D:CA:24\r\na=setup:active\r\na=mid:0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=sendrecv\r\na=msid:- 11e9dcdb-ce30-4b41-a746-1b917417f1bc\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:102 ILBC/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:110 telephone-event/48000\r\na=rtpmap:113 telephone-event/16000\r\na=rtpmap:126 telephone-event/8000\r\na=ssrc:76421774 cname:k+OSjUBPuVydLov2\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 127 125 104\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:Oa6q\r\na=ice-pwd:HqCtkCw705Qn3ZAxOZciM+fA\r\na=ice-options:trickle\r\na=fingerprint:sha-256 1C:EE:78:22:A1:28:DA:F5:7E:FA:9B:0F:85:50:21:7D:03:F4:8B:A4:0F:CA:8A:C8:DC:76:C8:2E:B2:8D:CA:24\r\na=setup:active\r\na=mid:1\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=extmap:10 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07\r\na=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=sendrecv\r\na=msid:- b04c6216-0e67-4289-b879-c3dd61403d5e\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:98 VP9/90000\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=fmtp:98 x-google-profile-id=0\r\na=rtpmap:99 rtx/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:127 red/90000\r\na=rtpmap:125 rtx/90000\r\na=fmtp:125 apt=127\r\na=rtpmap:104 ulpfec/90000\r\na=ssrc-group:FID 2120564286 1685572898\r\na=ssrc:2120564286 cname:k+OSjUBPuVydLov2\r\na=ssrc:1685572898 cname:k+OSjUBPuVydLov2\r\nm=application 9 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\nb=AS:30\r\na=ice-ufrag:Oa6q\r\na=ice-pwd:HqCtkCw705Qn3ZAxOZciM+fA\r\na=ice-options:trickle\r\na=fingerprint:sha-256 1C:EE:78:22:A1:28:DA:F5:7E:FA:9B:0F:85:50:21:7D:03:F4:8B:A4:0F:CA:8A:C8:DC:76:C8:2E:B2:8D:CA:24\r\na=setup:active\r\na=mid:2\r\na=sctpmap:5000 webrtc-datachannel 1024\r\n',
IceDataSeparator: '',
name: 'Maintainer',
type: '' }
Sending answer to: Maintainer
{ MessageType: 2,
Data:
'v=0\r\no=- 8357421406018085528 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1 2\r\na=msid-semantic: WMS\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 103 9 102 0 8 105 13 110 113 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:Oa6q\r\na=ice-pwd:HqCtkCw705Qn3ZAxOZciM+fA\r\na=ice-options:trickle\r\na=fingerprint:sha-256 1C:EE:78:22:A1:28:DA:F5:7E:FA:9B:0F:85:50:21:7D:03:F4:8B:A4:0F:CA:8A:C8:DC:76:C8:2E:B2:8D:CA:24\r\na=setup:active\r\na=mid:0\r\na=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\na=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=sendrecv\r\na=msid:- 11e9dcdb-ce30-4b41-a746-1b917417f1bc\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\na=rtcp-fb:111 transport-cc\r\na=fmtp:111 minptime=10;useinbandfec=1\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:9 G722/8000\r\na=rtpmap:102 ILBC/8000\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:110 telephone-event/48000\r\na=rtpmap:113 telephone-event/16000\r\na=rtpmap:126 telephone-event/8000\r\na=ssrc:76421774 cname:k+OSjUBPuVydLov2\r\nm=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 127 125 104\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:Oa6q\r\na=ice-pwd:HqCtkCw705Qn3ZAxOZciM+fA\r\na=ice-options:trickle\r\na=fingerprint:sha-256 1C:EE:78:22:A1:28:DA:F5:7E:FA:9B:0F:85:50:21:7D:03:F4:8B:A4:0F:CA:8A:C8:DC:76:C8:2E:B2:8D:CA:24\r\na=setup:active\r\na=mid:1\r\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\r\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\na=extmap:4 urn:3gpp:video-orientation\r\na=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\r\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\r\na=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\r\na=extmap:10 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07\r\na=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid\r\na=sendrecv\r\na=msid:- b04c6216-0e67-4289-b879-c3dd61403d5e\r\na=rtcp-mux\r\na=rtcp-rsize\r\na=rtpmap:96 VP8/90000\r\na=rtcp-fb:96 goog-remb\r\na=rtcp-fb:96 transport-cc\r\na=rtcp-fb:96 ccm fir\r\na=rtcp-fb:96 nack\r\na=rtcp-fb:96 nack pli\r\na=rtpmap:97 rtx/90000\r\na=fmtp:97 apt=96\r\na=rtpmap:98 VP9/90000\r\na=rtcp-fb:98 goog-remb\r\na=rtcp-fb:98 transport-cc\r\na=rtcp-fb:98 ccm fir\r\na=rtcp-fb:98 nack\r\na=rtcp-fb:98 nack pli\r\na=fmtp:98 x-google-profile-id=0\r\na=rtpmap:99 rtx/90000\r\na=fmtp:99 apt=98\r\na=rtpmap:127 red/90000\r\na=rtpmap:125 rtx/90000\r\na=fmtp:125 apt=127\r\na=rtpmap:104 ulpfec/90000\r\na=ssrc-group:FID 2120564286 1685572898\r\na=ssrc:2120564286 cname:k+OSjUBPuVydLov2\r\na=ssrc:1685572898 cname:k+OSjUBPuVydLov2\r\nm=application 9 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\nb=AS:30\r\na=ice-ufrag:Oa6q\r\na=ice-pwd:HqCtkCw705Qn3ZAxOZciM+fA\r\na=ice-options:trickle\r\na=fingerprint:sha-256 1C:EE:78:22:A1:28:DA:F5:7E:FA:9B:0F:85:50:21:7D:03:F4:8B:A4:0F:CA:8A:C8:DC:76:C8:2E:B2:8D:CA:24\r\na=setup:active\r\na=mid:2\r\na=sctpmap:5000 webrtc-datachannel 1024\r\n',
IceDataSeparator: '',
name: 'Maintainer',
type: '' }
Sending answer to: Maintainer
{ MessageType: 3,
Data:
'candidate:2961818892 1 udp 2122260223 198.154.23.246 60384 typ host generation 0 ufrag Oa6q network-id 1 network-cost 10|0|0',
IceDataSeparator: '|',
name: 'Maintainer',
type: '' }
Sending candidate to: Maintainer
{ MessageType: 3,
Data:
'candidate:667043520 1 udp 2122260223 198.154.23.230 61559 typ host generation 0 ufrag WFT3 network-id 1 network-cost 10|1|1',
IceDataSeparator: '|',
name: 'pcbuild',
type: '' }
Sending candidate to: pcbuild
{ MessageType: 3,
Data:
'candidate:667043520 1 udp 2122260223 198.154.23.230 61560 typ host generation 0 ufrag WFT3 network-id 1 network-cost 10|2|2',
IceDataSeparator: '|',
name: 'pcbuild',
type: '' }
Sending candidate to: pcbuild
{ MessageType: 3,
Data:
'candidate:1765915184 1 tcp 1518280447 198.154.23.230 59609 typ host tcptype passive generation 0 ufrag WFT3 network-id 1 network-cost 10|0|0',
IceDataSeparator: '|',
name: 'pcbuild',
type: '' }
Sending candidate to: pcbuild
{ MessageType: 3,
Data:
'candidate:1765915184 1 tcp 1518280447 198.154.23.230 59610 typ host tcptype passive generation 0 ufrag WFT3 network-id 1 network-cost 10|1|1',
IceDataSeparator: '|',
name: 'pcbuild',
type: '' }
Sending candidate to: pcbuild
{ MessageType: 3,
Data:
'candidate:1765915184 1 tcp 1518280447 198.154.23.230 59611 typ host tcptype passive generation 0 ufrag WFT3 network-id 1 network-cost 10|2|2',
IceDataSeparator: '|',
name: 'pcbuild',
type: '' }
Sending candidate to: pcbuild

Any ideas of where I should look to correct this issue would be greatly appreciated.

@fibann
Copy link
Member

fibann commented Aug 4, 2020

It seems that 'pcbuild' is sending two SDP answers to 'Maintainer'. This would explain why you get a Cannot apply remote description error - the second one fails to apply because the HL has already got an answer. You should try to figure out why the answer is being duplicated - if it's a bug in the signaling server/clients, or if PeerConnection.LocalSdpReadytoSend is actually raised twice after one offer.

@fibann fibann added the need info More information is needed from the author to answer label Aug 4, 2020
@astaikos316
Copy link
Author

Is there a reason why the SIgnaler base class changed the PeerConnection to a public variable?

@fibann
Copy link
Member

fibann commented Aug 4, 2020

I think this was part of #233, the point was to separate Signaler from PeerConnection so that it is easier to use a different class/mechanism for signaling if needed.

@astaikos316
Copy link
Author

I have checked and my signaling is correct. I am sure PeerConnection.LocalSdpReadytoSend is being fired twice for some reason.

@fibann
Copy link
Member

fibann commented Aug 4, 2020

We haven't observed this happening locally. Some things you can try to pinpoint the issue:

  • add a breakpoint to PeerConnection.LocalSdpReadytoSend, verify that it's actually called twice with an answer (and that CreateOffer is called just once), get the callstacks
  • run a debug build of MR-WebRTC on both hosts, get the WebRTC debug logs and look for something suspicious
  • make a minimal repro for us to investigate.

@astaikos316
Copy link
Author

Managed to find a code block that was sending messages twice. Issue resolved. Thank you for the help on this one.

@fibann fibann added invalid User error or by design and removed need info More information is needed from the author to answer labels Aug 5, 2020
@esengun
Copy link

esengun commented May 18, 2021

@astaikos316 I am having the same problem but could not find the code that was sending message twice. Could you tell which code block causes this problem? Thanks in advance.

@dhaminitinAltran
Copy link

Hi Having the same issue with Unity 2019.4.23 and the latest Hololens release any leads?

@esengun
Copy link

esengun commented May 21, 2021

I found the problem in my case which was setting peer ids at runtime after initializing the signaler object. I solved it by setting first peer ids and then enabling all webrtc objects. And also if you are trying to test on one pc, make sure that the peer ids are different.

@dhaminitinAltran
Copy link

dhaminitinAltran commented May 21, 2021

Hi @esengun
Thanks for your reply,

For anyone stuck in it while trying the webrtc sample.

particularly (Video Chat Demo Scene).
You need to first create a build locally and start it.

Then disable the Local media obj in the editor in the video scene then start the server.
play in the editor and then enter the editor's Local peer id in the build peer id click the Create offer and then you are good to go.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid User error or by design
Projects
None yet
Development

No branches or pull requests

4 participants