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

[TEST] Origin EALink refuses to handshake and therefore starting a game when a specific number of env vars is exceeded! 🤨 #508

Closed
sonic2kk opened this issue Jun 29, 2022 · 35 comments

Comments

@sonic2kk
Copy link
Owner

When trying to launch Mass Effect Legendary Edition from Steam using SteamTinkerLaunch, I have encountered a few issues.

  • Every so often (not sure how often exactly) STL's WaitRequester takes about a minute to show up, and when it does, the Game Menu takes a similar amount of time to show up (could be related to below)
  • The Game Menu doesn't show any game information (though the WaitRequester does), and this is consistent
    image
  • Probably the biggest problem, Mass Effect Legendary Edition doesn't launch (may affect other Origin games on Steam).

I've launched the game with and without SteamTinkerLaunch, and the two major differences I can see are:

  1. When launching from Steam, a dialog saying that Steam is setting up DirectX appears for a very short amount of time (probably less than second). This doesn't happen with STL but I'm not sure how important this is?
  2. When launching from Steam, a dialog that says "Connecting to Origin" pops up, then the Origin launcher shows up briefly, then the game opens.
  3. When launching from STL, there is no "Connecting to Origin" dialog. The STL Crash window opens and says the process closed after running for only 40 seconds.

For some reason, Mass Effect isn't launching properly through STL, and I would wager the "Connecting to Origin" step being missing could be part of the problem. I had a similar problem a while back on my laptop with STL and Sims 4, but I didn't think much of it and just launched without STL, blaming the problem on my laptop. I also remember Sims 4 not displaying any Game Information on the main menu. I would test Sims 4 on my PC now but it's quite a big game and I'm running low on storage space 😞 If anyone else can reproduce this issue with other Origin games please comment as well!

STL Version: v10.0.20220627
Distro: Arch Linux
Desktop: KDE Plasma Wayland

Log file (though I didn't spot anything particularly wrong):
1328670.log

@frostworx
Copy link
Collaborator

Last time I tried the game worked fine with steamtinkerlaunch (don't have it installed anymore and the download is a bit huge for another test :))
In very rare situations the steamworks shared dependencies do not install with an unofficial proton. so what might help is
to use the official proton as compatibility tool to create the compatdata and install the dependencies
and use steamtinkerlaunch as compatiblity tool afterwards.
All the Steamworks-Shared and Steam First Time Setup packages related code in steamtinkerlaunch was initially added to circumvent that problem somehow. But the problem occurred so rare since, that the code is totally unmantained (I regret having spent very much time into it and already considered to remove it completely, because probably nobody (including me) does actually use it)

of course it is also possible that above theory is totally unrelated and origin simply botched their installer again :)
good luck so far

@sonic2kk
Copy link
Owner Author

Ah now that you mentioned it I may have installed both Mass Effect and Sims 4 using GE, I've definitely had problem sometimes when doing a first time setup with third party Proton releases. I think Mass Effect Legendary Edition has cloud saves through Origin so it should be safe to try setting up the game again with regular Proton 7.0-3.

of course it is also possible that above theory is totally unrelated and origin simply botched their installer again :)

I wouldn't be surprised if Origin borked itself haha :-)

@sonic2kk
Copy link
Owner Author

sonic2kk commented Jul 2, 2022

I tried deleting the compatdata, installing Origin with Proton 7.0-3, and then launching again with STL, but the game still crashes, and STL still doesn't display the game info on the Main Menu. It works fine on the Wait Requester and the Crash dialog

image

image

Not sure where the Main Menu text might be falling over, though that's a more minor issue compared to the game itself not launching.

Since deleting the prefix and re-creating it, I now can see the "Connecting to Origin" dialog box when launching with STL, when previously I didn't.

I compared the launch behaviour of the game once again when launching with Proton 7.0-3 with and without STL, and there are a couple of differences between these. When launching from Steam, I see:

  1. A brief DirectX installation window with 1 of 1 steps complete that only appears for half a second
  2. A tall, rectangular, blank Origin window which briefly opens and closes
  3. The "Connecting to Origin" splash, which closes after a few seconds
  4. A square blank Origin window, which appears for a couple of seconds and then closes
  5. The game launches

When launching from STL, the behaviour is different. There is no DirectX installation window, and after the square blank Origin window, a regular Origin window (where I can see opens sometimes even with the Steam Overlay enabled (there is an FPS counter). This stays open for about 5 seconds and then closes, and then about 10-15 seconds later, the STL crash dialog appears. This is how the Origin window that only appears with STL looks:

image

The Origin icon appears in my system tray when launching with and without STL. However it takes significantly longer for Origin to start up with STL if I let the Wait Requester time out. If I click Main Menu and then click Play from there, the game launches with no real noticeable delay in launch speed.

Some very strange behaviour here. I realise Mass Effect (and most other Origin games I have) is unreasonably large, so if there's anything I can test or any further logs I can post from my side please let me know (playing Mass Effect for the first time so I'll have it installed for quite a while to test)

@sonic2kk
Copy link
Owner Author

sonic2kk commented Jul 2, 2022

So I found an Origin game in my library that was only 3gb called Unravel, and it has the same behaviour as Mass Effect Legendary Edition and Sims 4 - Exact same sequence with that weird Origin window that only shows up with STL, and the Main Menu is missing the game information.

@frostworx
Copy link
Collaborator

nice, means origin changed their launch system again 🙄
Will probably need some time to analyse how it works now, I guess the "$L2EA" in steamtinkerlaunch needs some love...
very likely not soon...

@frostworx
Copy link
Collaborator

no real progress yet, but a plan.

This is seemingly pretty hard to resolve though, so it won't happen too soon:

The plan is to

  • add a proper link2ea (see below) detection, so several functions are automatically skipped in steamtinkerlaunch (at least avoids logs with broken/invalid variables, but might iron out some link2ea bugs as well)
  • debug why the steam internal "evaluator script" isn't launched on start and use that opportunity to either fix it or run it "manually" (the evaluator scripts are usually not visible for the user, but steamtinkerlaunch auto stores it and has functions to alter and start them programmatically - might need some changes, the functions are massive, and I haven't touched them for a long time)
  • add a specific link2ea wait loop after the game start, as it seems like steamtinkerlaunch closes too early, because the running wineserver/proton instance simply was not found.

If everything works well we have a very nice, controllable link2ea implementation when done (and a more robust "Steamworks Shared/evaluatorscript" installation on top)

link2ea:
The game executable command for all origin games is different from those of regular games on steam, as it calls a game specific link2ea url. This makes it harder to control the game launch and requires additional work (not the only, but another reason why 3rd party launchers on top of steam suck)

As steamtinkerlaunch also collects game data from the binary appinfo.vdf in parsable/readable form, it is easy to find out which owned games use link2ea, by grepping for link2ea in the metadata files (which have been created by game launch through steamtinkerlaunch before or via steamtinkerlaunch meta command, which extracts metadata for all(?) owned games)

cd ~/.config/steamtinkerlaunch/meta/title/general
$ grep -R link2ea . 
./Dragon Age™ Inquisition.conf:EXECUTABLE="link2ea://launchgame/1222690?platform=steam&theme=dai"
./ItTakesTwo.conf:EXECUTABLE="link2ea://launchgame/1426210?platform=steam&theme=it2"
./BurnoutPR.conf:EXECUTABLE="link2ea://launchgame/1238080?platform=steam&theme=bprm"
./Mirror's Edge™ Catalyst.conf:EXECUTABLE="link2ea://launchgame/1233570?platform=steam&theme=mec"
./Need for Speed™ Most Wanted.conf:EXECUTABLE="link2ea://launchgame/1262560?platform=steam&theme=nfsmw"
./Dragon Age Inquisition.conf:EXECUTABLE="link2ea://launchgame/1222690?platform=steam&theme=dai"
./Need for Speed(TM) Most Wanted.conf:EXECUTABLE="link2ea://launchgame/1262560?platform=steam&theme=nfsmw"
./Mass Effect Legendary Edition.conf:EXECUTABLE="link2ea://launchgame/1328670?platform=steam&theme=met"
./UnravelTwo.conf:EXECUTABLE="link2ea://launchgame/1225570?platform=steam&theme=un2"
./It Takes Two.conf:EXECUTABLE="link2ea://launchgame/1426210?platform=steam&theme=it2"
./Burnout™ Paradise Remastered.conf:EXECUTABLE="link2ea://launchgame/1238080?platform=steam&theme=bprm"
./Unravel Two.conf:EXECUTABLE="link2ea://launchgame/1225570?platform=steam&theme=un2"
./Unravel.conf:EXECUTABLE="link2ea://launchgame/1225560?platform=steam&theme=un"

No nice issue, but interesting and important to fix, so thanks for the report! 👍

@frostworx
Copy link
Collaborator

hm, just removed my previous compatdata and the (already implemented the "manual" launch - totally forgot about it 🙄) evaluator script install worked as expected (maybe the launch recycled /dev/shm/steamtinkerlaunch/ - f.e. the list of available proton versions - needs further debug)
so next add a link2ea wait loop for the game exit - maybe this already covers the main issue.

@frostworx
Copy link
Collaborator

This is very difficult to debug, as there is no obvious error.
Besides some improvable cosmetics and minor fixes steamtinkerlaunch still starts the game as usual:
in the first step steamworks shared/evaluator script is started, which installs all dependencies (including Origin Launcher from the game dir) (still works, but some cosmetics would not be the worst idea)
and in the second step the link2ea URL is started (as usual, this did not change basically)

the "wait for game exit" function after the game start could close the still running/starting game in theory,
but it doesn't, as the gamer also crashes without it.

for testing I replaced it with a debug function which logs all wine/origin/exe related programs every second after the game launch. this reveals that after ~ 20 seconds the origin launcher stops running and no other exe (the game) is started.
so it seems like the handshake between the launcher and steam actually starting the game must be interrupted somewhere.
the Client_Log.txt from origin, which can be found in $compatdata/1225560/pfx/drive_c/users/steamuser/AppData/Local/Origin/Logs/ (Unravel steamappid 😀) shows tons of errors, but no idea if any of them is related.

