ValveSoftware / Proton

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

rFactor 2 (365960) #245

Open leillo1975 opened 6 years ago

leillo1975 commented 6 years ago

EDITED 2020-03: At this moment the game works with problems on online multiplayer (our car is more slow than the others), and you don't have FFB support on Logitech Wheels using the kernel driver. This can be fixed using new-lg4ff. The rest of the game works great with Steam Play/Proton

OLD: _Like in Wine, this game don't have the Force Feedback functionality, and is a pity because is very important in racing simulation games.

It also have a problem when you trying to run it. You must force it to run in 32 bit mode. To enable 32 bit mode you must mark the checkbox in the settings button on launcher. If you have problems with this launcher (it closes) you must set Steam in disconnected mode, run the game and change to 32bit on settings. Then put again Steam on connected mode and Play it_

leillo1975 commented 6 years ago

Yesterday I try to play online, and the game downloads all the mods, tracks and cars that it needs, loads everything and go to monitor, but a few seconds later the game crash and go to launcher

leillo1975 commented 6 years ago

One user of the rFactor 2 forums post this about the Force Feedback in Linux (Steam Play) for rFactor 2: https://forum.studio-397.com/index.php?threads/linux.61014/#post-958655

Can someone with the necessary knowledge keep an eye on it? This work perhaps activate Force Feedback on Automobilista and could be used in the Native version of Euro Truck Simulator 2

winterwicht commented 6 years ago

Could be nice, thx for the 32Bit Tip. Launcher and game start without problems, recognizes my Thrustmaster T500 RS, keys are assigned except clutch. Steering input isn't smooth at all, turns heavy left and right. Not playable with this wheel.

leillo1975 commented 6 years ago

About playing in 64 bit mode. I found this in Steam Forums: " You can get the game to run in 64bit mode by replacing rFactor 2/Bin64/d3dcompiler_43.dll with the version found here: https://github.com/samhocevar/d3d4linux

Getting 64bit support is crucial to prevent the game from crashing when It uses > 4GB of RAM

(I have no ideia what the difference is between the two versions of the dlls, but wine doesnt like the one bundled with the game)"

https://steamcommunity.com/app/365960/discussions/0/1734336452580506069/?tscn=1540942657#c1734343428028848843

leillo1975 commented 6 years ago

Don't start with 3.16-4beta. Take a look on this. With 3.7.8 runs well

leillo1975 commented 5 years ago

Testing 3.16-6 Beta, the game works again

harryhaaren commented 5 years ago

Hey, Thanks for keeping this issue up to date - I've checked the forum posts and such to get r2 working on Wine/Stream, I've a G27 wheel here to use with it. I'll try reproduce the game running for starters, and report back in future. For now - just a thanks for your efforts on documenting the current state! -Harry

leillo1975 commented 5 years ago

The game runs with the last Proton (4.2), but Force Feedback stills not working.

ttelford commented 5 years ago

@leillo1975: does RF2/64 bit still require the d3d4linux workaround with proton 4.2?

leillo1975 commented 5 years ago

@leillo1975: does RF2/64 bit still require the d3d4linux workaround with proton 4.2?

.... I don't know. My game is patched a lot of time ago.

BUT I HAVE A GREAT NEW ABOUT THIS GAME. With Proton 4.2-3 I can play online !!!!! In this moment, there is only needed that the force feedback works for the game to be fully functional. Has anyone tried it with the latest versions of Wine?

leillo1975 commented 5 years ago

Someone has tested this game with an G920 wheel? This controller has some effects included in the driver that G29, G27 or DFGT don't include. I found this in GamingOnLinux

"ETS2 and ATS are the only games I know that use the predefined effects of the force feedback system (spring, damper, inertia, friction and periodic effects). All other games calculate everything themselves and only use constant force effects. The logitech wheels (except G920) support spring and damper in hardware, but this is not implemented in the official Linux driver. The G920 supports all effects in hardware and all are available in the driver. There are no other (currently sold) wheels with a force feedback driver although it appears that Feral managed to make support for others on their own. Technically there is no reason why that stuff can't be implemented in user space. "

Perhaps this is the problem. Some time ago there was a project (ff-memless-next) who tried to include these on the kernel, but were finally discontinued:

https://lkml.org/lkml/2014/4/26/115

https://github.com/edwin-v/linux-hid-lg4ff-next

It would be a good thing if someone took up that job again, because it's very likely that a lot of games that work with Proton, but don't have Force Feedback, would work correctly.

ttelford commented 5 years ago

The force feedback for Linux documentation is at https://www.kernel.org/doc/html/v5.2/input/ff.html

It doesn’t look like it would be that hard to either roll your own tests (or better, use fftest, if possible). Then you’d know for sure.

I’m vaguely interested, but doubt I have the time at the moment. (I have a G29)

