[1.4.1] Fix missing TWCC feedback for audio-only publishers
What version of Janus is this happening on?
Janus v1.4.1, upstream commit [85304a7a4bdb2719583ad53ae04130a8273dba6a](https://github.com/meetecho/janus-gateway/commit/85304a7a4bdb2719583ad53ae04130a8273dba6a).
Reproduced without the patch and tested the fix against the same version.
Have you tested a more recent version of Janus too?
No. Testing has focused on our pinned v1.4.1 build. I did do a scan through prior versions and main and the issue appears to be there as well.
Was this working before?
As before I have only tested on v1.4.1. We observed this after enabling TWCC in our client. I have not done any regression testing between Janus versions.
Is there a gdb or libasan trace of the issue?
No crash/trace. I did do a test on the patched feedback callback. It passed AddressSanitizer and UndefinedBehaviorSanitizer checks.
Additional context
Our GStreamer client publishes through VideoRoom with TWCC negotiated. We add and remove tracks through renegotiation, reusing existing SDP m-lines. During audio-only publishing, including after removing video while keeping the microphone active, TWCC feedback stops despite audio RTP continuing. Feedback resumes in bursts when video is added through renegotiation.
In our tests, rtpgccbwe then drops its estimate to our configured bitrate floor reducing initial video quality. Its gradual bitrate increase makes recovery slow. With this patch, feedback continues during audio-only publishing, and video resumes normally reaching our bitrate ceiling in ~2 seconds instead of ~20 seconds.
The TWCC callback currently only looks for a receiving video track. This patch still prefers video, but falls back to a receiving audio track when no suitable video track is available. The RTCP feedback uses the selected tracks SSRCs, m-line index, and audio/video flag.
Before the patch, we observed audio-only feedback gaps of approximately 17–21 seconds. Afterward, feedback arrived continuously every 199–206 ms, matching the configured 200 ms interval.
Source: meetecho/janus-gateway