not sure how to proceed from here for now... :(

@frostworx
Copy link
Collaborator

Compared running processes (and rudimentary Client_Log.txt) between a steamtinkerlaunch and a proton standalone run.
The main issue seems to be that in standalone mode the instance is started through steamlinux runtime/pressure-vessel/pv-bwrap fun, but without when using steamtinkerlaunch.
The basic game launch is identical, so I assume this must be the core issue.
As steamtinkerlaunch does not actively disable the SLR, that fun must have changed again.

I hoped that topic was finally buried, but apparently it is not.
I'm uncertain if keeping on wasting time on troubleshooting SLR even makes much sense...
Let's see, maybe it is just some minor change.

@frostworx
Copy link
Collaborator

no it is not just some minor change...

@sonic2kk
Copy link
Owner Author

sonic2kk commented Jul 5, 2022

Wow, thanks for the huge amount of investigation into this! Seems like there's no easy way forward but thank you for the work on this all the time :-) I really have no idea about the Steam Linux Runtime or pressure-vessel but when researching I found some documentation on it on Valve's GitLab:

Maybe there's something useful here?

@frostworx
Copy link
Collaborator

thanks, I already used the upstream urls when initially wokring on SLR stuff and already rechecked while debugging again.
As SLR generally seems to have changed again (so not origin related) and is not used when using steamtinkerlaunch as compatibility tool any more I seriously consider retiring the whole project (upcoming holiday might help...?)
It might be still possible to fix this programmatically from steamtinkerlaunch side, but the problem could be completely isolated as well (the last sentence in the Steam Linux Runtime wiki is still valid)

@frostworx frostworx changed the title Issues launching Mass Effect Legendary Edition (and possibly other Origin games) Origin game compatibility broken - possibly caused by SLR. Maybe unfixable. Help welcome/required! Jul 6, 2022
@frostworx
Copy link
Collaborator

just added some wip functions for further troubleshooting and updated the issue title.

@frostworx frostworx changed the title Origin game compatibility broken - possibly caused by SLR. Maybe unfixable. Help welcome/required! ⚠ [top priority] (at least) Origin game compatibility broken - possibly caused by SLR. Maybe unfixable. Help welcome/required! Jul 6, 2022
@frostworx frostworx pinned this issue Jul 6, 2022
@frostworx
Copy link
Collaborator

using the SLR in its up-to-date version would require a version bump from 1 to 2 in the toolmanifest.vdf,
which would pull in several (intended) container-based restrictions.

This has multiple consequences, where some of them are difficult to solve correctly:

  • ~/.local/share/Steam/compatibilitytools.d/SteamTinkerLaunch/steamtinkerlaunch can no longer be a symlink to /usr/bin/steamtinklerlaunch
  • all globally installed steamtinkerlaunch files (in /usr/share/steamtinkerlaunch/) can no longer be used directly
  • all (optional) dependencies (usually in /usr/bin/+ libs ) can no longer be found/used directly
  • several vars are (likely) immutable (for example: STEAM_COMPAT_TOOL_PATHS). Means for example that not all proton installations can be accessed/found
  • much more (haven't finished troubleshooting into that direction and likely won't continue into that direction)

a very cut down version of steamtinkerlaunch worked with toolmanifest v2 and used the SLR, but wasn't 100% functional because of dependencies not available. Therefore it also wasn't possible to test if this fixed origin compatibility.

I guess the only valid way to make steamtinkerlaunch v2 compatible would be some container flavor containing all steamtinkerlaunch files and dependencies.

Until toolmanifest v1 still works (assuming it will be shutdown one day) steamtinkerlaunch will stick with it.
I won't work on any container implementation, but with some luck it can also be fixed with v1 (by providing variables, which would usually be set using v2 automatically there are multiple)

@frostworx
Copy link
Collaborator

frostworx commented Jul 30, 2022

I found something important:
When comparing the steam logs directly from a proton only unravel start and a stl unravel start, only in the proton launch a
2nd game process is added (after the actual game process (here 1225560 = unravel)):
Game process added : AppID 1182480 "", ProcID 51539, IP 0.0.0.0:0

bingo: appid 1182480 is EALink

with some luck it is enough to automatically "manually" start 1182480 whenever an origin game is detected.
no, it isn't

(I guess this is the key to this specific problem, but I'm afraid sooner or later a migration to the mostly closed down toolmanifest v2 container is inevitable)

@frostworx
Copy link
Collaborator

when replacing
main "$@"
with a hardcoded proton call in the current steamtinkerlaunch state
unravel starts correctly.
of course there is no steamtinkerlaunch functionality, but it means that origin games can still be started correctly with toolmanifest v1 and through a bash script. so I'd guess it has to be fixable within steamtinkerlaunch (unless it is some low level problem, like too many pids started or similar)

@frostworx
Copy link
Collaborator

Getting closer. When starting a hard-coded

"$HOME/.config/steamtinkerlaunch/proton/custom/GE-Proton7-27/proton" "waitforexitandrun" "link2ea://launchgame/1225560?platform=steam&theme=un"

before
writelog "INFO" "${FUNCNAME[0]} - First LoadCfg: $STLGAMECFG"
in
function prepareLaunch

it works, but doesn't if started after.
so, apparently some configuration variable is the problem (very likely some non-steamtinkerlaunch var, but a proton or wine var)

@frostworx
Copy link
Collaborator

We have a winner!

disabling

PROTON_NO_ESYNC="0"
PROTON_NO_FSYNC="0"
PROTON_FORCE_LARGE_ADDRESS_AWARE="1"

makes unravel start!

@frostworx
Copy link
Collaborator

frostworx commented Jul 30, 2022

WTF
It is not the variables itself, but the amount of variables set.
In my current wip working troubleshooting build, it is enough to export any random variable before to prevent the game from launching!

note for me later:
emptyVars all unneeded variables directly before gamestart

frostworx pushed a commit that referenced this issue Jul 30, 2022
@frostworx
Copy link
Collaborator

Above commit should fix the issue - please test (only tested with unravel here)
to sum it up:

This was not really a steamtinkerlaunch issue, but EALink refuses to handshake for whatever reason when a specific number of set env vars is exceeded. This is a very strange issue and I've never seen something similar before.

The $fix is that the new function unsetSTLvars is called before an origin game launch, which unsets all exported steamtinkerlaunch variables which are not required for shutting down after the game.

Fortunately, we were again not affected by the SLR problems mentioned above... fingers crossed

@frostworx frostworx changed the title ⚠ [top priority] (at least) Origin game compatibility broken - possibly caused by SLR. Maybe unfixable. Help welcome/required! [TEST] Origin EALink refuses to handshake and therefore starting a game when a specific number of env vars is exceeded! 🤨 Jul 30, 2022
@frostworx
Copy link
Collaborator

This commit

  • fixes the settings menu info part being empty (the origin launch url command caused an incompatibility with yad)
  • determines the actual game executable for origin games (which use a "link2ea" url as "executable" internally) by extracting it from the intercepted evaluatorscript (~/.config/steamtinkerlaunch/meta/eval/id/)
  • "link2ea" EXECUTABLE and GAMENAME entries in the metafiles (grep -R link2ea ~/.config/steamtinkerlaunch/meta/id/general/ to find all affected origin games) are updated accordingly (the "link2ea" launch url is additionally stored as ORIGINEXE)

@frostworx
Copy link
Collaborator

took an insane amount of time to debug and fix this. can you confirm the fix works?

@sonic2kk
Copy link
Owner Author

Sorry this took so long! So Mass Effect still won't launch for me but the behaviour has changed slightly.

First off some good news: I can confirm that the Main Menu now correctly shows information about Mass Effect. Thank you so so much for your effort on this!

image

However after the "Connecting to Origin" box, an Origin window sometimes appears that first says something about not being able to install a game from the Origin client, and then suddenly changes to a prompt asking me to select my language/region or something? I can't get it to stay long enough or consistently enough to actually read what it says but the box it shows looks like its asking me to select a region. The window closes after maybe half a second, then the Origin tray icon disappears, and the game closes shortly after. Once the game tries to connect to Origin, the SteamTinkerLaunch tray icon disappears.

Could this be anything to do with any potential leftover files somewhere? I removed the Mass Effect Legendary Edition config from ~/.config/steamtinkerlaunch/gamecfgs/, but I'm not sure if there are any others.

I have verified that the game launches without SteamTinkerLaunch.

I have attached a steamtinkerlaunch log file. I also tried to create Proton log file, but no such file is generated 😦 I understand SteamTinkerLaunch isn't your priority right now but for completeness please let me know if there are other files I can attach to help debug the issue.

steamtinkerlaunch.log

@frostworx
Copy link
Collaborator

frostworx commented Aug 26, 2022

I only tested the fix with Unravel.
Here Unravel still works, but I had to update the origin client (a requester asked) to get it working.
First I selected use old version/offline and the game did not work.
Can you confirm it works with it?

The setFullGameExePath WARN is not the problem, because Unravel logs the same, but should be fixed for origin either way.

proton logs don't work with origin games, because they do not start the game directly but an url. no idea if this can be changed/fixed.

I'll download Mass Effect Legendary and troubleshoot this soonish.
The main fix unsetSTLvars at least works for Unravel, but maybe it behaves differently for MEL. Likely I'll start with some debug output in that function if it doesn't work here as well.
I'm afraid there are no other useful steamtinkerlaunch logs, because the problem is unusual deep (at least the unsetSTLvars problem), maybe the origin logs themself reveal something useful (tbh I doubt though) (edit: typo)

@sonic2kk
Copy link
Owner Author

I just tested Unravel with STL and Proton 7.0-4 and Proton Experimental, and it doesn't launch for me. It has the same behaviour as Mass Effect Legendary Edition.

but I had to update the origin client (a requester asked) to get it working.

I got prompted to update Origin with both MELE and and Unravel, should've mentioned that.

That's a shame about the logs. I'll see if I can test some other Origin games.

@frostworx
Copy link
Collaborator

hm, can you test if unravel works with latest GE?
(haven't touched MELE yet)

@sonic2kk
Copy link
Owner Author

sonic2kk commented Aug 26, 2022

Just tried with GE-Proton7-30 and with STL it doesn't work for me, though it works without STL. It has the same behaviour as MELE: "Connecting to Origin", then showing the Origin tray icon and window briefly, then the Origin window disappears, tray icon disappears, and Steam sees that the game is closed (the blue "Stop" button changes back to the green "Play").

MELE doesn't work with GE-Proton7-30, just thought I'd retest it now that I have the latest GE.

I installed Sims 4, going to get Origin set up for that game and report back with the results.

EDIT: Unfortunately Sims 4 didn't work with STL. Without STL it with Proton Experimental and GE-Proton7-30.

I should also note that MELE, Unravel and Sims 4 all correctly show their game information in the Game Menu.

@frostworx
Copy link
Collaborator

not sure if you've seen above what the main problem is.
origin games apparently refuse to work when too many system variables are set.
steamtinkerlaunch creates multiple variables and therefore changes are high that the invisible border is crossed where it no longer works. This was 100% reproducible when testing with Unravel, but only one of several origin glitches.
Another one was missing game information, which was fixed separately

@frostworx
Copy link
Collaborator

frostworx commented Aug 26, 2022

MELE works fine for me here as well! (fresh install via proton-7.0-4, afterwards switched to steamtinkerlaunch using GE30)
Very likely this is an env variable problem on your system as well - seems like origin does some nasty stupid things here.
For testing you could add
echo "unset $line" >> "/tmp/${FUNCNAME[0]}.log"
into the while read -r line; do loop in function unsetSTLvars, to see which vars are cleared, and additionally add a
env > /tmp/env-in.txt before the while loop
and a
env > /tmp/env-out.txt
afterwards.
most important should be the latter. If there are many variables (likely most coming from your system(?)) this could be your problem (even only indirectly related)
might help to unset some manually for further testing.

for comparison:
my /tmp/env-out.txt has still 332 lines
There are several BASH_FUNCs left used by the TrayIcon, which all require multiple lines of course.
without those functions there are ~225 lines with variables left. (maybe variables count max at 256?)

@sonic2kk
Copy link
Owner Author

Thanks! So I added that logging. Both env-in and env-out had the BASH_FUNC lines you mentioned. They spanned over multiple lines, and when I collapsed each function down to one line, it brought my env-out.txt to a total of 232 lines. Without those my env-out is 218 lines.

unsetSTLvars.log unsets ~260 variables. So I guess that invisible variable limit is being crossed, but for some reason it's going over on my system.

I didn't see anything in env-out.txt which looked out of place, it was very general paths and variables for Mesa and Steam, and stuff like PulseAudio and SDL variables. I have attached my env-out.txt. in case there's something there which Origin might not like. I removed the BASH_FUNC lines to hopefully make the file a little bit cleaner.

env-out.txt

@frostworx
Copy link
Collaborator

unsetSTLvars.log only shows the variables which are being unset. just meant to show you what is happening in the background.
nothing in env-out.txt needs to look out of place. in my case it is the ammount of variables which exceeded, each variable on its own is fine. this is imho clearly an origin bug (or intended behavior)
I'm pretty sure unsetting one, multiple or most of those variables would fix the issue on your system as well.

@sonic2kk
Copy link
Owner Author

As this seems to be specific to my system I'm happy to close this issue :-) (Trying to help trim down the amount of open issues).

Thanks again for all your work on debugging this, sorry it took me so long to get around to testing. Maybe we could put something about this on the wiki too, though I'm not sure how many people are going to run into an issue like this after your fixes.

@frostworx
Copy link
Collaborator

I'm not sure if it is specific to your system, but I'm not sure how many people are interested in contributing anything to it 🤨

Sorry I couldn't help you any further.
I very much appreciate all your work you spend in steamtinkerlaunch, Don Quijote 😉
But don't waste too much time on it! (so don't I anymore)

@sonic2kk
Copy link
Owner Author

It's all good 😄 If it becomes a bigger problem in future and I can fix it I'll submit a PR myself.

Closing this now, as I don't think there'll be much further developments with keeping this issue open

@frostworx
Copy link
Collaborator

thanks mate! I'll probably close several other issues shortly for the same reason

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