feat(linux/xdgportal): implement event-driven capture#4768
feat(linux/xdgportal): implement event-driven capture#4768psyke83 wants to merge 3 commits intoLizardByte:masterfrom
Conversation
561c0fd to
7a3b57e
Compare
|
I'm marking this ready for review, but I'd appreciate if some other folks could test and verify it works OK on their configuration before considering this for merging. I've tested on GNOME and KDE 6.6.0 via Fedora 43. The updated duplication logic solves a few issues:
|
119aacc to
225c84f
Compare
Bundle ReportBundle size has no change ✅ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4768 +/- ##
==========================================
- Coverage 15.37% 15.32% -0.05%
==========================================
Files 97 97
Lines 20668 20712 +44
Branches 9472 9499 +27
==========================================
- Hits 3178 3175 -3
+ Misses 13815 13716 -99
- Partials 3675 3821 +146
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Works ok for me. I haven't noticed the difference to the previous portalgrab state though. Tested on the up to date CachyOS with KDE, AMD GPU |
a4134fa to
aa9a821
Compare
Do you want to ask for more volunteers on Discord? There is a |
Summary of changes:
* Synchronized capture:
- Move frame_cv wait to beginning of loop as a more efficient way to
wait for a new buffer whilst ensuring that unintentional buffer
reuse doesn't occur.
* Improved duplicate detection:
- Transition to duplicate detection logic using a combination
of SPA_META_Header (PTS) and SPA_META_VideoDamage metadata.
- Drop frames when PTS delta is zero and no damage is reported;
this helps to smoothen out stuttering unique to KWin.
* Destroying the core and context during a reinit can cause a deadlock which can be reproduced when PW_STREAM_FLAG_RT_PROCESS is set. Fix by ensuring that full teardown is only done in pipewire destructor. * Add a delay before sending the interrupt signal, as the GNOME XDG portal needs time to detect changes, otherwise Sunshine will crash when the users manually stops the stream on mutter.
Reduce duplicate checking complexity as stricter edge-case is not needed.
Perhaps. I've refreshed the PR to make the check less strict as I've identified that stuttering with KWin may actually be a bug on the compositor side related to XWayland applications. It's either this bug, or a variation of the same issue that only applies to screencasting. If testing this PR (or portalgrab on master) with Steam games, you're going to see stuttering in games due to Proton using XWayland by default. An effective workaround is to use a Proton fork such as Proton GE or Proton-cachyos, and enable the Wayland driver via this launch argument for your games: This will currently break Steam's overlay, but it does resolve all stuttering when streaming via KWin (at least on my system). This workaround doesn't seem to be necessary on GNOME/mutter, but it may be worth trying to yield improved latency and/or performance. |
|



Description
Additional fixes:
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage