fix: Resolve minimum_fps_target related issues on all platforms#4967
fix: Resolve minimum_fps_target related issues on all platforms#4967psyke83 wants to merge 2 commits intoLizardByte:masterfrom
Conversation
…Byte#4839)" This reverts commit 99d4e05.
3a84519 to
3bac8e3
Compare
|
The basic issue that this PR aims to solve is framerate violations that occur when frame processing latency is a bit higher than usual. This can happen with any capture method, but a solid Linux testcase that can be replicated for the issue against master is the following:
Result on master:
Results with PR:
Requesting a test from @andygrundman and @oryschakj-personal if it's not too much trouble. @ReenigneArcher I've also added two additional commits. One implements snapshot timeout + duplicate filtering on kmsgrab, and the other reverts the portalgrab workaround related to the same issue that this PR should hopefully solve. If you want we can split these into separate PRs, but I think it's helpful to test all three changes together as a first step. |
Bundle ReportBundle size has no change ✅ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4967 +/- ##
==========================================
- Coverage 18.20% 18.17% -0.03%
==========================================
Files 108 108
Lines 23409 23409
Branches 10330 10331 +1
==========================================
- Hits 4261 4254 -7
- Misses 14152 14917 +765
+ Partials 4996 4238 -758
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 28 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Resolves stream framerate violations by avoiding insertion of a single duplicate frame immediately after encoding a real frame, thus giving the platform capture thread some breathing room if frame processing time runs longer than usual.
3bac8e3 to
48e6847
Compare
|
I've backed out the kmsgrab duplicate detection change as it was triggering some false timeouts. I'll check if that can be fixed later and send in a separate PR if so. The testcase and fix I described for kmsgrab still applies to this PR in its current state, however. I'm still testing this PR with portalgrab to make 100% sure that it solves the issue of runaway framerate bursting; it's more difficult to reproduce consistently, so it may take some time to see if there's a regression. |
|
|
I got the build installed (48e6847) but can't get either VA-API or Vulkan running on my 5090. Is the fix still applicable to nvenc? |
Yes. You can still try the test case as long as you test with the kmsgrab capture method, the encoder shouldn't matter. This PR should resolve your issue reported in #4906 (but make sure the hardware cursor is enabled in kwin and set minimum_fps_target back to the default if you want to trigger the stutter issue properly). |



Description
Multiples changes that affects all platforms, aimed at resolving issues related to the minimum_fps_target setting. During testing of both portalgrab and kmsgrab, certain streaming conditions can be observed to cause the stream framerate cap to be violated, which is resolved by these changes.
Revert "fix(linux/xdgportal): avoid duplicate frame insertion
This reverts commit 99d4e05.
fix(video): avoid minimum_fps_target violations
Resolves stream framerate violations by avoiding insertion of a
single duplicate frame immediately after encoding a real frame, thus
giving the platform capture thread some breathing room if frame
processing time runs longer than usual.
Screenshot
Issues Fixed or Closed
Fixes #4906
Roadmap Issues
Type of Change
Checklist
AI Usage