fufexan / nix-gaming

Gaming on Nix
MIT License
580 stars 55 forks source link

add: Rocket league umu #197

Open emrebicer opened 3 months ago

emrebicer commented 3 months ago

After seeing the discussion at #151 and PR #193, I wanted to introduce Umu to Rocket League as well. Finally, I had some free time and made Rocket League work with Umu.

However, there is still an issue that I could not find a solution to yet. If I enable umu, I can run bakkesmod alongside rocket-league, however once bakkesmod tries to inject, it fails and gives an error message that goes Injection failed, please download vc_redist.x86.exe and restart your PC. A Google search made me believe that the error message is implying I should have Microsoft Visual C++ Redistributable in the prefix, however even after trying to install vcrun2019 with winetricks (umu-run winetricks vcrun2019) or manually running the installer.exe (VC_redist.x86.exe or x64) in the prefix through umu, I still get the same error message bakkesmod.

I have been looking into possible solutions but could not get far. I wonder if anyone here has a suggestion to find a solution for that.

So TLDR; RL works with umu, and bakkesmod runs but does not inject. Any ideas on how can I fix that?

fufexan commented 3 months ago

In my case the game doesn't seem to launch at all.

emrebicer commented 3 months ago

I guessed perhaps I was not adding umu to PATH correctly, but I just removed umu from my config and RL still seems to work without issues, and looks like the path is set correctly.

I added WINEPREFIX to umu scripts as well, maybe legendary was not directing to the correct game files. Though I am not confident that was the issue for you.

it could be helpful if you shared with which attributes/values you call rocket-league in your config and what the output is when you start rocket-league from the terminal

fufexan commented 3 months ago

Currently testing directly from the repo using this patch

diff --git a/pkgs/default.nix b/pkgs/default.nix
index 234bbf5..576a177 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -86,6 +86,7 @@
       rocket-league = pkgs.callPackage ./rocket-league {
         wine = config.packages.wine-tkg;
         inherit (config.packages) umu;
+        useUmu = true;
       };

       star-citizen = pkgs.callPackage ./star-citizen {

Output log is

nix-gaming on  rocket-league-umu [≡✓] via   
› nix run .#rocket-league
warning: Git tree '/home/mihai/Documents/code/git/nix-gaming' is dirty
do you want to allow configuration setting 'allowInsecure' to be set to 'true' (y/N)? 
do you want to permanently mark this value as untrusted (y/N)? 
warning: ignoring untrusted flake configuration setting 'allowInsecure'.
Pass '--accept-flake-config' to trust it
do you want to allow configuration setting 'extra-substituters' to be set to 'https://nix-gaming.cachix.org' (y/N)? 
do you want to permanently mark this value as untrusted (y/N)? 
warning: ignoring untrusted flake configuration setting 'extra-substituters'.
Pass '--accept-flake-config' to trust it
do you want to allow configuration setting 'extra-trusted-public-keys' to be set to 'nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=' (y/N)? 
do you want to permanently mark this value as untrusted (y/N)? 
warning: ignoring untrusted flake configuration setting 'extra-trusted-public-keys'.
Pass '--accept-flake-config' to trust it
[Core] INFO: Trying to re-use existing login session...
[cli] INFO: Preparing download for "Rocket League®" (Sugar)...
[Core] INFO: Parsing game manifest...
[Core] INFO: Install path: /home/mihai/Games/rocket-league/rocketleague
[Core] INFO: Selected CDN: fastly-download.epicgames.com (https)
[DLM] INFO: Found 0 missing files.
[cli] INFO: Download size is 0, the game is either already up to date or has not changed. Exiting...
[cli] INFO: Logging in...
[Core] INFO: Trying to re-use existing login session...
[cli] INFO: Checking for updates...
[Core] INFO: Getting authentication token...
[cli] INFO: Launching Sugar...
gamemodeauto:                                                                                                                                                                                     
gamemodeauto: 
gamemodeauto: 

nix-gaming on  rocket-league-umu [≡✓] via   took 8s 
› gamemodeauto: 
steamrt is up to date
UMU-Proton is up to date
/nix/store/836by2rrl5xxwnnc4kbd9v21j9gglmv7-gvfs-1.54.2/lib/gvfs/libgvfscommon.so: undefined symbol: g_task_set_static_name
Failed to load module: /nix/store/836by2rrl5xxwnnc4kbd9v21j9gglmv7-gvfs-1.54.2/lib/gio/modules/libgioremote-volume-monitor.so
/nix/store/836by2rrl5xxwnnc4kbd9v21j9gglmv7-gvfs-1.54.2/lib/gvfs/libgvfscommon.so: undefined symbol: g_task_set_static_name
Failed to load module: /nix/store/836by2rrl5xxwnnc4kbd9v21j9gglmv7-gvfs-1.54.2/lib/gio/modules/libgvfsdbus.so
/nix/store/xj09bp6qdnf5aswgw9wpjcx2n9267ggp-dconf-0.40.0-lib/lib/gio/modules/libdconfsettings.so: undefined symbol: g_assertion_message_cmpint
Failed to load module: /nix/store/xj09bp6qdnf5aswgw9wpjcx2n9267ggp-dconf-0.40.0-lib/lib/gio/modules/libdconfsettings.so
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
ERROR: ld.so: object '/tmp/pressure-vessel-libs-WVY9R2/${PLATFORM}/libgamemodeauto.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/tmp/pressure-vessel-libs-WVY9R2/${PLATFORM}/libgamemodeauto.so.0' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
wine: using kernel write watches, use_kernel_writewatch 1.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
fsync: up and running.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
wine: using kernel write watches, use_kernel_writewatch 1.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
wine: using kernel write watches, use_kernel_writewatch 1.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
wine: using kernel write watches, use_kernel_writewatch 1.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
wine: using kernel write watches, use_kernel_writewatch 1.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
wine: using kernel write watches, use_kernel_writewatch 1.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
wine: using kernel write watches, use_kernel_writewatch 1.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
wine: using kernel write watches, use_kernel_writewatch 1.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
wine: using kernel write watches, use_kernel_writewatch 1.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
wine: using kernel write watches, use_kernel_writewatch 1.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
wine: using kernel write watches, use_kernel_writewatch 1.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
wine: using kernel write watches, use_kernel_writewatch 1.
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory
dbus[435206]: arguments to dbus_pending_call_block() were incorrect, assertion "pending != NULL" failed in file dbus-pending-call.c line 766.
This is normally a bug in some application using the D-Bus library.

  D-Bus not built with -rdynamic so unable to print a backtrace

Removing gamemoderun occurrences from the derivation gets rid of the gamemode and dbus logs, but the game still doesn't launch. Not sure what the issue with gamemode is, as I have gamemoded running.

emrebicer commented 3 months ago

I just noticed we were not adding gamemode to the path correctly, but I don't think that was the issue with your case anyway. Honestly, when I run rocket-league, the output is pretty similar, I don't see any noticeable difference, except the game runs normally. Perhaps we can try looking into umu logs like that;

$ UMU_LOG=debug rocket-league
fufexan commented 3 months ago

Sure, here's the log. rl.log

emrebicer commented 3 months ago

I just compared the output with the output on my end, it looks pretty similar except for the wine: using kernel write watches, use_kernel_writewatch 1. statements toward the end, where I don't have such logs. I don't think that tells anything helpful though.

To debug further I would recommend creating a shell with umu-run and legendary-gl, they try to manually run the game directly through umu-run,

export GAMEID=umu-252950
export STORE=egs
export PROTON_VERB=runinprefix

legendary update Sugar --base-path ${location}
legendary launch Sugar --no-wine --wrapper "umu-run" --base-path ${location} --dry-run

With the dry run option, the last command should print the command legendary will run and just exit. Then you can try manually running this command without including gamemode or any other dependencies in the way. Also, it might be worth trying to setup the envvar PROTONPATH=GE-Proton to use a different version of proton.

But at this point, it becomes a little too much work and I am not confident that this kind of debugging can get us somewhere, so one option is to leave the PR in this state as a draft and come back to it when there are new releases or improvements from umu project. Honestly, it is a bit sad to see that even nix struggles with the "it works on my machine" problem.

fufexan commented 3 months ago

@emrebicer following your instructions I managed to get it to launch after a nix flake update.

emrebicer commented 3 months ago

That is very good to hear, so does the PR also work after the nix flake update by any chance? Or just the dry-run? If it is only the dry run, then perhaps you can try prepending the gamemoderun command before the dry-run output, so we can see if gamemode is somehow at fault

fufexan commented 3 months ago

Only the dry-run works. Strangely enough, it also works if I prepend gamemoderun, but not when I do nix run .#rocket-league.

emrebicer commented 3 months ago

I think I found the culprit here. I moved to another (physical) place where I don't have access to the desktop I have developed the changes for this PR, but I have my Nvidia desktop that is mentioned at #186 .

On this desktop. I can reproduce the issue you are having, I simply can't run Rocket League with Umu with this PR. I did do some digging and I believe the issue is with the environment variable export PROTON_VERB=runinprefix. By default, if this environment variable is not found, umu will set the option to PROTON_VERB=waitforexitandrun and I think this is the recommended way to use umu, however since I wanted to introduce bakkesmod option from nix-gaming I need to be able to run 2 programs at the same time using umu, so I set this env var to runinprefix as it is recommended in the umu project wiki.

Again, it was working without issues on my other desktop, but apparently, there is something wrong with it so it doesn't work on my Nvidia machine or your environment...

So I suggest for now we focus on making Rocket League work in any environment with umu and ignore bakkesmod case at the moment. Given that, I pushed a commit that removes the line where we set the mentioned env var. With that change, Rocket League Umu works on my Nvidia machine as well without issues. (A side note: there are no performance issues with umu, so this PR might lead to closing #186 as well.)

Can you please try with the latest change as well? If it also works for you without issues, then we can focus on how we can support bakkesmod with Umu as well, I guess I can open an issue about it at the Umu project repo and ask for their help/recommendations about it.

fufexan commented 1 month ago

@emrebicer I'm terribly sorry for the delay, the notification must have slipped my view.

I've just tested this, seems to work well despite the gamemode errors (which are probably a skill issue on my part).

emrebicer commented 1 month ago

No worries, I also get many gamemode errors that go gamemodeauto: dlopen failed - libgamemode.so: cannot open shared object file: No such file or directory. I don't know if this is the same issue, but similar issues are still open at upstream like here and there.

However despite the error, looks like gamemode is being activated, as the output of gamemoded -s is returning gamemode is active when Rocket League is running. So I am not sure if this is something we can fix / should be worried about.

Update: Looks like there is an issue with the same error message here, but to my understanding, it is also not something to worry about if gamemoded status is returning gamemode is active, which is the case.

fufexan commented 1 month ago

Okay, then hopefully it will be fixed upstream. Thanks for looking into it.