feat(linux)!: Support streaming through XDG portals and Pipewire#4417
feat(linux)!: Support streaming through XDG portals and Pipewire#4417ReenigneArcher merged 24 commits intomasterfrom
Conversation
Bundle ReportChanges will increase total bundle size by 90 bytes (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sunshine-esmAssets Changed:
Files in
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4417 +/- ##
==========================================
- Coverage 15.49% 15.14% -0.36%
==========================================
Files 94 95 +1
Lines 19248 19874 +626
Branches 8907 9178 +271
==========================================
+ Hits 2982 3009 +27
- Misses 12868 13326 +458
- Partials 3398 3539 +141
Flags with carried forward coverage won't be shown. Click here to find out more.
|
f7173e3 to
d65baf5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
70a1b64 to
9f0aefb
Compare
This comment was marked as resolved.
This comment was marked as resolved.
9f0aefb to
5987970
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
The current implementation in this PR doesn't perform as well as KMS capture on my system (RX 6600, Ubuntu 25.10 with Mesa PPA enabled), but this should not be a reason not to add support. It might work better on more powerful systems, and there is still room for improvement (example: the frame pacing code has not been changed to align with @gschintgen's improved pacing on KMS/X11). Also, the KDE/KWin developers have already stated that kmsgrab should be deprecated in favour of xdg portal. |
This comment was marked as resolved.
This comment was marked as resolved.
a4292c6 to
cca272e
Compare
This comment was marked as resolved.
This comment was marked as resolved.
2d722c3 to
a4947e8
Compare
This comment was marked as resolved.
This comment was marked as resolved.
5e2dfe4 to
8401227
Compare
Require GIO and PIPEWIRE packages for portal support and use SYSTEM include directories. Also, clarify the fatal error message order for missing dependencies.
Pipewire has been added to the dependency lists for FreeBSD, Arch, Fedora, Homebrew, and Debian-based packaging and build scripts. This ensures proper support and integration for systems using Pipewire.
A value of 2 indicates "Remember this Selection". Co-authored-by: Carson Katri <Carson.katri@gmail.com>
…ystems (#4510) Co-authored-by: Carlos Garnacho <carlosg@gnome.org> Co-authored-by: Carson Katri <Carson.katri@gmail.com> Co-authored-by: d.bondarev <d.bondarev@crm-onebox.com>
Corrects the installation path for sunshine-kms to use %{buildroot}%{_bindir} instead of %{_bindir}, ensuring proper packaging for RPM builds.
Replaced raw arrays with std::array for type safety and clarity in buffer and struct allocations throughout portalgrab.cpp. Updated related code to use .data() and .size() where appropriate, improving maintainability and reducing potential for errors.
Changed C-style string constants to array declarations for REQUEST_PREFIX and SESSION_PREFIX. Updated function calls to use std::array::data() for params. Split spa_pod_frame variable declarations for clarity.
Updated path string construction in portalgrab.cpp to use std::format instead of g_strdup_printf, improving type safety and readability.
Applied minor refactoring for improved code clarity and consistency: added [[maybe_unused]] to unused parameters, replaced C-style casts with static_cast, removed unnecessary semicolon, and simplified std::fill_n usage.
Refactored parameter assignment to avoid post-increment in array indexing and improve clarity. Updated token check to use direct character comparison. Replaced enum class usage with 'using enum' for mem_type_e. Improved logging for unrecognized capture status by using std::to_underlying.
Updated function parameters and local variables to use const qualifiers where appropriate. Replaced C-style casts with C++ static_cast for improved type safety and clarity. Minor code cleanups and style improvements.
Added the -DSUNSHINE_ENABLE_PORTAL=ON flag to FreeBSD CI, COPR spec, Flatpak, and linux_build.sh scripts to ensure the portal feature is enabled across all build targets. Also reordered some CMake flags for consistency.
Reformats the mark_as_advanced call in FindSystemd.cmake to list each variable on a separate line, improving readability and maintainability.
a10aed4 to
cb67b3e
Compare
|
|
@XT-Martinez can you test again? I think these changes were not included in this branch when you reported it before. |
|
I will merge this, PRs accepted for any issues. |
…ardByte#4417) Co-authored-by: Carlos Garnacho <carlosg@gnome.org> Co-authored-by: Carson Katri <Carson.katri@gmail.com> Co-authored-by: Bond <bond-d@ukr.net> Co-authored-by: d.bondarev <d.bondarev@crm-onebox.com> Co-authored-by: Conn O'Griofa <connogriofa@gmail.com>




Description
This PR replaces #2507 ... Thanks to @garnacho for the initial work on this!
This PR adds a new "grab" implementation to use XDG desktop portals and Pipewire. There is a breaking change that comes along with this implementation, which is that KMS capture must now be started from a separte sunshine service named
sunshine-kms. The mainsunshineservice now does not use extra capabilities defined by setcap.This feature should be considered beta for now. Known issues:
TODO:
-DSUNSHINE_ENABLE_PORTALthroughoutScreenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage