sonic2kk / steamtinkerlaunch

Linux wrapper tool for use with the Steam client for custom launch options and 3rd party programs
GNU General Public License v3.0
2.1k stars 70 forks source link

Cannot get MO2 to work #973

Closed danaYatsuta closed 9 months ago

danaYatsuta commented 9 months ago

System Information

Issue Description

I cannot get MO2 to launch at all. steamtinkerlaunch mo2 start downloads and installs MO2 successfully, but fails to launch it and crashes immediately with this console output. I repeated clean test described here with no success. On this page steamtinkerlaunch mo2 repairpfx command is also suggested, but it does not seem to work for me (using it just prints help).

I also tried to run steamtinkerlaunch mo2 winecfg but that doesn't work either, with this console output:

wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: File not found.

Logs

Log after mo2 start.

Log after mo2 winecfg. I imagine something is messed up here, as WINEPREFIX and last arguments are empty strings, but I have no idea what to do about it.

sonic2kk commented 9 months ago

Repairpfx doesn't work because you're not using SteamTinkerLaunch-git fwiw. 12.12 is pretty old now and I don't anticipate a new release anytime soon :-) I don't think that command would help you though. All documentation is for the latest git release, quite honestly I pay no attention to the stable release, I used it as a development "checkpoint" and have since given up on that, so everything is in a git release now.

Your observation sounds reasonable that this issue is something to do with prefix being not set properly. Did you get a ModOrganizer 2 install screen where you can walk through the installer, and did SteamTinkerLaunch create ~/.config/steamtinkerlaunch/mo2/compatdata? It seems like perhaps STL couldn't set up ModOrganizer 2 properly in the sense that it couldn't create/access wherever it needed to create the MO2 prefix.

It would also be useful to check if the MO2 EXE downloaded successfully. Also, has MO2 updates recently? I haven't installed in a few weeks but I recall efforts to update the tool with Starfield support. I have no idea if that works if that version is in a stable release.

When I'm back at my PC I'll investigate the logs, but you can try removing the prefix at the specified path above. If it doesn't exist then that's probably the issue. And of course, try this with a git build please :-)

sonic2kk commented 9 months ago

Oh, also, try with a normal GE build instead of one from the AUR. Someone a long time ago reported that the AUR Proton builds don't work. STL is also not made with those in mind. AUR GE-Proton builds are not made by or supported by GloriousEggroll either.

danaYatsuta commented 9 months ago

Thank you for quick reply!

MO2 installer did show up, although I'm not sure it has finished correctly. FWIW in .config/steamtinkerlaunch/mo2/compatdata/pfx/drive_c/Modding/MO2 there seems to be a complete install of MO2, with .exe and all.

I will try out all your suggestions and report again.

sonic2kk commented 9 months ago

Took a look at the log, and based on what you've said above, it sounds like it did install fine. Here is the start command from your log:

WINEDEBUG="-all" WINEPREFIX="/home/yatsuta/.config/steamtinkerlaunch/mo2/compatdata/pfx" "/usr/share/steam/compatibilitytools.d/proton-ge-custom/files/bin/wine" "/home/yatsuta/.config/steamtinkerlaunch/mo2/compatdata/pfx/drive_c/Modding/MO2/ModOrganizer.exe" -i "Morrowind"

You can try running this manually and seeing if it works, by directly pasting it into a terminal prompt. I really don't have a good feeling about that system-wide GE-Proton install, I have never tried it before.

The launch command for Winecfg does indeed look strange, it's like STL cannot find the prefix for MO2, which is very unusual

WINEDEBUG="-all" WINEPREFIX="" "/usr/share/steam/compatibilitytools.d/proton-ge-custom/files/bin/wine" ""

