NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.28k stars 13.54k forks source link

steamtinkerlaunch: doesn't do anything #210018

Closed Atemu closed 3 days ago

Atemu commented 1 year ago

Describe the bug

A clear and concise description of what the bug is.

Steam Tinker Launch doesn't do anything. A game started with it just closes again without ever showing any sign of life.

I tried Planetside 2 and TrackMania Nations Forever.

Steps To Reproduce

Steps to reproduce the behavior:

  1. ln -sfn /run/current-system/sw/bin/steamtinkerlaunch /Volumes/Games/Steam/compatibilitytools.d/SteamTinkerLaunch/steamtinkerlaunch (because regular install installs the unwrapped version which obviously doesn't work, see https://github.com/NixOS/nixpkgs/issues/295902)
  2. Select Steam Tinker Launch as compat tool for Steam game
  3. Run Steam game

Expected behavior

A clear and concise description of what you expected to happen.

I should at least see the GUI.

Additional context

Add any other context about the problem here.

steamtinkerlaunch.log

Notify maintainers

@urandom2

Metadata

a518c77148585023ff56022f09c4b2c418a51ef5

urandom2 commented 1 year ago

having not tested these specific games, I cannot be sure if this is an issue with how steamtinkerlaunch is packaged, nixos, or upstream; can you provide any more detail about what is failing?

Atemu commented 1 year ago

I wish I could but how? The logs don't tell me anything, there's nothing being logged to stdout and running it with -x shows it trying to run the game but it doesn't work? It's completely intransparent to me.

Which games have you tested to be working?

urandom2 commented 1 year ago

it would be useful to note if there is anything that you know works with the upstream script directly, that fails with this derivation, controlling for operating system differences where possible. failing that, let us know if you can get anything running as expected; otherwise, we may just need to mark this one as broken, until somebody with more steam/wine experience can assist.

this derivation is basically just a bash script, so the packaging effort was largely a matter of checking to see if we were wrapping all the dependencies; as a non-gamer myself, I was unable to test this against anything specific, as documented in #200157.

Atemu commented 1 year ago

I don't see anything documented in #200157. Which games did you test to be working?

urandom2 commented 1 year ago
  • [ ] Tested basic functionality of all binary files (usually in ./result/bin/)

I am referring to the link duplicated above; I do not use steamtinkerlaunch personally, I was just attempting to package the script, thus was unable to test it against any games.

jakehamilton commented 1 year ago

I just tried using steamtinkerlaunch for the first time and, I'll have to admit, the process was a bit confusing. Out of the box I ran into the same issue you had. I setup the compatibility tool using steamtinkerlaunch compat add, but I believe your method of linking to current-system is more correct and should work.

I configured my game to use Steam Tinker Launch as the Steam Play compatibility tool and it would exit almost immediately. I ran Steam from the terminal to watch the logs and it seems that Steam Tinker Launch is doing something weird with how it is looking for programs it depends on. It claimed to not have things like xdotool available and that was causing an early exit. I updated the global config ~/.config/steamtinkerlaunch/global.conf with the following:

## Skip dependency check for internally used programs
-SKIPINTDEPCHECK="0"
---
## Skip dependency check for internally used programs
+SKIPINTDEPCHECK="1"

That finally allowed the program to launch. The game would open and work fine, but with only this change Vortex failed to install and start. It turns out that a similar issue is stopping steamtinkerlaunch from finding Yad. I killed Steam and opened a new shell with nix shell nixpkgs#yad, then launched Steam from within this environment. After that everything worked great and I was able to successfully mod and play a game (Project Wingman).

I'm not quite sure why it's having issues finding certain programs.

Atemu commented 1 year ago

@jakehamilton those things are in our wrapper which was what I symlinked.

urandom2 commented 1 year ago

if there are binary dependencies that we missed during packaging, I would be happy to add those, see here. that said, we do already have xdotool included in that set, so I wager something us up with this dependency check.

EDIT: upon review, the dependency check seems to be working with makeWrapper as expected. if I can get some more logs about what is breaking wrt xdotool that may be able to narrow down exactly what is failing.

@jakehamilton those things are in our wrapper which was what I symlinked.

that said, there may be some system level things that cannot be done as part of the derivation, and that would be the point at which we need to build a nixos module. assuming the symlink is the only way to solve this, there is no way for create it as part of a derivation in /Volumes/Games/Steam/compatibilitytools.d/SteamTinkerLaunch/steamtinkerlaunch, but nixos modules can; similar to the difference between packaging wordpress and standing up a wordpress webserver.

romatthe commented 1 year ago

I've been having this issue as well. Some games, like The Outer Worlds, have poor ultrawide support, but there usually exist community made fixes for this. For The Outer Worlds there is a small program that you can run alongside the main game that fixes the aspect ratio while the game is running.

I was trying to use steamtinkerlaunch to get the game to run alongside it, as there is an option to fork a custom command inside the proton prefix upon game launch. I used the workaround by @jakehamilton to get the the steamtinkerlaunch window to pop up, but it fails to create the custom process upon launch.

/home/romatthe/.local/share/Steam/compatibilitytools.d/SteamTinkerLaunch/steamtinkerlaunch: line 6814: xdotool: command not found

That seems to be a very innocent line of code, but clearly it's failing to launch xdotool there.

I know VERY little about this subject unfortunately, but I do know that the new Steam Linux runtime does automatically run inside a bubblewrap container when launched, including those that run on top of Wine/Proton. Is there a possibility that because of the way NixOS differs in terms FHS that some paths aren't correctly mounted inside the bubblewrap environment? I've had a similar issue with NixOS and the inability to run gamescope as a launch option from Steam, because the gamescope cannot be found during execution.

I'm more than happy to provide additional logging for this, but it's not super easy. But the logs kept in the steamtinkerlaunch config directory are a little odd. Anything specific I could look for here?

Atemu commented 1 year ago

@romatthe, as mentioned previously, you need to symlink the wrapper (not the -wrapped script) because it provides all the dependencies required by stl.

I don't think it's an fhsenv issue. The gamescope issue is something else entirely.

Logs are also in /dev/shm/steamtinkerlaunch.

@jakehamilton I was not able to get any window to show up whatsoever. How did you configure the game and stl? Is it a native or Proton game? I'm trying to run Proton games by setting stl as the compat tool. No configuration done; everything default.

jakehamilton commented 1 year ago

@Atemu

I'd just typed out a lengthy reply and then went and looked at the link that STL made when I ran steamtinkerlaunch compat add and wouldn't you know it, it was:

steamtinkerlaunch -> /nix/store/din63apil6gz78zcfk7icd1kakqp9jj9-steamtinkerlaunch-11.11/bin/.steamtinkerlaunch-wrapped

This would explain why dependencies weren't found, the wrapper wasn't being used. I haven't tested (since all my game mods are just the way I like them at the moment and don't want them being blown away), but I'd wager that this fixes the problem. I went one step farther and linked the file from current-system:

