decky-XRGaming icon indicating copy to clipboard operation
decky-XRGaming copied to clipboard

Game crashes randomly if XRGaming is installed

Open Kup86 opened this issue 1 year ago • 37 comments

Hi,

Its me again but this time I bought Viture Pro glasses! I was partially motivated to make the upgrade from the old TCLs so that I can use your excellent app!

I did run into some problems though. When I was playing Alan Wake (og release) on the Steam Deck with the app enabled, the game would randomly crash (freeze frame). I would still be able to use the Steam options like bringing up the game scope menus letting me quit the game. However after I do this, I can no longer start a game unless I completely reboot - It just gets stuck in starting game with the Steam logo 'spinning'.

When it comes to Alan Wake, the game can crash at any time, from 1 minute to 30+ minutes of gameplay. However if I try to start Portal 2 with the app installed and using the glasses, it will consistently crash on the loading screen getting into the game (freeze screen/frame). Steam menus still work though same as before.

The freeze issue does NOT appear if

  1. I am not using the glasses but XRGaming app is installed
  2. I am using the glasses but XRGaming app in uninstalled/removed - As is, no app.

The issue still manifests even if the app is set to 'disabled'. Only resolves if uninstalled.

I haven't been able to test more games thoroughly but at least Alan Wake and Portal 2 are consistent. Other games do load normally and work but since I have not play them extensively, I do not know if they would manifest the same random freeze as Alan Wake.

Versions of Steam OS and Decky that I am using are both Stable and latest.

Cheers and once again, great app!

Kup86 avatar Nov 14 '24 03:11 Kup86

Hi, this is the first I've heard of this issue so hopefully it's not something caused by more recent Steam OS versions.

A few follow-up requests:

  1. Let me know the exact SteamOS version/build number you're on, as well as Decky loader and XR Gaming plugin versions.
  2. Please attach a copy of your XR driver log in /home/deck/.local/state/xr_driver/driver.log. Actually before that, first run xr_driver_cli --debug ipc,threads,device, then trigger the crash another time or two, then attach the latest log.
  3. Let me know whether you're in Vulkan-only mode or not. If you are, you'd see a message at the top of the plugin sidebar letting you know, so if you don't see any such message, then you're using the latest gamescope integration.
  4. Are you seeing the virtual display/pinning effect work for the brief period of time that the games run prior to crashing?

Thanks!

wheaney avatar Nov 14 '24 05:11 wheaney

Hi wheaney,

Thank you very much for replying so soon. I have tried to answer your questions below:

  1. SteamOS 3.6.20 Build: 20241030.1

  2. I get a 'command not found' when running the xr_driver_cli command. However I triggered 2 crashes before uploading the log file using Portal 2. driver.log

  3. No Vulkan message

  4. Before it crashes, the display pinning (or any other function) works fine. In Alan Wake it successfully runs no problem until it crashes.

As mentioned, Portal 2 is easy to replicate as it consistently crashes 5-10 seconds after starting the game - Before that pinning works.

Please let me know if you need more info.

Kup86 avatar Nov 14 '24 05:11 Kup86

Thanks for the info. Try /home/deck/.local/bin/xr_driver_cli --debug ipc,threads,device, then reproduce the crash and upload the log again.

wheaney avatar Nov 14 '24 05:11 wheaney

Can you confirm that the display pinning effect is working fine in SteamOS prior to launching the game?

wheaney avatar Nov 14 '24 06:11 wheaney

Yes I can confirm the pinning effect works and is stable prior to going in game. Any mode works fine. Note that the game crashes no matter the configuration the app is at (as as follow, or VR lite, crashes even if set to disabled but only in game).

Kup86 avatar Nov 14 '24 06:11 Kup86

Thanks, also see my request just above that about xr_driver_cli.

wheaney avatar Nov 14 '24 06:11 wheaney

I was able to run the command and then triggered the crash. Here are fresh logs: driver.log

I also noticed that after it crashes and force an exit back to SteamOS, the pinning effect is gone. However the app still detects the glasses with no errors but non of the pinning effects can be re-enabled until I restart the system

Kup86 avatar Nov 14 '24 06:11 Kup86

It looks like the debug flags got cleared right before you triggered the crash. Try setting everything up, then making the CLI call, then triggering the crash without touching the plugin settings.

wheaney avatar Nov 14 '24 06:11 wheaney

Fresh logs as instructed The file ended up too big so had to upload and share a link:

https://drive.google.com/file/d/1XROw9FtFL28QQLBkAoBanUU8KpkNm5nc/view?usp=sharing

Kup86 avatar Nov 14 '24 06:11 Kup86

I'll need to look closer into this, based on the logs at the very least I need to improve how it retries failed wayland calls as it's really spamming gamescope and that's probably part of the cause of the behavior you're seeing. In the meantime, if you disable the gamescope integration in your advanced settings, that'll take you back to vulkan-only mode and should prevent these problems. Just keep in mind that the visual effects will only apply in-game when you're in vulkan-only mode.

wheaney avatar Nov 14 '24 20:11 wheaney

I'll set it to Vulkan only mode. Thank you for looking into it :)

Please let me know if you need anything more along the way.

Kup86 avatar Nov 14 '24 22:11 Kup86

After using the steam deck with the app/glasses for some time with Gamescope integration disabled, I can confirm that it is much more stable - After playing for about half hour no crashes and Portal 2 now loads no problem.

Interestingly enough, I tried Control which is a DX12 game and that works great with the app all modes, even with the gamescope intergation disabled.

Kup86 avatar Nov 15 '24 08:11 Kup86

Having the same issues (And same resolution of disabling Gamescope) with Dredge installed as a Non Steam version from Epic.

reuter avatar Jan 12 '25 15:01 reuter

@reuter @Kup86 I have a potential fix for this in v2.0.4 of the driver, are either of you able to first confirm you're still seeing this behavior with the plugin?

wheaney avatar Mar 20 '25 20:03 wheaney

Hi Wheaney,

Thank you for getting back to us. Yes, I experienced the issue earlier in the week when I disabled 'Vulkan Only'. Didn't take long in a DX9 game for it to freeze. However I also noticed that if you disable and then enable the Vulkan only option without going into a game first (just on Game Mode, no freezes), it freezes in game unless you reboot the system after enabling Vulkan only mode.

I have recently loaned my Deck to a friend in hospital so if you need logs or testing, it could be a few days.

For user case background - I use the glasses all the time as they are great when commuting to work. However I haven't used them so much with the app as on a train, the gyros are too shaky to be usable due to the bumpy ride - I know nothing that can be done but just thought to mention it.

Kup86 avatar Mar 20 '25 23:03 Kup86

Not a big rush, but when you get a chance can you try this:

  1. Set up your deck so you can ssh to it, or add Konsole as an external Steam app from Desktop mode so you can access it in Game Mode
  2. Open the plugin sidebar so it's fully loaded
  3. Clear your driver log: truncate -s 0 /home/deck/.local/state/xr_driver/driver.log
  4. Run through the XR driver manual setup instructions. This has to be done after the plugin is already loaded, otherwise the plugin will notice and install its version of the driver over this.
  5. Wouldn't hurt to verify in the /home/deck/.local/state/xr_driver/driver.log that it says "project version 2.0.4" near the bottom.
  6. Enable IPC debug logs: ~/.local/bin/xr_driver_cli --debug ipc
  7. Back in the plugin, disable Vulkan-only mode.

It should attempt to use the gamescope integration. I'm not sure if it'll work, but at the very least it shouldn't crash the deck, hopefully. Let me know how it goes.

wheaney avatar Mar 20 '25 23:03 wheaney

Hi Wheaney,

I got my Steam Deck back yesterday and just finished following the instructions. I can confirm that the logs say "project version 2.0.4" in the logs.

I will try playing around with it and see how things go. It is the type of glitch that can happen right away or after 30 minutes so only by playing for a while can I confirm if this has solved it.

Thank you very much! I'll let you know how things go.

I have attached my driver.log just in case.

driver.log

Kup86 avatar Mar 31 '25 03:03 Kup86

I am afraid that it has crashed the same way. Here are the new logs after crash - I tried to run a DX game (Dishonored) twice to make sure - Both times are after installing the new driver above:

  1. Started with a fresh reboot - Started Dishonored - Froze right away, didn't make the title. As before, once the freeze happens, you can exit by pressing the steam button then 'Exit game' menu but you can't start any new game until a reboot happens.

  2. Just in case the above was a fluke - I shutdown the steam deck and restarted. Started Dishonored but it froze right away, same as above.

  3. Disabling Gamescope in the XR app, brings back functionality in game as before.

I have attached fresh logs after the crashes

driver.log

:

Kup86 avatar Mar 31 '25 04:03 Kup86

Note Step 3 that the plugin will reinstall its version of the driver whenever it gets loaded. So the reboot is causing that to happen (note the "project version" before the errors). Try this again but without the reboot. Also start with a clean slate on the driver log: truncate -s 0 /home/deck/.local/state/xr_driver/driver.log

wheaney avatar Mar 31 '25 06:03 wheaney

Unfortunately it still happens without the reboots.

Here is my sequence:

  1. Start Steam deck
  2. Go to the XR Gaming pluggin
  3. Truncate log file
  4. Manually install driver
  5. verify logs for driver install - ensure "project version 2.0.4" is present.
  6. Disable Vulkan only in pluggin
  7. Start game - Disohonored

Like Before, freezes 5 seconds or so after it starts - at least with Disohonored. Previously when we first started some months ago, I tried with Alan Wake and that can be 0 to 30 minutes. before freeze.

Fresh logs after crash.

driver.log

Kup86 avatar Mar 31 '25 08:03 Kup86

It looks like I forgot an important step in this test to set up the necessary debug logging. Can you revisit the setup steps. Steps 3 and 6 are new, clearing the log each time and adding the debug logging. Sorry to keep going in circles on this one.

wheaney avatar Mar 31 '25 16:03 wheaney

I tried the instructions as per the update. As soon as I disable 'Vulkan Only' mode - I get a grey screen. I can still hear the Steam menu but can see only grey through the glasses.

If I unplug and re-plug the glasses, I get the screen back through the glasses but the app features are no longer working as in just a normal display although it still says 'Viture Pro Connected' but nothing I do in the app does anything until I restart.

Here are the logs on the above.

driver.log

Kup86 avatar Apr 01 '25 04:04 Kup86

Unfortunately, it looks like disabling vulkan-only mode cleared out the debug setting:

2025-04-01 15:04:30.296 IPC debugging has been enabled
2025-04-01 15:05:14.050 Gamescope ReShade integration has been enabled
2025-04-01 15:05:14.050 IPC debugging has been disabled

So it didn't log any of the debug stuff :( I'd recommend having the glasses unplugged when you do the xr_driver_cli debug command, and then edit the config file at ~/.config/xr_driver/config.ini and set gamescope_reshade_wayland_disabled=false (or edit the existing line for gamescope_reshade_wayland_disabled, if it's there). Basically avoid using the decky UI at all by doing that setup and then plugging in the glasses.

wheaney avatar Apr 01 '25 04:04 wheaney

I just tried doing the instructions but this time with the Vulkan only already disbaled so I wouldn't have to go back to the app. Kept the debug.

driver.log

Kup86 avatar Apr 01 '25 04:04 Kup86

I see exactly what's going wrong now! I'll try to have a fix for you to test out tomorrow.

wheaney avatar Apr 01 '25 04:04 wheaney

That's great to hear!

Here is the logs from following the instructions by diabling Vulkan only by editing the config file and avoiding the app. You probably don't need it but just in case :)

driver.log

Kup86 avatar Apr 01 '25 04:04 Kup86

Actually I just pushed a potential fix and uploaded as v2.0.5. So you can give it another shot at your earliest convenience. You should see the new version reflected in the log.

wheaney avatar Apr 01 '25 05:04 wheaney

I just tested the same as last time (disabling Vulkan only through config file) - It still freezes the same way unfortunately.

I can confirm v.2.0.5 on the logs.

driver.log

Kup86 avatar Apr 01 '25 05:04 Kup86

Huh, interesting. I see from your logs that I'm no longer spamming gamescope. Now it's just periodically (every second) checking to see if gamescope's wayland service is available. You're saying that the behavior was exactly the same as before?

wheaney avatar Apr 01 '25 06:04 wheaney

If you don't mind trying to run Konsole as a non-steam app from within Game Mode, I'd like to see what you get from each of these when executed from Game Mode (won't work over SSH or from desktop mode):

  • echo $GAMESCOPE_WAYLAND_DISPLAY
  • echo $WAYLAND_DISPLAY
  • echo $DISPLAY

wheaney avatar Apr 01 '25 06:04 wheaney