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

util.protontricks does not work on first run #19

Open
dreamer opened this issue Oct 18, 2018 · 12 comments
Open

util.protontricks does not work on first run #19

dreamer opened this issue Oct 18, 2018 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@dreamer
Copy link
Contributor

dreamer commented Oct 18, 2018

Describe the bug
I am developing a gamefix for Valiant Hearts, which needs corefonts installed (as all Uplay titles do) and found out, that util.protontricks('corefonts') does not work for me.

What is interesting: it never works on on first run, but always on second one - but it's not good enough, because Uplay won't show any interface without corefonts installed, thus user won't be able to log in to start the game.

Any ideas how to proceed?

@pchome
Copy link
Contributor

pchome commented Oct 18, 2018

Something definitely wrong with util.protontricks().

Suggestions:

  • it should use Proton's WINE wherever possible, to prevent prefix (re)updates from local WINE
    e.g. use protonmain.env (https://github.com/simons-public/protonfixes/blob/master/protonfixes/util.py#L108)
    and set WINE env vars explicitly

          env = dict(protonmain.env)
          #env['WINEPREFIX'] = protonprefix() #should be in env[] already
          env['WINE'] = protonmain.wine_path
          env['WINELOADER'] = protonmain.wine_path
          env['WINESERVER'] = os.path.join(protonmain.bindir, 'wineserver')
    
  • allow Proton to create prefix first, e.g. skip all steps except waitforexitandrun (I guess prev Proton run commands should already do the job)
    e.g. (https://github.com/simons-public/protonfixes/blob/master/protonfixes/__init__.py#L11)

      if 'STEAM_COMPAT_DATA_PATH' in os.environ:
          if 'waitforexitandrun' in sys.argv[1]:
              fix.main()
    
  • also zenity loader somehow broken a bit, I can see multiple cycling calls in log while winetricks running and loader is active

Not tested deeper, because on already configured game it somehow works, but definitely util.protontricks() require more work and attention.

@simons-public simons-public self-assigned this Oct 18, 2018
@simons-public simons-public added the bug Something isn't working label Oct 18, 2018
@simons-public
Copy link
Owner

simons-public commented Oct 18, 2018

@pchome I'd like for util.protontricks to use Proton wine, but by the time the user_settings.py is sourced the Proton wineserver is already running and I was getting conflicts with winetricks trying to start the wineserver again. I'll try working on it again and see where I can get. I don't think I had WINELOADER defined, that could have been the problem. I think using Proton wine will probably fix the issue of having to run twice.

Protonfixes should be skipping the early steps here. The env variables will still get dumped to stderr if debug is imported, since that's been helpful for troubleshooting. The only issue with using waitforexitandrun is that I've found at least one game that doesn't use it and only uses proton run to launch, which is why I filtered out iscriptevaluator.exe instead. I think that if Valve was more open about the scripts that are run by iscriptevaluator we could just be committing fixes for those instead.

@dreamer Uplay has other issues as well that I've seen causing login issues. SSL is kind of broken in steam-runtime because of an older version of libgnutls. For now I've been 'replacing' the uplay dlls with a local gamefix just to be able to play, but it might be fixable using LD_PRELOAD.

EDIT: I just read that the Uplay connectivity might be fixed in Proton 3.16-1, but I'm still running 3.7 Beta installed by the client.

Can you post a log for Valiant Hearts for first & second run on an fresh prefix?

@dreamer
Copy link
Contributor Author

dreamer commented Oct 18, 2018

@simons-public I have connection issues worked out already - exactly by copying working gnutls into new directory and adding it to LD_LIBRARY_PATH. Uplay needs 32-bit version of gnutls to work. If corefonts were installed before Uplay starts for the first time then it would work quite all right.

I'll try to see if just copying font files into prefix might work good enough.

@pchome
Copy link
Contributor

pchome commented Oct 18, 2018

@simons-public
Probably this issue also echoes with #11.

I saw likely related error in logs:

[34mProtonFixes[11069] INFO: Using winetricks verb xact�[0m
wine client error:0: version mismatch 567/557.
Your wine binary was not upgraded correctly,
or you have an older one somewhere in your PATH.
Or maybe the wrong wineserver is still running?
�[34mProtonFixes[11069] INFO: Winetricks complete�[0m

Looks like not matching protocol versions for running wine and wineserver.

@dreamer
Just a hint: you can set e.g. LD_LIBRARY_PATH=$HOME/.local/lib64:$HOME/.local/lib in your $HOME/.profile
Then copy everything you want there. Most apps should respect defined LD_LIBRARY_PATH.

@simons-public
Copy link
Owner

@dreamer I like your idea of linking the font files directly, I've been thinking of working it in as a default for protonfixes since so many games require fonts and hardlinking takes no space or time anyway. I can't really think of any downsides to always having the MS fonts in a prefix.

@simons-public
Copy link
Owner

@pchome That's exactly the error I was getting using proton wine, I'll refactor util.protontricks making sure it uses all the required environment variables and test it as soon as I have some time.

@simons-public
Copy link
Owner

simons-public commented Oct 20, 2018

@dreamer Ok, so util.protontricks is properly using Proton's wine now, and corefonts automatically get linked to pfx/drive_c/windows/Fonts/ for all games now. Can you try out the latest commit and see if it still takes two runs?

@simons-public
Copy link
Owner

@pchome Can you expand on the zenity loader being broken? I'm not seeing multiple cycles of it in my logs

@pchome
Copy link
Contributor

pchome commented Oct 20, 2018

@simons-public

Ok, so util.protontricks is properly using native wine now

you mean Proton's WINE ?

Can you expand on the zenity loader being broken? I'm not seeing multiple cycles of it in my logs

I should do a cleanup and merge changes first, an than retest.
But usually I'm doing $ tail -F /tmp/dumps/*.txt in terminal, and then on next virtual desktop starting a game by clicking on Steam's tray icon. After a while zenity loader active, I can switch to prev virtual desktop and see multiple ... gameoverlayrenderer.so ... LD_PRELOAD cannot be preloaded .... Where winetricks's messages appeared by parts (between those preloader errors).

I better should retest this with recent changes, to be sure it still an issue. I'll report if so.

@simons-public
Copy link
Owner

Sorry, yes Proton's wine

@simons-public
Copy link
Owner

@dreamer Reading winetricks source just now, I think part of the reason it takes a second run after winetricks is because winetricks kills the wineserver with wineserver -k on a lot of tricks, and Proton doesn't know to restart it. I'm going to test having util.protontricks relaunch the wineserver after running tricks to see if that fixes the issue and if it causes any issues

@simons-public
Copy link
Owner

@dreamer I tested with rerunning wineserver at the end and it ended up causing steam to think the game was running after termination. However, when I started testing with the latest Proton 3.16-4 I noticed I wasn't having the issue anymore. Can you test with Proton 3.16-4 and let me know if you're still having the issue?

pchome added a commit to pchome/protonfixes that referenced this issue Nov 17, 2018
Sometimes `winetricks` performs a strange things, so
very likely it should wait for `wineserver` to quit.

Not sure, but it can also help simons-public#19, or otherwise there
should be one more check for a prefix existence.
simons-public pushed a commit that referenced this issue Nov 17, 2018
* Possible fix for a rare winetricks fail

Sometimes `winetricks` performs a strange things, so
very likely it should wait for `wineserver` to quit.

Not sure, but it can also help #19, or otherwise there
should be one more check for a prefix existence.

* Fix: Used full path to Proton's wineserver
techtonik pushed a commit to techtonik/protonfixes that referenced this issue Feb 24, 2021
* Possible fix for a rare winetricks fail

Sometimes `winetricks` performs a strange things, so
very likely it should wait for `wineserver` to quit.

Not sure, but it can also help simons-public#19, or otherwise there
should be one more check for a prefix existence.

* Fix: Used full path to Proton's wineserver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants