Mediasoup-demo not working with iceTransportPolicy relay

First of all kindly thanks for your great effort on mediasoup
I have an issue with mediasoup-demo and turn as following, any help is welcome

Your environment

  • Operating system: macOS
  • Node version: 12.19.0
  • npm version: 6.14.8
  • gcc/clang version: 12.0.0
  • mediasoup version: 3.6.25
  • mediasoup-client version: 3.6.21

Issue description

  • Tested using mediasoup-demo repo, also in our private mediasoup app
  • Without iceTransportPolicy, the demo work well
  • When using iceTransportPolicy relay to force using turn, the remote video is black/empty
  • With the same iceTransportPolicy and iceServers, raw webrtc implementation works well, so we have a conclusion that problem may come from mediasoup

Coturn /etc/turnserver.conf

listening-port=80
tls-listening-port=443
external-ip=PUBLIC/PRIVATE (AWS EC2 instance)

verbose

lt-cred-mech
user=usr:pwd
realm=myrealm

cert=/etc/letsencrypt/live/.../fullchain.pem
pkey=/etc/letsencrypt/live/.../privkey.pem

Event logs in chrome://webrtc-internals

Click to show
> setRemoteDescription
type: offer, sdp: v=0
o=mediasoup-client 10000 1 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-lite
a=fingerprint:sha-512 C5:F3:BB:CE:6E:9F:9A:47:39:39:47:AC:36:2C:17:B7:9B:FD:6A:00:6F:19:4C:14:44:23:75:8A:90:32:AE:9E:E5:FD:1E:DD:6B:8F:DB:0C:CE:C5:49:58:2F:83:D5:D1:F6:4D:D9:EC:B3:C8:4C:D3:FB:9A:79:E4:F7:91:C7:E1
a=msid-semantic: WMS *
a=group:BUNDLE 0
m=audio 7 UDP/TLS/RTP/SAVPF 100
c=IN IP4 127.0.0.1
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;useinbandfec=1;sprop-stereo=1;usedtx=1
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:10 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=setup:actpass
a=mid:0
a=msid:dl2Q6lRk3b6g49YI e7e99537-70f1-4a38-9ae4-d3ae9974bb7e
a=sendonly
a=ice-ufrag:mviaexjmpfkac2xu
a=ice-pwd:z4vjfisvug1ztbezst0o8jlg71ioegnw
a=candidate:tcpcandidate 1 tcp 1076302079 52.199.227.138 10069 typ host tcptype passive
a=end-of-candidates
a=ice-options:renomination
a=ssrc:285312805 cname:dl2Q6lRk3b6g49YI
a=rtcp-mux
a=rtcp-rsize

> transceiverAdded
Caused by: setRemoteDescription

getTransceivers()[0]:{
  mid:'0',
  sender:{
    track:null,
    streams:[],
  },
  receiver:{
    track:'e7e99537-70f1-4a38-9ae4-d3ae9974bb7e',
    streams:['dl2Q6lRk3b6g49YI'],
  },
  stopped:false,
  direction:'recvonly',
  currentDirection:null,
}

> signalingstatechange
have-remote-offer

> setRemoteDescriptionOnSuccess

> createAnswer
options: {, voiceActivityDetection: true}

> createAnswerOnSuccess
type: answer, sdp: v=0
o=- 8497393945815431537 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 100
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:tnFL
a=ice-pwd:2p2R7DjXWqW4Td8gQ4VI4I4H
a=ice-options:trickle
a=fingerprint:sha-256 15:A6:BC:DF:61:11:B3:79:76:56:2D:37:5C:16:27:51:CF:3A:BF:B6:B7:46:3E:B7:B4:84:AB:23:8A:F8:91:B4
a=setup:active
a=mid:0
a=extmap:10 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=recvonly
a=rtcp-mux
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;useinbandfec=1

> setLocalDescription (munged)
type: answer, sdp: v=0
o=- 8497393945815431537 2 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic:  WMS
a=group:BUNDLE 0
m=audio 9 UDP/TLS/RTP/SAVPF 100
c=IN IP4 0.0.0.0
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;useinbandfec=1;stereo=1
a=rtcp:9 IN IP4 0.0.0.0
a=extmap:10 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=setup:active
a=mid:0
a=recvonly
a=ice-ufrag:tnFL
a=ice-pwd:2p2R7DjXWqW4Td8gQ4VI4I4H
a=fingerprint:sha-256 15:A6:BC:DF:61:11:B3:79:76:56:2D:37:5C:16:27:51:CF:3A:BF:B6:B7:46:3E:B7:B4:84:AB:23:8A:F8:91:B4
a=ice-options:trickle
a=rtcp-mux

> transceiverModified
Caused by: setLocalDescription

getTransceivers()[0]:{
  mid:'0',
  sender:{
    track:null,
    streams:[],
  },
  receiver:{
    track:'e7e99537-70f1-4a38-9ae4-d3ae9974bb7e',
    streams:['dl2Q6lRk3b6g49YI'],
  },
  stopped:false,
  direction:'recvonly',
  currentDirection:'recvonly',
}

> signalingstatechange
stable

> setLocalDescriptionOnSuccess

> icegatheringstatechange
gathering

> icecandidateerror
url: stun:turn1.wrtc.work:80
address: [2405:4803:c80b:x:x:x:x:x]
port: 57746
host_candidate: [2405:4803:c80b:x:x:x:x:x]:57746
error_text: STUN host lookup received error.
error_code: 701

> setRemoteDescription
type: offer, sdp: v=0
o=mediasoup-client 10000 2 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-lite
a=fingerprint:sha-512 C5:F3:BB:CE:6E:9F:9A:47:39:39:47:AC:36:2C:17:B7:9B:FD:6A:00:6F:19:4C:14:44:23:75:8A:90:32:AE:9E:E5:FD:1E:DD:6B:8F:DB:0C:CE:C5:49:58:2F:83:D5:D1:F6:4D:D9:EC:B3:C8:4C:D3:FB:9A:79:E4:F7:91:C7:E1
a=msid-semantic: WMS *
a=group:BUNDLE 0 1
m=audio 7 UDP/TLS/RTP/SAVPF 100
c=IN IP4 127.0.0.1
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;useinbandfec=1;sprop-stereo=1;usedtx=1
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:10 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=setup:actpass
a=mid:0
a=msid:dl2Q6lRk3b6g49YI e7e99537-70f1-4a38-9ae4-d3ae9974bb7e
a=sendonly
a=ice-ufrag:mviaexjmpfkac2xu
a=ice-pwd:z4vjfisvug1ztbezst0o8jlg71ioegnw
a=candidate:tcpcandidate 1 tcp 1076302079 52.199.227.138 10069 typ host tcptype passive
a=end-of-candidates
a=ice-options:renomination
a=ssrc:285312805 cname:dl2Q6lRk3b6g49YI
a=rtcp-mux
a=rtcp-rsize
m=video 7 UDP/TLS/RTP/SAVPF 101 102
c=IN IP4 127.0.0.1
a=rtpmap:101 VP8/90000
a=rtpmap:102 rtx/90000
a=fmtp:102 apt=101
a=rtcp-fb:101 transport-cc
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:11 urn:3gpp:video-orientation
a=extmap:12 urn:ietf:params:rtp-hdrext:toffset
a=setup:actpass
a=mid:1
a=msid:dl2Q6lRk3b6g49YI 9364a39b-e85d-46c3-ba10-06f2ddd726c2
a=sendonly
a=ice-ufrag:mviaexjmpfkac2xu
a=ice-pwd:z4vjfisvug1ztbezst0o8jlg71ioegnw
a=candidate:tcpcandidate 1 tcp 1076302079 52.199.227.138 10069 typ host tcptype passive
a=end-of-candidates
a=ice-options:renomination
a=ssrc:114812765 cname:dl2Q6lRk3b6g49YI
a=ssrc:344378482 cname:dl2Q6lRk3b6g49YI
a=ssrc-group:FID 114812765 344378482
a=rtcp-mux
a=rtcp-rsize

> transceiverAdded
Caused by: setRemoteDescription

getTransceivers()[1]:{
  mid:'1',
  sender:{
    track:null,
    streams:[],
  },
  receiver:{
    track:'9364a39b-e85d-46c3-ba10-06f2ddd726c2',
    streams:['dl2Q6lRk3b6g49YI'],
  },
  stopped:false,
  direction:'recvonly',
  currentDirection:null,
}

> signalingstatechange
have-remote-offer

> setRemoteDescriptionOnSuccess

> icecandidateerror
url: turn:turn1.wrtc.work:80?transport=udp
address: [2405:4803:c80b:x:x:x:x:x]
port: 57746
host_candidate: [2405:4803:c80b:x:x:x:x:x]:57746
error_text: TURN host lookup received error.
error_code: 701

> createAnswer
options: {, voiceActivityDetection: true}

> createAnswerOnSuccess
type: answer, sdp: v=0
o=- 8497393945815431537 3 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 100
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:tnFL
a=ice-pwd:2p2R7DjXWqW4Td8gQ4VI4I4H
a=ice-options:trickle
a=fingerprint:sha-256 15:A6:BC:DF:61:11:B3:79:76:56:2D:37:5C:16:27:51:CF:3A:BF:B6:B7:46:3E:B7:B4:84:AB:23:8A:F8:91:B4
a=setup:active
a=mid:0
a=extmap:10 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=recvonly
a=rtcp-mux
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;stereo=1;useinbandfec=1
m=video 9 UDP/TLS/RTP/SAVPF 101 102
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:tnFL
a=ice-pwd:2p2R7DjXWqW4Td8gQ4VI4I4H
a=ice-options:trickle
a=fingerprint:sha-256 15:A6:BC:DF:61:11:B3:79:76:56:2D:37:5C:16:27:51:CF:3A:BF:B6:B7:46:3E:B7:B4:84:AB:23:8A:F8:91:B4
a=setup:active
a=mid:1
a=extmap:12 urn:ietf:params:rtp-hdrext:toffset
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:11 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:101 VP8/90000
a=rtcp-fb:101 transport-cc
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=rtpmap:102 rtx/90000
a=fmtp:102 apt=101

> setLocalDescription (munged)
type: answer, sdp: v=0
o=- 8497393945815431537 3 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic:  WMS
a=group:BUNDLE 0 1
m=audio 9 UDP/TLS/RTP/SAVPF 100
c=IN IP4 0.0.0.0
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;stereo=1;useinbandfec=1
a=rtcp:9 IN IP4 0.0.0.0
a=extmap:10 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=setup:active
a=mid:0
a=recvonly
a=ice-ufrag:tnFL
a=ice-pwd:2p2R7DjXWqW4Td8gQ4VI4I4H
a=fingerprint:sha-256 15:A6:BC:DF:61:11:B3:79:76:56:2D:37:5C:16:27:51:CF:3A:BF:B6:B7:46:3E:B7:B4:84:AB:23:8A:F8:91:B4
a=ice-options:trickle
a=rtcp-mux
m=video 9 UDP/TLS/RTP/SAVPF 101 102
c=IN IP4 0.0.0.0
a=rtpmap:101 VP8/90000
a=rtpmap:102 rtx/90000
a=fmtp:102 apt=101
a=rtcp:9 IN IP4 0.0.0.0
a=rtcp-fb:101 transport-cc
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=extmap:12 urn:ietf:params:rtp-hdrext:toffset
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:11 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=setup:active
a=mid:1
a=recvonly
a=ice-ufrag:tnFL
a=ice-pwd:2p2R7DjXWqW4Td8gQ4VI4I4H
a=fingerprint:sha-256 15:A6:BC:DF:61:11:B3:79:76:56:2D:37:5C:16:27:51:CF:3A:BF:B6:B7:46:3E:B7:B4:84:AB:23:8A:F8:91:B4
a=ice-options:trickle
a=rtcp-mux
a=rtcp-rsize

