Default to native resolution
I'd like to be able to use gamescope without needing to specify the resolution I'm in. Would that be possible?
As of right now, I appear to be able to launch only at 720p, unless I specify 1440p.
If running in nested mode it defaults to 720p. Embedded seems to set the native resolution.
What’s the difference?
If I simply run gamescope, that’s nested?
Nested mode is when you are running it from a desktop environment/window manager or virtual terminal. Embedded mdoe is when you are running it directly from TTY.
Nested mode is when you are running it from a desktop environment/window manager or virtual terminal. Embedded mdoe is when you are running it directly from TTY.
Ooh! Thanks. Didn’t know that’s a possibility.
When I tried to play Mass Effect: Legendary Edition on my Steam Deck (game mode), it was on 720p. Is it because it was nested?
I ran gamescope in embedded mode and the resolution starts steam in native but runs the game under steam on the default (720p) resolution. Is this the expected behavior?
Use case when this is annoying:
- Sunshine + Moonlight streaming
- Sunshine setting client resolution with
kscreen-doctor - gamescope in use for HDR in KDE
- gamsecope needs to have
-f -H 2160added to Steam's custom command to not run in 720p - When actual screen resolution gets modified by Sunshine (e.g. down to 1080p), gamescope will still run in 2160p
With gamescope not respecting actual full screen resolution, it's hard to set the entire thing to HDR + adjusting resolution for optimal streaming experience.
On KDE, this at least can workaround this use-case:
SDL_VIDEO_WAYLAND_PREFER_LIBDECOR=0 gamemoderun gamescope -f -b -H $(kscreen-doctor -j | jq '.screen.currentSize.height') --hdr-enabled %command%
Going through kscreen-doctor allows to grab some of the main screen (which is probably the one that's being streamed) properties that we can re-inject dynamically in Gamescope options.
For my previous comment, those running Sunshine might also try this as a command:
sh -c "gamescope -f -e --hdr-enabled -H ${SUNSHINE_CLIENT_HEIGHT} -W ${SUNSHINE_CLIENT_WIDTH} -r ${SUNSHINE_CLIENT_FPS} --other_options_that_you_want -- steam -gamepadui"
It works well enough for me.
@slagiewka Do you have tearing when going through Gamescope on Moonlight?
@slagiewka Do you have tearing when going through Gamescope on Moonlight?
Currently I don't think that I have tearing.
With help from the comment above by @DistantThunder and a bit of research about JSON querying, I figured out how to definitively get the height of my primary monitor. Since my screens are vertically stacked, the way DistantThunder queried the height wasn't working for me, so instead my query gets the primary display's height directly by getting the display with the minimum priority value and then its height. Here's the full command line that I've been successfully using for the Linux version of Assault Android Cactus in Steam in KDE Plasma Wayland with an AMD Radeon RX 7900 XT GPU and an HDR 240 Hz VRR display:
XKB_DEFAULT_LAYOUT=us XKB_DEFAULT_VARIANT=qwerty __GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink MANGOHUD=1 gamescope --hdr-enabled --adaptive-sync --fullscreen --steam --force-windows-fullscreen --expose-wayland --backend wayland --force-grab-cursor --output-height $(kscreen-doctor -j | jq '[.outputs[]] | min_by(.priority).size.height') --nested-height $(kscreen-doctor -j | jq '[.outputs[]] | min_by(.priority).size.height') -- %command%
Just to add to @AlexFolland, I have a variant of the same which is "simpler" (depending on needs, it works well for me and I'd prefer not adding more than I need):
gamescope --force-grab-cursor -W $(kscreen-doctor -j | jq '[.outputs[]] | min_by(.priority).size.width') -H $(kscreen-doctor -j | jq '[.outputs[]] | min_by(.priority).size.height') -r $(kscreen-doctor -j | jq '[.outputs[]] | min_by(.priority).refreshRate') --adaptive-sync --hdr-enabled --hdr-sdr-content-nits 250 -f -- %command%
The main difference is that my version sets height, width and refreshRate explicitly:
-Wto set gamescope's screen width-Hfor the height-rfor the refresh rate--force-grab-cursorto avoid issues with the cursor (this may depend on the game, Deadlock needs it but Helldivers doesn't)--adaptive-syncis self explanatory I think--hdr-enabled, as it says, sets HDR on;--hdr-sdr-content-nits 250sets brightness of non-HDR content to 250-fsets gamescope to full screen