I observe a rare issue when RTP timestamps of one of the tracks are way off comparing to other tracks, see this example with timestamps of 11 tracks over WebRTC connection:
Those are in nanoseconds, but you can clearly see where the outlier is.
Those cause all kinds of issues in GStreamer application when trying to synchronize those tracks so I’m wondering if this is an expected behavior (doesn’t look like it) or there might be some bug in mediasoup (like integer overflow somewhere) that might cause this? There is always a chance that this is not a mediasoup bug, but it looks very suspicious to me considering that other tracks are fine.
I have no reproducible demo for this, but the issue does definitely happen in production and I can add some instrumentation if needed.
It is only happening in production with a very small number of cases.
My observation is that this only happens after renegotiation with newly added tracks, I haven’t see this happening to tracks added earlier in the middle of the way.
Maybe I can put some instrumentation in the worker code to log useful info? I’m still not as familiar with code base to figure out where to place it exactly. Something like logging some timestamps of all consumers on a transport once new consumer is added and resumed.
Maybe I can put some instrumentation in the worker code to log useful info
Not needed in this case after all. We use SimpleConsumer for audio, and there we don’t touch the RTP timestamp . So that timestamp already comes that way from the endpoint.
Correct me if I’m wrong, but every endpoint should choose random initial RTP timestamp, but when someone consumes multiple tracks over the same WebRTC connection, those should be in the same relative time domain, am I right?
Nope. Each RTP stream has its own super random timestamp origin. When sending (or receiving) N tracks from same media source (same peer basically) the RTP absolute timestamp in the RTCP Sender Reports of each RTP stream are also random values but they must be incremented following the same source clock. We deal with that in SimulcastConsumer.cpp (for creating a single and continuos stream for the consumer when it switched from one stream to another).