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

Black remote video in 6.0.x on reconnected to the session #444

Closed
CSantosM opened this issue Nov 11, 2019 · 10 comments
Closed

Black remote video in 6.0.x on reconnected to the session #444

CSantosM opened this issue Nov 11, 2019 · 10 comments
Assignees
Milestone

Comments

@CSantosM
Copy link
Contributor

Hello @hthetiot
I updated codova-plugin-iosrtc in OpenVidu (2.11.0) to last version but the behaviour is not the same.

With 5.0.6 version, all work as expected. However, using 6.0.3 version, something is broken.

Since 6.0.0 this issue is repeated.

Observerd behavior

The first time the userBrowser is connected works, when the userBrowser leave the session and rejoin, fails

Steps to reproduce the problem

The test I've made:

5.0.6:

  1. Ionic OpenVidu App is connected to the session (userApp).
  2. Chrome browser user is connected to the same session (userBrowser).
  3. userBrowser left and reconnected to the session.
  4. Other Chrome browser user is connected to the same session.

All users can be seen each other. All is working fine.

Test Video Link with 5.0.6

6.0.0:

  1. Ionic OpenVidu App is connected to the session (userApp).
  2. Chrome browser user is connected to the same session (userBrowser).
    The first time works
  3. userBrowser left and reconnected to the session.

Here, the userBrowser is appearing black in the app and whoever is connected to the session will appear black

userBrowser can see the userApp stream.

The first time the userBrowser is connected works, when the userBrowser leave the session and rejoin, fails

Test Video Link with 6.0.0

Platform information

  • Cordova version: cordova-ios: 5.0.1, cordova: 9.0.0
  • Plugin version: 5.0.6 - 6.0.3
  • iOS version: 12.4.1
  • Xcode version: macOS Catalina, Xcode 11.2
@hthetiot hthetiot self-assigned this Nov 11, 2019
@hthetiot hthetiot added the bug label Nov 11, 2019
@hthetiot hthetiot added this to the 6.0.x milestone Nov 11, 2019
@CSantosM
Copy link
Contributor Author

CSantosM commented Nov 11, 2019

I have discovered some Error logs that could help

Call[1755:572475] iosrtcPlugin#MediaStream_setListener()
CPeerConnection#setRemoteDescription() | success callback
2019-11-11 12:36:29.444336+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStreamTrack_setListener()
2019-11-11 12:36:29.444397+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStreamTrack_setListener() 
| ERROR: pluginMediaStreamTrack with id=ee971f28-d2cb-4c58-b389-a498f317b124 does not exist

2019-11-11 12:36:29.444486+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStreamTrack_setListener()
2019-11-11 12:36:29.444524+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStreamTrack_setListener() 
| ERROR: pluginMediaStreamTrack with id=add2f7f9-7a94-403f-bc0a-4cabb8bae2af does not exist

2019-11-11 12:36:29.449402+0100 OpenVidu Call[1755:572723] PluginRTCPeerConnection#addIceCandidate()
2019-11-11 12:36:29.454520+0100 OpenVidu Call[1755:572723] PluginRTCPeerConnection#addIceCandidate()
2019-11-11 12:36:29.455790+0100 OpenVidu Call[1755:572723] PluginRTCPeerConnection#addIceCandidate()
2019-11-11 12:36:29.457157+0100 OpenVidu Call[1755:572475] PluginMediaStream#init()
2019-11-11 12:36:29.457252+0100 OpenVidu Call[1755:572475] PluginMediaStream#run()
2019-11-11 12:36:29.457693+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStream_setListener()
2019-11-11 12:36:29.457868+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStream_addTrack()
2019-11-11 12:36:29.457921+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStream_addTrack()
 | ERROR: pluginMediaStreamTrack with id=ee971f28-d2cb-4c58-b389-a498f317b124 does not exist

2019-11-11 12:36:29.458034+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStream_addTrack()
2019-11-11 12:36:29.458084+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStream_addTrack() 
| ERROR: pluginMediaStreamTrack with id=add2f7f9-7a94-403f-bc0a-4cabb8bae2af does not exist

2019-11-11 12:36:29.458172+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStreamTrack_setEnabled()
2019-11-11 12:36:29.458214+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStreamTrack_setEnabled()
 | ERROR: pluginMediaStreamTrack with id=ee971f28-d2cb-4c58-b389-a498f317b124 does not exist

2019-11-11 12:36:29.458287+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStreamTrack_setEnabled()
2019-11-11 12:36:29.458325+0100 OpenVidu Call[1755:572475] iosrtcPlugin#MediaStreamTrack_setEnabled() 
| ERROR: pluginMediaStreamTrack with id=add2f7f9-7a94-403f-bc0a-4cabb8bae2af does not exist

2019-11-11 12:36:29.460346+0100 OpenVidu Call[1755:572723] PluginRTCPeerConnection#addIceCandidate()
2019-11-11 12:36:29.462004+0100 OpenVidu Call[1755:572723] PluginMediaStream#setListener()
2019-11-11 12:36:29.462149+0100 OpenVidu Call[1755:572723] PluginMediaStream#setListener()
2019-11-11 12:36:29.469542+0100 OpenVidu Call[1755:572475] user [object Object]
2019-11-11 12:36:29.491653+0100 OpenVidu Call[1755:572475] iosrtcPlugin#new_MediaStreamRenderer()
2019-11-11 12:36:29.491868+0100 OpenVidu Call[1755:572475] PluginMediaStreamRenderer#init()
2019-11-11 12:36:29.500197+0100 OpenVidu Call[1755:572475] PluginMediaStreamRenderer#run()
2019-11-11 12:36:29.500917+0100 OpenVidu Call[1755:572475] [LayoutConstraints] Unable to simultaneously satisfy constraints.
```

@oscarvadillog
Copy link

oscarvadillog commented Nov 12, 2019

Similar bug using Janus

2019-11-12 17:27:54.716115+0100 VideoApp[869:238634] iosrtc:RTCDataChannel onEvent() | [type:new, data:{"channel":{"id":-1,"readyState":"connecting","protocol":"","maxPacketLifeTime":65535,"ordered":false,"maxRetransmits":65535,"bufferedAmount":0,"negotiated":false},"type":"new"}] +54ms
2019-11-12 17:27:54.716263+0100 VideoApp[869:238634] iosrtc:RTCPeerConnection onEvent() | [type:signalingstatechange, data:{"signalingState":"have-remote-offer","type":"signalingstatechange"}] +13ms
2019-11-12 17:27:54.757566+0100 VideoApp[869:238634] iosrtc:RTCPeerConnection onEvent() | [type:addtrack, data:{"type":"addtrack","track":{"readyState":"live","id":"janusv0","kind":"video","enabled":true,"trackId":"janusv0"}}] +7ms
2019-11-12 17:27:54.757710+0100 VideoApp[869:238634] iosrtc:RTCPeerConnection onEvent() | [type:addstream, data:{"stream":{"id":"janus","audioTracks":{},"videoTracks":{"janusv0":{"readyState":"live","id":"janusv0","kind":"video","enabled":true,"trackId":"janusv0"}}},"type":"addstream"}] +1ms
2019-11-12 17:27:54.757782+0100 VideoApp[869:238634] iosrtc:MediaStream create() | [dataFromEvent:{"id":"janus","audioTracks":{},"videoTracks":{"janusv0":{"readyState":"live","id":"janusv0","kind":"video","enabled":true,"trackId":"janusv0"}}}] +18s
2019-11-12 17:27:54.757829+0100 VideoApp[869:238634] iosrtc:MediaStream new MediaStream(arg) | [arg:[]] +0ms
2019-11-12 17:27:54.757942+0100 VideoApp[869:238634] iosrtcPlugin#MediaStream_setListener()
2019-11-12 17:27:54.758107+0100 VideoApp[869:238634] iosrtc:MediaStreamTrack new() | [dataFromEvent:{"readyState":"live","id":"janusv0","kind":"video","enabled":true,"trackId":"janusv0"}] +18s
2019-11-12 17:27:54.758158+0100 VideoApp[869:239162] PluginMediaStream#setListener()
2019-11-12 17:27:54.758205+0100 VideoApp[869:238634] iosrtcPlugin#MediaStreamTrack_setListener()
2019-11-12 17:27:54.760015+0100 VideoApp[869:238634] iosrtcPlugin#MediaStreamTrack_setListener() | ERROR: pluginMediaStreamTrack with id=janusv0 does not exist
2019-11-12 17:27:54.760773+0100 VideoApp[869:238634] iosrtc:MediaStream getTracks() +1ms
2019-11-12 17:27:54.761100+0100 VideoApp[869:238634] iosrtc:MediaStream getTracks() +1ms

Testing PR #445 same error

@hthetiot hthetiot modified the milestones: 6.0.x, 6.0.4 Nov 18, 2019
@hthetiot hthetiot changed the title Black remote video in 6.0.3 Black remote video in 6.0.x on reconnected to the session Nov 18, 2019
@hthetiot
Copy link
Contributor

@CSantosM @oscarvadillog I don't reproduce the issue myself, I do close peerConnections and mediaStream before making a new call and I don't have issue with switch Camera on renegotiate. I somewhat think this is PR is more a workaround more than a fix as this previous MediaStream should be cleaned and therefore exiting MediaStream not overrided.

I think the real fix would be to find where MediaStream is not cleaned.

Can you confirm you use new peerConnections on new call
Can you confirm that the issue arise because you keep MediaStream for each call instead of using addTrack with new MediaStream ?
I'm willing to release this PR but we need to find why I do not reproduce at some point.

@hthetiot
Copy link
Contributor

Note: I need to use PeerConnection.Id +MediaStream.id to avoid MediaStream.id colision also i think it will also solve the issue for janus.

@CSantosM
Copy link
Contributor Author

Hello @hthetiot , you must cancel the PR because it don't solve this issue .

I've tried to fix it completely, however I was not able to do it. The issue is still reproducing with that "fix".

@hthetiot
Copy link
Contributor

hthetiot commented Nov 18, 2019

@CSantosM I'm working on fix, can you call cordova.plugins.iosrtc.dump() once you reproduce.

@hthetiot
Copy link
Contributor

hthetiot commented Nov 18, 2019

@CSantosM Check this one #447

@CSantosM
Copy link
Contributor Author

Ok @hthetiot

I have test the fixes on task/stream-track-uuid branch and the problem looks like solved.

I have not used cordova.plugins.iosrtc.dump() because I was not able to reproduce the issue.
Great update :)

@hthetiot
Copy link
Contributor

@CSantosM great news, thank you for testing again.

@hthetiot
Copy link
Contributor

merged #447 on master will test master then release 6.0.4

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

No branches or pull requests

3 participants