I am surprised to see it uses a completely different driver, though. (hidlg4ff vs. hid-logitech-hidpp)

Edit: it also looks like the official Linux support for the g29 is ~18 months newer than lg4ff-next. I haven’t actually looked at the code.

ttelford commented 5 years ago

... and after reading the thread, it seems there were valid/good reasons for the code (as posted back in 2014) to not make it in.

It looked like there was quite a bit of “I think it would be better to...” going on. Also, developers from Logitech jumped onboard and offered help in what was previously pure reverse engineering.

There are no doubt other threads that could tell more of the story.

leillo1975 commented 5 years ago

In the last build (1114) the game don't show the launcher and is not possible to play it. Please, take a look to the log steam-365960.log

kisak-valve commented 5 years ago

Hello @leillo1975, err:steamclient:create_win_interface Don't recognize interface name: SteamClient019 in the log hints that the game bumped to a steamworks sdk release that's not in Proton yet.

leillo1975 commented 5 years ago

It worked again with 4.11-3. Thanks!

Hello @leillo1975, err:steamclient:create_win_interface Don't recognize interface name: SteamClient019 in the log hints that the game bumped to a steamworks sdk release that's not in Proton yet.

It worked again with 4.11-3. Thanks!

leillo1975 commented 5 years ago

The game don't load again. The same problem with a new steamworks sdk?

steam-365960.log

kisak-valve commented 5 years ago

There's no hint of a missing steamworks interface, so something else is going on here.

The log does have a bunch of access violations (c0000005) before the game crashes on a null pointer.

wine: Unhandled page fault on execute access to 0x00000000 at address (nil) (thread 0043), starting debugger...

Also, it's not clear if this is a Proton regression because the game got an update about 6 hours ago.

leillo1975 commented 5 years ago

It's not only my problem, in the linux-unofficial room of rFactor 2 official discord channel, more users have the same problem like me. Is it the same for the users here?

madbad commented 5 years ago

I can get to the launcher but when starting the actual game it crashes after the splash screen. Attacched log. steam-365960.log system info.txt

madbad commented 5 years ago

As some user discovered in the rFactor2 linux discord the crash is due to the newly added intro movie. As a workaround renaming or removing this file should make it work again.

/home/yourusername/.local/share/Steam/steamapps/common/rFactor 2/Core/UIData/PREGAME.avi

leillo1975 commented 5 years ago

It would have to see what kind of video it is and what codec it uses to know why Proton doesn't play it.

leillo1975 commented 5 years ago

I think you must see this article on reddit. Finally we can play rF2 with FFB with all the effects on Linux : https://www.reddit.com/r/linux_gaming/comments/dypf2q/newlg4ff_a_much_more_complete_new_driver_for_our/ Good work @berarma !!!

At the moment only works with Wine, because Proton 4.11-8 has broken FFB in some games, but in the next version it will be fixed: https://github.com/ValveSoftware/Proton/issues/3194#issuecomment-555558839

leillo1975 commented 4 years ago

With the last version of proton (4.11-10), and using the @berarma 's new Linux Logitech Wheels Driver (new-lg4ff) , the game has a good Force Feedback. Good Work!

khromalabs commented 4 years ago

Hi just to mention my experience, Gentoo using the new-lg4ff driver, Logitech GT driving force wheel, force feedback only works using the 32bit executables (thank you thank you thank you @berarma ) , using 64bits the wheel works as well, but no FFB. I'm also playing with dualshock controllers, the FFB works in fftest but no luck in rFactor2. (I've also tried to disable the controllers in Steam, same result).

leillo1975 commented 4 years ago

Are you using inverted/negative ffb? Try it

El mié., 1 ene. 2020 15:58, Rubén Gómez notifications@github.com escribió:

Hi just to mention my experience, Gentoo using the new-lg4ff driver, Logitech GT driving force wheel, force feedback only works using the 32bit executables (thank you thank you thank you @berarma https://github.com/berarma ) , using 64bits the wheels works as well, but no FFB. I'm also playing with dualshock controllers, the FFB works in fftest but no luck in rFactor2. (I've also tried to disable the controllers in Steam, same result).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ValveSoftware/Proton/issues/245?email_source=notifications&email_token=AAEGXDPPQRHUFXNXADSADILQ3SVR5A5CNFSM4FREXGEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH5GWLQ#issuecomment-570059566, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEGXDOS7SAL3FPXLJ2JKW3Q3SVR5ANCNFSM4FREXGEA .

berarma commented 4 years ago

Hi just to mention my experience, Gentoo using the new-lg4ff driver, Logitech GT driving force wheel, force feedback only works using the 32bit executables (thank you thank you thank you @berarma ) , using 64bits the wheel works as well, but no FFB. I'm also playing with dualshock controllers, the FFB works in fftest but no luck in rFactor2. (I've also tried to disable the controllers in Steam, same result).

It shouldn't matter 32 or 64 bits. It could be be some system misconfiguration but I don't even know what it could be.

You should open an issue in the new-lg4ff project where it could get more attention.

leillo1975 commented 4 years ago

There are a problem with online multiplayer races. If you play a single player race with multiple AI's there are no problem, but if this race is against another players online, in Linux your car is much slower than the rest of the cars. You can better see this problem here: https://youtu.be/CEcS-dn6gBI One Studio-397 (rFactor2) developer tell us on the rFactor 2 Linux discord room the following:

"Marrs: Well, a car that appears to go much slower is usually caused by the physics thread running too slow (not making it in its allocated time slot). You can easily test that via the graph you can enable with Ctrl-C. The purple horizontal bar should not go all the way to 100% (ideally stay below 50% really)."

" believe you can (judging on the videos you've shown). I don't know the cause. Something in the network stack maybe that is slower? Hard to say.""

Assetto Corsa Competizione has a similar problem on Online Races, that makes us suspect a problem with Wine/Proton online component

alexbrrsclnt commented 4 years ago

@berarma provided some logs of online playing to the rfactor2 devs, they have looked into them and here are some of their conclussions:

Marrs: Let's start with the good news. The graphics look good. As we could also see in the video, a steady framerate, nothing erratic really.

Now the bad news. The physics are behaving erratic, and in the "top 3" of code segments that we measure are two that are directly related to network communication. So it's safe to say that our hunch was right, there is something going on with the networking emulation. That is about all we can see on our side, so if you want to know more, you'd have to start profiling OS functions and compare Windows to Linux.

Is there any way to trace the network functions while playing to be able to find anything wrong?

berarma commented 4 years ago

Is there any way to trace the network functions while playing to be able to find anything wrong?

https://wiki.winehq.org/Debug_Channels

alexbrrsclnt commented 4 years ago

I have launched the game with "PROTON_LOG=1 %command%" and played a online session. This is the generated log file.

steam-365960.log

If we can tune the logging to check only for the network code, please, let us know how.

leillo1975 commented 4 years ago

There are a problem with online multiplayer races. If you play a single player race with multiple AI's there are no problem, but if this race is against another players online, in Linux your car is much slower than the rest of the cars. You can better see this problem here: https://youtu.be/CEcS-dn6gBI One Studio-397 (rFactor2) developer tell us on the rFactor 2 Linux discord room the following:

"Marrs: Well, a car that appears to go much slower is usually caused by the physics thread running too slow (not making it in its allocated time slot). You can easily test that via the graph you can enable with Ctrl-C. The purple horizontal bar should not go all the way to 100% (ideally stay below 50% really)."

" believe you can (judging on the videos you've shown). I don't know the cause. Something in the network stack maybe that is slower? Hard to say.""

Assetto Corsa Competizione has a similar problem on Online Races, that makes us suspect a problem with Wine/Proton online component

I can confirm that the network problem with this game is also related with Wine. I test it with Lutris and Wine 5.2 and have the same problem

leillo1975 commented 4 years ago

The Studio-397 dev that @alexbrrsclnt mentions, accompanied his comments with two graphs. I think they provide pretty good information and I insert them into the message:

@berarma provided some logs of online playing to the rfactor2 devs, they have looked into them and here are some of their conclussions:

Marrs: Let's start with the good news. The graphics look good. As we could also see in the video, a steady framerate, nothing erratic really.

captureG

Now the bad news. The physics are behaving erratic, and in the "top 3" of code segments that we measure are two that are directly related to network communication. So it's safe to say that our hunch was right, there is something going on with the networking emulation. That is about all we can see on our side, so if you want to know more, you'd have to start profiling OS functions and compare Windows to Linux.

captureN

Is there any way to trace the network functions while playing to be able to find anything wrong?

The second graphic is very similar to the frametimes of this Assetto Corsa Competizione Online Multiplayer video: https://youtu.be/cEoahOxIWqc

In our opinion this could be the same problem

alexbrrsclnt commented 4 years ago

I have created an entry on the Wine Bug tracker to try to get more info about this issue. https://bugs.winehq.org/show_bug.cgi?id=48668

berarma commented 4 years ago

This command in the launch options will log networking code calls:

WINEDEBUG=+seh,+winhttp,+winsock,+wininet %command%

And the log file for a network race. I'm just standing in the pit: steam-365960.log.gz

According to the game developers, there seems to be something running very slow in the network code compared to the game running on Windows. Another user has reported performance problems on servers hosting the game when there's many clients connected.

berarma commented 4 years ago

I've created a profile file with sysprof. It's been recorded while inside an online race to show the issue:

rfactor2.syscap.gz

A lot of time is spent inside network calls that send and receive data through the network. Most of the time goes into the function igb_rd32 in the kernel that in turn calls the function readl which reads data from the hardware. I don't know if the problem is the kernel misbehaving, the driver being slow, or Proton doing too many calls to the kernel. Or even a mix of all these.

There's also a mutex consuming some significant time related to the same calls. A high number of concurrent calls to that function could be the cause.

Maybe someone with more knowledge of the network stack or the kernel could help.

EDIT: I just noticed the syscap file only shows the correct function names when the right version of kernel debugging info is in the system. It will show incorrect funcion names otherwise. Sorry, I'll make a new post with the right info.

berarma commented 4 years ago

Here's more information about the networking issue. In online races, the physics threads run slower than they should, and it only happens in online races, offline works with the physics thread under 50% CPU use, like it should.

The following data was taken while standing in the pit in an online training session.

Sysprofile screenshot showing the slowest system call: Captura de pantalla de 2020-03-31 11-24-17

Sysprofile screenshot showing the second slowest system call: Captura de pantalla de 2020-03-31 11-25-11

Strace ouput of the 3 slowest threads using the "-r" option: rfactor2_all_1.strace.gz rfactor2_all_2.strace.gz rfactor2_all_3.strace.gz

radome914gt commented 4 years ago

Using Wireshark, I did a comparison between Proton and Windows on the datagram upload rate to the server. Proton was sending UDP datagrams at a rate ranging from about 161 to 181 per second. When I did the same test on Windows the rate was 270 per second.

I wonder if we can understand; what is the relationship between telling the server where we are in the client, and handling the car's physics that causes the former to affect the latter in such a way?

gofman commented 4 years ago

@berarma I put the possible (hacky) fix here: https://bugs.winehq.org/show_bug.cgi?id=48668 It would be great if you could test it.

berarma commented 4 years ago

@gofman It works perfectly now! I haven't done a proper race yet, but everything is very smooth now with or without other cars. Thank you very much! You did a wonderful job!

Here's a Proton build 5.0-7 with both patches applied: http://www.mediafire.com/file/zz1p2kabyt5ffmy/proton_5.0-local.7z/file

These are the patches for reference: https://github.com/ValveSoftware/Proton/issues/1420#issuecomment-639084670 https://bugs.winehq.org/show_bug.cgi?id=48668#c7

I've applied both patches but it's the second one that fixes the multiplayer issue in rFactor2.

leillo1975 commented 4 years ago

@berarma I put the possible (hacky) fix here: https://bugs.winehq.org/show_bug.cgi?id=48668 It would be great if you could test it.

@GloriousEggroll , can you include this fix on your next Proton-GE?

gofman commented 4 years ago

Here is a sane version: https://www.winehq.org/pipermail/wine-devel/2020-June/167775.html

berarma commented 4 years ago

For your testing pleasure: http://www.mediafire.com/file/7zc3875pe8koyoh/proton-5.0-9-rf2-acc.7z

Both latest ACC and rF2 patches are applied to the latest Proton 5.0-9.

leillo1975 commented 4 years ago

Proton-5.9-GE-ST don't work out of the box: https://github.com/GloriousEggroll/proton-ge-custom/releases/tag/5.9-GE-4-ST

EDIT: FFB in Logitech G29 don't work with new-lg4FF. Please, @GloriousEggroll , take a look to this issue.

ingmarcosp commented 4 years ago

Did some get working plugins?

leillo1975 commented 3 years ago

I don't know if this is the best place to notify this, but with nvidia 460 driver, the game gives me a very low framerates (20-25fps). With 450 driver, fps goes to usual rate. Probably, this is a Nvidia and not a Proton issue, but I don't know where I can report this issue.

alexbrrsclnt commented 3 years ago

I don't know if this is the best place to notify this, but with nvidia 460 driver, the game gives me a very low framerates (20-25fps). With 450 driver, fps goes to usual rate. Probably, this is a Nvidia and not a Proton issue, but I don't know where I can report this issue.

I can confirm this issue

berarma commented 3 years ago

I don't know if this is the best place to notify this, but with nvidia 460 driver, the game gives me a very low framerates (20-25fps). With 450 driver, fps goes to usual rate. Probably, this is a Nvidia and not a Proton issue, but I don't know where I can report this issue.

Same here. The game was working perfectly at +90fps with drivers 450.80.02, now it's unplayable at around 20fps with drivers 460.32.03. My GPU is RTX2070 Super.

Gonzo2O28 commented 3 years ago

I am having huge performance issues with rF2 either. i am having 200-300 FPS in Windows and under Proton roughly around 50-70 which feel like 30fps on my Ryzen 5950x and RTX 3090.

leillo1975 commented 3 years ago

I am having huge performance issues with rF2 either. i am having 200-300 FPS in Windows and under Proton roughly around 50-70 which feel like 30fps on my Ryzen 5950x and RTX 3090.

What version of the Nvidia Driver you are using?