fishjam-dev / membrane_rtc_engine

Customizable Real-time Communication Engine/SFU library focused on WebRTC.
Apache License 2.0
141 stars 13 forks source link

[RTC-102] Fix screensharing freezes #225

Closed daniel-jodlos closed 1 year ago

daniel-jodlos commented 1 year ago

This PR should address screensharing freezes. They were caused by the browser's optimization to send only 1 FPS when streaming static content, which caused the Engine to detect the track as inactive and disable it. In this PR a fix is introduced, that changes the activity requirement: Previously, a track had to send less than 5 packets in one cycle. Now, to be considered inactive, it cannot send a single packet for 3 cycles.

QA

A typical meeting scenario works best here - in the room where simulcast is enabled, share some static content, eg. Jira, change the card and wait a few seconds. I think the type of screensharing makes a difference here - let's test both sharing the entire screen and a single Chrome tab. Previously, the track would have been disabled after around 5-7 seconds, after the fix it should remain active.

We also need to check if the disabled encoding is correctly detected by the server, which can be observed by disabling a layer that the other peer currently uses. The expected behavior is for another layer to be automatically selected after it is disabled. Please note that disabling of the encoding is currently broken on videoroom master, due to the FE bug, but a fix is available: https://github.com/membraneframework/membrane_videoroom/pull/86

codecov[bot] commented 1 year ago

Codecov Report

Merging #225 (abbacd9) into master (645859b) will decrease coverage by 0.15%. The diff coverage is 61.11%.

@@            Coverage Diff             @@
##           master     #225      +/-   ##
==========================================
- Coverage   56.65%   56.51%   -0.15%     
==========================================
  Files          35       35              
  Lines        1562     1573      +11     
==========================================
+ Hits          885      889       +4     
- Misses        677      684       +7     
Impacted Files Coverage Δ
...b/membrane_rtc_engine/endpoints/webrtc_endpoint.ex 0.00% <0.00%> (ø)
...ane_rtc_engine/endpoints/webrtc/variant_tracker.ex 90.90% <84.61%> (-9.10%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 645859b...abbacd9. Read the comment docs.