Hi,
Yes, publish/unpublish in my nomenclature means creating and closing of producer on the client side plus the signaling to the server (and remotes).
I can’t find any issue in my signaling, I mean messages between client and server are correct (producer ids match). I just see one possible race condition with the consumer : the remote could consume “between” the producer creation and its closure, but this case is handled in my code (the consumer is directly closed instead of resumed).
The strange part is not really on consumer but directly on the producer (and browser), as said before the producer of track 2 triggers score events which contains ssrcs of the producer 1. Also in webrtc-internals, when the problem occur, I dont see the remote-inbound-rtp (outbound-rtp exists) of the producer 2. So it seems the server does not “receive” the tracks. (the local and remote offer seem correct : mid match and a:simulcast is correct, no ssrc in the sdp but I think it’s normal)
See the logs of producers scores (producer 1 (closed): 0bf2677b-215d-4c4a-ad76-f91008558c5e, producer 2: 921ce2f7-ca00-47b2-a175-b199b39cd9b9) :
"producerId": "0bf2677b-215d-4c4a-ad76-f91008558c5e",
"score": [
{
"encodingIdx": 0,
"ssrc": 953422320,
"rid": "r0",
"score": 10
},
{
"encodingIdx": 1,
"ssrc": 843441212,
"rid": "r1",
"score": 10
},
{
"encodingIdx": 2,
"ssrc": 1418984211,
"rid": "r2",
"score": 10
}
],
"producerMid": "4"
"producerId": "921ce2f7-ca00-47b2-a175-b199b39cd9b9",
"score": [
{
"encodingIdx": 0,
"ssrc": 953422320,
"rid": "r0",
"score": 10
},
{
"encodingIdx": 1,
"ssrc": 843441212,
"rid": "r1",
"score": 10
},
{
"encodingIdx": 2,
"ssrc": 1418984211,
"rid": "r2",
"score": 10
}
],
"producerMid": "5"
In my tests, I’ve tried to delay the consumption of the remote, it doesn’t fix the issue. But if I delay the close of the producer, then the problem disappears.
Btw, I’ve seen that creating and closing of producers is sequential using the awaitqueue, but the close message to server does not depend on awaitqueue, so in general the producer is closed before on the server and after on client (because the client waits the end of producer 2 creation).