Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome to pion audio (opus) streaming not working #784

Closed
enobufs opened this issue Aug 13, 2019 · 4 comments
Closed

Chrome to pion audio (opus) streaming not working #784

enobufs opened this issue Aug 13, 2019 · 4 comments

Comments

@enobufs
Copy link
Member

enobufs commented Aug 13, 2019

Your environment.

  • Version: pion/[email protected] and current master (7f300)
  • Browser: Chrome version 76.0.3809.100 (Official Build) (64-bit)

What did you do?

Updated pion to v2.1.x (it used to work with the old pion ~v1)
See my webrtc-audio-streaming (branch: update-pion-to-v2.1)

  • Sener (answerer): Chrome browser
  • Receiver (offerer): Pion
  • The sender waits for signaling message
  • The receiver (pion) creates a peer connection and send SDP to the browser

What did you expect?

  • The sender sends Opus stream
  • The receiver receives Opus stream and plays it using oto library.

When the receiver is a browser, it works (with the same sender).

What happened?

ICE connection state changes to "Connected", but OnTrack() won't get called.

More than likely I am doing something wrong, but if anyone could give me some insight, that would be appreciated.

Here's some console logs:

LOG: 2019/08/13 00:32:02.574100 rtc: local SDP: v=0
o=- 914858406 1565681522 IN IP4 0.0.0.0
s=-
t=0 0
a=fingerprint:sha-256 C2:FC:D3:F3:75:0D:5E:64:FD:A8:4C:88:AD:63:0F:A5:F1:B4:EF:8F:F8:03:D2:A3:0A:46:FA:C4:76:08:6D:D8
a=group:BUNDLE 0
m=application 9 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
a=setup:actpass
a=mid:0
a=sendrecv
a=sctpmap:5000 webrtc-datachannel 1024
a=ice-ufrag:FdJcxuQwDmoDzMgv
a=ice-pwd:TXEqHwlGEkqYWczOzoeOdIrCGKcOmvlX
a=candidate:foundation 1 udp 2130706431 10.0.0.135 60240 typ host generation 0
a=candidate:foundation 2 udp 2130706431 10.0.0.135 60240 typ host generation 0
a=end-of-candidates
a=setup:actpass

LOG: 2019/08/13 00:32:02.574182 Signaling State has changed have-local-offer
LOG: 2019/08/13 00:32:03.231354 received remote description
LOG: 2019/08/13 00:32:03.231389 rtc: remote SDP: v=0
o=- 937235166013632755 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
a=msid-semantic: WMS
m=application 9 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
b=AS:30
a=ice-ufrag:q5QD
a=ice-pwd:xkl95wu4mLiGhUcU7MPi/eqo
a=ice-options:trickle
a=fingerprint:sha-256 BF:66:19:70:A0:87:14:42:DE:9D:73:7A:27:61:CA:CA:52:AA:66:44:C1:75:59:CE:8E:E1:1F:4B:E5:4D:E6:85
a=setup:active
a=mid:0
a=sctpmap:5000 webrtc-datachannel 1024

LOG: 2019/08/13 00:32:03.231519 Signaling State has changed stable
LOG: 2019/08/13 00:32:03.231540 Connection State has changed checking
LOG: 2019/08/13 00:32:03.231825 received remote candidate
LOG: 2019/08/13 00:32:03.231893 rtc: remote candidate: candidate:2876613781 1 udp 2113937151 6d8cff14-c958-4016-ac6e-b1e732c833e8.local 63139 typ host generation 0 ufrag q5QD network-cost 999
LOG: 2019/08/13 00:32:03.232374 received remote candidate
LOG: 2019/08/13 00:32:03.232397 rtc: remote candidate: candidate:1717310165 1 udp 2113939711 6a78376c-14e3-4b1d-aeae-e46c8448e84e.local 63140 typ host generation 0 ufrag q5QD network-cost 999
LOG: 2019/08/13 00:32:04.328450 Connection State has changed connected
@enobufs
Copy link
Member Author

enobufs commented Aug 13, 2019

@Sean-Der
I have made this suggested change but OnTrack handle still not get called.

Now the log looks more like it.. (made a progress).

