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

Gamescope windows invisible for Steam games #1707

Closed
3 of 6 tasks
SeongGino opened this issue Jan 17, 2025 · 9 comments
Closed
3 of 6 tasks

Gamescope windows invisible for Steam games #1707

SeongGino opened this issue Jan 17, 2025 · 9 comments

Comments

@SeongGino
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Are you using any gamescope patches or a forked version of gamescope?

  • The issue occurs on upstream gamescope without any modifications

Current Behavior

When gamescope is prepended to a Steam game's launch parameters, regardless of switches used, no window ever actually appears - however, the game is still running in the background with audio appearing to play out of... nothing. It simply has to be stopped by cancelling the process from Steam.

It seems to affect multiple games, but I've tried with Senko no Ronde 2 and Spelunky just for examples.

Interestingly, in KDE's Wayland session, there are windows that appear linked to gamescope, but they are invisible and nothing comes up when activated - they also don't close when requesting the windows to close, again prompting a force close from Steam's UI.

Image

That said, Gamescope still works normally on this setup with non-Steam titles, using Proton via my own Bottles-like launcher which simply prepends gamescope [...] as a scaling option.

Image

Image

Steps To Reproduce

  1. Set a Steam title's launch parameters to gamescope -W (resX) -H (resY) -e -- %command%
  2. Launch the game
  3. Observe audio playing from the game in the background, despite no window appearing.

Hardware information

- Distro: Arch Linux
- CPU: AMD Ryzen 5 5600X
- GPU: NVIDIA GeForce RTX 3060ti
- Driver Version: NVIDIA 565.77

Software information

- Desktop environment: KDE 6.2.5
- Session type: X11 & Wayland
- Gamescope version: `gamescope version 3.16.1-34-g328f06b0 (gcc 14.2.1)`
- Gamescope launch command(s): `gamescope -w 1920 -h 1200 -W 3840 -H 2160 -r 60 -e -- %command%` (and permutations thereof)

Which gamescope backends have the issue you are reporting?

  • Wayland (default for nested gamescope)
  • DRM (default for embedded gamescope, i.e. gamescope-session)
  • SDL
  • OpenVR

Logging, screenshots, or anything else

For what it's worth, Gamescope's console output is very similar in all cases, minus the Steam-specific stuff. Pasting in the output running Steam from a CLI:

