-
Notifications
You must be signed in to change notification settings - Fork 72
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
Get Steam Linux Runtime from Compat Tool Manifest #737
Conversation
@frostworx You probably have more familiarity with the Steam Linux Runtime stuff than I would. No rush on review as this is still in an initial state but I wouldn't mind some input on this :-) |
Just checked the
The last possibility, that it is downloaded on game run, is what I think the most likely case. I believe I have even seen this but I can't confirm and haven't tested this yet. Therefore, SteamTinkerLaunch will probably need to be responsible for downloading a required runtime. The chances are that a user will have ran a game before with vanilla Proton, and that vanilla Proton and GE-Proton builds will require the same SLR, but we can't guarantee this so perhaps we'll need to run something like I don't know if that command will wait until the tool is downloaded, if not we may have to find a way to "pause" the game launch while the given SLR downloads. On this subject, though we have a couple of ways of going about it, I personally prefer the idea of not downloading the SLR until after a user tries to start a game with STL. This mirrors Steam client behaviour and means we will always download the relevant tool specified for their selected Proton version (e.g. if they open a game and GE-ProtonX-YZ wants X tool, but they change to Proton 7.0 and it wants Y tool, two tools won't be downloaded). Fun times :-) |
Steam command to download SLR works, however:
Well, progress is being made. The main outstanding bug I can see is with GameScope. The rest will be general testing that should hopefully not raise too many issues!
I'm dumb, the crashing issue was because the SLR was not installed to Also from this, with my uninstalling and re-installing of the SLR, I can confirm that Steam will install the required tool(s) from the tool manifest when you try to launch the game. That is something else we'll have to consider... |
I haven't spent any time within the last months in looking into SLR or any other proton related mechanics, so no idea what the current situation is. The core requirement probably still is a 100% My previous findings can be found in the wiki of course and this issue might have some more background information as well. good luck! I still hope for you that you will get some busy helping hands from the "community" 🤨 |
Hehe, no worries, thanks for the comment :-) Perhaps a new option should be created so that SLR can be defaulted to off, with an option to enable it explicitly and a note that the user has to ensure the SLR is downloaded manually. Not sure what impact this might have on native games, if any. Probably none. I think re-working the to be opt-in is the solution that I'll go with here. That is basically the current behaviour anyway 😉 Will look into this when I have some time (got a couple of things to do and pending PRs for other projects) |
I think the solution we will go with is this:
I think most users will have a required tool's SLR installed. Unless they have not launched any game on their system before without STL and have only used STL to launch all of their games, they probably have the required SLR installed. And if they don't, no real problems should arise. Testing is needed to ensure nothing goes wrong if they do have the SLR, which is this PR. In other words we need to make sure this PR doesn't break anything, so I will do a lot of testing with it. I was overthinking things a little I guess. If no SLR is available we can just skip and launch anyway like we currently do, and tell the user that we couldn't find a requested tool's SLR. Perhaps we should show this on the UI somewhere and offer a way to resolve this. On a related note, I wonder what So this is looking feasible, it will just need testing and a couple of tweaks to fix the GameScope problem. Update: The GameScope issue was related to the SLR failing if there are spaces in the path. This doesn't seem to affect regular Steam launches anymore, though it definitely used to. If we can solve the issue of spaces in the path, "regular" Proton launches should work. |
We can't wait for this to finish. Instead, log a warning. In future we should show the notifier.
mapfile was causing the issue here when the path had spaces, so now we just manually create the array. It's small and fixed, not sure why I didn't do this before.
Progress update:
Need to test native games and custom commands next. I think by default not passing the SLR to custom commands is the best choice, and having that fall under the checkbox introduced in #732. I'm not sure what happens with custom commands at the moment honestly when it comes to the SLR. After that I will do some more general testing with other game variations (games with launchers, Origin games, etc) and see if they pose any problems. Once testing on the desktop is finished, I'll move on to testing on my Steam Deck. I don't foresee any problems but I have been burned before here 😅 |
Tested some games with launchers:
MELE did not work but it all with Origin, but when launching without STL it removed Origin, switched to the EA App. It still doesn't work with STL though even on master. Probably this is an entirely separate issue, thanks EA 🙄 Don't care enough to debug it for now but maybe in future. Now onto testing some native games to see how they work. If the ones I test work then I will assume the SLR feature is working correctly and move on to testing other things around it like custom commands and force SLR. EDIT: Turns out the EA App only crashes if the SLR is disabled. With it enabled on this PR, the EA App actually opens but says that the game failed to start. Probably the launch command has changed here and how we handle EA App games needs changing, but that is a separate issue to this PR and actually seems like it can only be investigated once this issue is resolved, i.e. when STL correctly uses the SLR. |
Just tested native games and had a "D'oh!" moment - This logic only gets the required SLR from the Not sure what to do here, I wonder if native games just default to the regular EDIT: Actually, on Linux Desktop, native games do not use the Steam Linux Runtime by default. This is only enforced for verified native games on the Steam Deck. And generally, games will work with the SLR on the Steam Deck. In cases where they don't, Steam Play None can be used I guess. Hmm, I will need to think how we want to handle this for native games. I am thinking that we can check for and grab the regular Steam Linux Runtime to use for native games. I am a bit on the fence about forcing the SLR for native games, but actually in my experience it tends to fix native games more than break them, so it's probably fine (many of the "To the Moon" series games require you to enforce the SLR). Note to self: This will surely be fun for custom commands 😅 |
Well I rewrote the logic to try and accomodate native Linux games, but it did nothing it seems 😅 Running with the SLR forced as a compat tool for native games shows a Running native games from the command line and passing the SLR launch command does not show the Also, an interesting aside: The regular SLR (I guess named "Scout" internally) actually (currently) lists SLR Soldier as a required tool in its tool manifest. However the launch command is I guess native games aren't broken by this, but they also aren't correctly getting the SLR. Fun!... |
Seems to be consistent with what is specified in toolmanifest's 'commandline' key
Tested "Force Steam Linux Runtime" for a few Proton games, works fine. |
Inspecting the game launch process from Steam via the command line, it does something quite interesting:
So it actually runs SLR Soldier (or if the I guess for native games we'll need to check the SLR's required tool AppID and then fetch it pretty much like we do for Proton games. I will probably just strip out and re-create the logic again to avoid duplicating the logic, since the logic is pretty much identical to how Proton games do it, and we insert our scout-on-soldier after the "parent" SLR command. |
Woohoo, SLR now works for native and Proton games! Confirmed this by testing some games with Proton, and native games (one which I know requires SLR to even launch) and they all work, plus I checked to make sure the I also think I was able to make the code cleaner in this commit compared to before. Now that native games seem to work, custom commands need testing, and then we need to ensure this still works on Steam Deck. |
Custom commands still work and of course do not use the SLR. Probably we can add a checkbox in a separate PR to enable SLR for custom commands. |
Langfiles are updated. Assuming things work fine on Steam Deck (fingers crossed), the wiki may need a light touch-up. I'll look into what might need updating there before merging this PR, and get an edit ready for it. @zany130 You were the one that brought this to my attention, please feel free to give this a whirl and see if this runtime-funtime is solved :-) |
Initial testing on my Steam Deck seems to be working fine! The first time I tried to launch a game (Cookie Clicker) it took several minutes, but that was probably the Steam Deck itself as I was playing in Desktop Mode for the sake of checking if the SLR was running. Tested in Game Mode and everything seems to work fine there too. I can't verify very easily if it's actually using the SLR in Game Mode but given that it's not crashing, I'll assume it is 😅 Tested the following games on Steam Deck:
This seems to work fine in my tests. There is no major benefit that I can see, but it works! I will wait for further testing before merging. |
I have an updated wiki markdown file at the ready for when this is merged. |
Just realised this was not tested on Flatpak, but I don't foresee any issues that would be caused on Flatpak. It's already able to do a lot of the other filesystem stuff that STL does, so I don't foresee this introducing any other issues. |
Wow nice work @sonic2kk !!! Sorry I haven't been active lately. I will go ahead and test this in the next few days |
Think it makes more sense to assign @zany130 as a reviewer instead :-) No rush on this, I don't have a release planned in the near future or anything. Extra eyes are always welcome on the code I manage to hack together :-) It gives some reassurance before pushing the big green merge button! |
Well haven't gotten to actually testing all the possibilities like what if a user has a fresh install with no SLR (i briefly looked over the conversation and there code for installing SLR in that senerio?) But at the very least SLR is working for me with trails of cold steel with just the use slr and reaper option ticked (no force) |
If there's no SLR (i.e. the path doesn't exist) then STL should just skip it. I have a bunch of checks where it should basically ignore invalid paths 😄
Awesome news!! 🥳 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM tested out a few games and it seems to be working correctly. Didn't get around to testing what happens with a clean steam install but that should be fine
EDIT: created a new user on my PC and tested that way it correctly logs that it couldn't find the requested SLR and that it needs to be downloaded. Game launch continued as normal so that's working
Thanks a bunch for such thorough testing! 🚀 I'll merge this tomorrow more than likely :-) |
Heh, Proton 8.0 is out and has switched to using "Steam Linux Runtime - Sniper". SteamTinkerLaunch was successfully able to fetch the new SLR (was previously installed by a game I forced Proton 8.0 with):
Pretty neat that it worked :-) |
Background
If I understand correctly, the Steam Linux Runtime command used to be passed as part of the launch command for games. Somewhere along the way this behaviour changed, at least for games using compatibility tools. Maybe this changed with the introduction of the various different runtimes (Soldier, Sniper, Scout). Since then, as far as I know SteamTinkerLaunch's "Use Steam Linux Runtime" option has done pretty much nothing, since the change in Steam behaviour broke it.
Completely by accident, I noticed that in most recent Proton compatibility tools'
toolmanifest.vdf
file, they specify arequire_tool_appid
key. This holds an AppID that points at a required tool. I have only checked a few but I have only ever seen this point to a Steam Linux Runtime, and in fact, the same runtime at that -1391110
, which isSteam Linux Runtime - Soldier
(fun fact, you can search for items in your library by AppID straight from Steam 😉).Implementation
This PR restores passing the required SLR (if installed) to a given game. We check if the current
RUNPROTON
has atoolmanifest.vdf
, check if it has arequire_tool_appid
field and get the AppID, then get the directory of that AppID. If it exists, we append/_v2-entry-point --verb=waitforexitandrun
to the end of the path, and use that as our SLR command.This currently makes a few assumptions that work for now, but may not work in future:
require_tool_appid
s are a variation of the Steam Linux Runtime_v2-entry-point
script exists - This should probably have a separate check, as this could change in futureGE-Proton7-69
requiresSteam Linux Runtime - Sonic2kk
, but all vanilla Proton builds stick toSteam Linux Runtime - Soldier
. This is probably very unlikely and would more likely impact older GE builds that rely on older SLR runtimes than newer Proton releases, but it is still a problem. We can probably fix this by using somesteam://
command to attempt to install a given AppID before game launch.A handy trick to confirm if a game is using the Steam Linux Runtime is to enable Proton logging. The Proton log will show some SLR information at the top:
Testing
This implementation also currently has an issue that causes GameScope to crash. Well, almost always. I launched Cookie Clicker about 5 times and only 1 of those times had a correct game launch. Most of the time the game didn't open and SteamTinkerLaunch showed its dialog and quit. This will need to be fixedThe issue was to do with paths having spaces and how we built the launch command for the SLR. This has been fixed as per the "Fix SLR not working if not installed on path with spaces" checkbox.Various other games with various different launch "features" e.g. games with launchers, will need to be tested to ensure launch functionality works. I will prioritise configuration launchers more than DRM launchers (STEINS;GATE, Sonic Adventure 2, etc).
Tools like MO2 will also need tested.
I tested GameMode and MangoHUD and they both worked correctly on each launch and did not cause any launch issues with Cookie Clicker at least.
TODO