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

Unsubscribe from publisher's datachannel disables all subscribed data channels, can't resubscribe #2755

Closed
kaqq opened this issue Aug 10, 2021 · 3 comments

Comments

@kaqq
Copy link

kaqq commented Aug 10, 2021

Working scenario:

  1. Subscribe to a single publisher's video and data channels.
  2. Unsubscribe from data channel by sending:
    "body": { "streams": [ { "feed": 8532500667596649, "mid": "1" } ], "request": "unsubscribe"
  3. we are not receiving data channel messages
  4. subscribe to data channel again.
  5. data channel messages start flowing.

Not working scenario:
1.subscribe to many publisher's video and data channels.
2. Unsubscribe from one of subscribed publishers by sending:
"body": { "streams": [ { "feed": 8532500667596649, "mid": "1" } ], "request": "unsubscribe"
result:
3. We are not receiving any data channel messages from any publisher.
4. subscribe to data channel again not working, messages are not flowing.
expected:
3. We are not receiving data channel messages from this publisher, however, the rest of them are working
4. subscribe to data channel again enables messages from this publisher.

tested on latest multistream: f976215
Worth mentioning that after triggering any SDP change for the subscriber (even unsubscribe from video) datachannel is fixed.

@atoppi
Copy link
Member

atoppi commented Aug 25, 2021

I can reproduce the issue.
Janus log

[Wed Aug 25 12:35:32 2021] Removing subscriber streams
[Wed Aug 25 12:35:32 2021] No unsubscription done, skipping renegotiation

Then the subscriber can not receive any message from any publisher.

@atoppi atoppi added the bug label Aug 25, 2021
@atoppi
Copy link
Member

atoppi commented Aug 25, 2021

@kaqq try commenting this line and building janus again

g_atomic_int_set(&s->ready, 0);

It seems to solve the issue for me.
Please also make sure that everything else works as expected.

@lminiero
Copy link
Member

lminiero commented Sep 3, 2021

Yes, that line definitely needs to be removed: it's already in the code that handles the removal of the streams in the following lines, when a subscription becomes completely empty, which is the only place where it should be. In fact, ready is set back to 1 if subsequent renegotiations add media again.

I'll have to check if the ready=1 thing is done when re-subscribing to datachannels as well, though, as IIRC it currently checks the media direction, which doesn't change for datachannels.

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