-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
PeerConnection OnTrack callback never invoked #880
Comments
Hey @tylerlong I think it could be a few different things
|
Please do, thanks. There are lots of legacy things in the world that we have to support. I cannot control the remote side so I cannot change its cipher but accept it. Thanks again. Before Pion support legacy ciphers, it should panic with error message: "unsupported cipher in remote SDP: 'sha-1'", otherwise as a developer I have no idea what happened. Just my two cents. Thanks. |
@tylerlong My guess is that if you turned on verbose debugging it probably threw an error message on fingerprint mismatch. Unfortunately we can't panic because we are a library :/ don't want to hurt other code is running. Would it be possible to get an account for ringcentral? Happy to debug, would love to get everything working this weekend! |
As my understanding, SSRC is optional. https://tools.ietf.org/id/draft-westerlund-mmusic-max-ssrc-00.html#rfc.section.1
It is not the use case for me. I don't need multiple media sources.
Above is my use case. |
If we receive an unknown SSRC and we have a single media section with no SSRCes declared fire an OnTrack with that stream Resolves #880
If we receive an unknown SSRC and we have a single media section with no SSRCes declared fire an OnTrack with that stream Resolves #880
If we receive an unknown SSRC and we have a single media section with no SSRCes declared fire an OnTrack with that stream Resolves #880
If we receive an unknown SSRC and we have a single media section with no SSRCes declared fire an OnTrack with that stream Resolves #880
Hey @tylerlong This is fixed! I am able to use the ringcentral softphone and save the PCM to disk! Unfortunately the oggwriter is hardcoded to support Opus only, if you are interested we could expand it to support PCM if that is helpful! |
@Sean-Der Thank you so much! That is fast! I don't know much about audio formats. But overall support more is a good idea. Let me have a try and get back to you. |
I tried the latest version github.com/pion/webrtc/v2 v2.1.9 and it still doesn't work for me PeerConnection OnTrack callback never invoked. But yesterday I tried it at home it worked. The different is yesterday I was trying it on Windows and today I am trying it on macOS. |
I added a test to assert it was working (and everything seems fine!) my guess would be there is another issue. Probably networking if you are in different environments, many office networks only work with TURN enabled etc..
|
I do see "OnICEConnectionStateChange connected" SDP:
|
I am going home to try it on my windows machine. Update you later. |
WindowsI tried it on my Windows a couple of times. And the conclusion is : sometimes it works while sometimes it doesn't. The same code, I run it multiple times and I got different result. weird. When it worked
Sample SDP when it worked
When it didn't work
then after around 30 seconds, I got:
Sample SDP when it didn't work
macOSMost of the time it fails.
In rare cases it succeeds:
|
Let me try on my end tonight! If you try on MacOS multiple times do you get similar results? If you can get a pcap comparing good/bad results that would be really helpful! Hopefully I can replace tonight and just fix the issue :) thanks @tylerlong |
No hurry. I will post more detail in my comment above. |
I did some debugging.
So the root cause is err = pc.dtlsTransport.Start(DTLSParameters{
Role: dtlsRole,
Fingerprints: []DTLSFingerprint{{Algorithm: fingerprintHash, Value: fingerprint}},
}) timeout |
If I debug into So it might has something to do with timing. If we delay the execution of |
I will work on reproducing! I am not sure why DTLS is timing out. Hopefully I can reproduce it on my home network. If you can use wireshark/tcpdump and get all |
@tylerlong do you see any errors server side? It sounds like we are causing an error by sending DTLS traffic too soon maybe? I will look at what happens when we delay DTLS vs when we don't |
Unfortunately I cannot see server side log. I don't maintain our server side code and I treat it as a black box when I created the Node.js softphone SDK. I've sent tcpdump file to you via email. |
https://github.com/pion/webrtc/blob/master/dtlstransport.go#L256: dtlsConn, err := dtls.Client(dtlsEndpoint, dtlsConfig) If I add breakpoint to this line and its next line and "Step Over" to next line, it always work If I add breakpoint to this line and its next line and "Resume Program" (no matter how long I wait before resume), it often doesn't work. So I think this might be a concurrency deadlock issue. "Step Over" is like single threaded, so it never deadlock. |
Looking at the pcap we keep DTLS traffic, but the other side never responds. We are running as the DTLS client (and we also are able to choose if we want to run as Client or Server). Let me get a PR that switches roles and we can see if that helps! Will be done tonight |
User can now control what DTLSRole the local client takes when answering via the SettingEngine. Relates to #880
User can now control what DTLSRole the local client takes when answering via the SettingEngine. Relates to #880
User can now control what DTLSRole the local client takes when answering via the SettingEngine. Relates to #880
User can now control what DTLSRole the local client takes when answering via the SettingEngine. Relates to #880
User can now control what DTLSRole the local client takes when answering via the SettingEngine. Relates to #880
User can now control what DTLSRole the local client takes when answering via the SettingEngine. Relates to #880
User can now control what DTLSRole the local client takes when answering via the SettingEngine. Relates to #880
@Sean-Der / @tylerlong I also noticed that without the stun, the Sip connection was a failure. I put the DTLS on the server (as suggested in the PR). |
I have VideoCall System developed through Ionic Cordova with PeerJS, it works properly on Android. for example: peer.on('stream') does not trigger at all, I used this plugin to handle the MediaStreams, but for some reasons, after the first video call it says MediaStream already exists, How i can I trigger some events if I get a call from peer, onstream, onremove, I tried to remove streams, tracks, and other stuff after ending video call, but it did not work. |
can you please either
thanks! |
Everytime we receieve a new SSRC we probe it and try to determine the proper way to handle it. In most cases a Track explicitly declares a SSRC and a OnTrack is fired. In two cases we don't know the SSRC ahead of time * Undeclared SSRC in a single media section (pion#880) * Simulcast The Undeclared SSRC processing code would run before Simulcast. If a Simulcast Offer/Answer only contained one Media Section we would never fire the OnTrack. We would assume it was a failed Undeclared SSRC processing. This commit fixes the behavior.
Everytime we receieve a new SSRC we probe it and try to determine the proper way to handle it. In most cases a Track explicitly declares a SSRC and a OnTrack is fired. In two cases we don't know the SSRC ahead of time * Undeclared SSRC in a single media section (pion#880) * Simulcast The Undeclared SSRC processing code would run before Simulcast. If a Simulcast Offer/Answer only contained one Media Section we would never fire the OnTrack. We would assume it was a failed Undeclared SSRC processing. This commit fixes the behavior.
Everytime we receieve a new SSRC we probe it and try to determine the proper way to handle it. In most cases a Track explicitly declares a SSRC and a OnTrack is fired. In two cases we don't know the SSRC ahead of time * Undeclared SSRC in a single media section (#880) * Simulcast The Undeclared SSRC processing code would run before Simulcast. If a Simulcast Offer/Answer only contained one Media Section we would never fire the OnTrack. We would assume it was a failed Undeclared SSRC processing. This commit fixes the behavior.
Everytime we receieve a new SSRC we probe it and try to determine the proper way to handle it. In most cases a Track explicitly declares a SSRC and a OnTrack is fired. In two cases we don't know the SSRC ahead of time * Undeclared SSRC in a single media section (pion/webrtc#880) * Simulcast The Undeclared SSRC processing code would run before Simulcast. If a Simulcast Offer/Answer only contained one Media Section we would never fire the OnTrack. We would assume it was a failed Undeclared SSRC processing. This commit fixes the behavior.
Your environment.
What did you do?
I have written the following code: https://github.com/ringcentral/ringcentral-softphone-go/blob/master/softphone.go#L137-L220
Just for your reference, here is the Node.js version of the GoLang code: https://github.com/ringcentral/ringcentral-softphone-js/blob/ce833c613d5e4bb959235e37addefd10cc9cb81e/index.js#L140-L177 . The Node.js code works like a charm.
What did you expect?
I expect that the
peerConnection.OnTrack
callback function will be invoked so that I can get the input audioWhat happened?
peerConnection.OnTrack
never invoked and I am stuck.Some questions:
Could it because I specify the wrong codec? If so, I expect some error message like: no codec to handle the remote track. remote SDP sample:
How can I port the Node.JS code to GoLang? Because I know Node.js version works like charm. And the code even works in browser (with browser WebRTC). So if pion/webrtc is compatible with browser WebRTC, I should be able to get this GoLang version work.
Could it becuase of this #879? I temporarily worked around the issue: https://github.com/ringcentral/ringcentral-softphone-go/blob/master/softphone.go#L133
The text was updated successfully, but these errors were encountered: