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

WRC 9 #22

Open
xpander69 opened this issue Jan 13, 2021 · 45 comments
Open

WRC 9 #22

xpander69 opened this issue Jan 13, 2021 · 45 comments

Comments

@xpander69
Copy link

xpander69 commented Jan 13, 2021

Name of the game: World Rally Championship 9
Steam ID: No Steam
Game Type (native/proton/wine): Wine
Proton/Wine version: 5.18, 5.20, 5.22, 6.0rc1, 6.0rc3, 6.0rc6
Wheel Model: Logitech G920
Distribution: Arch Linux
Kernel version: 5.10.6

Force Feedback present: YES, but only Constant force. No other forces work :(

Game detects Logitech G920 profile, buttons seems to work, no force feedback settings can be adjusted. Game reports that wheel with haptic feedback needed.

tried all combinations of the ffbtools to try to fix it, with no joy.
Log: with features-hack, update fix and throttling
wrcffb.txt-20210113195118.log

i doubt anything can be done with it with ffbtools though. from what i gather on the forums is that people say that G-Hub has to run to detect the wheel properly. G-Hub is some windows software i guess?

ss_13012021_20 39 51

@berarma
Copy link
Owner

berarma commented Jan 13, 2021

I guess you've driven the car in the game to get this log. It just sets an autocenter force. I guess that's what you mean in the description of the FFB you get.

The problem will probably lie in Wine. Maybe it's not correctly detecting the wheel or its capabilities the way the game queries it.

@xpander69
Copy link
Author

xpander69 commented Jan 13, 2021

yeah i drove one split on a finland track... yeah i guessed those tools wont help here. I guess you can close this issue then. Just wanted to check in if maybe someone knows how to make it work :(
any idea how i could debug this?
WINEDEBUG=+dinput or what are the wheels using? xinput?

@berarma
Copy link
Owner

berarma commented Jan 13, 2021

I'll leave it open. This project is aimed at helping solve any FFB related problem since these are usually ignored in most places. No problem on discussing here about debugging and trying to get this issue fixed somewhere else.

any idea how i could debug this?
WINEDEBUG=+dinput or what are the wheels using? xinput?

I think that would be enough but Proton developers usually recommend WINEDEBUG=+dinput,+plugplay,+hid,+tid.

@xpander69
Copy link
Author

xpander69 commented Jan 13, 2021

debug.log
this is what i got... i guess i should report this to wine devs or proton?..though this game is not on Steam, previous game is, which i think uses same engine.

edit:

i think this line: 0024:trace:dinput:_dump_DIDEVCAPS dwDevType: 00010214 DI8DEVTYPE_JOYSTICK (HID)

should be DI8DEVTYPE_DRIVING to make it known for this game. according to older game: ValveSoftware/Proton#1183 (comment)

@berarma
Copy link
Owner

berarma commented Jan 13, 2021

It can be reported to the Wine bug tracker.

You could have found the source of the problem. Which SDL version is using your Wine install?

@xpander69
Copy link
Author

It can be reported to the Wine bug tracker.

You could have found the source of the problem. Which SDL version is using your Wine install?

hmm how do i check which one wine is using?... i have extra/sdl2 2.0.14-1 [installed] and have built my wine versions myself, so i guess it builds with that?

@berarma
Copy link
Owner

berarma commented Jan 13, 2021

Probably. You can use the ldd command with the wine executable to see which libraries is it linked to.

@xpander69
Copy link
Author

uhh doesn't look like they are hooked at all... same with system wine

xpander@archlinux /mnt/SSDGames/DXVK-testing/wine-versions/wine-fsync_6.0.3/bin $ ldd wine
	linux-gate.so.1 (0xf7ed1000)
	libpthread.so.0 => /usr/lib32/libpthread.so.0 (0xf7e57000)
	libdl.so.2 => /usr/lib32/libdl.so.2 (0xf7e51000)
	libc.so.6 => /usr/lib32/libc.so.6 (0xf7c5f000)
	/lib/ld-linux.so.2 => /usr/lib/ld-linux.so.2 (0xf7ed3000)
xpander@archlinux /mnt/SSDGames/DXVK-testing/wine-versions/wine-fsync_6.0.3/bin $ ldd wine64
	linux-vdso.so.1 (0x00007ffe0f7c5000)
	libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f2574ba1000)
	libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f2574b9b000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007f25749d2000)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f2574c17000

@berarma
Copy link
Owner

berarma commented Jan 14, 2021

I was wrong. It's not the main executable that links, it's the libraries dinput.dll.so and dinput8.dll.so.

@xpander69
Copy link
Author

those do not show libsdl mentioned either... what i also found is here:
https://www.reddit.com/r/WRCTheGame/comments/il9820/wrc9_possible_issues_and_fixes/

under Your G25/G27/G29/G920 does not have FFB settings?

some weird registry hack to make it detectable, but under wine theres no such location even.
is it possible to fake this kind of thing?

@berarma
Copy link
Owner

berarma commented Jan 14, 2021

The files should be available in the game's prefix directory.

Maybe your wine install doesn't use SDL. That would explain the issue. Can you try running the game with proton? Proton is just a modified Wine. There must be a guide somewhere to do it.

@xpander69
Copy link
Author

with proton (5.0, 5.13 and experimental) it just crashes on startup. or i dont know how to hook it correctly into proton. i just added the game exe as the non-steam application and made sure the paths are correct.

also Snowrunner and LFS have FFB working just fine with those wine versions. I will try some more things.. thanks for the input.

@kodatarule
Copy link

kodatarule commented Jan 14, 2021

I can confirm the issue as well both on my G29 and Formula Force EX. It seems that it recognizes it as a joystick instead of a wheel thus leaving all of the FFB locked.
EDIT: With Proton it just straight up crashes.

@berarma
Copy link
Owner

berarma commented Jan 14, 2021

OK, I think that's the issue, I've just checked in the code and it seems so. Wine has two backends for dinput, one uses the Linux evdev interface, the other one uses SDL. Evdev has no way to query the joystick type, SDL has. You should look for a way to build Wine using SDL. Proton uses SDL by default, Wine maybe not.

@xpander69
Copy link
Author

yeah managed to get it to run with proton-GE 5.21
it now shows nicely its using SDL, the game shows all the options unlocked ingame now also, but vibrations still dont work. so no road bumps or anything are felt.. and it seems way beyond my knowledge to figure it out sadly

@berarma
Copy link
Owner

berarma commented Jan 14, 2021

Good, we've figured out something. Can you post a new ffbtools log without any options enabled? It should show us what the game is trying to to do.

@xpander69
Copy link
Author

xpander69 commented Jan 14, 2021

ffbGEtest-20210114134618.log
its still the same like it was before..i had throttling enabled though, but that doesn't change anything

and winedebug with dinput and stuff
winedbug_logffbGE.log

0024:trace:dinput:IDirectInputAImpl_EnumDevices  Checking device 0 ('Wine mouse driver')
0024:trace:dinput:IDirectInputAImpl_EnumDevices  Checking device 1 ('Wine keyboard driver')
0024:trace:dinput:IDirectInputAImpl_EnumDevices  Checking device 2 ('Wine SDL joystick driver')
01c4:trace:dinput:di_em_win_wndproc 0x10068 36 0 4cc8f8a0
01c4:trace:dinput:di_em_win_wndproc 0x10068 129 0 4cc8fc60
01c4:trace:dinput:di_em_win_wndproc 0x10068 131 0 4cc8fa50
01c4:trace:dinput:di_em_win_wndproc 0x10068 1 0 4cc8fc60
0024:trace:dinput:find_sdldevs Found a joystick on 0x7edd6610: Logitech G920 Driving Force Racing Wheel
0024:trace:dinput:find_sdldevs  ... with force feedback
0024:trace:dinput:fill_joystick_dideviceinstanceA 580 0x21e3f0
0024:fixme:wbemprox:client_security_SetBlanket 0000000062C9ECF0, 000000004BF776E0, 10, 0, (null), 3, 3, 0000000000000000, 0x00000000
0024:fixme:wbemprox:client_security_Release 0000000062C9ECF0
0024:fixme:wbemprox:enum_class_object_Next timeout not supported
0024:trace:dinput:IDirectInput7AImpl_CreateDeviceEx (0x4bf7acd0)->({001e36b7-5dba-0000-a8c9-cfc8689db403}, (null), 0x21e1d0, (nil))
0024:trace:dinput:mousedev_create_device 0x4bf7acd0 {001e36b7-5dba-0000-a8c9-cfc8689db403} (null) 0x21e1d0 0
0024:trace:dinput:keyboarddev_create_device 0x4bf7acd0 {001e36b7-5dba-0000-a8c9-cfc8689db403} (null) 0x21e1d0 0
0024:trace:dinput:sdl_create_device 0x4bf7acd0 {001e36b7-5dba-0000-a8c9-cfc8689db403} (null) 0x21e1d0 0
0024:trace:dinput:select_enum_function for 046d/c262, using no maps
0024:trace:dinput:alloc_device axes 4 povs 1 buttons 18
0024:trace:dinput:fill_joystick_dideviceinstanceA 580 0x21d7e0
0024:trace:dinput:fill_joystick_dideviceinstanceW 1100 0x21da80
0024:trace:dinput:IDirectInputAImpl_AddRef (0x4bf7acd0) ref 2
0024:trace:dinput:sdl_create_device Created a Joystick device (0x4bf8a900)
0024:trace:dinput:IDirectInputDevice2WImpl_SetDataFormat (0x4bf8a900) 0x14166e088

@berarma
Copy link
Owner

berarma commented Jan 14, 2021

The ffbtools log is pretty much empty. It shows even less than before as if the game didn't try to use the ffb.

But the Wine log shows the correct controller type and force feedback.

We're closer but something else is not working yet.

@leillo1975
Copy link

I have a question for you, @xpander69 . Does your steering wheel have a Driving Force GT compatibility mode? I don't know if the G920 have compatibility models, but I ask you this because I can't play with my G29 in the native mode on WRC7, but if I change the compatibility mode to DFGT, I could calibrate and assign the axes correctly.

@xpander69
Copy link
Author

I have a question for you, @xpander69 . Does your steering wheel have a Driving Force GT compatibility mode? I don't know if the G920 have compatibility models, but I ask you this because I can't play with my G29 in the native mode on WRC7, but if I change the compatibility mode to DFGT, I could calibrate and assign the axes correctly.

I have no idea about compatibility mode, but i do have Driving Force GT as well, blew the dust off of it and i tested it, but sadly same story, shows nicely all the options in the menus, but doesnt have any forces working. thats with the new-lg4ff driver.
ss_14012021_22 39 39

@berarma
Copy link
Owner

berarma commented Jan 15, 2021

and winedebug with dinput and stuff
winedbug_logffbGE.log

This log seems to be incomplete. Can you post the whole file after having driving the car at least for some seconds?

I've spotted a minor bug in Wine related to FFB. It reports that both axis X and Y support FFB but that's not true. I don't know how this might affect this issue or if it doesn't matter at all.

@xpander69
Copy link
Author

full log is 800MB... it spams like crazy :D
packaged ~15.6MB
https://drive.google.com/file/d/1POyS52ySNefRJa7Fg2VocytUc4X0RjnJ/view?usp=sharing

@berarma
Copy link
Owner

berarma commented Jan 15, 2021

I was wrong, Wine doesn't have a SDL backend for DInput, it's only in the Wine fork used in Proton.

From here we need some help from developers that know the Wine code better than me.

We shouldn't report a bug to Wine using Proton. And we shouldn't report a bug to Proton using ProtonGE.

I'd try to make the game work with the Wine fork that Proton uses: https://github.com/ValveSoftware/wine

If this works we can report a bug to Valve's Wine repository and handle all the needed fixes there.

If this doesn't work we could report a ProtonGE bug and hope that it gets some attention from Proton/Wine developers.

Or we could report a bug in Wine instead about it not correctly recognizing wheels, but that bug would evolve more slowly unless they suddenly decide to port the SDL backend from Proton to Wine. Getting bugs fixed in Wine will fix them everywhere else.

In the bug you should attach a log that is the smallest you can get that involves FFB. It could be simply starting the game and using the FFB test in the setup. Explain what you've done and what's happened.

If you do any of this please post the link to the bug report here and I'll participate sharing the information I've found.

@berarma
Copy link
Owner

berarma commented Jan 15, 2021

If you can build ProtonGE you can try a quick hack to see if the bug I've found makes a difference.

Change this line: https://github.com/wine-mirror/wine/blob/e909986e6ea5ecd49b2b847f321ad89b2ae4f6f1/dlls/dinput/joystick_linuxinput.c#L564

From:
if (newDevice->joydev->has_ff && (i == 0 || i == 1))

To this:
if (newDevice->joydev->has_ff && i == 0)

Then make sure everything is rebuilt.

@xpander69
Copy link
Author

Thanks for the input. I can try to build proton-tkg i guess. No idea how to build GE or wine fork that valve using. This will have to wait few days though. got some other stuff on my plate atm. Will report back soon.

@berarma
Copy link
Owner

berarma commented Jan 15, 2021

OK. When you do, building the Wine fork should be the same as building the original Wine. The README in the repository has directions. If the game worked on this Wine version, this direction would probably take us faster to a fix.

@xpander69
Copy link
Author

xpander69 commented Jan 15, 2021

ok, since i had some time i tried to build the wine from the valve github repo with the fix/patch you mentioned, but im not succeeding.. i mean it builds all fine, but it seems to build only 32bit version for some idiotic reason. i went through documentation there and also on the official wine site, but i cant find why its just 32bit.. its bizarre.
wine: '/mnt/stuff/xpander/Games/WRC_9/_WRC9_prefix/pfx' is a 64-bit installation, it cannot be used with a 32-bit wineserver.

tried to force export CFLAGS='-m64' also but no joy

edit: building proton-tkg with the patch

--- a/dlls/dinput/joystick_linuxinput.c	2021-01-15 16:26:12.768326000 +0200
+++ b/dlls/dinput/joystick_linuxinput.c	2021-01-15 16:29:57.963794017 +0200
@@ -561,7 +561,7 @@
         newDevice->generic.props[idx].lDeadZone   = newDevice->generic.deadzone;
 
         /* Linux supports force-feedback on X & Y axes only */
-        if (newDevice->joydev->has_ff && (i == 0 || i == 1))
+        if (newDevice->joydev->has_ff && i == 0)
             df->rgodf[idx].dwFlags |= DIDOI_FFACTUATOR;
 
         idx++;

hopefully that will work, i think tkg uses proton wine builds also.. not 100% sure though

edit2: sadly the game crashes with proton-tkg like with normal proton builds and logs dont have anything useful either
ss_15012021_16 51 47

edit3: ok this game has some serious issues.. i got it working with proton-tkg with the patch applied now (after fiddling with which versions of DXVK/vkd3d-proton to us) but the wheel isnt detected at all now...

@jotomo
Copy link

jotomo commented Jan 15, 2021

@xpander69 You're on Arch, right? There's a wine-valve package in the AUR, with the PKGBUILD mentioning a quirk about win32/win64 build order: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=wine-valve#n123

@berarma
Copy link
Owner

berarma commented Jan 15, 2021

There are some options to 'configure' command that can be useful. At least '--enable-win64' must be needed for 64 bit Wine.

@isopix
Copy link

isopix commented Jan 15, 2021 via email

@kodatarule
Copy link

kodatarule commented Jan 15, 2021

No regular wine doesn't seem to work properly with the wheel, but I am currently building wine-valve so I can get a log of my wheel. I'm gonna use Formula Force EX instead of my g29 due to the setup I have, but both don't have FFB at all. I can test with both in a bit and provide logs.
EDIT: Nope, the game straight up refused to start with wine-valve...
Screenshot_20210115_224117

EDIT2: For some reason using Proton-5.21-GE-1 works, but if I try normal proton or wine-valve this shows up:
00f4:err:winediag:load_dxvk_config Couldn't load dxvk_config.dll, won't apply default DXVK config options

@berarma
Copy link
Owner

berarma commented Jan 15, 2021

I didn't knew, that to get wheel support wee need proton. What about
wine-staging or wine-wine-tkg builds? I know they all requires SDL2,
but not sure if it's used for input or something else..

That's not completely true. Wheels are supported in Wine but they aren't correctly identified as wheels. This is only required by some software.

I don't know about staging and tkg. Look for a joystick_sdl.c file in the sources or check that dinput.dll.so is linked to libSDL.

@berarma
Copy link
Owner

berarma commented Jan 16, 2021

EDIT2: For some reason using Proton-5.21-GE-1 works, but if I try normal proton or wine-valve this shows up:
00f4:err:winediag:load_dxvk_config Couldn't load dxvk_config.dll, won't apply default DXVK config options

Someone could report an issue to Proton for WRC9: https://github.com/ValveSoftware/Proton/issues

There's already one for WRC7 but none for WRC9.

@isopix
Copy link

isopix commented Jan 16, 2021 via email

@xpander69
Copy link
Author

EDIT2: For some reason using Proton-5.21-GE-1 works, but if I try normal proton or wine-valve this shows up:
00f4:err:winediag:load_dxvk_config Couldn't load dxvk_config.dll, won't apply default DXVK config options

Someone could report an issue to Proton for WRC9: https://github.com/ValveSoftware/Proton/issues

There's already one for WRC7 but none for WRC9.

WRC 9 is not available on Steam. Thats the problem.

If you are using archlinux, you can also test chaotic-aur/wine-tkg-staging-fsync-git 6.0rc6.r0.g7ab49f09-312. I haven't tested it yet(all machines are disassrembled, waiting for parts to rebuild all, but I do wonder if it works). Anyway every wine build in archlinux(offiical and unoficial repos, requires 'sdl2')

On 1/16/21, Bernat @.***> wrote: > EDIT2: For some reason using Proton-5.21-GE-1 works, but if I try normal > proton or wine-valve this shows up: > 00f4:err:winediag:load_dxvk_config Couldn't load dxvk_config.dll, won't > apply default DXVK config options Someone could report an issue to Proton for WRC9: https://github.com/ValveSoftware/Proton/issues There's already one for WRC7 but none for WRC9. -- You are receiving this because you commented. Reply to this email directly or view it on GitHub: #22 (comment)

yeah well i dont use chaotic-aur but i have built many tkg versions, doesnt change anything.

currently trying to debug why the game crashes on all proton verisons (5.0, 5.13, 5.13-experimental), except 5.21-GE
the only real error i get is that
68112.672:0044:0054:err:ntoskrnl:ZwLoadDriver failed to create driver L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\NDIS": 00000001

which i dont get with 5.21-GE

@xpander69
Copy link
Author

Ok i went ahead and bought WRC 8 to report to proton. (Its currently at sale for -80% if you read this within few days of posting this)

made a report, first need to fix the crashing with regular proton versions i guess, then to the FFB.

report here: ValveSoftware/Proton#4567

@whizse
Copy link

whizse commented Aug 26, 2021

I looked into this and the fix was surprisingly simple. WRC9 (and 8) checks dwFFDriverVersion for a non-zero value, presumably to check for a loaded driver.

With this change force feedback effects work, but I haven't really done any but the most rudimentary checks. There might still be effects missing.

Testing was done on the G29 (with new-lg4ff), and others have (I think) tried it on G920. Would be interesting to know if other wheels work now too.

This change, and a few others needed for the games to run out of the box, should hopefully be available in Proton Experimental soon.

@xpander69
Copy link
Author

xpander69 commented Aug 26, 2021

That's great news! Will wait for proton experimental update then to test it

edit: tried to patch it into the wine-tkg builds to try with WRC9 but FFB still didnt work. maybe i did something wrong with patching or maybe it only works with proton? cause regualr wine doesn't even have joystick_sdl.c file to patch

@xpander69
Copy link
Author

xpander69 commented Sep 9, 2021

Confirming. Everything seems to work fine with new proton-experimental. all the forces seem to be there with my G920.
Amazing job! Thank you

Gameplay vid: https://youtu.be/8c8y61dN9w8

@xpander69
Copy link
Author

xpander69 commented Nov 5, 2021

Ok getting loads of these

[Fri Nov  5 13:51:55 2021] logitech-hidpp-device 0003:046D:C262.0010: Force feedback command queue contains 7080 commands, causing substantial delays!
[Fri Nov  5 13:56:40 2021] logitech-hidpp-device 0003:046D:C262.0010: Force feedback command queue contains 20 commands, causing substantial delays!

first one is with just --throttling

second one is with --throttling --throttling-time 33

thats already 33ms late of the effects and its felt ingame also, but the queue is still getting full. is there something that can be done with it? kernel side?

edit: setting physics synchronization (ingame settings) from high to low reduced those a bit.

@berarma
Copy link
Owner

berarma commented Nov 5, 2021

Maybe the ffbwrap library isn't working correctly. It might be some thread bypassing the library. I think there's no way the queue can contain 7080 commands when using throttling.

@xpander69
Copy link
Author

xpander69 commented Nov 6, 2021

yeah i had older version. updated but, im still getting 20 commands to be delayed.
game is spamming them or whats the deal? i dunno how to check all this better.

edit: ahh sorry. it seems fine now. just getting those game game startup, when driving everything is behaving fine

@berarma
Copy link
Owner

berarma commented Nov 6, 2021

yeah i had older version. updated but, im still getting 20 commands to be delayed.
game is spamming them or whats the deal? i dunno how to check all this better.

edit: ahh sorry. it seems fine now. just getting those game game startup, when driving everything is behaving fine

I wouldn't worry, it might be sending a lot of fast commands on startup and the lag doesn't matter then.

@xpander69
Copy link
Author

Yeah. It seems to be related to game FPS also.. if my fps goes over 120 i get those in the terminal. if i cap it to 90 fps then its clean at least with --throttling-time 16

without the ffwrap its just insane spam, thousands constantly getting queued up.. is the kernel ffb driver so bad for G920 or something the game does weird?

@berarma
Copy link
Owner

berarma commented Nov 7, 2021

It's the game doing something very bad and the driver doing nothing to prevent it. Since the Windows driver seems to do the throttling by default, some game developers don't seem to care to do it properly.

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

7 participants