Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steam Linux Runtime re-check #324

Closed
frostworx opened this issue Oct 18, 2021 · 35 comments
Closed

Steam Linux Runtime re-check #324

frostworx opened this issue Oct 18, 2021 · 35 comments

Comments

@frostworx
Copy link
Collaborator

This info sticky might not be 100% correct and possibly will be edited
Any hints are welcome!

Based on #323 I found out that stl uses an old "v1" toolmanifest.vdf when used as Steam Compatibility Tool.
With this old toolmanifest.vdf the Steam Linux Runtime is not even started and stl works until game requirements/dependencies are covered with globally installed packages (I'm looking at you, gstreamer).

When using stl as Steam Launch Option, the Steam Linux Runtime is loaded directly on game launch (comes from game launch parameters in this case), which in turn also triggers the currently in-Steam-selected Proton (before stl is even touched).
Then the game starts regularly (likely it is not even using SLR here, but SLR just closed after its Proton launch attempt exited and stl starts the game afterwards - just guessing)

With an updated v2 toolmanifest.vdf (back in Steam Compatibility Tool mode), SLR starts as well, but any system access to system files is rejected from the SLR container, so stl can't be used (not only /usr/share/stl/ is inaccessible, but also all (optional) 3rd party tools).
Files in $HOME are accessible in theory, but copying (or symlinking if even possible) all /usr/share/stl/ and 3rd party tools f.e. to ~/.config/stl/global/ is no sane option, because it can be restricted anytime as well.

Both the v1 toolmanifest.vdf and the Steam Launch Option can be closed down upstream any time (assuming this is a goal when using a container),
which (probably) would kill Steam Tinker Launch (and of course every other tool which works similar) forever.
I hope this won't happen, but IMHO it is not that unlikely.

@frostworx frostworx pinned this issue Oct 18, 2021
@frostworx frostworx changed the title Steam Tinker Launch will probably die with SLR (Steam Linux Runtime) possibly being forced completely ⚠ Steam Tinker Launch will probably die with SLR (Steam Linux Runtime) possibly being forced completely Oct 18, 2021
@frostworx
Copy link
Collaborator Author

Added above description more or less also to the Steam Linux Runtime wiki

@frostworx
Copy link
Collaborator Author

Warned enough. We'll see...

@zany130
Copy link
Collaborator

zany130 commented May 9, 2022

so I think it would be better to continue the conversation here so continuing from https://www.reddit.com/r/SteamTinkerLaunch/comments/ulh355/steam_linux_runtime/

found some interesting tidbits


Logs
CompatForceSLR.log
CompatForceSLRNoMangoGameMode.log
CompatnoForceSLR.log
compatnoForceSLRnoMangonoGame.log

SLRnoMangonoGame.log


So running this game (trails of cold steel 3) with USESLR enabled in the steamtinkerlaunch settings but FORCESLR disabled
SLR does not load from what I understand this is expected when running steamtinkerlaunch as a compat tool (at least as is now from what I understood this could be fixed by using "v2 toolmanifest.vd" but that breaks access to other files and locations on the filesystem)

Running the game with USESLR enabled and FORCESLR enabled WHILE gamemode and mangohud (as the binary) is enabled causes the game not to launch (Is this expected ? can something be done about it?)

Running the game with USESLR and FORCESLR enabled with gamemode and mangohud disabled launches the game with SLR ( can verify as in the proton logs this is added on the top of the log where it mentions the kernel version and some other sys info ( this is how I noticed all this in the first place and started investigating

depot: 0.20220329.49
pressure-vessel: 0.20220315.0
scripts: v0.20220311.0-0-gae4cbed
soldier: 0.20220329.0 soldier 0.20220329.0

EDIT:
when steamtinkerlaunch is run as a launch command it uses SLR (when mangohud and gamemode are disabled) when USESLR is enabled and FORCESLR disabled (again this is expected from what I understood)

the interesting thing is enabling gamemode or mangohud (tried both individually) while SLR is being used prevents the game from running (actually maybe this is due to it running in a container (which is what SLR is afaik) and it can't access those things?)

running the game without steamtinkerlaunch in the launch options or compat tool does allow mangohud and gamemod to work alongside SLR though so maybe there something there?

sorry if all this was already known and explained and I necrod this for nothing 😅 but at the very least maybe this can clear things up a bit and I could definitely see someone making an issue about mangohud or gamemode not working when steamtinkerlaunch is used as a launch command and they not knowing it's because of SLR so we can just add a warning to the wiki about that if nothing can be done

@zany130 zany130 reopened this May 9, 2022
@frostworx frostworx changed the title ⚠ Steam Tinker Launch will probably die with SLR (Steam Linux Runtime) possibly being forced completely Steam Linux Runtime re-check May 10, 2022
@frostworx
Copy link
Collaborator Author

Thanks for the report! only changed the title for now, will re-check soonish

@frostworx
Copy link
Collaborator Author

Just took a quick look.
Seems like the recently added mangohud command line arguments (in combination with gamemode) have a problem with the old SLR settings.
I have not yet decided, but currently tend to completely remove all SLR and REAPER related options instead of digging through all this mess again.
It will always be a moving target, so I do not really see a reason to maintain an apparently barely used function at all.

@frostworx
Copy link
Collaborator Author

just started both a native and a windows game with steamtinkerlaunch as launch option. Both attempts did not have the SLR anymore in the command line, so apparently this was changed upstream (no idea when, as mentioned in above reddit thread I haven't checked that for a long timer)
This makes the decision to remove SLR and REAPER functions completely easier, as there doesn't seem to be a valid use case left :)

@frostworx
Copy link
Collaborator Author

Just "removed all Steam-Linux-Runtime and Reaper related tweaks" (also from the whole wiki)
only tested a bit, but it should work fine if I haven't missed anything :)

@zany130
Copy link
Collaborator

zany130 commented May 10, 2022

I'm not sure about removing all the SLR and reaper stuff.

On the one hand this commit does fix the issue of mangohud and gamemode not working when SLR is used

but on the other hand now proton games (and some native games which might need SLR since they haven't been updated for newer linux systems though at that point it may be better to run it with proton) will not behave the same as when it is run without steamtinkerlaunch, so that could introduce the possibility of proton (or native) bugs that only happen when steamtinkerlaunch is used.

on the other other hand 🤣 We found out that the SLR functions never really worked anyway unless you (may be incorrect but so far this is what testing shows)

a. force enable it if you are using steamtinkerlaunch as a compat tool AND also disable gamemode and mangohud

b. USESLR is enough when ran as a launch command but again you need to disable gamemode and mangohud.

so to keep the functions we would need to either

a. fix the issue with mangohud and gamemode not working with SLR (problem is like you said this can break at any time becuase of upstream and maybe even break other things)

b. add notes to the wiki about this issue and add code to automaticly disable gamemode and mangohud when SLR is being used.

c. I think in this case (though I have to try it adding mangohud and gamemode as launch commands in steam and disabling them in steamtinkerlaunch might work? (an argument could be made then that maybe this is what we should do sice gamemode already messed with some other functions like GDB and cheatengine and Imagine (haven't tried) now since we are using the mangohud binary it will also break those functions) so maybe we need to find out why that happens and fix it anyway or drop support for them (which would heavily cripple steamtinkerlaucnh as thes are (at least mangohud) very heavily used functions i belive)

EDIT:

This was all tested on 10.0 stable from the chaotic aur (was to lazy to build an older git version before the delete but shouldn't make much of a difference)
Tested my theory of enabling gamemode and mangohud through steam launch commands instead of doing it in steamtinkerlaunch and it worked,

  • steamtinkerlaunch as a launch command worked like this with just USESLR and USEREAPenabled
  • steamtinkerlaunch as a compat tool worked with the above settings plus FORCESLR and FORCEREAP although running with mangohud and gamemode added to steams launch command made steamtinkerlaunch's menue's very slow to load (including the initial wait menu) for some reason .

@frostworx
Copy link
Collaborator Author

sorry, short reply. RL work starts soon.
Now, with all possible SLR modifications removed, all games should use the SLR as if they were launched without steamtinkerlaunch.
initially the SLR functions did work of course.
Now I'm simply no longer interested in maintaining it.
FORCESLR and FORCEREAP are both removed and therefore do nothing.

@zany130
Copy link
Collaborator

zany130 commented May 11, 2022

Removing the SLR options changed nothing (well except that you can't get slr working now when run as a compat tool since FORCESLR was removed) SLR still doesn't work if mangohud or gamemode are enabled in steamtinkerlaunch when ran as a launch command. Adding mangohud and/or gamemode to the steam launch command fixes this

@frostworx
Copy link
Collaborator Author

As already written FORCESLR is was a steamtinkerlaunch internal function, which relies on previous SLR command line options.
As apparently those command line options are gone this would not even work anymore of course.
As steamtinklerlaunch does not touch the command line options at all (it can't with the code being removed) there must be another reason why "SLR still doesn't work if mangohud or gamemode are enabled in steamtinkerlaunch when ran as a launch command"
Have you checked the incoming and outgoing command line options in your logs?

@frostworx
Copy link
Collaborator Author

I guess I simply removed it too quickly and added a little bug somewhere "only tested a bit". we'll see

@frostworx
Copy link
Collaborator Author

I think the discussion is a bit misleading and at least for me not easy to understand.
So I'll try to sum up my position:

  • I'm not interested in messing around with the SLR anymore (especially as I won't work very much on steamtinkerlaunch in this season (nature is calling :)))
  • anyway I could of course revert the SLR removal and leave it as-is (so people who want to mess around with it, get a chance to contribute)
  • when reverting it should be still discussed imho if at least FORCESLR and FORCEREAP should be removed anyway or at least rebuilt (f.e. make it editable and not depend on a previous run)
  • as far as I have seen it in the short tests since yesterday, SLR is no longer provided as command line, which was the only apparent possibility to alter it in any way. So now it seems to be started always "magically under the hood" no matter how steamtinkerlaunch was used (compat tool or launch option)
  • as you actually can't even disable SLR for that reason, it would make sense to remove the USESLR and USEREAP option
    and change the reverted functions to act as if both were set.
  • is it actually safe to say that mangohud and gamemode not working is even related to SLR (or related to its recent removal)?

@zany130
Copy link
Collaborator

zany130 commented May 11, 2022

As i said on my above comment i was testing on 10.0 stable to make sure that adding mangohud and/or gamemode to the steam launch command allows SLR to work with either FORCESLR for when it's use as a compat tool or 'USESLR` for when it is used as a launch command

Running this way allows mangohud and/or gamemode to work with SLR

Now back to the latest git if you run as a compat tool SLR is not used due to the lack of FORCESLR (it seems when we load steamtinkerlaunch as a compat tool and then proton it doesn't use SLR unless we use the FORCESLR hack you implemented)

Now if we use steamtinkerlaunch as a launch command (again on latest git) SLR is used (I'm guessing because we're using proton as the compat tool and then running steamtinkerlaunch).

Now the problem is if you enable mangohud and/or gamemode the game will not launch just like before on the 10.0 stable release.

Once again applying the workaround i found of adding gamemode and/or mangohud as a steam launch command allows the game to launch with SLR (again confirmed by the top portion of the proton log)

I didn't include logs since they don't show anything about SLR since all the SLR code was removed

BTW this was all tested using proton 7.0-2 since that uses SLR (at least when it's used as the compat tool directly) GE for example does not use SLR

frostworx pushed a commit that referenced this issue May 11, 2022
@frostworx
Copy link
Collaborator Author

frostworx commented May 11, 2022

just reverted the removal.
leaving this open for discussion. I'm sure many people will jump up

edit: good to know GE doesn't use SLR, might be the reason why I never had any SLR problems.

@zany130
Copy link
Collaborator

zany130 commented May 11, 2022

  1. That's fine. Good luck and have fun!!!

  2. just reverting the change won't change much (just allowing you to force SLR when it wasn't found)

  3. See above

  4. As far as i can tell it seems SLR is only used when a proton version that uses it is launched as a compat tool for that game (the reason being i think from what I been reading it can use different SLR environments depending on the game)
    When steamtinkerlaunch is used as a compat tool it doesn't call SLR like proton 7.0-2 does (maybe that's the fix? Call SLR like proton does?) Again this is all speculation so might be totally wrong

  5. See above

6.yes as i can confirm through my tests which i went into detail above if there is ever a situation we're SLR is going to be used (because it was forced through steamtinkerlaunch on older versions, or it was found because of USESLR (again on an older version) or because proton called it) enabling mangohud and/or gamemode in steamtinkerlaunch will prevent the game from launching. In that senerio i found that enabling mangohud and/or gamemode through steam launch commands instead allows the game to launch (and use SLR with gamemode/mangohud)

One thing i haven't tested that i will when I get home is if SLR can be disabled by setting `USESLR' to 0 on the older version of steamtinkerlaunch (when ran as a launch command since it won't use SLR when ran as a compat tool unless you force it)

@frostworx
Copy link
Collaborator Author

assuming you started to write this before the revert above ("on older version")
I agree that testing with official proton actually using the SLR might be the key here.

@zany130
Copy link
Collaborator

zany130 commented May 11, 2022

Yeah sorry I'm using GitHub mobile (omw to school) so i didn't see you posted before i finished typing

@frostworx
Copy link
Collaborator Author

np, just wanted to be sure.
I have to admit that I currently don't have the patience to read longer bug reports and therefore probably do not read them too carefully (need vacation). Of course I still do appreciate them! So sorry for all the confusion.

@zany130
Copy link
Collaborator

zany130 commented May 11, 2022

Np take your vacation you earned it😊 bring me back souvenirs 😋😅 In the meantime I'll look into this more on my end (doubt i will be able to come up with anything though) and yeah let's leave this open maybe someone can help (maybe we can post the issue on the Linux gaming development discord?)

@frostworx
Copy link
Collaborator Author

Thanks for understanding! :)
Unfortunately it is some more weeks until vacation, but at least the weather is already ready :)
We spend lots of vacation time on photographing butterflies, so I'll bring you a photo of a rare one :D
Thanks for digging through all this SLR mess meanwhile. I'm sure it just needs a simple (but hard to find) fix but foremost a cooler head :)
Personally I do not really use discord, so no idea if this would make sense(?)

@frostworx
Copy link
Collaborator Author

Maybe interesting. With SLR re-added the good old STARTDEBUG is back as well.
When set to 1 (currently line 16)
a (mostly SLR related) debug log is written to /dev/shm/steamtinkerlaunch/steamtinkerlaunch-startmode-STARTDEBUG.txt
not sure if it helps us here, but it clearly shows that original Proton still ships SLR & REAPER (like you already said)
Additionally it is easier to see how the original command was modified through steamtinkerlaunch (INITIAL LAUNCH COMAND vs FINAL LAUNCH RUNCMD )

@zany130
Copy link
Collaborator

zany130 commented May 11, 2022

Ohh forgot about that i remember you told me about the start debug function but i forgot about it. Yes it should be helpful in further debugging.

And photographing butterflies? Nice i live in south Florida (U.S.A) so i like to go to the everglades and enjoy nature every now and then really relaxing and good for the soul😊

As for just posting there issue on discord you might be right i don't use social media much (werid since I am from the facebook generation well more myspace lol yeah getting old 😅)

but yeah that might just come of as spammy and rude if i just go "hey guys can you just drop everything and come look at this supper specific issue i found on GitHub ( obviously exaggerated Abit)

@frostworx
Copy link
Collaborator Author

just played a bit with standalone steam launch options, and apparently the extra commands (here mangohud and gamemoderun) are prepended to the whole launch command, where currently in steamtinkerlaunch they are appended to the SLR/REAP commands.
f.e.
echo /usr/bin/mangohud %command% > /tmp/with-mango
echo %command% > /tmp/rawcommand
vs. current FINAL LAUNCH RUNCMD
shouldn't be that hard to fix, but may need some days anyway.
thanks for your perseverance, @zany130 :)

ps: never been in Florida (or U.S.A. generally), because we mostly avoid traveling via airplane generally, but I'm sure I'd love the
everglades as well :) Have much fun and peace there! :)

@frostworx
Copy link
Collaborator Author

SLR and REAP are prepended to the game command in the function startGame, which is "too late" because gamemode and mangohud and friends are already inserted in launchSteamGame (which calls startGame)
With luck it would be enough to prepend SLR and REAP at the beginning of launchSteamGame as it would be simple to change.
With bad luck this causes multiple new bugs and misbehaviors.
Not sure yet how to best fix this, just wanted to give some more additional information :)

@zany130
Copy link
Collaborator

zany130 commented May 12, 2022

nice!! it would be cool if this could also fix needing FORCESLR when used as a compat tool but it looks like that might just be a limitation on how it all works. Also don't worry about new bugs if anything I'll probably find them and report them knowing my luck with that lol😅

@frostworx
Copy link
Collaborator Author

Haha, I think you're right. Haven't counted valid bug reports, but I'm pretty sure your on first 1st place easily 😀
Until there is no way to even see SLR starting/being used when using steamtinkerlaunch as compat tool, I'm afraid there's no way around FORCESLR. but who knows what I find, when I dive into the SLR mess again :P

@zany130
Copy link
Collaborator

zany130 commented May 12, 2022

Yeah true maybe then a cleaner thing to do is

if vanilla proton is used (and it's greater than what ever version it was that introduced SLR in proton) and is launched as a compat tool and USESLR is = 1 then FORCESLR is used.

Else if steamtinkerlaunch is ran as a launch command we ignore all SLR stuff and let proton handle it.

Then the FORCESLR can be hidden from the user and it just automatically used when SLR is enable and we are running as a compat tool

EDIT: ideally if we can even figure out how SLR is called and use by vanilla proton when it's ran as a compat tool for a game we could even do the same thing making FORCESLR less hacky

EDIT2: i think this would also work when a Linux native game is ran and a the user wants to use SLR. They would run steamtinkerlaunch as a launch command this all SLR options in steamtinkerlaunch will be ignored and SLR works

The tricky part would be fixing the mangohud/gamemode bug.

Maybe getting what ever the final launch command is (with SLR if it's used) and adding gamemode/mangohud to the front like you said?

@frostworx
Copy link
Collaborator Author

I'm not convinced that automagically enabling the FORCESLR hack without giving the user a choice is a good idea.
In fact I would still prefer removing it completely instead.
Sure many users do not want to configure anything and want everything work magically, but I do not want steamtinkerlaunch to work like this. Imho no configuration option should be overridden by default.
I might test a bit next week, but not sure yet. I hope this is easy to fix :)
have a nice weekend!

@zany130
Copy link
Collaborator

zany130 commented May 13, 2022

well I'm not saying to remove the user being able to choose

I'm saying maybe the USESLR option should just become the same as FORCESLR when steamtinkerlaunch is ran as a compat tool since USESLR does nothing anyway unless you use FORCESLR

I did mention removing all SLR options when its ran as a launch tool though which means the user wouldn't be able to disable it then.

Maybe the 'USESLR' can work like this as a compat tool (Which is how it works now I think)

if 'USESLR' = 1 and SLR is found in the launch commands use it just like that with no modifications (except maybe adding mangohud/gamemode to the beginning of the command if we use that idea)

If USESLR = 1 and no SLR is found we continue running without SLR and same if USESLR = 0

EDIT:
So to sum it up basicly if the user wants to use SLR and they are running steamtinkerlaunch as a compat tool we just use the FORCESLR hack though I think we should check if they are using a proton version that is supposed to be using SLR in the first place (GE does not)

@frostworx
Copy link
Collaborator Author

fyi: I'll rewrite the whole game launch command concatenation (split into generic subfunctions and merge at the end in the correct order)
This will also fix SLR (command line) glitches.

@frostworx
Copy link
Collaborator Author

fyi: #465
(initial rewrite just landed, calling for testers 😀)

@zany130
Copy link
Collaborator

zany130 commented May 19, 2022

Sorry i haven't replied. My 1080 fan shroud broke off (long story 😆) so i been without a computer for the past two days. Should be getting a 6700xt i found at MSRP this weekend though so I'll test then

@frostworx
Copy link
Collaborator Author

sorry to hear. on the other side I'm sure you'll love your replacement gpu :)
take your time! (will do so as well :))

@frostworx
Copy link
Collaborator Author

closing in favor of #465

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants