ValveSoftware / Proton

Compatibility tool for Steam Play based on Wine and additional components
Other
24.15k stars 1.06k forks source link

Forza Motorsport (2440510) #7151

Open robotman40 opened 1 year ago

robotman40 commented 1 year ago

Compatibility Report

System Information

I confirm:

[ ] that I haven't found an existing compatibility report for this game. [ ] that I have checked whether there are updates for my system available.

Symptoms

Game crashes on launch, supposedly due to this in the Proton log

19625.840:00e8:01b0:warn:threadname:NtSetInformationThread Thread renamed to L"wine_threadpool_worker"
19625.859:0030:01b4:warn:threadname:NtSetInformationThread Thread renamed to L"wine_threadpool_worker"
19625.859:0030:01b8:warn:threadname:NtSetInformationThread Thread renamed to L"wine_threadpool_worker"
19625.859:0030:01bc:warn:threadname:NtSetInformationThread Thread renamed to L"wine_threadpool_worker"
19625.860:0030:01c0:warn:threadname:NtSetInformationThread Thread renamed to L"wine_threadpool_worker"
19625.860:0030:01c4:warn:threadname:NtSetInformationThread Thread renamed to L"wine_threadpool_worker"
pid 69674 != 69673, skipping destruction (fork without exec?)

I've noticed many warnings related to NtSetInformationThread throughout the log and a couple fixme errors like 19619.029:0064:0070:fixme:hid:handle_IRP_MN_QUERY_ID and 19619.971:0110:0114:fixme:uiautomation:msaa_provider_GetPropertyValue.

Here is the full Proton log

https://drive.google.com/file/d/1UWI7cHhhP9cLCMnP7rqm1btflvKbjRh_/view?usp=sharing

Reproduction

Launch the game and observe it show the splash screen and then crash

robotman40 commented 9 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7151#issuecomment-1873504313

Can you trace what causes the exception? From what has been stated previously, it is likely due to unimplemented flags in the VirtualAlloc function.

robotman40 commented 7 months ago

Anything new? The memory issue fixed? Is Gaming Services still a problem?

anliec commented 7 months ago

Gaming Services is still the main blocking point. For the memory error, ignoring MEM_LARGE_PAGES & MEM_PHYSICAL seams to be the way to go, but until Xbox make a Gaming Services that works with wine that's not helping much.

LunaRosalie commented 7 months ago

i wonder if valve could actually submit some request to microsoft to help with making gaming services work through a layer or proton or wine for Deck

robotman40 commented 7 months ago

i wonder if valve could actually submit some request to microsoft to help with making gaming services work through a layer or proton or wine for Deck

Well considering that Forza's Steam Deck support page mentions Forza Motorsport, it seems they are aware of the issue, but their hands-off language implies it's unlikely they'll do anything.

UPDATE: I contacted Forza support and told them about what's stopping this game from running on Linux and asked if there were plans to support it. They didn't answer my question and just redirected me to their Steam Deck support page.

AsciiWolf commented 5 months ago

Was there any progress in making Forza Motorsport running in Wine/Proton? I know that there was some upstream work in progress, but that was months ago.

LeonardoWL037 commented 5 months ago

If you use the new proton (9.0 beta), after the splash screen, is shown an info popup that gaming services needs to be installed. With OK and Cancel options, OK leads to Microsoft support link where it teaches how to install it. All the steps are for windows 10+. Tried installing with proton launcher on the Motorsport prefix, no Success.

I think we really depend on Turn 10 for this, unless someone discover a way to circunvent this.

robotman40 commented 5 months ago

If you use the new proton (9.0 beta), after the splash screen, is shown an info popup that gaming services needs to be installed. With OK and Cancel options, OK leads to Microsoft support link where it teaches how to install it. All the steps are for windows 10+. Tried installing with proton launcher on the Motorsport prefix, no Success.

I think we really depend on Turn 10 for this, unless someone discover a way to circunvent this.

Just curious to see, but could you send a screenshot?

Also, someone said they were able to install Gaming Services on Windows LTSC (which does not come with the Microsoft Store). How does it work there if (presumably) there is no way of installing UWP apps, while it fails on Proton?

LeonardoWL037 commented 5 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7151#issuecomment-2054295335

Sure Screenshot_20240414_225518

robotman40 commented 5 months ago

So here is something odd. @logos128 said he was able to install a version of Windows 10 that doesn't come with the Microsoft Store and was able to install Gaming Services successfully (with the script Microsoft provides on their website).

Yet, on Proton, it fails to run it.

From our observations, gamingrepair.exe tries to open the Microsoft Store to install Gaming Services. Why was it working on @logos128's Windows 10 install that didn't come with the Microsoft Store, but not on Proton, which also lacks the Microsoft Store.

LeonardoWL037 commented 5 months ago

No clue, i tried here to install via get-appxpackage Microsoft.GamingServices without microsoft store, it seems to work, but when i launch the game, it wont connect to server and just let me play offline, i have do manually open xbox app so i can play

LeonardoWL037 commented 5 months ago

No clue, i tried here to install via get-appxpackage Microsoft.GamingServices without microsoft store, it seems to work, but when i launch the game, it wont connect to server and just let me play offline, i have do manually open xbox app so i can play

Wait, you're saying the game actually launches?

If so, then we're one step closer at least.

Forgot to tell that i tested on a Windows laptop and uninstalled microsoft store and dependencies, my bad

robotman40 commented 5 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7151#issuecomment-2054675342

Could you try copying over the Gaming Services stuff to Motorsport's prefix and see if it does anything?

LeonardoWL037 commented 5 months ago

Tried it before, no advance. At least on my knowledge, its installed here for me: C:\Program Files\WindowsApps\Microsoft.GamingServices_20.88.5001.0_x64__8wekyb3d8bbwe

But there a lot of registers to every executable of it on my windows installation

logos128 commented 5 months ago

@GalacticalEdge, initially I thought the Microsoft Store is a separate app that includes all of the store functionality itself. Appeared it is just a frontend providing convenient access to the store for end users. All functionality is actually part of the Universal Windows Platform (Windows.ApplicationModel.Store, Windows.Services.Store, etc.) and as such is part of the OS.

Back then I did a lot of testing , incl. implementing dozens of api stub calls and even "noname" ordered functions, to try to mix Wine with some native Windows components, but it always ended up asking for more AppModel related stuff in ntdll or kernel32/kernelbase.

So the ApplicationModel will need to be implemented more thoroughly in Wine first (with the store stuff just stub-ed, etc.), for this to progress further. It is part of Win10/11 now, so more apps will need it in the future anyway.

robotman40 commented 5 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7151#issuecomment-2057488457

So you're saying it's possible, but would need to essentially implement UWP on Wine?

Also, to add, I believe Forza Horizon 4's Steam release forced Wine to implement some UWP functions anyway, so at least we got a foundation.

logos128 commented 5 months ago

So you're saying it's possible, but would need to essentially implement UWP on Wine?

It depends on how the FM uses GamingServices and whether that involves using any store api from the OS. Implementing any api that would require authentication or exchange of credentials with the MS Store won't be possible, as this is proprietary MS service.

I believe however, that FM does online authentication/communication the same way as FH5, through the XboxLive dll. It could be using GamingServices just for the cloud support. There is also a strong possibility that GamingServices includes all the authentication code itself, and doesn't rely on any system apis for that. Anyway, GamingServices is an app package service, that will need at least basic support for such apps in Wine (through Windows.ApplicationModel and the related apis in ntdll, etc.).

I was able to run one of the executables in the package - gamingservices.exe I think - as a regular service in a wineprefix. IIRC it mostly needed implementation of app package related apis from ntdll and kernel32/kernelbase. Didn't require any of the store stuff. It returned an error while starting the service, but at least didn't crash. There are few other services in the package, though.

robotman40 commented 5 months ago

Since there are ways of downloading UWP apps through unofficial sources, could they be used as building blocks for UWP support in Wine (since Gaming Services needs UWP support)?

logos128 commented 5 months ago

UWP interfaces are already being worked on - look in dlls/windows.xxxx.., etc. For example windows.gaming.input provides support for force feedback wheels in FH5. There is even an initial implementation of windows.applicationmodel with some app package support.

There are two sets of problems to get GamingServices running on Wine, IMO.

The first problem is to make installation procedure complete successfully. This one involves implementing the MS Store stuff - downloading, installing, etc. I think though, that if GamingServices and other required components are already installed on the wine prefix, the GamingRepair installer won't attempt to re-download them from the store. So, if for example Valve distributes those components as part of the SteamWorks package, and then Proton manually installs them as part of the FM prefix creation, it would theoretically be possible to skip the MS store downloading. This still involves implementing support for app package services and possibly windows.applicationmodel.store stubs, etc.

The second problem is getting the various GamingServices components to function properly. This one involves implementing a lot of app package related interfaces and possibly other UWP interfaces and ntdll/kernel32 apis. From my testing with one of the executables - gamingservices.exe - it didn't import MS Store related apis IIRC. Also depends on what GamingServices functionality is actually used by FM. It is possible that only a small set of apis really need implementation and others just need to be stub-ed, etc.

As for the unofficial MS Store downloading, I don't think it can be legally supported by Valve.

robotman40 commented 5 months ago

if for example Valve distributes those components as part of the SteamWorks package, and then Proton manually installs them as part of the FM prefix creation, it would theoretically be possible to skip the MS store downloading.

