chimeraos icon indicating copy to clipboard operation
chimeraos copied to clipboard

Gamescope crashes when monitor is turned off, does not recover when monitor turned on again.

Open phoyd opened this issue 1 year ago • 16 comments

When I turn off my monitor in game mode and later turn it on again, I see nothing but a black screen with a cursor blinking. After a while desktop mode starts. Starting game mode from desktop mode manually fails and throws me back into desktop mode.

i.E.

  1. I am in game mode.
  2. I turn off my monitor gamescope-stdout.log steam-stdout.log
  3. I turn my monitor on again
  4. I am seeing a black screen with a text mode cursor blinking in the upper left.
  5. After a while, desktop mode starts
  6. Starting game mode from the desktop mode ui fails and throws me back into desktop mode (step 5)

Here's my `.gamescope-stdout.log' when I turn my monitor off (date column and comments added by me):

# These lines are from the gamescope startup. 
Wed Jan 24 12:57:54 PM CET 2024: wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x564b762d47d0 (res 0x564b766c0bb0)
Wed Jan 24 12:57:54 PM CET 2024: xwm: Rejecting WM_CHANGE_STATE to ICONIC for window 0x400007
Wed Jan 24 12:57:54 PM CET 2024: wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x564b76735840 (res 0x564b766c2350)
Wed Jan 24 12:57:54 PM CET 2024: drm: drmModeAddFB2 failed: Invalid argument
Wed Jan 24 12:57:54 PM CET 2024: xwm: got the same buffer committed twice, ignoring.
Wed Jan 24 12:57:54 PM CET 2024: drm: drmModeAddFB2 failed: Invalid argument
Wed Jan 24 12:57:54 PM CET 2024: drm: [josh edid] BASE Checksum valid? Y
Wed Jan 24 12:57:54 PM CET 2024: drm: [josh edid] Wrote new edid to: /home/gamer/.config/gamescope/edid.bin
Wed Jan 24 12:57:54 PM CET 2024: drm: drmModeAddFB2 failed: Invalid argument
Wed Jan 24 12:57:54 PM CET 2024: wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x564b7673e990 (res 0x564b766c6090)
# Now I turn off the monitor: 
Wed Jan 24 12:58:22 PM CET 2024: wlserver: [backend/session/session.c:181] udev event for card1 (change)
Wed Jan 24 12:58:22 PM CET 2024: wlserver: [backend/session/session.c:210] DRM device card1 changed
Wed Jan 24 12:58:22 PM CET 2024: wlserver: Got change event for KMS device
Wed Jan 24 12:58:22 PM CET 2024: drm: CRTC 53 has no degamma LUT support
Wed Jan 24 12:58:22 PM CET 2024: drm: CRTC 53 has no VALVE1_CRTC_REGAMMA_TF support
Wed Jan 24 12:58:22 PM CET 2024: drm: CRTC 55 has no degamma LUT support
Wed Jan 24 12:58:22 PM CET 2024: drm: CRTC 55 has no VALVE1_CRTC_REGAMMA_TF support
Wed Jan 24 12:58:22 PM CET 2024: drm: CRTC 57 has no degamma LUT support
Wed Jan 24 12:58:22 PM CET 2024: drm: CRTC 57 has no VALVE1_CRTC_REGAMMA_TF support
Wed Jan 24 12:58:22 PM CET 2024: drm: CRTC 59 has no degamma LUT support
Wed Jan 24 12:58:22 PM CET 2024: drm: CRTC 59 has no VALVE1_CRTC_REGAMMA_TF support
Wed Jan 24 12:58:22 PM CET 2024: drm: CRTC 61 has no degamma LUT support
Wed Jan 24 12:58:22 PM CET 2024: drm: CRTC 61 has no VALVE1_CRTC_REGAMMA_TF support
Wed Jan 24 12:58:22 PM CET 2024: drm: CRTC 63 has no degamma LUT support
Wed Jan 24 12:58:22 PM CET 2024: drm: CRTC 63 has no VALVE1_CRTC_REGAMMA_TF support
Wed Jan 24 12:58:22 PM CET 2024: drm: current connector 'DP-3' disconnected
Wed Jan 24 12:58:22 PM CET 2024: drm: cannot find any connected connector!
Wed Jan 24 12:58:22 PM CET 2024: wlserver: Updating mode for xwayland server #0: 1280x720@60
Wed Jan 24 12:58:22 PM CET 2024: vulkan: 3932160 vs 3932160!
Wed Jan 24 12:58:22 PM CET 2024: vulkan: 3932160 vs 3932160!
Wed Jan 24 12:58:22 PM CET 2024: vulkan: 3932160 vs 3932160!
Wed Jan 24 12:58:22 PM CET 2024: pipewire: renegotiating stream params (size: 1280x720)
Wed Jan 24 12:58:23 PM CET 2024: (EE) failed to read Wayland events: Broken pipe
Wed Jan 24 12:58:23 PM CET 2024: (EE) failed to read Wayland events: Broken pipe
# After a few second an attempt to initialize the display seems to be made: 
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [backend/headless/backend.c:68] Creating headless backend
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [libseat] [libseat/backend/seatd.c:64] Could not connect to socket /run/seatd.sock: No such file or directory
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [libseat] [libseat/libseat.c:76] Backend 'seatd' failed to open seat, skipping
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [libseat] [libseat/libseat.c:73] Seat opened with backend 'logind'
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [backend/session/session.c:109] Successfully loaded libseat session
Wed Jan 24 12:58:30 PM CET 2024: ATTENTION: default value of option vk_xwayland_wait_ready overridden by environment.
Wed Jan 24 12:58:30 PM CET 2024: ATTENTION: default value of option vk_xwayland_wait_ready overridden by environment.
Wed Jan 24 12:58:30 PM CET 2024: ATTENTION: default value of option vk_xwayland_wait_ready overridden by environment.
Wed Jan 24 12:58:30 PM CET 2024: drm: warning: picking an arbitrary DRM device
Wed Jan 24 12:58:30 PM CET 2024: drm: Immediate flips are not supported by the KMS driver
Wed Jan 24 12:58:30 PM CET 2024: drm: found new connector 'DVI-D-1'
Wed Jan 24 12:58:30 PM CET 2024: drm: found new connector 'HDMI-A-1'
Wed Jan 24 12:58:30 PM CET 2024: drm: found new connector 'DP-3'
Wed Jan 24 12:58:30 PM CET 2024: drm: found new connector 'DP-2'
Wed Jan 24 12:58:30 PM CET 2024: drm: found new connector 'DP-1'
Wed Jan 24 12:58:30 PM CET 2024: drm: CRTC 53 has no degamma LUT support
Wed Jan 24 12:58:30 PM CET 2024: drm: CRTC 53 has no VALVE1_CRTC_REGAMMA_TF support
Wed Jan 24 12:58:30 PM CET 2024: drm: CRTC 55 has no degamma LUT support
Wed Jan 24 12:58:30 PM CET 2024: drm: CRTC 55 has no VALVE1_CRTC_REGAMMA_TF support
Wed Jan 24 12:58:30 PM CET 2024: drm: CRTC 57 has no degamma LUT support
Wed Jan 24 12:58:30 PM CET 2024: drm: CRTC 57 has no VALVE1_CRTC_REGAMMA_TF support
Wed Jan 24 12:58:30 PM CET 2024: drm: CRTC 59 has no degamma LUT support
Wed Jan 24 12:58:30 PM CET 2024: drm: CRTC 59 has no VALVE1_CRTC_REGAMMA_TF support
Wed Jan 24 12:58:30 PM CET 2024: drm: CRTC 61 has no degamma LUT support
Wed Jan 24 12:58:30 PM CET 2024: drm: CRTC 61 has no VALVE1_CRTC_REGAMMA_TF support
Wed Jan 24 12:58:30 PM CET 2024: drm: CRTC 63 has no degamma LUT support
Wed Jan 24 12:58:30 PM CET 2024: drm: CRTC 63 has no VALVE1_CRTC_REGAMMA_TF support
Wed Jan 24 12:58:30 PM CET 2024: drm: Connectors:
Wed Jan 24 12:58:30 PM CET 2024: drm:   DVI-D-1 (disconnected)
Wed Jan 24 12:58:30 PM CET 2024: drm:   HDMI-A-1 (disconnected)
Wed Jan 24 12:58:30 PM CET 2024: drm:   DP-3 (disconnected)
Wed Jan 24 12:58:30 PM CET 2024: drm:   DP-2 (disconnected)
Wed Jan 24 12:58:30 PM CET 2024: drm:   DP-1 (disconnected)
Wed Jan 24 12:58:30 PM CET 2024: drm: cannot find any connected connector!
Wed Jan 24 12:58:30 PM CET 2024: vulkan: selecting physical device 'AMD Radeon RX 570 Series (RADV POLARIS10)': queue family 1
Wed Jan 24 12:58:30 PM CET 2024: vulkan: physical device does not support DRM format modifiers
Wed Jan 24 12:58:30 PM CET 2024: vulkan: supported DRM formats for sampling usage:
Wed Jan 24 12:58:30 PM CET 2024: vulkan:   AR24 (0x34325241)
Wed Jan 24 12:58:30 PM CET 2024: vulkan:   XR24 (0x34325258)
Wed Jan 24 12:58:30 PM CET 2024: vulkan:   AB24 (0x34324241)
Wed Jan 24 12:58:30 PM CET 2024: vulkan:   XB24 (0x34324258)
Wed Jan 24 12:58:30 PM CET 2024: vulkan:   AB4H (0x48344241)
Wed Jan 24 12:58:30 PM CET 2024: vulkan:   XB4H (0x48344258)
Wed Jan 24 12:58:30 PM CET 2024: vulkan:   AB48 (0x38344241)
Wed Jan 24 12:58:30 PM CET 2024: vulkan:   XB48 (0x38344258)
Wed Jan 24 12:58:30 PM CET 2024: vulkan:   AB30 (0x30334241)
Wed Jan 24 12:58:30 PM CET 2024: vulkan:   XB30 (0x30334258)
Wed Jan 24 12:58:30 PM CET 2024: vulkan:   AR30 (0x30335241)
Wed Jan 24 12:58:30 PM CET 2024: vulkan:   XR30 (0x30335258)
Wed Jan 24 12:58:30 PM CET 2024: vulkan: 3932160 vs 3932160!
Wed Jan 24 12:58:30 PM CET 2024: vulkan: 3932160 vs 3932160!
Wed Jan 24 12:58:30 PM CET 2024: vulkan: 3932160 vs 3932160!
Wed Jan 24 12:58:30 PM CET 2024: wlserver: Running compositor on wayland display 'gamescope-0'
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [backend/headless/backend.c:16] Starting headless backend
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [backend/libinput/backend.c:87] Starting libinput backend
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [backend/libinput/events.c:70] Adding Power Button [0:1]
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [backend/libinput/events.c:70] Adding Power Button [0:1]
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [backend/libinput/events.c:70] Adding Lenovo ThinkPad Compact USB Keyboard with TrackPoint [6127:24647]
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [backend/libinput/events.c:70] Adding Lenovo ThinkPad Compact USB Keyboard with TrackPoint [6127:24647]
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [backend/libinput/backend.c:128] libinput successfully initialized
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [xwayland/server.c:108] Starting Xwayland on :0
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [xwayland/server.c:108] Starting Xwayland on :1
Wed Jan 24 12:58:30 PM CET 2024: ATTENTION: default value of option mesa_glthread overridden by environment.
Wed Jan 24 12:58:30 PM CET 2024: ATTENTION: default value of option mesa_glthread overridden by environment.
Wed Jan 24 12:58:30 PM CET 2024: ATTENTION: default value of option mesa_glthread overridden by environment.
Wed Jan 24 12:58:30 PM CET 2024: ATTENTION: default value of option mesa_glthread overridden by environment.
Wed Jan 24 12:58:30 PM CET 2024: ATTENTION: default value of option mesa_glthread overridden by environment.
Wed Jan 24 12:58:30 PM CET 2024: ATTENTION: default value of option mesa_glthread overridden by environment.
Wed Jan 24 12:58:30 PM CET 2024: ATTENTION: default value of option mesa_glthread overridden by environment.
Wed Jan 24 12:58:30 PM CET 2024: ATTENTION: default value of option mesa_glthread overridden by environment.
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x5576fbf6c1c0 (res 0x5576fc0c1640)
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [xwayland/server.c:273] Xserver is ready
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x5576fbf6f560 (res 0x5576fc092570)
Wed Jan 24 12:58:30 PM CET 2024: wlserver: [xwayland/server.c:273] Xserver is ready
Wed Jan 24 12:58:30 PM CET 2024: pipewire: stream state changed: connecting
Wed Jan 24 12:58:30 PM CET 2024: pipewire: stream state changed: paused
Wed Jan 24 12:58:30 PM CET 2024: pipewire: stream available on node ID: 46
Wed Jan 24 12:58:30 PM CET 2024: xwm: Embedded, no cursor set. Using left_ptr by default.
Wed Jan 24 12:58:30 PM CET 2024: xwm: Embedded, no cursor set. Using left_ptr by default.
Wed Jan 24 12:58:30 PM CET 2024: wlserver: Updating mode for xwayland server #0: 1280x720@60
Wed Jan 24 12:58:30 PM CET 2024: vulkan: 3932160 vs 3932160!
Wed Jan 24 12:58:30 PM CET 2024: vulkan: 3932160 vs 3932160!
Wed Jan 24 12:58:30 PM CET 2024: vulkan: 3932160 vs 3932160!
Wed Jan 24 12:58:30 PM CET 2024: pipewire: renegotiating stream params (size: 1280x720)
Wed Jan 24 12:58:31 PM CET 2024: wlserver: [types/wlr_compositor.c:681] New wlr_surface 0x5576fbce5990 (res 0x5576fc08ef70)
Wed Jan 24 12:58:32 PM CET 2024: (EE) failed to read Wayland events: Broken pipe
Wed Jan 24 12:58:32 PM CET 2024: (EE) failed to read Wayland events: Broken pipe
# Next attempt to initialize display a few seconds later:
Wed Jan 24 12:58:38 PM CET 2024: wlserver: [backend/headless/backend.c:68] Creating headless backend
Wed Jan 24 12:58:38 PM CET 2024: wlserver: [libseat] [libseat/backend/seatd.c:64] Could not connect to socket /run/seatd.sock: No such file or directory
Wed Jan 24 12:58:38 PM CET 2024: wlserver: [libseat] [libseat/libseat.c:76] Backend 'seatd' failed to open seat, skipping
Wed Jan 24 12:58:38 PM CET 2024: wlserver: [libseat] [libseat/libseat.c:73] Seat opened with backend 'logind'
Wed Jan 24 12:58:38 PM CET 2024: wlserver: [backend/session/session.c:109] Successfully loaded libseat session
Wed Jan 24 12:58:38 PM CET 2024: ATTENTION: default value of option vk_xwayland_wait_ready overridden by environment.
Wed Jan 24 12:58:38 PM CET 2024: ATTENTION: default value of option vk_xwayland_wait_ready overridden by environment.
[...]

.steam-stdout.log shows me a crash:

steam.sh[6958]: Running Steam on chimeraos 44-1 (4b7363e) 64-bit
steam.sh[6958]: STEAM_RUNTIME is enabled automatically
setup.sh[7029]: Steam runtime environment up-to-date!
steam.sh[6958]: Steam client's requirements are satisfied
01/24 13:26:14 Init: Installing breakpad exception handler for appid(steam)/version(1705108172)/tid(7071)
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
X connection to :0 broken (explicit kill or server shutdown).
tid(7071) burning pthread_key_t == 0 so we never use it
[2024-01-24 13:26:14] Startup - updater built Jan 13 2024 00:51:43
[2024-01-24 13:26:14] Startup - Steam Client launched with: '/home/gamer/.local/share/Steam/ubuntu12_32/steam' '-gamepadui' '-steamos3' '-steampal' '-steamdeck'
[2024-01-24 13:26:14] Opted in to client beta 'steamdeck_stable' via beta file
You are in the 'steamdeck_stable' client beta.
Looks like steam didn't shutdown cleanly, scheduling immediate update check
[2024-01-24 13:26:14] Loading cached metrics from disk (/home/gamer/.local/share/Steam/package/steam_client_metrics.bin)
[2024-01-24 13:26:14] Using the following download hosts for Public, Realm steamglobal
[2024-01-24 13:26:14] 1. https://client-update.akamai.steamstatic.com, /, Realm 'steamglobal', weight was 1000, source = 'update_hosts_cached.vdf'
[2024-01-24 13:26:14] 2. https://cdn.cloudflare.steamstatic.com, /client/, Realm 'steamglobal', weight was 1, source = 'update_hosts_cached.vdf'
[2024-01-24 13:26:14] 3. https://cdn.steamstatic.com, /client/, Realm 'steamglobal', weight was 1, source = 'baked in'
[2024-01-24 13:26:14] Checking for update on startup
[2024-01-24 13:26:14] Checking for available updates...
[2024-01-24 13:26:14] Downloading manifest: https://client-update.akamai.steamstatic.com/steam_client_steamdeck_stable_ubuntu12
[2024-01-24 13:26:15] Manifest download: send request
src/common/framefunction.cpp (238) : Assertion Failed: CFrameFunctionMgr::~CFrameFunctionMgr: non static FrameFunction[CHTTPClient::BFrameFuncHandleCompletedWorkItems] still registered
01/24 13:26:15 Init: Installing breakpad exception handler for appid(steam)/version(1705108172)/tid(7071)
assert_20240124132615_3.dmp[7117]: Uploading dump (out-of-process)
/tmp/dumps/assert_20240124132615_3.dmp
src/common/framefunction.cpp (238) : Assertion Failed: CFrameFunctionMgr::~CFrameFunctionMgr: non static FrameFunction[CHTTPClient::BFrameFuncHandleCompletedWorkItems] still registered
assert_20240124132615_3.dmp[7117]: Finished uploading minidump (out-of-process): success = yes
assert_20240124132615_3.dmp[7117]: response: CrashID=bp-c21a0d4a-931c-46d7-9c32-a101f2240124
assert_20240124132615_3.dmp[7117]: file ''/tmp/dumps/assert_20240124132615_3.dmp'', upload yes: ''CrashID=bp-c21a0d4a-931c-46d7-9c32-a101f2240124''

My card is a RX570 8GB. I've tried both DisplayPort and HDMI to no avail, ChimeraOS is 44-1 (4b7363e)

phoyd avatar Jan 24 '24 12:01 phoyd

Looks like #770

rzippo avatar Jan 24 '24 20:01 rzippo

Can you test again using the latest stable ChimeraOS 45 release?

alkazar avatar Jan 30 '24 15:01 alkazar

Upgraded to the 45 release. Turning off my monitor and turning it on again or replugging my HDMI cable greets me with a "Downloading configuration updates..." screen and a restart - or a black screen. The crash of game scope happens the moment the monitor is turned off, which means I can only download games with my monitor on :(

My workaround now is to use a EDID dongle.

phoyd avatar Feb 01 '24 09:02 phoyd

So I think this might actually be intended behaviour. Gamescope needs to adjust to any new display environment so it is restarted.

alkazar avatar Feb 01 '24 13:02 alkazar

It used to not do this, in v43. Also I don't think "kill any game that is running just in case there is some adjusting to do" should be intended behavior to begin with.

rzippo avatar Feb 01 '24 13:02 rzippo

It also means, for example, that I can not install games without a monitor turned on the whole time or that I can't switch to another input, for example when connected to a TV.

phoyd avatar Feb 01 '24 15:02 phoyd

Yea gamescope shouldn't be crashing when a display is turned off. When all connectors are disconnected it would force itself to reset but never when turning off the display. I'll look into this.

ruineka avatar Feb 01 '24 15:02 ruineka

Well, I noticed that I wasn't able to reproduce this. But I realized this is probably because my TV doesn't actually turn off, but goes into some kind of stand-by mode.

alkazar avatar Feb 01 '24 17:02 alkazar

Well, I noticed that I wasn't able to reproduce this. But I realized this is probably because my TV doesn't actually turn off, but goes into some kind of stand-by mode.

Mine does as well (Samsung QN90B), but if I hold the power button on the remote for 2-3 seconds it fully shuts off, and the bug can be reproduced consistently.

If I let it standby or use it for something else, it seems to "keep the connection alive" only for certain amount of time. This is how I initially experienced the issue, I went back to the game I left on pause and saw the boot screen instead.

rzippo avatar Feb 01 '24 17:02 rzippo

Confirmed both instances and they are both working correctly on the force-panel branch. We'll need to finish the rebase and update gamescope-plus.

ruineka avatar Feb 01 '24 20:02 ruineka

is there any way to fix this behavior? I'm building a home console based on a mini pc + hdmi switcher and android console. I would like that when switching hdmi switcher (using fingerbot of course) switch me to steam games mode instead of desktop. Maybe I can use some hack for this? This behavior breaks my basic home steam console script(

Is an EDID dongle the only way out?

WeslyG avatar Feb 08 '24 14:02 WeslyG

EDID dongle work fine for me)

WeslyG avatar Feb 10 '24 13:02 WeslyG

Confirmed both instances and they are both working correctly on the force-panel branch. We'll need to finish the rebase and update gamescope-plus.

Any updates on this?

rzippo avatar Feb 26 '24 18:02 rzippo

This is happening to me as well on v45-1.

alexhaugland avatar Apr 03 '24 11:04 alexhaugland

same on ChimeraOS 45-1. changing hdmi input to windows pc and waiting a few minutes to switch back, only black screen shows.

and the bluetooth works strangely when connected a new controller. it needs about one minute then the controller can be usable. Also this problem occurs when the system power on, at the bluetooth first connected to the controller, it works fine for a few seconds then not work, until about 1-2 minutes it satart to work again. the wireless card is intel ax210, Bluetooth Version 5.3

chaosye0 avatar May 06 '24 11:05 chaosye0

Same Here. An News ? Cant Download Games with TV is turned Off...

SaulGoodman1337 avatar May 06 '24 17:05 SaulGoodman1337