Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for screensharing in gamescope using the gamescope pipewire video source. #480

Open
ILOVEPIE opened this issue Apr 2, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@ILOVEPIE
Copy link

ILOVEPIE commented Apr 2, 2024

Describe the solution you'd like.
If we can consume the gamescope:out_0 pipewire video source we can use that for screensharing under gamescope.

@ILOVEPIE ILOVEPIE added the enhancement New feature or request label Apr 2, 2024
@kaitlynkittyy
Copy link
Contributor

I'd like to add enhancements where possible, but I'm lacking an understanding of this issue.
Could you please explain in detail what use case this would have and why it would be important?

@PolisanTheEasyNick
Copy link
Contributor

And also please specify how we can reproduce it.
Because today I tried starting game with gamescope and it just started in another window, which I really can choose using portal picker or I can just stream whole display with game window.

@ILOVEPIE
Copy link
Author

ILOVEPIE commented Apr 12, 2024

And also please specify how we can reproduce it.
Because today I tried starting game with gamescope and it just started in another window, which I really can choose using portal picker or I can just stream whole display with game window.

Gamescope is a wayland compositor that runs by itself when it is not being launched from another compositor. It does not support a portal capture at the moment and only has the pipewire output. The problem is that this is the main compositor for the Steam Deck's game mode, which means the only way to capture video in the Steam Deck's game mode of a game is to use the pipewire output.

@kaitlynkittyy
Copy link
Contributor

And also please specify how we can reproduce it.
Because today I tried starting game with gamescope and it just started in another window, which I really can choose using portal picker or I can just stream whole display with game window.

Gamescope is a wayland compositor that runs by itself when it is not being launched from another compositor. It does not support a portal capture at the moment and only has the pipewire output. The problem is that this is the main compositor for the Steam Deck's game mode, which means the only way to capture video in the Steam Deck's game mode of a game is to use the pipewire output.

ah, i see
that will most likely not be supported in this PR, but will be investigated in the future.

@PolisanTheEasyNick
Copy link
Contributor

I believe for achieving this we can use org.freedesktop.portal.ScreenCast.OpenPipeWireRemote DBus call.
But for achieving streams creation directly from DBus requires whole streaming code refactor and migrating from electron's desktopCapturer.getSources calling to direct DBus calls for Linux systems, which is a real major of work.

@simvux
Copy link

simvux commented Apr 13, 2024

As far as I know you can have multiple implementations of the same portal exposed via dbus. So, maybe this could be fixed by having an xdg-desktop-portal implementation for gamescope, thus this being an issue for upstream gamescope?

@ILOVEPIE
Copy link
Author

As far as I know you can have multiple implementations of the same portal exposed via dbus. So, maybe this could be fixed by having an xdg-desktop-portal implementation for gamescope, thus this being an issue for upstream gamescope?

Unfortunately gamescope has no plans to implement/support the xdg-desktop-portal, if you can convince them otherwise more power to you.

@Cynosphere
Copy link
Contributor

Unfortunately gamescope has no plans to implement/support the xdg-desktop-portal, if you can convince them otherwise more power to you.

Then it's not going to be done because screensharing in Electron relies on desktop portals. It would be easier for them to implement it than for anyone to attempt to hack support into Electron.

@ILOVEPIE
Copy link
Author

Unfortunately gamescope has no plans to implement/support the xdg-desktop-portal, if you can convince them otherwise more power to you.

Then it's not going to be done because screensharing in Electron relies on desktop portals. It would be easier for them to implement it than for anyone to attempt to hack support into Electron.

Uh... electron already has support for pipewire sources as camera feeds, the problem is that it specifically filters out any source not marked as a "camera".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants