ValveSoftware / gamescope

SteamOS session compositing window manager
Other
3k stars 198 forks source link

Gamescope doesn't quit when game quits #777

Open shindaseishin opened 1 year ago

shindaseishin commented 1 year ago

OS: KUbuntu 22.10 Kernels tested: stock ubuntu 5.19.0 and xanmod 6.1 GPU: AMD RX 570 Mesa version: 22.2.5

Tested on both Plasma X11 and Plasma Wayland.

When I play a game via steam using gamescope everything works correctly until I quit the game.

When I do, the game ends, music stops playing, etc. but I am not dropped out to desktop. Steam shows the game is still running. I can bring up the process manager and see that the game process is no longer running but an instance of gamescope will still be running. Killing it will make the game disappear and the desktop to return. I can also kill the gamescope process by pressing stop in the steam client. It happens both full screen and windowed.

I have tested with Pillars of Eternity: Deadfire (Linux native), Valheim (native), Aragami 2 (proton), and Portal (native). All exhibit the same behaviour.

I also tried Stardew Valley (with SMAPI installed) but that exited correctly. Not sure why that worked when the others did not.

Compiled git master branch (fully up to date as of about an hour ago).

Happy to provide any additional details if they would help.

iggut commented 1 year ago

Same here in Ubuntu 22.10 Gnome wayland. Compiled it today and tried Looking-Glass-Client for my Windows 11 VM with gamescope and it works very well. When shutting down windows it closes looking-glass, but the terminal that was used to launch gamescope/looking-glass needs a Ctrl+C to stop the process.

This is the last line in terminal where it waits for me to kill the process: xwm: error 3: BadWindow (invalid Window parameter) request 15 minor 0 serial 270140

Not sure if it has anything to do with the issue, just though I'd add the info.

patlefort commented 1 year ago

A little debugging show that it is stuck on https://github.com/Plagman/gamescope/blob/2a09fbcb695102e9a990ed7cf1fdc350397a58f1/src/wlserver.cpp#L1211

Adding a timeout fix the issue, however I don't know why it is stuck there.

Faugus commented 1 year ago

I'm having this problem with Life is Strange: Before the Storm. If I Alt+F4, Gamescope closes. But if I quit the game from the main menu, Gamescope won't close.

A little debugging show that it is stuck on

https://github.com/Plagman/gamescope/blob/2a09fbcb695102e9a990ed7cf1fdc350397a58f1/src/wlserver.cpp#L1211

Adding a timeout fix the issue, however I don't know why it is stuck there.

How did you add this timeout?

patlefort commented 1 year ago

How did you add this timeout?

By changing -1 in that line to a value in milliseconds, like 1000.

shindaseishin commented 1 year ago

I tried adding the timeout as @patlefort suggested and it worked. Thank you!

Faugus commented 1 year ago

How did you add this timeout?

By changing -1 in that line to a value in milliseconds, like 1000.

Is there a way to add this timeout to a already compiled build? Cause I'm using the Gamescope from Arch's repository.

shindaseishin commented 1 year ago

No. That value is hard coded into the program and can't be changed at run time, only compile time. Maybe someone could make a pull request with the change in it to get it into the main code base which would get in to the arch version eventually, but it is probably better to figure out why the original line is failing.

DocMAX commented 1 year ago

Shouldn't gamescope -- sleep 3 close gamescope after 3 sec?

shindaseishin commented 1 year ago

Nope. It doesn't close after 3 seconds. I recompiled gamescope to current master without the fix @patlefort suggested and ran the command @DocMAX posted. With the process monitor open I can see gamescope start and then a moment later sleep starts. Three seconds later sleep quits but gamescope keeps going. I have to manually kill it.

Just for testing purposes, I reran a few games with the recompiled version, Valheim still exhibits the issue, but Cyberpunk 2077 does not.

DocMAX commented 1 year ago

So is this a bug or not?

shindaseishin commented 1 year ago

It is a bug. gamescope doesn't quit. It stays resident in memory after it is supposed to have ended and continues to display a screen when it is not supposed to.

mlgomez commented 1 year ago

A little debugging show that it is stuck on

https://github.com/Plagman/gamescope/blob/2a09fbcb695102e9a990ed7cf1fdc350397a58f1/src/wlserver.cpp#L1211

Adding a timeout fix the issue, however I don't know why it is stuck there.

This seems like something that should be in a pull request.

awsms commented 1 year ago

I noticed that killing gamescope won't kill the invoked program either.... is it expected behaviour, or another bug?

EoceneMiacid commented 1 year ago

This is really quite a severe bug.

It means I can start a Steam game in gamescope just fine, but I can't launch another one without rebooting the PC, even after explicitly killing the 'gamescope' process, restarting Steam, etc.

If I exit a non-Steam game in gamescope, the process won't terminate properly either. After a while, the console it was started from starts spamming the message 'vblankmanager: write failed: Resource temporarily unavailable'.

denisstrizhkin commented 1 year ago
I encounter the same problem with flatpak: ID Version Branch
com.valvesoftware.Steam.CompatibilityTool.Proton-GE 8.14-1 stable
org.freedesktop.Platform.VulkanLayer.gamescope 3.12.5 23.08
com.valvesoftware.Steam 1.0.0.78 stable

My desktop environment is GNOME Wayland. When I launch Stardew Valley it works as expected and if I quit from game menu it closes just fine too. But if I close the window itself then the game closes but gamescope just hangs around. Even if I use sudo pkill -9 -f gamescope the game shows as stopped in steam but I can't open it again unless I restart the steam client. Same behavior for Half-Life 1.

denisstrizhkin commented 1 year ago

I can provide any additional info if needed.

DeedleFake commented 1 year ago

@EoceneMiacid

I've found that it is possible to start a new game without rebooting, but it required killing the entire process tree of everything gamescope started and even then it seems to fail to fix the problem occasionally.

TiZ-HugLife commented 11 months ago

A little debugging show that it is stuck on https://github.com/Plagman/gamescope/blob/2a09fbcb695102e9a990ed7cf1fdc350397a58f1/src/wlserver.cpp#L1211 Adding a timeout fix the issue, however I don't know why it is stuck there.

This seems like something that should be in a pull request.

A pull request was made, but @emersion felt that waiting was not a good fix. What is the problem with waiting? Specifically, what other things stand to break if this method is used? This is a legitimate question. Users are left out in the cold on a 7-month old issue that has a very trivial workaround, so it merits a response.

A real fix will definitely take some digging into all the interlocking parts, but there has been radio silence from gamescope contributors on this issue, so we don't know what--if anything--is being done to figure out what the real fix is. So why not merge a workaround if the workaround doesn't impact anything else? Sure, this creates technical debt, which is very real and shouldn't be ignored, but by leaving issues unaddressed in pursuit of real fixes, you create a different sort of debt that I can't really find a word for.

yaomtc commented 11 months ago

This also occurs with xivlauncher. I use Gamescope to get around this issue: https://bugs.kde.org/show_bug.cgi?id=458233

returnofblank commented 11 months ago

I'm having the issue with CS2, can't say I've ever had the issue on other games, but I don't really use gamescope with other games.

Edit: Issue persists on other games, just tried Raft

Joshua-Ashton commented 11 months ago

Very strange, this used to work and no code has changed here. Gamescope sets itself up as a reaper so if it dies its children should too.

yaomtc commented 11 months ago

To be more specific, the XIVLauncher process ends just fine, it's specifically the gamescope-wl process that keeps going (and Steam doesn't know XIVLauncher has quit until I end that process manually)

Joshua-Ashton commented 11 months ago

Can you try with the latest stuff I pushed to master?

shindaseishin commented 11 months ago

@Joshua-Ashton I just pulled your changes and compiled. I have tested with a couple of games and gamescope now seems to quit properly when quitting the game.

yaomtc commented 11 months ago

Can't get it to work in Plasma, gives an error about something being unsupported. I'll get it in a minute. In GNOME there's a different issue.

$ XL_SECRET_PROVIDER=FILE gamescope -w 2560 -h 1440 -f -- %command% run --parent-expose-pids --parent-share-pids --parent-pid=1 --branch=stable --arch=x86_64 --command=xivlauncher dev.goats.xivlauncher
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
wlserver: [backend/headless/backend.c:68] Creating headless backend
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
vulkan: selecting physical device 'AMD Radeon RX 5700 XT (RADV NAVI10)': queue family 1 (general queue family 0)
vulkan: physical device supports DRM format modifiers
vulkan: supported DRM formats for sampling usage:
vulkan:   AR24 (0x34325241)
vulkan:   XR24 (0x34325258)
vulkan:   AB24 (0x34324241)
vulkan:   XB24 (0x34324258)
vulkan:   RG16 (0x36314752)
vulkan:   NV12 (0x3231564E)
vulkan:   AB4H (0x48344241)
vulkan:   XB4H (0x48344258)
vulkan:   AB48 (0x38344241)
vulkan:   XB48 (0x38344258)
vulkan:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:16] Starting headless backend
wlserver: [xwayland/sockets.c:63] Failed to bind socket @/tmp/.X11-unix/X0: Address already in use
wlserver: [xwayland/server.c:108] Starting Xwayland on :3
wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x5650f2723df0 (res 0x5650f2749d30)
wlserver: [xwayland/server.c:273] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 93
xwm: execvp failed: No such file or directory
gamescope: children shut down!
(EE) failed to read Wayland events: Broken pipe
yaomtc commented 11 months ago

Plasma:

$ XL_SECRET_PROVIDER=FILE gamescope -w 2560 -h 1440 -f -- %command% run --parent-expose-pids --parent-share-pids --parent-pid=1 --branch=stable --arch=x86_64 --command=xivlauncher dev.goats.xivlauncher
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
Your Wayland compositor does NOT support wp_presentation/presentation-time which is required for VK_KHR_present_wait and VK_KHR_present_id which is needed for Gamescope to function.
Please update your compositor or complain to your compositor vendor for support.

This is on Arch with Plasma (Wayland) and Gnome on Wayland.

EoceneMiacid commented 11 months ago

I just compiled the latest version from git as well, and I'm now experiencing several new problems.

I'm on Arch, using the Wayfire compositor on an ATI Radeon 6600.

gamescope -w 1920 -h 1080 -f -- wine game.exe - this now crashes my compositor outright, most of the time. Interestingly, when it doesn't, gamescope now terminates properly after quitting the game. The crash could be a Wayfire bug.

Running gamescope with no arguments shows:

No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
wlserver: [backend/headless/backend.c:68] Creating headless backend
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
vulkan: selecting physical device 'AMD Radeon RX 6600 (RADV NAVI23)': queue family 1 (general queue family 0)
vulkan: physical device supports DRM format modifiers
vulkan: supported DRM formats for sampling usage:
vulkan:   AR24 (0x34325241)
vulkan:   XR24 (0x34325258)
vulkan:   AB24 (0x34324241)
vulkan:   XB24 (0x34324258)
vulkan:   RG16 (0x36314752)
vulkan:   NV12 (0x3231564E)
vulkan:   AB4H (0x48344241)
vulkan:   XB4H (0x48344258)
vulkan:   AB48 (0x38344241)
vulkan:   XB48 (0x38344258)
vulkan:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
wlserver: [wayland] unable to lock lockfile /run/user/1000/gamescope-0.lock, maybe another compositor is running
wlserver: Running compositor on wayland display 'gamescope-1'
wlserver: [backend/headless/backend.c:16] Starting headless backend
wlserver: [xwayland/server.c:108] Starting Xwayland on :2
wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x5619625ca110 (res 0x5619624f8310)
wlserver: [xwayland/server.c:273] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 70
pipewire: renegotiating stream params (size: 1280x720)

What is completely broken now is running Steam games, however.

This used to work:

gamescope -w 1920 -h 1080 -f -r 60 -e -- /home/eocene/.steam/steam/ubuntu12_32/reaper SteamLaunch AppId=985890 -- /home/eocene/.steam/steam/ubuntu12_32/steam-launch-wrapper -- /home/eocene/.steam/steam/steamapps/common/Streets of Rage 4/SOR4

But with the latest version this happens:

gamescope -w 1920 -h 1080 -r 60 -f -e -- /home/eocene/.steam/steam/ubuntu12_32/reaper SteamLaunch AppId=985890 -- /home/eocene/.steam/steam/ubuntu12_32/steam-launch-wrapper -- /home/eocene/.steam/steam/steamapps/common/Streets of Rage 4/SOR4
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
wlserver: [backend/headless/backend.c:68] Creating headless backend
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
vulkan: selecting physical device 'AMD Radeon RX 6600 (RADV NAVI23)': queue family 1 (general queue family 0)
vulkan: physical device supports DRM format modifiers
vulkan: supported DRM formats for sampling usage:
vulkan:   AR24 (0x34325241)
vulkan:   XR24 (0x34325258)
vulkan:   AB24 (0x34324241)
vulkan:   XB24 (0x34324258)
vulkan:   RG16 (0x36314752)
vulkan:   NV12 (0x3231564E)
vulkan:   AB4H (0x48344241)
vulkan:   XB4H (0x48344258)
vulkan:   AB48 (0x38344241)
vulkan:   XB48 (0x38344258)
vulkan:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
wlserver: [wayland] unable to lock lockfile /run/user/1000/gamescope-0.lock, maybe another compositor is running
wlserver: [wayland] unable to lock lockfile /run/user/1000/gamescope-1.lock, maybe another compositor is running
wlserver: Running compositor on wayland display 'gamescope-2'
wlserver: [backend/headless/backend.c:16] Starting headless backend
wlserver: [xwayland/server.c:108] Starting Xwayland on :3
wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x55d9bb4f6ec0 (res 0x55d9bb4e2e40)
wlserver: [xwayland/server.c:273] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 73
gamescope: children shut down!

Adding gamescope to a game's launch options in steam has the same effect.

gamescope -w 1920 -h 1080 -r 60 -f -e -- %command%

awsms commented 11 months ago

to add something to yaomtc comment, gamescope used to work a few months ago (toggling fullscreen will freeze my PC and other shenanigans). however it's now completely unusable (RTX 3600 mobile / Cinnamon DE): every single time I'll launch gamescope, I'll meet another bug then crash. and commit after commit, I'll meet even new bugs. now, launching gamescope will simply invoke a black screen, and my PC will halt for ~5sec when I kill it.

gamescope -W 1920 -H 1080 -r 120 -- vkcube
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
wlserver: [backend/headless/backend.c:68] Creating headless backend
vulkan: selecting physical device 'NVIDIA GeForce RTX 3060 Laptop GPU': queue family 2 (general queue family 0)
vulkan: physical device supports DRM format modifiers
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x3231564E (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x48344241 (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x48344258 (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x38344241 (VkResult: 0)
vulkan: vkGetPhysicalDeviceFormatProperties2 returned zero modifiers for DRM format 0x38344258 (VkResult: 0)
vulkan: supported DRM formats for sampling usage:
vulkan:   AR24 (0x34325241)
vulkan:   XR24 (0x34325258)
vulkan:   AB24 (0x34324241)
vulkan:   XB24 (0x34324258)
vulkan:   RG16 (0x36314752)
vulkan:   AB30 (0x30334241)
vulkan:   XB30 (0x30334258)
vulkan:   AR30 (0x30335241)
vulkan:   XR30 (0x30335258)
wlserver: Running compositor on wayland display 'gamescope-0'
wlserver: [backend/headless/backend.c:16] Starting headless backend
wlserver: [xwayland/server.c:108] Starting Xwayland on :1
wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x55d2910818a0 (res 0x55d2910843d0)
wlserver: [xwayland/server.c:273] Xserver is ready
pipewire: stream state changed: connecting
pipewire: stream state changed: paused
pipewire: stream available on node ID: 69
Selected GPU 0: NVIDIA GeForce RTX 3060 Laptop GPU, type: DiscreteGpu
[Gamescope WSI] Creating Gamescope surface: xid: 0x400000
[Gamescope WSI] Atom of T was wrong type. Expected XCB_ATOM_CARDINAL.
wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x55d290f44f70 (res 0x55d2910895a0)
[Gamescope WSI] Atom of T was wrong type. Expected XCB_ATOM_CARDINAL.
[Gamescope WSI] Made gamescope surface for xid: 0x400000
[Gamescope WSI] Surface state:
  steam app id:                  0
  window xid:                    0x400000
  wayland surface res id:        5
  layer client flags:            0x0
  server hdr output enabled:     false
  hdr formats exposed to client: false
wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x55d29110aa30 (res 0x55d2910897e0)
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.
Errors from xkbcomp are not fatal to the X server
[Gamescope WSI] Creating swapchain for xid: 0x400000 - minImageCount: 3 - format: VK_FORMAT_B8G8R8A8_UNORM - colorspace: VK_COLOR_SPACE_SRGB_NONLINEAR_KHR - flip: true
[Gamescope WSI] Created swapchain for xid: 0x400000 - imageCount: 3

I can still run it OK from the TTY though.

Joshua-Ashton commented 11 months ago

gamescope -w 1920 -h 1080 -f -- wine game.exe - this now crashes my compositor outright, most of the time. Interestingly, when it doesn't, gamescope now terminates properly after quitting the game. The crash could be a Wayfire bug.

If your compositor is crashing, then yes, that's a compositor bug. (Unless you see a GPU hang in dmesg)

Joshua-Ashton commented 11 months ago

Also you should not be using -e if you are not launching Steam.

awsms commented 11 months ago

gamescope -w 1920 -h 1080 -f -- wine game.exe - this now crashes my compositor outright, most of the time. Interestingly, when it doesn't, gamescope now terminates properly after quitting the game. The crash could be a Wayfire bug.

If your compositor is crashing, then yes, that's a compositor bug. (Unless you see a GPU hang in dmesg)

do you know which compositors work fine with gamescope?

yaomtc commented 11 months ago

Oh yeah I forgot 3.12.x doesn't work for me: #919

EDIT: 3.12.5 works, at least with vanilla FFXIV via Proton. It's the latest version I build from gamescope-git on AUR that I couldn't get to work at all

EDIT (2024) - I've since lost my reason to use gamescope so I'm not following this topic anymore

awsms commented 11 months ago

Replying to https://github.com/ValveSoftware/gamescope/issues/777#issuecomment-1742092314

doesn't even work on TTY anymore since recent commits.

EoceneMiacid commented 11 months ago

Yeah, gamescope is now more broken than it's ever been.

Joshua-Ashton commented 11 months ago

Are you talking about the same issue where it's your compositor crashing? If so, I don't really think there is anything I can do about that. If you want to bisect it might be useful information at least.

doesn't even work on TTY anymore since recent commits.

Can you give info on your setup? It's working fine for me.

EoceneMiacid commented 11 months ago

Are you talking about the same issue where it's your compositor crashing? If so, I don't really think there is anything I can do about that. If you want to bisect it might be useful information at least.

I'm working with the compositor developers to fix it. It is related to a 'bad xwayland window', so at the very least this helps us fix an edge case.

It is difficult to nail down what the precise cause is because we are testing it on three very similar setups (Arch Linux, AMD Radeon, exact same compositor revision) and we are all experiencing crashes, but under very different circumstances.

What also doesn't help is that the recent commit broke my gamescope integration in my frontend. There it doesn't make the compositor crash (despite using the same command line parameters), but rather the gamescope process just terminates immediately after launching with the 'gamescope: children shut down!' message. The game window then launches regardless.

So, very inconsistent behaviour. We are looking into the compositor crash situation at the moment.

Joshua-Ashton commented 11 months ago

If the main child shuts down then Gamescope will correctly now yes. Are you launching in some wrapper that immediately kills itself?

I would like to help but things are still very vague. If you can give repro steps that'd be appreciated.

awsms commented 11 months ago

If the main child shuts down then Gamescope will correctly now yes.

This is not the case for me. After running gamescope -w 1920 -h 1080 -r 60 -- vkcube then exiting it, I can see the gamescope: children shut down! message (note that gamescope spawns a buggy window with no content), but gamescope will never close by itself untill I manually kill the process. If I don't kill gamescope, then my terminal gets spammed with "vblankmanager: write failed: Resource temporarily unavailable" forever. I'm running 3.12.7.r0.gd1eb70b. NVIDIA RTX 3600 mobile, i3, without a compositor.

EoceneMiacid commented 11 months ago

Discovered something interesting in the meantime.

gamescope -w 1920 -h 1080 -r 60 -f -- vkcube ... crashes the compositor.

gamescope -w 1920 -h 1080 -r 60 -- vkcube ... doesn't.

So the -f switch (fullscreen) is the cause.

As for the problem with gamescope quitting immediately, it seems this is related to gamemode. I will look into this in-depth tomorrow.

anthr76 commented 5 months ago

I'm also facing this issue on KDE 6

I have launch arguments that look like this

gamemoderun gamescope -f --force-grab-cursor --mangoapp --prefer-vk-device 1002:744c --rt -W 3840 -H 2160 -w 3840 -h 2160 -r 60 -- env MANGOHUD="1" %command%

At the time of writing I have this up until this commit installed https://github.com/ValveSoftware/gamescope/commit/bc0cf62d813048a93ac8c82994340c166d863833

DeedleFake commented 5 months ago

Try running gamescope with SDL_VIDEODRIVER=x11. That seems to have fixed it the vast majority of the time for me, as well as a ton of other bugs.

BearsPunch commented 4 months ago

Try running gamescope with SDL_VIDEODRIVER=x11. That seems to have fixed it the vast majority of the time for me, as well as a ton of other bugs.

Can confirm that SDL_VIDEODRIVER=x11 fix the issue. After that explorer.exe and other win processes close after game closed

superboo07 commented 1 month ago

Try running gamescope with SDL_VIDEODRIVER=x11. That seems to have fixed it the vast majority of the time for me, as well as a ton of other bugs.

Game refuses to launch when using this as a launch option for gamescope. Logs from lutris are included below.

lutris-wrapper: School Days
Started initial process 20910 from gamescope -w 2880 -h 1800 SDL_VIDEODRIVER=x11 -- /home/misha/.local/share/lutris/runners/wine/wine-tkg-valve-exp-bleeding-9.0.108818.20240723-327-x86_64.pkg/bin/wine /home/misha/Documents/School Days/School-Days-Stuff/School Days/SCHOOLDAYS HQ.exe
Start monitoring process.
[gamescope] [Info]  console: gamescope version 3.14.24
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
Failed to load plugin: '/usr/lib/libatk-bridge-2.0.so.0: undefined symbol: atk_object_get_help_text'
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
[gamescope] [Info]  vulkan: selecting physical device 'Intel(R) Graphics (RPL-P)': queue family 0 (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: 
[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:   AB48 (0x38344241)
[gamescope] [Info]  vulkan:   XB48 (0x38344258)
[gamescope] [Info]  vulkan:   AB30 (0x30334241)
[gamescope] [Info]  vulkan:   AR30 (0x30335241)
[gamescope] [Info]  vulkan:   XR30 (0x30335258)
[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 :2
[gamescope] [Debug] wlserver: [types/wlr_compositor.c:771] New wlr_surface 0x59251bf79c70 (res 0x59251bf81400)
[gamescope] [Debug] wlserver: [xwayland/server.c:272] Xserver is ready
[gamescope] [Info]  pipewire: stream state changed: connecting
[gamescope] [Info]  pipewire: stream state changed: paused
[gamescope] [Info]  pipewire: stream available on node ID: 110
[gamescope] [Info]  xwm: Embedded, no cursor set. Using left_ptr by default.
[gamescope] [Info]  vblank: Using timerfd.
[gamescope] [Info]  xdg_backend: PreferredMetadata: Red: 0.67968 0.32032, Green: 0.2373 0.72266, Blue: 0.13964 0.0498, White: 0.3125 0.3291, Max Luminance: 200 nits, Min Luminance: 0 nits, Max Full Frame Luminance: 200 nits
[gamescope] [Info]  josh edid: Patching res 800x1280 -> 2880x1800
[gamescopereaper] [Error] process: Failed to start process "SDL_VIDEODRIVER=x11": No such file or directory
[gamescope] [Info]  launch: Primary child shut down!
[gamescope] [Debug] pipewire: renegotiating stream params (size: 2560x1440)
(EE) failed to read Wayland events: Broken pipe
Monitored process exited.
Initial process has exited (return code: 0)
All processes have quit
Exit with return code 0
DeedleFake commented 1 month ago

@superboo07

Because of various changes, the SDL_VIDEODRIVER=x11 fix no longer works. Instead, use env -u WAYLAND_DISPLAY gamescope ....

unit73e commented 1 month ago

I have the same issue with wine:

The process gets stuck if I run the following command and try to exit:

gamescope -- wine explorer

But it works fine if I run with the SDL backend:

gamescope --backend sdl -- wine explorer

Only small issue with the SDL backend (probably the same as env -u WAYLAND_DISPLAY because that just tells you're not running Wayland) is I get a core dump after exiting:

[1]    10904 IOT instruction (core dumped)  gamescope --backend sdl -- wine explorer

Not sure if that's normal because wine doesn't support Wayland AFAIK.

With other processes it works fine:

gamescope -- sleep 3
gamescope -- vkcube
gamescope -- glxgears

With SDL backend it will always core dump at the end, even with the commands above.

AlexFolland commented 1 week ago

This happens to me as well. I'm using KDE Plasma (Wayland). Prepending env -u WAYLAND_DISPLAY to my gamescope command does allow gamescope to quit, but leaves gamescopereaper running. I have to periodically open ksysguard and send KILL signals to the gamescopereaper processes to get them to all quit. Here's my gamescope command:

env -u WAYLAND_DISPLAY gamescope --fullscreen --nested-width 1920 --nested-height 1080 --scaler fit --filter pixel -- wine '/run/media/alex/gaming/games/worms armageddon/WA.exe'