In that case, Valve would need to convince Microsoft to make Gaming Services itself part of the SteamWorks package (which I highly doubt they'd do)

logos128 commented 5 months ago

In that case, Valve would need to convince Microsoft to make Gaming Services itself part of the SteamWorks package (which I highly doubt they'd do)

Yep, in my opinion without MS support this cannot be resolved in an official way. T10 can even distribute the required components as part of the FM download - somewhere in the folder structure, etc.

robotman40 commented 4 months ago

By any chance, do the other Forza games rely on anything from Xbox Gaming Services? I know Forza Horizon 4 requires Xbox Game Bar and that stuff for inviting friends and joining clubs (trying on Proton will just throw a "There is no Windows program configured to open this file" error and causes FH4 to show an error saying there was an issue communicating with the server, but continues to run fine), but does not crash on launch.

mohamadaljaf commented 4 months ago

UWP and WinRT are not intertwined and many regular applications are already using WinRT modules. For Forza Horizon 4, it seems to only require windows.gaming.ui.gamebar.dll and in the Wine implementation all this does is return values saying the gamebar is not visible.

WinRT modules are increasingly being used and most applications won't run without them. Wine does not have any dedicated WinRT developers nor do they seem interested in developing it. I applied to CodeWeavers to work on Wine and specifically WinRT modules but they rejected me despite meeting the listed job requirements and having fixed several WinRT bugs.

If Valve is hiring Proton/Wine developers I'd be more than happy to work on this issue and add more support for WinRT modules.

robotman40 commented 4 months ago

Replying to https://github.com/ValveSoftware/Proton/issues/7151#issuecomment-2132044433

So do we know what Gaming Services is used for in the game aside from DRM (I think)?

Also, for the Deck Verified evaluation, it should be changed to "This game is unsupported on Steam Deck due to use of an unsupported anti-cheat or multiplayer service"

robotman40 commented 1 month ago

This is a dead horse already, so I'm not sure if anyone will notice, but a Wine developer told me stubbing Gaming Services might get the game to at least launch, but in a very limited state. Any thoughts?

mohamadaljaf commented 1 month ago

It's likely to get the game running, but without online functionality. For the latter, that likely needs a thorough implementation of not only GamingServices but also any dependencies or related services like Xbox Live, which AFAIK is not possible to implement in Wine at the moment.

A person in this thread tried copying GamingServices to the prefix and it didn't work. Error 0x89240101 is E_GAMERUNTIME_DLL_NOT_FOUND or "The game runtime DLL was not found.". In this case, it might be querying the registry first. GamingServices has at least two registry keys:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\GamingServices] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\GamingServicesNet]

What you can try is installing GamingServices on a Windows OS, export those keys, and import them into the Wine registry.

Moreover, if the game is using Win32 API to check if GamingServices is running, like QueryServiceStatus for instance, then you could add a hack into Proton that returns SERVICE_RUNNING.

robotman40 commented 1 month ago

Replying to https://github.com/ValveSoftware/Proton/issues/7151#issuecomment-2301210172

The game likely communicates to online services using XboxLive.dll, which is probably similar to Forza Horizon 5 and other Xbox titles. So who knows what Gaming Services is for.

Also, I don't have the time to try your suggested workaround since I am extremely busy.

robotman40 commented 1 month ago

Replying to https://github.com/ValveSoftware/Proton/issues/7151#issuecomment-2301210172

Also, could you tell me the location of the Gaming Services files so I can copy them over when I got the time? I will also see if importing the registry keys does anything.

mohamadaljaf commented 1 month ago

It should be in C:\Program Files\WindowsApps.

RiskRunner0 commented 5 days ago

I have GamingServicesNet running, but for some reason I can't get Gaming Services service to start:

$ ps aux | grep GamingService
matt      123774  0.0  0.0 263384 21352 ?        Ssl  19:40   0:00 C:\Program Files\WindowsApps\Microsoft.GamingServices_23.92.22001.0_x64__8wekyb3d8bbwe\GamingServicesNet.exe
$ WINEPREFIX=/media/games/SteamLibrary/steamapps/compatdata/2440510/pfx wine net start GamingServicesNet
The Gaming Services service is starting.
Service already running.
$ WINEPREFIX=/media/games/SteamLibrary/steamapps/compatdata/2440510/pfx wine net start GamingServices
The Gaming Services service is starting.
02e4:fixme:heap:RtlSetHeapInformation HEAP_INFORMATION_CLASS 1 not implemented!
02e4:fixme:ole:CoInitializeSecurity 00007FFFFE229710, -1, 0000000000000000, 0000000000000000, 0, 2, 0000000000000000, 0, 0000000000000000 stub
02e4:fixme:ole:global_options_Set 00007FFFFE7B0CA0, 1, 2.
02e4:fixme:ole:global_options_Set 00007FFFFE7B0CA0, 5, 1.
02f4:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 00006FFFFE0F8952, 47) stub
02f4:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 00006FFFFDFEB6AA, 37) stub
02f4:fixme:ntdll:RtlGetDeviceFamilyInfoEnum 0000000000000000 00007FFFFEDDF900 0000000000000000: stub
02f4:err:ole:com_get_class_object class {0000034e-0000-0000-c000-000000000046} not registered
02f4:err:ole:com_get_class_object no class object {0000034e-0000-0000-c000-000000000046} could be created for context 0x1
Service request timeout.
02e4:fixme:combase:RoGetActivationFactory (L"Windows.Internal.System.Profile.RegionPolicyEvaluator", {00000035-0000-0000-c000-000000000046}, 00007FFFFE1FF920): semi-stub
02e4:err:combase:RoGetActivationFactory Failed to find library for L"Windows.Internal.System.Profile.RegionPolicyEvaluator"

It feels really close tbh

RiskRunner0 commented 5 days ago

Got past the "failed to find library", now I'm getting this:

$ system32 WINEPREFIX=/media/games/SteamLibrary/steamapps/compatdata/2440510/pfx wine net start GamingServices
The Gaming Services service is starting.
0624:fixme:heap:RtlSetHeapInformation HEAP_INFORMATION_CLASS 1 not implemented!
0624:fixme:ole:CoInitializeSecurity 00007FFFFE229710, -1, 0000000000000000, 0000000000000000, 0, 2, 0000000000000000, 0, 0000000000000000 stub
0624:fixme:ole:global_options_Set 00007FFFFE7B0CA0, 1, 2.
0624:fixme:ole:global_options_Set 00007FFFFE7B0CA0, 5, 1.
0630:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 00006FFFFE0F8952, 47) stub
0630:fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 00006FFFFDFEB6AA, 37) stub
0630:fixme:ntdll:RtlGetDeviceFamilyInfoEnum 0000000000000000 00007FFFFEDDF900 0000000000000000: stub
0630:err:ole:com_get_class_object class {0000034e-0000-0000-c000-000000000046} not registered
0630:err:ole:com_get_class_object no class object {0000034e-0000-0000-c000-000000000046} could be created for context 0x1
Service request timeout.
0624:fixme:combase:RoGetActivationFactory (L"Windows.Internal.System.Profile.RegionPolicyEvaluator", {00000035-0000-0000-c000-000000000046}, 00007FFFFE1FF920): semi-stub

I have no idea what service request is timing out. I can see on wireshark that when I start up the GamingServices service, it pings 40.65.111.94, which looks like title.mgt.xboxlive.com:

$ nslookup title.mgt.xboxlive.com
Server:         100.100.100.100
Address:        100.100.100.100#53

Non-authoritative answer:
title.mgt.xboxlive.com  canonical name = title.mgt.xboxlive.com.akadns.net.
Name:   title.mgt.xboxlive.com.akadns.net
Address: 40.65.111.94

I can't see it trying to make that request through wine though

logos128 commented 2 days ago

@RiskRunner0 That's very interesting indeed! Are these services installed automatically by FM or did you install them manually?

If FM can install and register them during game installation now, then that's a great improvement over a year ago. I follow Wine development closely and don't recall any significant work being done on the apis necessary for the GamingRepair installer to function properly. So it must have been more of a T10/MS effort. :slightly_smiling_face:

A year ago GamingServices was an app package service, and as there is no support for such services in Wine, it needed manual registration/installation of the various service components (gamingservices.exe, gamingservicesnet.exe, etc.) in the prefix.

Anyway, great progress so far!

robotman40 commented 2 days ago

Replying to https://github.com/ValveSoftware/Proton/issues/7151#issuecomment-2387528717

Did you copy over Gaming Services from a Windows install or did the game install them itself?

Also, since you have it partially running, could you see what happens when you launch the game at this point?

RiskRunner0 commented 2 days ago

I manually installed GamingServices and StateRepository and all the keys needed for them, FM didn't provide them and launching the game is the same since GamingServices doesn't seem to fully run

robotman40 commented 2 days ago

I manually installed GamingServices and StateRepository and all the keys needed for them, FM didn't provide them and launching the game is the same since GamingServices doesn't seem to fully run

So have you figured why Gaming Services times out during startup yet?

Also, did the game still give the same kind of error while starting up? (The one where it says Gaming Services needs to be installed)

RiskRunner0 commented 2 days ago

So have you figured why Gaming Services times out during startup yet?

I think I can't get StateRepository started, and since that's a dependency of GamingServices, it barfs. StateRepository is trying to start a group appmode, and I couldn't really find anything about it - it's trying to run svchost.exe -k appmodel -p