[gamescope] [Info]  console: gamescope version 3.16.1-34-g328f06b0 (gcc 14.2.1)
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts'
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts/00-gamescope'
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts/00-gamescope/common'
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/common/inspect.lua' (id: 0)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/common/modegen.lua' (id: 1)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/common/util.lua' (id: 2)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts/00-gamescope/displays'
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/asus.rogally.lcd.lua' (id: 3)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/deckhd.steamdeck.deckhd-lcd.lua' (id: 4)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.lcd.lua' (id: 5)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.oled.lua' (id: 6)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/etc/gamescope/scripts'
[gamescope] [Warn]  scriptmgr: Directory '/etc/gamescope/scripts' does not exist
[gamescope] [Info]  scriptmgr: Loading scripts from: '/home/seong/.config/gamescope/scripts'
[gamescope] [Warn]  scriptmgr: Directory '/home/seong/.config/gamescope/scripts' does not exist
Game Recording - would start recording game 574160, but recording for this game is disabled
Adding process 194432 for gameID 574160
[gamescope] [Info]  vulkan: selecting physical device 'NVIDIA GeForce RTX 3060 Ti': queue family 2 (general queue family 0)
[gamescope] [Info]  vulkan: physical device supports DRM format modifiers
[gamescope] [Info]  wlserver: [backend/headless/backend.c:67] Creating headless backend
[gamescope] [Error] vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x38344241 (VkResult: 0)
[gamescope] [Error] vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x38344258 (VkResult: 0)
[gamescope] [Info]  vulkan: supported DRM formats for sampling usage:
[gamescope] [Info]  vulkan:   AR24 (0x34325241)
[gamescope] [Info]  vulkan:   XR24 (0x34325258)
[gamescope] [Info]  vulkan:   AB24 (0x34324241)
[gamescope] [Info]  vulkan:   XB24 (0x34324258)
[gamescope] [Info]  vulkan:   RG16 (0x36314752)
[gamescope] [Info]  vulkan:   NV12 (0x3231564E)
[gamescope] [Info]  vulkan:   AB4H (0x48344241)
[gamescope] [Info]  vulkan:   XB4H (0x48344258)
[gamescope] [Info]  vulkan:   AB30 (0x30334241)
[gamescope] [Info]  vulkan:   XB30 (0x30334258)
[gamescope] [Info]  vulkan:   AR30 (0x30335241)
[gamescope] [Info]  vulkan:   XR30 (0x30335258)
[gamescope] [Info]  vulkan: Creating Gamescope nested swapchain with format 44 and colorspace 0
[gamescope] [Info]  wlserver: Using explicit sync when available
[gamescope] [Info]  wlserver: Running compositor on wayland display 'gamescope-0'
[gamescope] [Info]  wlserver: [backend/headless/backend.c:17] Starting headless backend
[gamescope] [Info]  wlserver: Successfully initialized libei for input emulation!
[gamescope] [Error] wlserver: [xwayland/sockets.c:64] Failed to bind socket @/tmp/.X11-unix/X0: Address already in use
[gamescope] [Info]  wlserver: [xwayland/server.c:107] Starting Xwayland on :1
ERROR: ld.so: object '/home/seong/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Adding process 194450 for gameID 574160
ERROR: ld.so: object '/home/seong/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/seong/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[gamescope] [Info]  pipewire: stream state changed: connecting
[gamescope] [Info]  pipewire: stream state changed: paused
[gamescope] [Info]  pipewire: stream available on node ID: 129
[gamescope] [Info]  vblank: Using timerfd.
Adding process 194452 for gameID 574160
ProtonFixes[194562] INFO: Running protonfixes
...
[gamescope] [Warn]  xwm: got the same buffer committed twice, ignoring.
[gamescopereaper] [Info]  reaper: Parent of gamescopereaper was killed. Killing children.
@matte-schwartz
Copy link

Have you tried without -e? iirc that's only meant for launching Steam within Gamescope (ie gamescope -e -- steam)

@xlacroixx
Copy link

xlacroixx commented Jan 21, 2025

Exact same problem. When I launch my games, their windows don't appear and aren't registered by my compositor. I can still hear their audio just fine.
This also happens outside of Steam.
However, my logs are different.

Nothing more happens before the ^C in my logs.

Looking at my logs, I thought it would be somehow a library/dependency issue, according to this line:

[47226:47226:0121/132426.084033:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.portal.Secret.RetrieveSecret: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.UnknownMethod: L’interface « org.freedesktop.portal.Secret » n’existe pas pour l’objet à l’emplacement /org/freedesktop/portal/desktop
where the French part means:
Interface "org.freedesktop.portal.Secret" does not exist for the object located at /org/freedesktop/portal/desktop.

So I rolled back libsecret to 0.21.4-1 from 0.21.6-1, which I updated that day, but alas, no change.

Maybe not a compositor issue either, since mine is different.
My setup is:

  • Kernel: Linux (vanilla) 6.12.10.arch1-1 and also tested on Linux (CachyOS) 6.12.6-1 (out of date because of debugging lockups)
  • WM: Hyprland (-git package) Hyprland 0.46.0 built from branch main at commit a661203bb6d4714b211572759e2f74b1da194972
  • Gamescope: (-git package) [gamescope] [Info] console: gamescope version 3.16.1-34-g328f06b0 (gcc 14.2.1)

Maybe related: #1673 (comment) (same error appears in my log)

Output of LANG=C gamescope chromium (Ungoogled Chromium):

[gamescope] [Info]  console: gamescope version 3.16.1-34-g328f06b0 (gcc 14.2.1)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts'
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts/00-gamescope'
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts/00-gamescope/common'
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/common/inspect.lua' (id: 0)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/common/modegen.lua' (id: 1)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/common/util.lua' (id: 2)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/usr/share/gamescope/scripts/00-gamescope/displays'
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/asus.rogally.lcd.lua' (id: 3)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/deckhd.steamdeck.deckhd-lcd.lua' (id: 4)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.lcd.lua' (id: 5)
[gamescope] [Info]  scriptmgr: Running script file '/usr/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.oled.lua' (id: 6)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/etc/gamescope/scripts'
[gamescope] [Warn]  scriptmgr: Directory '/etc/gamescope/scripts' does not exist
[gamescope] [Info]  scriptmgr: Loading scripts from: '/home/ezkha/.config/gamescope/scripts'
[gamescope] [Warn]  scriptmgr: Directory '/home/ezkha/.config/gamescope/scripts' does not exist
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
[gamescope] [Info]  vulkan: selecting physical device 'AMD Radeon RX 6750 XT (RADV NAVI22)': queue family 1 (general queue family 0)
[gamescope] [Info]  vulkan: physical device supports DRM format modifiers
[gamescope] [Info]  wlserver: [backend/headless/backend.c:67] Creating headless backend
[gamescope] [Info]  xdg_backend: Seat name: Hyprland
[gamescope] [Info]  vulkan: supported DRM formats for sampling usage:
[gamescope] [Info]  vulkan:   AR24 (0x34325241)
[gamescope] [Info]  vulkan:   XR24 (0x34325258)
[gamescope] [Info]  vulkan:   AB24 (0x34324241)
[gamescope] [Info]  vulkan:   XB24 (0x34324258)
[gamescope] [Info]  vulkan:   RG16 (0x36314752)
[gamescope] [Info]  vulkan:   AB4H (0x48344241)
[gamescope] [Info]  vulkan:   XB4H (0x48344258)
[gamescope] [Info]  vulkan:   AB48 (0x38344241)
[gamescope] [Info]  vulkan:   XB48 (0x38344258)
[gamescope] [Info]  vulkan:   AB30 (0x30334241)
[gamescope] [Info]  vulkan:   XB30 (0x30334258)
[gamescope] [Info]  vulkan:   AR30 (0x30335241)
[gamescope] [Info]  vulkan:   XR30 (0x30335258)
[gamescope] [Info]  wlserver: Using explicit sync when available
[gamescope] [Info]  wlserver: Running compositor on wayland display 'gamescope-0'
[gamescope] [Info]  wlserver: [backend/headless/backend.c:17] Starting headless backend
[gamescope] [Info]  wlserver: Successfully initialized libei for input emulation!
[gamescope] [Info]  wlserver: [xwayland/server.c:107] Starting Xwayland on :1
[gamescope] [Info]  pipewire: stream state changed: connecting
[gamescope] [Info]  pipewire: stream state changed: paused
[gamescope] [Info]  pipewire: stream available on node ID: 83
[gamescope] [Info]  vblank: Using timerfd.
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
ATTENTION: default value of option vk_xwayland_wait_ready overridden by environment.
[Gamescope WSI] Application info:
  pApplicationName:
  applicationVersion: 1
  pEngineName:
  engineVersion: 1
  apiVersion: 4206893
[Gamescope WSI] Executable name: chromium
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
ATTENTION: default value of option vk_xwayland_wait_ready overridden by environment.
ATTENTION: default value of option vk_wsi_force_swapchain_to_current_extent overridden by environment.
[Gamescope WSI] Application info:
  pApplicationName: chromium
  applicationVersion: 1
  pEngineName: ANGLE
  engineVersion: 1
  apiVersion: 4198400
[Gamescope WSI] Executable name: chromium
[Gamescope WSI] Forcing on VK_EXT_swapchain_maintenance1.
[gamescope] [Info]  edid: Patching res 800x1280 -> 1280x720
[gamescope] [Warn]  xwm: got the same buffer committed twice, ignoring.
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
> Warning:          Could not resolve keysym XF86KbdInputAssistPrevgrou
> Warning:          Could not resolve keysym XF86KbdInputAssistNextgrou
Errors from xkbcomp are not fatal to the X server
[gamescope] [Error] xdg_backend: Compositor released us but we were not acquired. Oh no.
[47226:47226:0121/132426.084033:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.portal.Secret.RetrieveSecret: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.UnknownMethod: L’interface « org.freedesktop.portal.Secret » n’existe pas pour l’objet à l’emplacement /org/freedesktop/portal/desktop
[47226:47226:0121/132426.084043:ERROR:secret_portal_key_provider.cc(150)] Failed to retrieve secret: No response from portal.
[47226:47226:0121/132426.085549:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.ScreenSaver.GetActive: object_path= /org/freedesktop/ScreenSaver: org.freedesktop.DBus.Error.UnknownMethod: Unknown method GetActive or interface org.freedesktop.ScreenSaver.
[Gamescope WSI] Creating Gamescope surface: xid: 0x800002
[Gamescope WSI] Atom of T was wrong type. Expected XCB_ATOM_CARDINAL.
[Gamescope WSI] Made gamescope surface for xid: 0x800002
[Gamescope WSI] Surface state:
  steam app id:                  0
  window xid:                    0x800002
  wayland surface res id:        5
  layer client flags:            0x0
  server hdr output enabled:     false
  hdr formats exposed to client: false
[Gamescope WSI] Creating swapchain for xid: 0x800002 - oldSwapchain: (nil) - provided minImageCount: 3 - minImageCount: 3 - format: VK_FORMAT_B8G8R8A8_UNORM - colorspace: VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - flip: true
[Gamescope WSI] Created swapchain for xid: 0x800002 swapchain: 0x3c4c00d79800 - imageCount: 3
[gamescope] [Error] xdg_backend: Compositor released us but we were not acquired. Oh no.
[Gamescope WSI] Swapchain recieved new refresh cycle: 16.67ms
^C
[gamescopereaper] [Info]  reaper: Parent of gamescopereaper was killed. Killing children.
[47270:47270:0121/132428.118441:ERROR:connection.cc(63)] X connection error received.
[gamescope] [Info]  launch: Primary child shut down!

There are some localized messages even though I'm running with LANG=C.

@misyltoad
Copy link
Collaborator

misyltoad commented Jan 21, 2025

You can only use -e if Steam is also launched inside Gamescope

@SeongGino
Copy link
Author

SeongGino commented Jan 23, 2025

Have you tried without -e? iirc that's only meant for launching Steam within Gamescope (ie gamescope -e -- steam)

I could've sworn that I'd tried without the -e flag as well (but the documentation wasn't exactly clear that it's for running Steam in gamescope - I thought it applied to games running in Steam regardless).

Unfortunately I won't be available at my desktop until next week to triple check that.

@xlacroixx
Copy link

xlacroixx commented Jan 23, 2025

I can add that I've been using -e for games launched within Steam for a long time, that is, I ran Steam outside of Gamescope and a script in custom command launches Gamescope with the game and -e.

It always worked fine, I even think it was useful for making the Steam overlay work. Is this related to the issue though?

@matte-schwartz
Copy link

It was relevant because I've definitely seen gamescope -e -- %command% present invisible windows before as described in the original post

@xlacroixx
Copy link

xlacroixx commented Jan 25, 2025

Okay. Problem solved on my end. Yet another API/ABI breakage.

I had hyprland-git and all of its dependencies + ecosystem as -git versions.
By migrating to the tagged (stable) packages, and making sure I'm using gamescope (not gamescope-git), Gamescope is able to launch.

I can't fully test with Steam yet because I've got another very bad issue with Mesa drivers.
(https://gitlab.freedesktop.org/mesa/mesa/-/issues/12310)

However I think that was another entirely unrelated issue then.

@SeongGino
Copy link
Author

SeongGino commented Jan 26, 2025

@xlacroixx If your issue persists outside of Steam, then that sounds like an entirely different issue from OP even if the symptoms are similar. My Plasma+NV setup should be fairly ubiquitous enough though not to be an issue that hasn't been raised before? Aside from the NVIDIA beta driver listed, it's all stable versions (including Steam, albeit run thru steam-native tho I'm not sure what effect this even has these days), so the likelihood of some ABI nonsense happening seems slim.

Side note: using gamescope-git atm is a necessity for me until a new tagged release comes out that integrates an earlier nv fix that isn't in the still-current tagged version.

@SeongGino
Copy link
Author

Stupid me, seems like this was caused by calling for a window resolution bigger than my physical display (calling for 4K on a 1440p monitor).

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

No branches or pull requests

4 participants