There may be potential that this is because of some prefix mess-up, or perhaps the STL global config file doesn't have a valid MO2 path? Do subsequent runs of steamtinkerlaunch mo2 start also show empty prefixes? The second command is supposed to be the Winecfg command. Perhaps STL can't find it in the system-wide proton-ge-custom files (maybe it doesn't exist for those? unsure).

sonic2kk commented 9 months ago

I checked the Wine output you showed, it's very strange. It seems like Wine is failing (the minidump-related output is actually generated by Wine).

If you have ran any system updates before running MO2, you may want to restart your system. Strange Wine-related failures and crashes are usually resolved for me by restarting my PC, but I have never seen anything related to minidump before, and I've been tinkering with Wine for a long time now...

STL does pipe Wine output to /dev/shm/steamtinkerlaunch/startMO2_.log but I don't know that it has anything more than the output you have provided. And since we're passing the WINEDEBUG="-all" flag, I'm not too sure how to get other output.


I just checked quickly and there doesn't seem to be a new release of ModOrganizer 2. The start command provided looks healthy. If running that command directly from terminal fails then perhaps there is a different issue at play.

sonic2kk commented 9 months ago

I tested out the repairpfx option and there was an intermittent failure with it which I have attempted to resolve in the latest commit. Thanks for bringing it up, really that option was created for me as a shorthand and I figured it might be useful to others. The reason it wasn't working in your case though is because it's only in v12.12, but still, thanks for mentioning it because I wouldn't have noticed this for a while probably :-)

I'm downloading the AUR package you mentioned to see what behaviour I get with it, just out of curiosity.

sonic2kk commented 9 months ago

Actually, the AUR build worked for me surprisingly. It doesn't match the Wine output you provided at all and even running outside of STL, the command still works (it's the same as yours, except it has my paths instead :grinning:). Even steamtinkerlaunch mo2 winecfg worked for me.

Wine generating a minidump is really odd and probably is a deeper problem. You could try running a different executable with the same command if you have one. So basically:

WINEDEBUG="-all" WINEPREFIX="/home/yatsuta/.config/steamtinkerlaunch/mo2/compatdata/pfx" "/usr/share/steam/compatibilitytools.d/proton-ge-custom/files/bin/wine" "/path/to/your/alternative/exe"

