protonfixes icon indicating copy to clipboard operation
protonfixes copied to clipboard

util.protontricks does not work on first run

Open dreamer opened this issue 5 years ago • 12 comments

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?

dreamer avatar Oct 18 '18 09:10 dreamer

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.

pchome avatar Oct 18 '18 15:10 pchome

@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?

simons-public avatar Oct 18 '18 18:10 simons-public

@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.

dreamer avatar Oct 18 '18 18:10 dreamer

@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.

pchome avatar Oct 18 '18 18:10 pchome

@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 avatar Oct 18 '18 18:10 simons-public

@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 avatar Oct 18 '18 18:10 simons-public

@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 avatar Oct 20 '18 00:10 simons-public

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

simons-public avatar Oct 20 '18 00:10 simons-public

@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.

pchome avatar Oct 20 '18 00:10 pchome

Sorry, yes Proton's wine

simons-public avatar Oct 20 '18 00:10 simons-public

@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 avatar Oct 23 '18 01:10 simons-public

@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?

simons-public avatar Nov 01 '18 23:11 simons-public