LOG: 2019/08/13 01:08:08.167327 Create PeerConnection
LOG: 2019/08/13 01:08:08.177055 rtc: local SDP: v=0
o=- 69145903 1565683688 IN IP4 0.0.0.0
s=-
t=0 0
a=fingerprint:sha-256 87:CB:4D:54:E1:CC:E3:D2:44:71:6B:06:B8:84:E5:2A:DE:7B:35:0D:49:78:29:F4:5D:E2:7F:5F:E0:72:E3:43
a=group:BUNDLE 0 1
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 0.0.0.0
a=setup:actpass
a=mid:0
a=ice-ufrag:mvkkoZqqsmkwhQZO
a=ice-pwd:snlyuXvUScubIWtviWRkIyeuAaqFaICq
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10;useinbandfec=1;stereo=1
a=ssrc:281908850 cname:EPskTIaEMlZQdkJY
a=ssrc:281908850 msid:EPskTIaEMlZQdkJY rNqZHbXbsHNBCtiA
a=ssrc:281908850 mslabel:EPskTIaEMlZQdkJY
a=ssrc:281908850 label:rNqZHbXbsHNBCtiA
a=msid:EPskTIaEMlZQdkJY rNqZHbXbsHNBCtiA
a=sendrecv
a=candidate:foundation 1 udp 2130706431 10.0.0.135 61440 typ host generation 0
a=candidate:foundation 2 udp 2130706431 10.0.0.135 61440 typ host generation 0
a=end-of-candidates
a=setup:actpass
m=application 9 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
a=setup:actpass
a=mid:1
a=sendrecv
a=sctpmap:5000 webrtc-datachannel 1024
a=ice-ufrag:mvkkoZqqsmkwhQZO
a=ice-pwd:snlyuXvUScubIWtviWRkIyeuAaqFaICq
a=candidate:foundation 1 udp 2130706431 10.0.0.135 61440 typ host generation 0
a=candidate:foundation 2 udp 2130706431 10.0.0.135 61440 typ host generation 0
a=end-of-candidates
a=setup:actpass

LOG: 2019/08/13 01:08:08.177194 Signaling State has changed have-local-offer
LOG: 2019/08/13 01:08:08.185944 received remote description
LOG: 2019/08/13 01:08:08.186006 rtc: remote SDP: v=0
o=- 2932091870383311610 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0 1
a=msid-semantic: WMS 873af8da-0ada-47c9-a16c-7183f28782c8
m=audio 9 UDP/TLS/RTP/SAVPF 111
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:PxUW
a=ice-pwd:xJKJkooDcpyLlvP61dG7OuyL
a=ice-options:trickle
a=fingerprint:sha-256 A9:EB:8D:35:05:69:A8:3D:6C:38:7B:C6:3E:E7:88:32:10:0A:33:2B:B8:82:BE:E2:A6:D1:29:EB:CB:03:C3:57
a=setup:active
a=mid:0
a=sendrecv
a=msid:873af8da-0ada-47c9-a16c-7183f28782c8 a48b04de-4dd7-4648-a4e8-e3cc4cb01dbd
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=fmtp:111 minptime=10;useinbandfec=1
a=ssrc:3036742241 cname:91y9v5cmnZtWe5hZ
m=application 9 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
b=AS:30
a=ice-ufrag:PxUW
a=ice-pwd:xJKJkooDcpyLlvP61dG7OuyL
a=ice-options:trickle
a=fingerprint:sha-256 A9:EB:8D:35:05:69:A8:3D:6C:38:7B:C6:3E:E7:88:32:10:0A:33:2B:B8:82:BE:E2:A6:D1:29:EB:CB:03:C3:57
a=setup:active
a=mid:1
a=sctpmap:5000 webrtc-datachannel 1024

LOG: 2019/08/13 01:08:08.186278 Signaling State has changed stable
LOG: 2019/08/13 01:08:08.186552 Connection State has changed checking
LOG: 2019/08/13 01:08:09.200257 received remote candidate
LOG: 2019/08/13 01:08:09.200342 rtc: remote candidate: candidate:2876613781 1 udp 2113937151 6d8cff14-c958-4016-ac6e-b1e732c833e8.local 65188 typ host generation 0 ufrag PxUW network-cost 999
LOG: 2019/08/13 01:08:09.201650 received remote candidate
LOG: 2019/08/13 01:08:09.201692 rtc: remote candidate: candidate:1717310165 1 udp 2113939711 6a78376c-14e3-4b1d-aeae-e46c8448e84e.local 65189 typ host generation 0 ufrag PxUW network-cost 999
LOG: 2019/08/13 01:08:09.339872 Connection State has changed connected

@enobufs
Copy link
Member Author

enobufs commented Aug 13, 2019

Never mind. (sender was in weired state) Now it is working!! @Sean-Der
Thank you!

@tylerlong
Copy link

tylerlong commented Oct 17, 2019

@enobufs what is the root cause? I am having the same issue: "ICE connection state changes to "Connected", but OnTrack() won't get called."

I added the following and it still doesn't work:

if _, err = peerConnection.AddTransceiverFromKind(webrtc.RTPCodecTypeAudio); err != nil {
    panic(err)
}

@enobufs
Copy link
Member Author

enobufs commented Oct 17, 2019

The root cause was the fix mentioned above. My tool seems to work. It transfers opus stream from browser to browser or to pion. I wonder if this works for you... (the tool does not do pion to browser tho).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants