-
Notifications
You must be signed in to change notification settings - Fork 18
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
Grant access to Gamescope socket on Steam Deck #178
Conversation
Started test build 94776 |
Build 94776 successful
|
Started test build 94779 |
Build 94779 successful
|
Tested the latest build and confirmed that this fixes the issue with no apparent regression. |
Started test build 94796 |
Build 94796 successful
|
Thank you for testing, I don't have a steam deck and there's a surprising amount of steamdeck exclusive issues. Just so I can understand it, could you please elaborate a bit further on the nature of the issue? Does it always happen on steam deck? does it only happen with Does the error entirely prevent dolphin from working? Does it only affect the vulkan renderer? And last, there are four commits for a single line change, would you mind if I squashed before merging? |
It's pretty complex and I'm not familiar with the details of how exactly Valve got HDR10 working on Steam Deck OLED well before HDR was otherwise even fully supported in Linux, but you can read the Chiaki4deck thread starting from about here to get more details. My mental model (which might be slightly inaccurate) of what's going on is that:
The error message I posted a picture of only shows up if you install the Gamescope Flatpak but fail to whitelist xdg-run/gamescope-0. But you need both for HDR applications running through Flatpak, including Dolphin -- in fact, when I was testing this PR, I enabled HDR post-processing effects in Dolphin's graphics settings and that caused the Steam Deck OLED's HDR mode to be correctly engaged whenever I launched a Dolphin game. Just whitelisting xdg-run/gamescope-0 makes no difference on its own -- if you fail to install the Gamescope Flatpak, games can try to render in HDR but then they will be tonemapped down to the SDR colorspace. Unfortunately the Gamescope Flatpak is not autoinstalled. Steam Deck users of Dolphin, Heroic, Lutris, and other applications who want to play games in HDR will need to be educated that they need to also install the Gamescope Flatpak. So far I'm not aware of a better solution; bundling Gamescope inside the Dolphin Flatpak doesn't seem like a good idea since Dolphin and Gamescope don't necessarily update at the same cadence, which could introduce incompatibilities. Btw, this PR's change is harmless for users who have no interest in running non-Steam HDR games. Everything will go on as usual for them.
Only Dolphin HDR post-processing effects won't work without this PR, but other than that, the error doesn't prevent Dolphin from running (you can still press OK to "power through" the error). I believe the error is from the code in Gamescope that (IIUC) uses Vulkan to create a zero-copy / low-latency virtual display layer seen by the application. I vaguely suspect that all Flatpak games would need to have xdg-run/gamescope-0 whitelisted in order to fully take advantage of Gamescope's performance benefits...
Yes please do squash. The initial commits that I later reverted included changes to the environment variables, but I realized that these are only useful for applications like Lutris or Heroic that include options to actually run games inside their own nested Gamescope instance (e.g. for launching them inside a Gamescope window on your desktop). |
Thank you, that was very helpful. I'll try to add some explanation to the readme when I have some time. |
I have approved the change but FYI, the gamescope socket is not fixed meaning there can be a gamescope-0 gamescope-1 sockets,. if two/more are running. This makes it incompatible with static permissions of Flatpak as you can't predict the value. But |
Makes sense. Not sure of a better way to do it. I guess it should always be gamescope-0 when running in Steam Deck's Game Mode unless they change its design. |
I encounter this error every time I launch a Dolphin game through Steam Deck's Game Mode UI:
![20240120_180303](https://private-user-images.githubusercontent.com/99134546/298313492-5a4b3ca1-99ae-41e2-9af8-6d2591799d27.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5MzEwMjAsIm5iZiI6MTcyMTkzMDcyMCwicGF0aCI6Ii85OTEzNDU0Ni8yOTgzMTM0OTItNWE0YjNjYTEtOTlhZS00MWUyLTlhZjgtNmQyNTkxNzk5ZDI3LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI1VDE4MDUyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgzYTJlYTE5MzBmNmU4NGQ3YjBlODhmZDdmZDFkYjg1YTYyNWVlMjMwMWI3MjIyMjMzZTg3ZjNjNmRhZTYwN2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.QfPevoi3f4Z6axY03NkCtGYxsvoY7_M7YQ9d7S9TPdE)
I've encountered it many times before when launching games through other Flatpaks, like those for Lutris, Heroic, and other emulators. Recently, I found that this error went away after adding support for HDR on Steam Deck to Lutris Flatpak -- itself based on the method used for enabling HDR support on Heroic and Chiaki4deck. So I'm pushing this PR that I believe will give Dolphin Flatpak access to the Gamescope socket. I'm leaving this PR as draft for now until I've run the test build to confirm it works.
Similar to PRs I have made for RetroArch, PrimeHack, and PPSSPP, I have tested and confirmed that just adding the gamescope-0 socket is enough to make the error go away, with no apparent regressions, if you have the Gamescope Flatpak installed: