Skip to content

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

Closed

Description

@cedricfung

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"

Activity

  1. cedricfung commented on Jul 22, 2020

    @cedricfung
    ContributorAuthor

    We have discussed this previously @jeremija

  2. jeremija commented on Jul 22, 2020

    @jeremija
    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.

  3. jeremija commented on Jul 23, 2020

    @jeremija
    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?

  4. cedricfung commented on Jul 23, 2020

    @cedricfung
    ContributorAuthor

    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.

  5. tarrencev commented on Sep 15, 2020

    @tarrencev
    Contributor

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

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

  6. cedricfung commented on Sep 16, 2020

    @cedricfung
    ContributorAuthor

    @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.
  7. added this to the milestone on Aug 28, 2021
  8. cedricfung commented on Aug 29, 2021

    @cedricfung
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址