steamtinkerlaunch -> /run/current-system/sw/bin/steamtinkerlaunch

For setting things up, I took some notes and have pasted them here: https://gist.github.com/jakehamilton/632edeb9d170a2aedc9984a0363523d3

I recommend running Steam from the terminal and checking the logs there. That is how I noticed that I needed to set SKIPINTDEPCHECK in the global config for STL (the errors only appeared when run under Steam).

zeta-00 commented 1 year ago

I'm having the same issue, I just can't get it working, if you could message here when this gets fixed in nixpkgs, that way this workaround does not have to be done, thanks.

Atemu commented 5 months ago

Tagging @sonic2kk as I'm at my wits end here.

(You can ignore the discussion in between, it's mostly a duplicate of https://github.com/NixOS/nixpkgs/issues/295902. Important facts are in the main post and that it works for @jakehamilton but not for me.)

Repro:

ln -sfn /run/current-system/sw/bin/steamtinkerlaunch ~/.steam/steam/compatibilitytools.d/SteamTinkerLaunch/steamtinkerlaunch
rm -r ~/.config/steamtinkerlaunch/ /dev/shm/steamtinkerlaunch/

Then start steam, select STL as the compat tool for a game (I used Just act Natural as it's small and F2P) and launch.

Then observe: Nothing. No window, no actual error message; nothing.

Steam logs show a bunch of ERROR: ld.so: object '/Volumes/Games/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. and pid 1847965 != 1847800, skipping destruction (fork without exec?) but that's just noise.

Logfile doesn't show any obvious errors to my eye:

Thu Mar 14 15:56:33 CET 2024 INFO - setflatpak - started SteamTinkerLaunch from /nix/store/2zm995ah0qa55pydjn7ai3bcgci19aia-steamtinkerlaunch-12.12/bin/.steamtinkerlaunch-wrapped
Thu Mar 14 15:56:33 CET 2024 INFO - initAID - Set AID from STEAM_COMPAT_APP_ID to '1485080'
Thu Mar 14 15:56:33 CET 2024 INFO - initAID - Set OSCDP to STEAM_COMPAT_DATA_PATH '/Volumes/Games/Steam/steamapps/compatdata/1485080'
Thu Mar 14 15:56:33 CET 2024 INFO - loadLanguage - First load the default language 'english' to make sure all variables are filled
Thu Mar 14 15:56:33 CET 2024 INFO - loadLangFile - Language from command line is 'english'
Thu Mar 14 15:56:33 CET 2024 INFO - loadLangFile - SYSTEMSTLCFGDIR is '/nix/store/2zm995ah0qa55pydjn7ai3bcgci19aia-steamtinkerlaunch-12.12/share/steamtinkerlaunch'
Thu Mar 14 15:56:33 CET 2024 INFO - loadLangFile - Command line language 'english' is no file - trying to find its absolute path
Thu Mar 14 15:56:33 CET 2024 INFO - loadLangFile - Loading found system wide /nix/store/2zm995ah0qa55pydjn7ai3bcgci19aia-steamtinkerlaunch-12.12/share/steamtinkerlaunch/lang//english.txt
Thu Mar 14 15:56:33 CET 2024 WARN - updateEditor - 'xdg-open' selected as editor or configured editor not found - trying to find an installed editor installed
Thu Mar 14 15:56:34 CET 2024 INFO - updateEditor - No valid editor found - will fall back to 'xdg-open'.
Thu Mar 14 15:56:34 CET 2024 INFO - loadLanguage - Loading STLLANG from '/Users/atemu/.config/steamtinkerlaunch/global.conf'
Thu Mar 14 15:56:34 CET 2024 INFO - loadLanguage - STLLANG from '/Users/atemu/.config/steamtinkerlaunch/global.conf' is 'english'
Thu Mar 14 15:56:35 CET 2024 INFO - setLocalInstall - Looks like we don't have a local non-root install
Thu Mar 14 15:56:35 CET 2024 INFO - updateConfigEntry - Option 'GLOBALCOLLECTIONDIR' is updated with the new value '/nix/store/2zm995ah0qa55pydjn7ai3bcgci19aia-steamtinkerlaunch-12.12/share/steamtinkerlaunch/collections' in config 'global.conf'
Thu Mar 14 15:56:35 CET 2024 INFO - getCurrentCommandline - No Proton in command line arguments 'waitforexitandrun /Volumes/Games/Just Act Natural/JustActNatural.exe'
Thu Mar 14 15:56:35 CET 2024 INFO - saveOrgVars - Storing some original variables to restore them later
Thu Mar 14 03:56:35 PM CET 2024 INFO - emptyVars - Emptied some original variables as they slowdown several system calls when started from steam
Thu Mar 14 03:56:35 PM CET 2024 INFO - emptyVars - Set $PATH to '/nix/store/4vzal97iq3dmrgycj8r0gflrh51p8w1s-bash-5.2p26/bin:/nix/store/sgpv5hm93gzkcm4s536nmkpag3q5d22s-gawk-5.2.2/bin:/nix/store/fmx804pc0bs1966xq5bb67kark2mww9r-git-2.43.2/bin:/nix/store/320v66ili0mwnyrxj3dwbxm0z8ndkbw7-gnugrep-3.11/bin:/nix/store/k4kwrfs8b5hqys2c2cl9hb7sjswgni94-xxd-vim-9.1.0075/bin:/nix/store/zd0lbbpbh0yapf4ilc7hzdvx87gl746r-unzip-6.0/bin:/nix/store/qn68gcsd7i5ck0vgfggj6bqfaaarjv0z-wget-1.21.4/bin:/nix/store/4p88p0yr14kspc21pcf0lf353vn842sc-xdotool-3.20211022.1/bin:/nix/store/ws69vs7mf68ym7k691l8kj8b9sbfh0fc-xprop-1.2.7/bin:/nix/store/kydr1p8ipa3020ns4x26bvcpff6a582p-xrandr-1.5.2/bin:/nix/store/rvp5wg10bc81nrz0j0l2x5p8bm4sw1f7-xwininfo-1.1.6/bin:/nix/store/00klgpb5vvsvgdvcymayffr13m68v73b-yad-13.0/bin:/run/wrappers/bin:/usr/bin:/usr/sbin:/Users/atemu/.local/bin/:/Users/atemu/.local/bin/:/run/wrappers/bin:/Users/atemu/.nix-profile/bin:/nix/profile/bin:/Users/atemu/.local/state/nix/profile/bin:/etc/profiles/per-user/atemu/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:'
Thu Mar 14 03:56:35 PM CET 2024 START - ######### Initializing Game Launch 1485080 using SteamTinkerLaunch v12.12 #########
Thu Mar 14 03:56:35 PM CET 2024 INFO - main - Starting with a clean log
Thu Mar 14 03:56:35 PM CET 2024 INFO - main - Start creating default configs
Thu Mar 14 03:56:35 PM CET 2024 INFO - createDefaultCfgs - START
Thu Mar 14 03:56:35 PM CET 2024 INFO - loadLanguage - First load the default language 'english' to make sure all variables are filled
Thu Mar 14 03:56:35 PM CET 2024 INFO - loadLangFile - Language from command line is 'english'
Thu Mar 14 03:56:35 PM CET 2024 INFO - loadLangFile - GLOBALSTLLANGDIR is '/nix/store/2zm995ah0qa55pydjn7ai3bcgci19aia-steamtinkerlaunch-12.12/share/steamtinkerlaunch/lang'
Thu Mar 14 03:56:35 PM CET 2024 INFO - loadLangFile - Command line language 'english' is no file - trying to find its absolute path
Thu Mar 14 03:56:35 PM CET 2024 INFO - loadLangFile - Loading found system wide /nix/store/2zm995ah0qa55pydjn7ai3bcgci19aia-steamtinkerlaunch-12.12/share/steamtinkerlaunch/lang/english.txt
Thu Mar 14 03:56:35 PM CET 2024 WARN - updateEditor - 'xdg-open' selected as editor or configured editor not found - trying to find an installed editor installed
Thu Mar 14 03:56:35 PM CET 2024 INFO - updateEditor - No valid editor found - will fall back to 'xdg-open'.
Thu Mar 14 03:56:35 PM CET 2024 INFO - loadLanguage - Loading STLLANG from '/Users/atemu/.config/steamtinkerlaunch/global.conf'
Thu Mar 14 03:56:35 PM CET 2024 INFO - loadLanguage - STLLANG from '/Users/atemu/.config/steamtinkerlaunch/global.conf' is 'english'
Thu Mar 14 03:56:35 PM CET 2024 INFO - createDefaultCfgs - setSteamPaths:
Thu Mar 14 03:56:35 PM CET 2024 INFO - setSteamPaths - Reading Steam Path variables from '/dev/shm/steamtinkerlaunch/steampaths.txt'
Thu Mar 14 03:56:35 PM CET 2024 WARN - updateEditor - 'xdg-open' selected as editor or configured editor not found - trying to find an installed editor installed
Thu Mar 14 03:56:35 PM CET 2024 INFO - updateEditor - No valid editor found - will fall back to 'xdg-open'.
Thu Mar 14 03:56:36 PM CET 2024 INFO - getGameOS - Starting game OS detection
Thu Mar 14 03:56:36 PM CET 2024 WARN - getGameOS - Could not extract the full game binary path from the incoming game launch command, so assuming this is a Windows game!
Thu Mar 14 03:56:36 PM CET 2024 INFO - setWin - '' determined to be a Windows Game
Thu Mar 14 03:56:36 PM CET 2024 INFO - createDefaultCfgs - createProtonList:
Thu Mar 14 03:56:36 PM CET 2024 INFO - createDefaultCfgs - createProtonList end
Thu Mar 14 03:56:36 PM CET 2024 INFO - listAllSettingsEntries - '/dev/shm/steamtinkerlaunch/setentries.txt' already exists - nothing to do
Thu Mar 14 03:56:36 PM CET 2024 INFO - createDefaultCfgs - STOP
Thu Mar 14 03:56:36 PM CET 2024 SKIP - listSteamLibraries - not recreating already available '/dev/shm/steamtinkerlaunch/SteamLibraries.txt'
Thu Mar 14 03:56:36 PM CET 2024 INFO - setSteamLibraryPaths - STEAM_COMPAT_LIBRARY_PATHS set to '/Volumes/Games/Steam/steamapps'
Thu Mar 14 03:56:36 PM CET 2024 INFO - setSteamLibraryPaths - STEAM_COMPAT_MOUNTS set to ''
Thu Mar 14 03:56:36 PM CET 2024 INFO - setSteamLibraryPaths - STEAM_COMPAT_TOOL_PATHS set to ''
Thu Mar 14 03:56:36 PM CET 2024 INFO - main - Checking internal dependencies:
Thu Mar 14 03:56:36 PM CET 2024 INFO - setAwkBin - Found 'gawk' as an 'awk' variant. It should work without any issues, because 'gawk' was tested completely
Thu Mar 14 03:56:36 PM CET 2024 INFO - checkIntDeps - Result of version check for yad binary '/nix/store/00klgpb5vvsvgdvcymayffr13m68v73b-yad-13.0/bin/yad' is '13.0'
Thu Mar 14 03:56:36 PM CET 2024 INFO - main - Initializing first Proton:
Thu Mar 14 03:56:36 PM CET 2024 INFO - initOldProtonArr - Creating an initial array with available Proton versions using the file '/dev/shm/steamtinkerlaunch/ProtonCSV.txt' which was created during a previous run
Thu Mar 14 03:56:36 PM CET 2024 INFO - initFirstProton - Initializing Proton
Thu Mar 14 03:56:36 PM CET 2024 INFO - initFirstProton - No Proton version available in template yet - searching for one
Thu Mar 14 03:56:36 PM CET 2024 INFO - initFirstProton - Updated 'USEPROTON' in '/Users/atemu/.config/steamtinkerlaunch/default_template.conf' to ''
Thu Mar 14 03:56:36 PM CET 2024 INFO - initFirstProton - Initial Proton version 'FIRSTUSEPROTON' from '/Users/atemu/.config/steamtinkerlaunch/default_template.conf' is ''
Thu Mar 14 03:56:36 PM CET 2024 INFO - main - Initializing default window resolution
Thu Mar 14 03:56:36 PM CET 2024 INFO - setInitWinXY - Using '2580x1080' from config '/dev/shm/steamtinkerlaunch/defres.txt'
Thu Mar 14 03:56:36 PM CET 2024 INFO - main - Welcome to SteamTinkerLaunch
Thu Mar 14 03:56:36 PM CET 2024 INFO - removeEmptyFiles - Removing empty files from '/Users/atemu/.config/steamtinkerlaunch/games/appinfo'
Thu Mar 14 03:56:36 PM CET 2024 INFO - removeEmptyFiles - Removing empty files from '/Users/atemu/.config/steamtinkerlaunch/games/header'
Thu Mar 14 03:56:36 PM CET 2024 INFO - main - Checking command line: incoming arguments 'waitforexitandrun /Volumes/Games/Just Act Natural/JustActNatural.exe'
Atemu commented 4 months ago

@sonic2kk would you prefer I open an issue in STL instead?

sonic2kk commented 4 days ago

Sorry, I just saw this when going through my emails.

This could be because of the path of the game, it doesn't look like it contains steamapps/common but that it is a Steam game launch. Steam games launched from paths that don't contain steamapps/common are not valid, it looks like your path is waitforexitandrun /Volumes/Games/Just Act Natural/JustActNatural.exe. This came up before, see https://github.com/sonic2kk/steamtinkerlaunch/issues/1132#issuecomment-2199311096.

Non-Steam Games have separate logic, where we check if we have SteamAppId and that it is 0, which is how we can tell Non-Steam Games apart. However in this case because this is a game purchased on Steam, it has a SteamAppId of 1485080 as seen in the log.

Make sure the game you are launching is in a Steam library folder, that should hopefully resolve the issue.

Atemu commented 4 days ago

Ohh, that could indeed be what's happening here; I do have my steam library symlinked to /Volumes/Games/. That has recently caused a super weird edge-case with SteamVR too, so I might look into solving this via bind-mounts instead.

Atemu commented 3 days ago

And that was indeed the issue. I have redone my steam state setup and it's working as expected now.

sonic2kk commented 3 days ago

Apologies it took so long to respond >_< But I'm glad it's working now!

Atemu commented 3 days ago

No worries, you don't owe me anything.