ValveSoftware / gamescope

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

Gamescope exits before running game: (EE) failed to read Wayland events: Broken pipe #1557

Closed feffes closed 1 day ago

feffes commented 1 day ago

Hey, I'm trying to run Blazblue Centralfiction (steam app id 586140) using Proton-GE 8-25 with gamescope. Running the game directly in sway works completely fine, but if I run the game in gamescope under sway gamescope exits early and then proceeds to launch the game in a normal sway container.

feffe at tori in ~/gamescope
$ PROTON_LOG=1 gamescope -w 2560 -h 1440 --  steam steam://rungameid/586140
[gamescope] [Info]  console: gamescope version 3.15.9-8-gddf0d76d (gcc 14.2.1)
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
[gamescope] [Info]  vulkan: selecting physical device 'AMD Radeon RX 7900 XTX (RADV NAVI31)': 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: seat0
[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:   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: 254
[gamescope] [Info]  xwm: Embedded, no cursor set. Using left_ptr by default.
[gamescope] [Info]  vblank: Using timerfd.
[gamescope] [Info]  edid: Patching res 800x1280 -> 2560x1440
[gamescope] [Info]  launch: Primary child shut down!
(EE) failed to read Wayland events: Broken pipe
feffe at tori in ~/gamescope
$

When I run gamescope -e -w 2560 -h 1440 -- steam steam://rungameid/586140 it first runs the full output pasted above, including exiting and returning to the shell prompt, then proceeds to run the game anyway, but without any gamescope process as its parent (no gamescope processes exist at this point).

This happens when I run it through steam in embedded mode as well, except in that case the gamescope session will be completely fine until I run the actual game, at which point the gamescope session will send me back to the tty display but fail to exit the actual gamescope program (it can still be seen with htop but won't exit until killed manually).

this is what I use to run embedded mode

#!/bin/zsh
DXVK_HDR=1 \
  gamescope -e \
  --adaptive-sync \
  -f \
  -O DP-2 \
  -w 3840 \
  -h 2160 \
  -W 3840 \
  -H 2160 \
  -r 120 \
  --hdr-enabled \
  --hdr-itm-enabled \
  -- steam -gamepadui -steamos3 

steam-586140.log

This is the only game that has this issue for me so far. I've run gamescope with dozens of other games completely fine with this setup.

Arch linux using the latest packages from the official repos + latest mesa-git and gamescope-git as of the time of writing (although I did reproduce the issues on stable versions of those packages as well).

AMD RX 7900 XTX

kisak-valve commented 1 day ago

Hello @feffes, PROTON_LOG=1 gamescope -w 2560 -h 1440 -- steam steam://rungameid/586140 this command reads as set an environment variable, start gamescope, call Steam's startup script to hand off the message steam://rungameid/586140 to the running Steam instance and close.

It is not in any way a direct start of the game, and an abnormal method to try to do that.

matte-schwartz commented 1 day ago

fwiw I do not see this issue in embedded gamescope on neither Proton Experimental bleeding-edge (btw videos and audio both seem to work OOTB with this) nor GE 8-25.

gamescope \
    --generate-drm-mode fixed \
    --xwayland-count 2 \
    -w 7680 -h 2160 \
    --default-touch-mode 4 \
    --hide-cursor-delay 3000 \
    --max-scale 2 \
    --fade-out-duration 200 \
    --cursor-scale-height 2160 \
    -e -R "$socket" -T "$stats" \
    -O '*',eDP-1 \

I use Valve's /usr/bin/gamescope-session from SteamOS so Steam gets launched with -steamos3 -steampal -gamepadui -steamdeck. Adaptive sync and HDR were both enabled via the right Steam performance menu toggles. I tried your exact embedded command as well and did not experience the same issue.

I don't use Sway so I'm unsure if there is a separate Sway-specific issue here or not.

feffes commented 1 day ago

Thanks, editing the launch options of the game to PROTON_LOG=1 gamescope -w 2560 -h 1440 %command% and running that directly actually got it to run as a child of the gamescope process and everything looks correct in htop.

As for the crash on the embedded side, it seems that something I did has resolved that as well. My hunch was that it might have been some weird game display config state but I'm unable to reproduce the issue even after deleting the compatdata. It would crash gamescope under GE 8-25 with empty launch options and no compatdata, and now it no longer crashes gamescope and plays completely fine under GE 8-25 with empty launch options and no compatdata.

I guess it's fine to close this since I can no longer reproduce the issue.