fix(pipewire): revert back to compositor-side pacing - #5538
Conversation
KWin 5.x/6.x has poor frame pacing when not using variable rate capture for screencasting, but KWin 6.7 also breaks desktop animation pacing when variable rate capture (0/1) is negotiated. The upcoming KWin 6.8 improves pacing for non-variable rate capture, so switch back to capture using a negotiated target maxFramerate, thus fixing desktop animation pacing. This change also avoids first-time negotiation failure for mutter, but we can retain the _negotiatiate_maxframerate fallback to negotiate the target fps only via SPA_FORMAT_VIDEO_framerate, just in case there are other compositors that don't handle maxFramerate negotiation robustly.
|
Technically I'm happy with the change as-is, but I'm keeping it in draft as it's a quasi-breaking change until Plasma 6.8 releases in October, or if the related fix for improved pacing gets backported to older branches. Summary of effects:
If anyone is interested in testing the improved pacing, it's trivial to manually backport the single commit to KWin 6.7. |
|
Not sure if holding this back until 6.8 will help as much because only rolling release distributions will get the fix within a reasonable time frame. Most regular distributions will stick to the KDE (therefore KWin) version that it shipped on release and therefore will lack behind until a new release is available (and upgraded to by the user). One way to handle this would be to detect the running KWin version and change the logic accordingly based on that. IMHO we should avoid such workarounds if possible (keep code simple for future maintenance) but atm it's the only thing I could come up that would solve the issues above for users stuck on older versions of KWin. |
|
We should probably keep in mind that Plasma 6.6 is the currently assigned LTS release, and that version currently has no downsides with variable rate pacing; only 6.7 onwards exhibits the half-rate desktop animation bug. Merging this PR as-is would not be good for distros adhering to the 6.6 LTS release or earlier. Other non-rolling release distros that use Plasma 6.7 (such as Fedora 43 onwards) will also be impacted, as they have good general pacing but very poor desktop responsiveness due to the animation bug caused by variable pacing. Maybe a version check to determine whether to set up variable rate is warranted, and we can justify the effort by also using it to determine if the compositor is not KWin at all, just avoid variable rate entirely and thus avoid mutter having to renegotiate. Let's first see if the pacing improvement commit is cherry-picked to the 6.7 branch at least... but I doubt it. |



Description
KWin 5.x/6.x has poor frame pacing when not using variable rate capture for screencasting, but KWin 6.7 also breaks desktop animation pacing - which runs at half speed - when variable rate capture (0/1) is negotiated.
The upcoming KWin 6.8 improves pacing for non-variable rate capture, so if we switch back to capture using a negotiated target maxFramerate, we can also fix desktop animation pacing.
This change also avoids first-time negotiation failure for mutter, but we can retain the negotiate_maxframerate_ fallback to negotiate the target fps only via SPA_FORMAT_VIDEO_framerate, just in case there are other compositors that don't handle maxFramerate negotiation robustly.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
See our AI usage policy.