gamescope icon indicating copy to clipboard operation
gamescope copied to clipboard

Default to native resolution

Open YamiYukiSenpai opened this issue 2 years ago • 10 comments

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.

YamiYukiSenpai avatar Feb 19 '23 01:02 YamiYukiSenpai

If running in nested mode it defaults to 720p. Embedded seems to set the native resolution.

lennie420 avatar Feb 27 '23 04:02 lennie420

What’s the difference?

If I simply run gamescope, that’s nested?

YamiYukiSenpai avatar Feb 28 '23 01:02 YamiYukiSenpai

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.

lennie420 avatar Feb 28 '23 11:02 lennie420

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?

YamiYukiSenpai avatar Feb 28 '23 12:02 YamiYukiSenpai

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?

NadeemSadiq avatar Nov 29 '23 16:11 NadeemSadiq

Use case when this is annoying:

  1. Sunshine + Moonlight streaming
  2. Sunshine setting client resolution with kscreen-doctor
  3. gamescope in use for HDR in KDE
  4. gamsecope needs to have -f -H 2160 added to Steam's custom command to not run in 720p
  5. 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.

slagiewka avatar Jun 27 '24 12:06 slagiewka

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.

DistantThunder avatar Aug 23 '24 19:08 DistantThunder

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 avatar Aug 24 '24 08:08 slagiewka

@slagiewka Do you have tearing when going through Gamescope on Moonlight?

DistantThunder avatar Aug 29 '24 12:08 DistantThunder

@slagiewka Do you have tearing when going through Gamescope on Moonlight?

Currently I don't think that I have tearing.

slagiewka avatar Sep 10 '24 08:09 slagiewka

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%

AlexFolland avatar Nov 13 '24 21:11 AlexFolland

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:

  • -W to set gamescope's screen width
  • -H for the height
  • -r for the refresh rate
  • --force-grab-cursor to avoid issues with the cursor (this may depend on the game, Deadlock needs it but Helldivers doesn't)
  • --adaptive-sync is self explanatory I think
  • --hdr-enabled, as it says, sets HDR on; --hdr-sdr-content-nits 250 sets brightness of non-HDR content to 250
  • -f sets gamescope to full screen

Kaylebor avatar Dec 28 '24 23:12 Kaylebor