Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
137 stars 2 forks source link

Game crash when VR controllers are connected on Linux #2301

Closed coolymike closed 3 months ago

coolymike commented 4 months ago

Describe the bug?

When the game is running with VR controllers connected, the deadzone information is taken from SkyFrost.Base.AppConfig. Recently, SkyFrost.Base.Models.dll was added to Resonite, moving AppConfig into it.

Something went terribly wrong with the reference to AppConfig from Assembly-CSharp.dll, causing the game to crash as soon data for a VR controller is updated.

Most likely, the Assembly-CSharp.dll for Linux just needs to be recompiled, but I don't have the required C# experience to be completely sure about this.

TL;DR Linux Native crashes when starting VR

To Reproduce

Play on Linux with VR controllers connected

Expected behavior

No game crash

Screenshots

Screenshot of the game before crashing: image

Resonite Version Number

2024.6.11.74 (introduced earlier, see additional context)

What Platforms does this occur on?

Linux

What headset if any do you use?

Index

Log Files

Relevant part of log:

(  0 FPS)   Updated:  -> 2024.6.11.74
(  0 FPS)   Device Activity Level changed from k_EDeviceActivityLevel_Unknown to k_EDeviceActivityLevel_UserInteraction
(  0 FPS)   Exception when running engine update step. Stage: UpdateBegin
System.TypeLoadException: Could not resolve type with token 01000111 (from typeref, class/assembly SkyFrost.Base.AppConfig, SkyFrost.Base, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null)
  at SteamVRDriver.UpdateController (FrooxEngine.TrackedObject controller, Valve.VR.SteamVR_Input_Sources source, System.Single deltaTime) [0x00194] in <19ee43791b074ffa8cf44722aa9c76ac>:0 
  at SteamVRDriver.UpdateInputs (System.Single deltaTime) [0x00240] in <19ee43791b074ffa8cf44722aa9c76ac>:0 
  at FrooxEngine.InputInterface.Update (System.Single deltaTime) [0x00411] in <a104bd47ce8b4d5f9833f495a86713dc>:0 
  at FrooxEngine.Engine.UpdateStep () [0x0010f] in <a104bd47ce8b4d5f9833f495a86713dc>:0 
  at FrooxEngine.Engine.RunUpdateLoop () [0x0005f] in <a104bd47ce8b4d5f9833f495a86713dc>:0 

This is unmodded, and the rest of the log is irrelevant for this issue. Due to privacy reasons I prefer not to include the full logs.

Additional Context

The issue was most likely introduced with 2024.6.10.1405 according to https://steamdb.info/depot/2519833/history/?changeid=M:1127554538094923334

Although I am on Index, this issue affects all headsets with supported controllers.

Reporters

whippersnatchpumpkinpatch on Discord

charlie-sans commented 4 months ago

it would be nice if this got fixed as i just started gaming on linux instead of windows and i really want to go back into vr without having to dual boot

rcelyte commented 4 months ago

For anyone looking for a temporary workaround, here's a series of commands to manually patch the broken references in Assembly-CSharp.dll (tested against Resonite 2024.6.11.74; use at your own risk):

cd path/to/Resonite_Data/Managed
git clone --depth 1 https://github.com/maxild/ILProgramming.git
./ILProgramming/tools/ildasm.5.0.0/runtimes/linux-x64/native/ildasm -out=Assembly-CSharp.il Assembly-CSharp.dll
sed -i 's/\[SkyFrost.Base\]/\[SkyFrost.Base.Models\]/g' Assembly-CSharp.il
./ILProgramming/tools/ilasm.5.0.0/runtimes/linux-x64/native/ilasm -dll Assembly-CSharp.il
rm -rf Assembly-CSharp.il ILProgramming/
shiftyscales commented 4 months ago

Seeking input from @ProbablePrime.

coolymike commented 4 months ago

For anyone looking for a temporary workaround, here's a series of commands to manually patch the broken references in Assembly-CSharp.dll (use at your own risk):

I have tested and confirmed this workaround. It is functional and does not appear to break any other functionality. Thank you.

This also confirms that the fix is for YDMS to recompile Assembly-CSharp.dll with the updated reference to SkyFrost.Base.Models instead of SkyFrost.Base.

coolymike commented 3 months ago

According to the SteamDB manifest changelog, the Assembly-CSharp.dll file was modified. Most likely, it was recompiled with the fix for #69. Considering this issue was already fixed on Windows, the fix was in the source, but not in the Linux build. Now with Assembly-CSharp.dll recompiled, it should be fixed on Linux. I do not have the time to test right now, as such I am not completely certain whether it's fixed. I will test this asap.

rcelyte commented 3 months ago

It's fixed now.

shiftyscales commented 3 months ago

Closing then. If for some reason @coolymike's findings differ, and they report such, this can be re-opened.

coolymike commented 3 months ago

The issue is fixed now. Assembly-CSharp.dll was recompiled after #69 was fixed, allowing VR on Linux native to run out of the box without crashing.

FlameSoulis commented 3 months ago

The issue is fixed now. Assembly-CSharp.dll was recompiled after #69 was fixed, allowing VR on Linux native to run out of the box without crashing.

69

Nice.