> transceiverModified
Caused by: setLocalDescription

getTransceivers()[1]:{
  mid:'1',
  sender:{
    track:null,
    streams:[],
  },
  receiver:{
    track:'9364a39b-e85d-46c3-ba10-06f2ddd726c2',
    streams:['dl2Q6lRk3b6g49YI'],
  },
  stopped:false,
  direction:'recvonly',
  currentDirection:'recvonly',
}

> signalingstatechange
stable

> setLocalDescriptionOnSuccess

> setRemoteDescription
type: offer, sdp: v=0
o=mediasoup-client 10000 3 IN IP4 0.0.0.0
s=-
t=0 0
a=ice-lite
a=fingerprint:sha-512 C5:F3:BB:CE:6E:9F:9A:47:39:39:47:AC:36:2C:17:B7:9B:FD:6A:00:6F:19:4C:14:44:23:75:8A:90:32:AE:9E:E5:FD:1E:DD:6B:8F:DB:0C:CE:C5:49:58:2F:83:D5:D1:F6:4D:D9:EC:B3:C8:4C:D3:FB:9A:79:E4:F7:91:C7:E1
a=msid-semantic: WMS *
a=group:BUNDLE 0 1 probator
m=audio 7 UDP/TLS/RTP/SAVPF 100
c=IN IP4 127.0.0.1
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;useinbandfec=1;sprop-stereo=1;usedtx=1
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:10 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=setup:actpass
a=mid:0
a=msid:dl2Q6lRk3b6g49YI e7e99537-70f1-4a38-9ae4-d3ae9974bb7e
a=sendonly
a=ice-ufrag:mviaexjmpfkac2xu
a=ice-pwd:z4vjfisvug1ztbezst0o8jlg71ioegnw
a=candidate:tcpcandidate 1 tcp 1076302079 52.199.227.138 10069 typ host tcptype passive
a=end-of-candidates
a=ice-options:renomination
a=ssrc:285312805 cname:dl2Q6lRk3b6g49YI
a=rtcp-mux
a=rtcp-rsize
m=video 7 UDP/TLS/RTP/SAVPF 101 102
c=IN IP4 127.0.0.1
a=rtpmap:101 VP8/90000
a=rtpmap:102 rtx/90000
a=fmtp:102 apt=101
a=rtcp-fb:101 transport-cc
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:11 urn:3gpp:video-orientation
a=extmap:12 urn:ietf:params:rtp-hdrext:toffset
a=setup:actpass
a=mid:1
a=msid:dl2Q6lRk3b6g49YI 9364a39b-e85d-46c3-ba10-06f2ddd726c2
a=sendonly
a=ice-ufrag:mviaexjmpfkac2xu
a=ice-pwd:z4vjfisvug1ztbezst0o8jlg71ioegnw
a=candidate:tcpcandidate 1 tcp 1076302079 52.199.227.138 10069 typ host tcptype passive
a=end-of-candidates
a=ice-options:renomination
a=ssrc:114812765 cname:dl2Q6lRk3b6g49YI
a=ssrc:344378482 cname:dl2Q6lRk3b6g49YI
a=ssrc-group:FID 114812765 344378482
a=rtcp-mux
a=rtcp-rsize
m=video 7 UDP/TLS/RTP/SAVPF 127
c=IN IP4 127.0.0.1
a=rtpmap:127 VP8/90000
a=rtcp-fb:127 transport-cc
a=rtcp-fb:127 ccm fir
a=rtcp-fb:127 nack
a=rtcp-fb:127 nack pli
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:11 urn:3gpp:video-orientation
a=extmap:12 urn:ietf:params:rtp-hdrext:toffset
a=setup:actpass
a=mid:probator
a=msid:probator probator
a=sendonly
a=ice-ufrag:mviaexjmpfkac2xu
a=ice-pwd:z4vjfisvug1ztbezst0o8jlg71ioegnw
a=candidate:tcpcandidate 1 tcp 1076302079 52.199.227.138 10069 typ host tcptype passive
a=end-of-candidates
a=ice-options:renomination
a=ssrc:1234 cname:probator
a=rtcp-mux
a=rtcp-rsize

> transceiverAdded
Caused by: setRemoteDescription

getTransceivers()[2]:{
  mid:'probator',
  sender:{
    track:null,
    streams:[],
  },
  receiver:{
    track:'probator',
    streams:['probator'],
  },
  stopped:false,
  direction:'recvonly',
  currentDirection:null,
}

> signalingstatechange
have-remote-offer

> setRemoteDescriptionOnSuccess

> createAnswer
options: {, voiceActivityDetection: true}

> createAnswerOnSuccess
type: answer, sdp: v=0
o=- 8497393945815431537 4 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1 probator
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 100
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:tnFL
a=ice-pwd:2p2R7DjXWqW4Td8gQ4VI4I4H
a=ice-options:trickle
a=fingerprint:sha-256 15:A6:BC:DF:61:11:B3:79:76:56:2D:37:5C:16:27:51:CF:3A:BF:B6:B7:46:3E:B7:B4:84:AB:23:8A:F8:91:B4
a=setup:active
a=mid:0
a=extmap:10 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=recvonly
a=rtcp-mux
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;stereo=1;useinbandfec=1
m=video 9 UDP/TLS/RTP/SAVPF 101 102
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:tnFL
a=ice-pwd:2p2R7DjXWqW4Td8gQ4VI4I4H
a=ice-options:trickle
a=fingerprint:sha-256 15:A6:BC:DF:61:11:B3:79:76:56:2D:37:5C:16:27:51:CF:3A:BF:B6:B7:46:3E:B7:B4:84:AB:23:8A:F8:91:B4
a=setup:active
a=mid:1
a=extmap:12 urn:ietf:params:rtp-hdrext:toffset
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:11 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:101 VP8/90000
a=rtcp-fb:101 transport-cc
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=rtpmap:102 rtx/90000
a=fmtp:102 apt=101
m=video 9 UDP/TLS/RTP/SAVPF 127
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:tnFL
a=ice-pwd:2p2R7DjXWqW4Td8gQ4VI4I4H
a=ice-options:trickle
a=fingerprint:sha-256 15:A6:BC:DF:61:11:B3:79:76:56:2D:37:5C:16:27:51:CF:3A:BF:B6:B7:46:3E:B7:B4:84:AB:23:8A:F8:91:B4
a=setup:active
a=mid:probator
a=extmap:12 urn:ietf:params:rtp-hdrext:toffset
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:11 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:127 VP8/90000
a=rtcp-fb:127 transport-cc
a=rtcp-fb:127 ccm fir
a=rtcp-fb:127 nack
a=rtcp-fb:127 nack pli

> setLocalDescription (munged)
type: answer, sdp: v=0
o=- 8497393945815431537 4 IN IP4 127.0.0.1
s=-
t=0 0
a=msid-semantic:  WMS
a=group:BUNDLE 0 1 probator
m=audio 9 UDP/TLS/RTP/SAVPF 100
c=IN IP4 0.0.0.0
a=rtpmap:100 opus/48000/2
a=fmtp:100 minptime=10;stereo=1;useinbandfec=1
a=rtcp:9 IN IP4 0.0.0.0
a=extmap:10 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=setup:active
a=mid:0
a=recvonly
a=ice-ufrag:tnFL
a=ice-pwd:2p2R7DjXWqW4Td8gQ4VI4I4H
a=fingerprint:sha-256 15:A6:BC:DF:61:11:B3:79:76:56:2D:37:5C:16:27:51:CF:3A:BF:B6:B7:46:3E:B7:B4:84:AB:23:8A:F8:91:B4
a=ice-options:trickle
a=rtcp-mux
m=video 9 UDP/TLS/RTP/SAVPF 101 102
c=IN IP4 0.0.0.0
a=rtpmap:101 VP8/90000
a=rtpmap:102 rtx/90000
a=fmtp:102 apt=101
a=rtcp:9 IN IP4 0.0.0.0
a=rtcp-fb:101 transport-cc
a=rtcp-fb:101 ccm fir
a=rtcp-fb:101 nack
a=rtcp-fb:101 nack pli
a=extmap:12 urn:ietf:params:rtp-hdrext:toffset
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:11 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=setup:active
a=mid:1
a=recvonly
a=ice-ufrag:tnFL
a=ice-pwd:2p2R7DjXWqW4Td8gQ4VI4I4H
a=fingerprint:sha-256 15:A6:BC:DF:61:11:B3:79:76:56:2D:37:5C:16:27:51:CF:3A:BF:B6:B7:46:3E:B7:B4:84:AB:23:8A:F8:91:B4
a=ice-options:trickle
a=rtcp-mux
a=rtcp-rsize
m=video 9 UDP/TLS/RTP/SAVPF 127
c=IN IP4 0.0.0.0
a=rtpmap:127 VP8/90000
a=rtcp:9 IN IP4 0.0.0.0
a=rtcp-fb:127 transport-cc
a=rtcp-fb:127 ccm fir
a=rtcp-fb:127 nack
a=rtcp-fb:127 nack pli
a=extmap:12 urn:ietf:params:rtp-hdrext:toffset
a=extmap:4 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:11 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:1 urn:ietf:params:rtp-hdrext:sdes:mid
a=setup:active
a=mid:probator
a=recvonly
a=ice-ufrag:tnFL
a=ice-pwd:2p2R7DjXWqW4Td8gQ4VI4I4H
a=fingerprint:sha-256 15:A6:BC:DF:61:11:B3:79:76:56:2D:37:5C:16:27:51:CF:3A:BF:B6:B7:46:3E:B7:B4:84:AB:23:8A:F8:91:B4
a=ice-options:trickle
a=rtcp-mux
a=rtcp-rsize

> transceiverModified
Caused by: setLocalDescription

getTransceivers()[2]:{
  mid:'probator',
  sender:{
    track:null,
    streams:[],
  },
  receiver:{
    track:'probator',
    streams:['probator'],
  },
  stopped:false,
  direction:'recvonly',
  currentDirection:'recvonly',
}

> signalingstatechange
stable

> setLocalDescriptionOnSuccess

> icecandidate (relay)
sdpMid: 0, sdpMLineIndex: 0, candidate: candidate:3180445958 1 udp 41820159 54.199.104.2 53944 typ relay raddr 0.0.0.0 rport 0 generation 0 ufrag tnFL network-id 1 network-cost 10

> icecandidate (relay)
sdpMid: 0, sdpMLineIndex: 0, candidate: candidate:3984814211 1 udp 8265471 54.199.104.2 63538 typ relay raddr 0.0.0.0 rport 0 generation 0 ufrag tnFL network-id 1 network-cost 10

> icecandidateerror
url: turns:turn1.wrtc.work:443?transport=tcp
host_candidate: :0
error_text: TURN host lookup received error.
error_code: 701

> icegatheringstatechange
complete

You may have an IP routing problem between client and TURN server or between TURN and mediasoup server.

Hi, I have tested as following:

  • I create a raw webrtc with simple socket io, run on my local machine with iceServers and iceTransportPolicy to force using turn, that raw webrtc demo work well (I always look at the chrome://webrtc-internals to see and confirm the relay candidate). So I guess connection between turn server and my local machine is OK.
  • For mediasoup-demo I clone the repo, then modify transport config with the same above config, then run on my local machine. But couldnt see the remote video.

So as you suggest there may be an issue routing, but sadly I dont know how to debug and findout the solution. Could change the port range of mediasoup help it?

Please don’t try random things. Ensure that the listen and/or announced IP in the mediasoup WevRtcTransport can talk to the IP that TURN uses for relaying. There is a setting for that in the TURN server.

And instead of “video is not shown” please focus on transport.connectionState in mediasoup-client and transport.iceState in server side. There are also events for them.

I hope this will help. O cannot help much more.

Thanks for your great support, we have figured out the root cause. One of our engineer set forceTcp=true in the code and it cause the demo failed with turn relay.

After remove it, issue resolved.