That would help narrow down whether this is a Wine issue, a borked MO2 installation/exe, or a borked prefix (since you tried a clean install already, I suspect there's a different problem).

danaYatsuta commented 9 months ago

Alright, so far I did the following:

I tried running /usr/share/steam/compatibilitytools.d/proton-ge-custom/files/bin/wine WINEDEBUG="-all" WINEPREFIX="/home/yatsuta/.config/steamtinkerlaunch/mo2/compatdata/pfx" "/usr/share/steam/compatibilitytools.d/proton-ge-custom/files/bin/wine" "/home/yatsuta/.config/steamtinkerlaunch/mo2/compatdata/pfx/drive_c/Modding/MO2/ModOrganizer.exe" -i "Morrowind" (posting the full command because it might be incorrect, I'm not very proficient with wine), here's the output:

wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
002c:fixme:winediag:LdrInitializeThunk wine-staging 8.0 is a testing version containing experimental patches.
002c:fixme:winediag:LdrInitializeThunk Please mention your exact version when filing bug reports on winehq.org.
006c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
006c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
006c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
006c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: File not found.

Regarding "Do subsequent runs of steamtinkerlaunch mo2 start also show empty prefixes?" - I think mo2 start always shows correct (well I assume they are correct at least) prefixes.

Gonna try running the command with different executable and will report after.

danaYatsuta commented 9 months ago

Ran /usr/share/steam/compatibilitytools.d/proton-ge-custom/files/bin/wine WINEDEBUG="-all" WINEPREFIX="/home/yatsuta/.config/steamtinkerlaunch/mo2/compatdata/pfx" "/usr/share/steam/compatibilitytools.d/proton-ge-custom/files/bin/wine" "/home/yatsuta/.local/share/Steam/steamapps/common/Sonic Adventure 2/Launcher.exe" , the output is exactly the same.

I tried to launch the same game from Steam with Proton GE just to check whether it just randomly decided to combust but launching the game from Steam still works.

sonic2kk commented 9 months ago

Ah, you can't use Steam games, those usually have DRM. Try a "regular" exe from outside of Steam. If you have maybe a DRM-free game from GOG or some freeware program you could try running, that might yield better results :slightly_smiling_face: There are also other complexities around running these commands with Steam games directly, however, the fact that the output is the same is really strange to me. Normally it would give different output.

This output from Wine:

Application could not be started, or no application associated with the specified file. ShellExecuteEx failed: File not found.

Means that Wine cannot find the executable you're pointing it to.


For the comment before:

Did MO2 start with that output? It sounds like it would not. The path looks correct though, the MO2 and AUR GE-Proton paths all look the same as mine were (except a different username for the MO2 path).

Regarding "Do subsequent runs of steamtinkerlaunch mo2 start also show empty prefixes?" - I think mo2 start always shows correct (well I assume they are correct at least) prefixes.

That's good to know, so SteamTinkerLaunch is able to find the prefix to try and launch in.

removed .config/steamtinkerlauncher and /dev/shm/steamtinkerlauncher yet again

Sorry if I was unclear, I meant only remove ~/.config/steamtinkerlaunch/mo2/compatdata, not the whole path (as this removes all STL configuration, the path mention is where the prefix is).


With regards to the manual MO2 start line, did you run this before re-installing ModOrganizer 2? When you remove the prefix, you remove the MO2 install. Sorry again if this was unclear, but if there is no executable at the path in that command, then that would explain the last two parts of the output. Try installing MO2 again and seeing if running that command works when STL does not.

These don't sound like STL issues at this point but I'm really intrigued as to what is causing this problem... The output now is at least not a minidump but that might only be because Wine cannot find the MO2 executable (and the SA2 executable in the most recent example, which is weird as heck).

sonic2kk commented 9 months ago

Ah wait, the command you provided has a mistake in it, in both instances, which would explain the output:

/usr/share/steam/compatibilitytools.d/proton-ge-custom/files/bin/wine WINEDEBUG="-all" WINEPREFIX="/home/yatsuta/.config/steamtinkerlaunch/mo2/compatdata/pfx" "/usr/share/steam/compatibilitytools.d/proton-ge-custom/files/bin/wine" "/home/yatsuta/.config/steamtinkerlaunch/mo2/compatdata/pfx/drive_c/Modding/MO2/ModOrganizer.exe" -i "Morrowind"

At the beginning, there is an extra /usr/share/steam/compatibilitytools.d/proton-ge-custom/files/bin/wine. You should remove this, so the command looks like this:

WINEDEBUG="-all" WINEPREFIX="/home/yatsuta/.config/steamtinkerlaunch/mo2/compatdata/pfx" "/usr/share/steam/compatibilitytools.d/proton-ge-custom/files/bin/wine" "/home/yatsuta/.config/steamtinkerlaunch/mo2/compatdata/pfx/drive_c/Modding/MO2/ModOrganizer.exe" -i "Morrowind"

With the command you ran, Wine thought everything after the first path was a Wine command. This would explain the strange output!

danaYatsuta commented 9 months ago

Ah, okay. I was using nu-shell which didn't let me to run that for some reason, so I thought I had to start a command like this.

I switched to bash, and there are some changes.

MO2: still doesn't launch, but the output mildly changed:

wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
[2023-11-10 22:55:30.304 W] SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) failed: COM error 0x57: Invalid parameter.
[2023-11-10 22:55:30.304 W] Qt's default DPI awareness context is DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2. If you know what you are doing you can overwrite this default using qt.conf (https://doc.qt.io/qt-6/highdpi.html#configuring-windows)
creating minidump for the current process
trying file '.\ModOrganizer-2.5.0rc1-20231110T225530.dmp'
writing mini minidump
minidump written correctly
[2023-11-10 22:55:47.031 E] ModOrganizer has crashed, core dump created.

And yeah, I'm running this after ensuring MO2 is in place.

When it comes to SA2 however, the game did actually launch (although trying to actually launch the game from launcher fails, but I assume this is because of the aforementioned DRM thing).

Finally, using it on a non-steam .exe also worked.

danaYatsuta commented 9 months ago

I'm going to install MO2 manually and try to launch it with proton ge, maybe that could provide some insight.

sonic2kk commented 9 months ago

Ahhh okay, I found the problem. I re-installed ModOrganizer 2, and I am seeing the minidump output. This is because ModOrganizer 2 2.5.0 is not compatible under Wine. Pre-releases are not listed under GitHub releases by default, which is why I didn't see it when I visited the repository. STL currently downloads the absolute latest MO2 version, but I will patch it to download only the latest stable for now.

From looking at a comment on another repo and the Wine bug reports, ModOrganizer 2 2.5.0 is currently incompatible with Wine, due to an unimplemented feature required by Qt6. There is a pull request for Wine open to fix this though, and once that's merged and available in Wine, a Proton version could pick this up, and the issue will be resolved.

Once Proton or a flavour of Proton picks up this patch, MO2 2.5.0 should work, That will likely be once it's out of release candidate though.

So the issue is that this release of ModOrganizer 2, which is a pre-release, does not work under Wine yet, but it will in future, once a build of Proton picks this up that you can use with STL. You could theoretically build a Proton-tkg version pointing at Wine-staging with this patch, but you don't have to, I can put a fix in place for now.

For now, I will patch STL to only download the latest stable ModOrganizer 2, and this should work. It will download v2.4.4.

Hope this made sense, the issue is an incompatible ModOrganizer 2 version generating the minidump. A fix is available upstream in Wine. Basically a Wine breakage, but one we can workaround by just using the latest stable MO2.


I'll let you know when this fix is pushed, but you'll need to use STL-git to use it. There is an AUR package, or you can run sudo make install after cloning the repo.

sonic2kk commented 9 months ago

I'm going to install MO2 manually and try to launch it with proton ge, maybe that could provide some insight.

If you want you can install v2.4.4 manually and that should fix the problem, though I will push the fix to download the newer MO2 fix very soon hopefully and it would be great if you could test that. It would mean a clean resolution to this issue :-) I wouldn't have caught it if you hadn't reported this so thanks!

sonic2kk commented 9 months ago

Actually, in the code, I set up a flag to ignore pre-releases when fetching GitHub executables. So this is a 3-character change that I will push momentarily.

I even tested with Morrowind, because it was relevant to your issue, and it's working now locally :-) (weird resolution because I didn't set Wine DPI scaling for my display).

image

danaYatsuta commented 9 months ago

Ohhhhh, I see. Yeah, the Mod Organizer 2 I tried to use with Wine before trying out STL was 2.4.4 and it worked, I didn't really pay attention to the version.

Thank you for investigating this issue and finding the root cause, and I'm looking forward to the fix!

sonic2kk commented 9 months ago

The fix has been pushed in 6ff8371e9c8f8122ab4b532e4649e76509a38666. I tested and MO2 now only downloads v2.4.4.

To be extra sure, remove your ~/.config/steamtinkerlaunch/downloads/mo2 folder, so that there is no v2.5.0rc1 exe :-) Once you do that, and use STL-git, MO2 should install correctly.

It seems like this pre-release was only released yesterday, so this is definitely a good catch! And thank you for your patience in testing.

Also, with the space, and the version change, the diff ended up actually being five characters instead of three heh

danaYatsuta commented 9 months ago

Yes, MO2 launches now!! This is such a relief.

Thank you for taking time to investigate this, I really appreciate it :)

sonic2kk commented 9 months ago

No problem at all :-) Thank you for reporting it and being patient with the runaround with testing there, and for being diligent before opening an issue.

Happy gaming! Enjoy Morrowind (if you're planning to play it, maybe it was just the default instance).

distek commented 9 months ago

Just wanted to post in-case someone else has this issue but just removing the downloads folder didn't work.

I removed both of these and it started no issue:

~/.config/steamtinkerlaunch/downloads/mo2
~/.config/steamtinkerlaunch/mo2

@sonic2kk : Would this mess anything up beyond just needing to reinstall mo2?

sonic2kk commented 9 months ago

That would remove the prefix, which means your install got messed up (maybe mismatch Proton versions). The wiki already notes this though, and we have the repairpfx command which can help.

If you tried to install MO2 without using STL git then of course you need to remove the prefix, I noted as much here I believe as well.

There should be no issues with removing the prefix other than losing your mods if you didn't instal them into a separate directory. All MO2 configuration will be lost as well. But if MO2 never worked to begin with then ofc that's not an issue :-)

I'll also note just incase anyone in future might get lost, the paths are different on Flatpak STL.