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

mid reuse will cause the new track state ended in Chrome #1343

Closed
cedricfung opened this issue Jul 22, 2020 · 7 comments
Closed

mid reuse will cause the new track state ended in Chrome #1343

cedricfung opened this issue Jul 22, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@cedricfung
Copy link
Contributor

cedricfung commented Jul 22, 2020

Your environment.

  • Version: v3 master
  • Browser: Chrome 84 on Ubuntu

What did you do?

With kraken.fm (https://vec.io/posts/deploy-a-group-audio-conferencing-service), A and B in the room, if A leaves and joins again, there will be no audio wave for A on B's Chrome. If A leaves and C joins, there will also no audio wave for C on B's chrome.

However, A and C's audio could be heard by B, then I inspected the MediaStreamTrack, and found its state is 'ended'.

It may be that the mid reuse causes Chrome to treat the tracks ended?

What did you expect?

What happened?

Related code flow

  1. A Chrome publish to pion
  2. B Chrome publish to pion
  3. Pion publish all streams to B
  4. A leave
  5. Pion RemoveTrack(oldA) and publish to B
  6. B Chrome get onmute and onended event for the old A track
  7. A join
  8. Pion AddTrack(newA) and publish to B
  9. B Chrome get ontrack but readyState: "ended"
@cedricfung
Copy link
Contributor Author

We have discussed this previously @jeremija

@jeremija
Copy link
Member

Hey thanks for writing this up. I'm surprised I didn't run into this in Peer Calls, although I do most of my testing in Firefox. I'll see if I can reproduce.

@jeremija
Copy link
Member

I'm unable to reproduce this in Peer Calls and on Kraken.fm in latest Chrome. I assume you have a different version running on Kraken.fm?

I'm curious to see if you are able to reproduce your issue here https://peercalls.com

I've been trying to run your Kraken.fm project locally for the past hour, but I couldn't get it to work and I don't have any more time. Do you think you could create a short example that reproduces your issue?

@cedricfung
Copy link
Contributor Author

The online kraken uses an old version of pion. To test this you may try to build kraken engine and the web in your local environment.

s4y added a commit to s4y/space that referenced this issue Aug 5, 2020
Avoid reusing transceivers to work around pion/webrtc#1343
@tarrencev tarrencev added the bug Something isn't working label Sep 15, 2020
@tarrencev
Copy link
Contributor

@cedricfung i wonder if this is related to #1414?

I wasn't able to reproduce. Could you check again?

@cedricfung
Copy link
Contributor Author

@tarrencev The issue is still there. I just update the https://github.com/MixinNetwork/kraken.fm development guide.

To reproduce it

  1. Get the kraken server code https://github.com/MixinNetwork/kraken, modify go.mod to use the official pion master instead of my fork.
  2. Use the default config/engine.example.toml, and modify the engine.interface to your network interface name.
  3. go build and start the engine ./kraken -c config/engine.toml
  4. In both Firefox and Chrome, open a room http://localhost:8000/?room=pion-master
  5. When both of them connected to each other, there should be visualizations in both browsers.
  6. Refresh the page in Chrome, wait about 5 seconds, the visualization in Firefox is still there.
  7. Refresh the page in Firefox, the visualization in Chrome stops.

@cedricfung
Copy link
Contributor Author

I can confirm v3.1.0-beta.3 has resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

4 participants