gotzl / hid-fanatecff

Driver to support FANATEC input devices, in particular ForceFeedback of various wheel-bases
GNU General Public License v2.0
171 stars 21 forks source link

Test it with the Fanatec CSL DD with compatibility mode #15

Closed dbro86 closed 2 years ago

dbro86 commented 3 years ago

Hi,

first of all kudos for starting that here. Is a shining light to eventually play the native Codemasters sims with a Fanatec wheel on Linux.

Now that I have a CSL DD, I'd like to get that running on Linux. First with compatibility mode; then later natively.

However, I have no experience in writing drivers. If I can assist in any way, let me know.

VG Brody

gotzl commented 3 years ago

Hi, It seems fanatec uses a common USB data format for their devices. So to get the CSL DD working, I hope it is enough to add its PID to the driver. So plz connect the base (in native mode) and post the output of lsusb or the last 10 lines or so of dmesg.

wa-nelson commented 3 years ago

@gotzl I've got one as well:

FWIW It's got a ClubSport Wheel Base V2.5 Compatibility mode (yellow) which works with the driver already.

But here's the dmesg output for PC Mode (red):

[ 1189.235473] usb 1-1.2: new full-speed USB device number 15 using xhci_hcd
[ 1189.558930] usb 1-1.2: New USB device found, idVendor=0eb7, idProduct=0020, bcdDevice= 0.41
[ 1189.558932] usb 1-1.2: New USB device strings: Mfr=1, Product=3, SerialNumber=0
[ 1189.558933] usb 1-1.2: Product: FANATEC Wheel
[ 1189.558934] usb 1-1.2: Manufacturer: Fanatec
[ 1189.597488] hid_map_usage: 78 callbacks suppressed
[ 1189.597490] Fanatec FANATEC Wheel: Invalid code 768 type 1
[ 1189.597491] Fanatec FANATEC Wheel: Invalid code 769 type 1
[ 1189.597492] Fanatec FANATEC Wheel: Invalid code 770 type 1
[ 1189.597493] Fanatec FANATEC Wheel: Invalid code 771 type 1
[ 1189.597493] Fanatec FANATEC Wheel: Invalid code 772 type 1
[ 1189.597494] Fanatec FANATEC Wheel: Invalid code 773 type 1
[ 1189.597494] Fanatec FANATEC Wheel: Invalid code 774 type 1
[ 1189.597495] Fanatec FANATEC Wheel: Invalid code 775 type 1
[ 1189.597496] Fanatec FANATEC Wheel: Invalid code 776 type 1
[ 1189.597496] Fanatec FANATEC Wheel: Invalid code 777 type 1
[ 1189.597578] input: Fanatec FANATEC Wheel as /devices/pci0000:00/0000:00:01.3/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/0003:0EB7:0020.0010/input/input38
[ 1189.597721] input: Fanatec FANATEC Wheel as /devices/pci0000:00/0000:00:01.3/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/0003:0EB7:0020.0010/input/input39
[ 1189.597842] hid-generic 0003:0EB7:0020.0010: input,hiddev6,hidraw9: USB HID v1.11 Joystick [Fanatec FANATEC Wheel] on usb-0000:01:00.0-1.2/input0
dbro86 commented 3 years ago

Here is the Output of sudo dmesg -w in compatibility mode (yellow):

[ 1252.731804] usb 1-2: new full-speed USB device number 17 using xhci_hcd
[ 1252.873401] usb 1-2: New USB device found, idVendor=0eb7, idProduct=0004, bcdDevice= 0.41
[ 1252.873405] usb 1-2: New USB device strings: Mfr=1, Product=3, SerialNumber=0
[ 1252.873406] usb 1-2: Product: FANATEC Wheel
[ 1252.873407] usb 1-2: Manufacturer: Fanatec
[ 1252.875785] /home/brodowskid/projects/github.com/gotzl/hid-fanatecff/hid-ftec.c: ftec_probe: ifnum 0
[ 1252.875857] hid_map_usage: 34 callbacks suppressed
[ 1252.875857] Fanatec FANATEC Wheel: Invalid code 768 type 1
[ 1252.875858] Fanatec FANATEC Wheel: Invalid code 769 type 1
[ 1252.875859] Fanatec FANATEC Wheel: Invalid code 770 type 1
[ 1252.875859] Fanatec FANATEC Wheel: Invalid code 771 type 1
[ 1252.875860] Fanatec FANATEC Wheel: Invalid code 772 type 1
[ 1252.875860] Fanatec FANATEC Wheel: Invalid code 773 type 1
[ 1252.875861] Fanatec FANATEC Wheel: Invalid code 774 type 1
[ 1252.875861] Fanatec FANATEC Wheel: Invalid code 775 type 1
[ 1252.875862] Fanatec FANATEC Wheel: Invalid code 776 type 1
[ 1252.875862] Fanatec FANATEC Wheel: Invalid code 777 type 1
[ 1252.875895] input: Fanatec FANATEC Wheel as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:0EB7:0004.000E/input/input64
[ 1252.876146] ftec_csl_elite 0003:0EB7:0004.000E: input,hiddev98,hidraw7: USB HID v1.11 Joystick [Fanatec FANATEC Wheel] on usb-0000:00:14.0-2/input0
[ 1252.876149] /home/brodowskid/projects/github.com/gotzl/hid-fanatecff/hid-ftec.c:  ... 1 1 1 56
               -128 127 -128 127

[ 1252.876150] /home/brodowskid/projects/github.com/gotzl/hid-fanatecff/hid-ftecff.c:  ... setting FF bits
[ 1252.876152] /home/brodowskid/projects/github.com/gotzl/hid-fanatecff/hid-ftecff.c: setting range to 900

End the led of my "CSL Elite Steering Wheel WRC" is on.

dbro86 commented 3 years ago

I'm using Archlinux with kernel 5.14.14.

dbro86 commented 3 years ago

Which branch I have to use?

dbro86 commented 2 years ago

Nevertheless the 1st try in compatibility mode Dirt 4 detected a "Clubsport Wheel 2.5". Unfortunately, the accelerator pedal was not recognized, while however the steering wheel as well as the brake pedal were recognized. (I use the CSL pedals without clutch kit, which are directly connected to the CSL DD wheelbase).

gotzl commented 2 years ago

Which branch I have to use?

The next branch. I've just pushed a change to support the native (red) mode of CSL DD, if you want to give it a try ...

Unfortunately, the accelerator pedal was not recognized

This driver is only to get FF working. All axis already work w/o this driver via the default HID driver. I cannot comment why in your case the accelerator doesn't work, I would suspect an issue with the game/wine. You could use a tool such as https://gitlab.com/sdl-jstest/sdl-jstest to check if all axis work on OS level.

wa-nelson commented 2 years ago

New dmesg output:

[ 4724.993857] usb 1-1.2: new full-speed USB device number 25 using xhci_hcd
[ 4725.317899] usb 1-1.2: New USB device found, idVendor=0eb7, idProduct=0020, bcdDevice= 0.41
[ 4725.317901] usb 1-1.2: New USB device strings: Mfr=1, Product=3, SerialNumber=0
[ 4725.317902] usb 1-1.2: Product: FANATEC Wheel
[ 4725.317903] usb 1-1.2: Manufacturer: Fanatec
[ 4725.356221] hid_map_usage: 34 callbacks suppressed
[ 4725.356222] Fanatec FANATEC Wheel: Invalid code 768 type 1
[ 4725.356223] Fanatec FANATEC Wheel: Invalid code 769 type 1
[ 4725.356224] Fanatec FANATEC Wheel: Invalid code 770 type 1
[ 4725.356224] Fanatec FANATEC Wheel: Invalid code 771 type 1
[ 4725.356225] Fanatec FANATEC Wheel: Invalid code 772 type 1
[ 4725.356225] Fanatec FANATEC Wheel: Invalid code 773 type 1
[ 4725.356225] Fanatec FANATEC Wheel: Invalid code 774 type 1
[ 4725.356226] Fanatec FANATEC Wheel: Invalid code 775 type 1
[ 4725.356226] Fanatec FANATEC Wheel: Invalid code 776 type 1
[ 4725.356226] Fanatec FANATEC Wheel: Invalid code 777 type 1
[ 4725.356272] input: Fanatec FANATEC Wheel as /devices/pci0000:00/0000:00:01.3/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/0003:0EB7:0020.0011/input/input44
[ 4725.356355] input: Fanatec FANATEC Wheel as /devices/pci0000:00/0000:00:01.3/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/0003:0EB7:0020.0011/input/input45
[ 4725.356432] hid-generic 0003:0EB7:0020.0011: input,hiddev0,hidraw0: USB HID v1.11 Joystick [Fanatec FANATEC Wheel] on usb-0000:01:00.0-1.2/input0
[ 4730.280367] usb 1-1.4.2: reset high-speed USB device number 9 using xhci_hcd

Looks like it's still registering as a generic HID

gotzl commented 2 years ago

@wa-nelson Strange... Maybe you missed unloading the old module? After make and sudo make install you need to sudo rmmod hid-fanatec if the module was already loaded. Then plugin the wheel-base.

wa-nelson commented 2 years ago

@gotzl Yep that's it, guess I thought it would just overwrite the old one. Can confirm your next branch works with ffbplay

gotzl commented 2 years ago

@wa-nelson It overwrites the old one, but only on disk, not in RAM ;) Usual linux pitfalls ;)

wa-nelson commented 2 years ago

@gotzl Makes sense, never worked with drivers before so didn't realize that would be a problem. Thanks for the update though! Everything's working great for me

dinuxlt commented 2 years ago

Hi,

just want to double check here. CSL DD in compability mode works as expected? FFB, pedals, wheel buttons etc?

gotzl commented 2 years ago

@dinuxlt I don't own the device, so it's up to others to really confirm what works and what not. From my perspective, the CSL DD should work in both compat and native mode, with FFB, pedals and buttons.

dbro86 commented 2 years ago

Hello all, now I would like to give a brief update here about my tests and trials.

The premise was actually the CSL DD together with the CSL Pedals under Dirt Rally, Dirt 4 and F1 2017 can use. Why exactly these, these are at the moment the only sim-racing games that exist as a native Linux application.

First of all, under Archlinux I struggled a bit with the udev rules -> had to adapt for me.

Through a search I found the following page https://steamcommunity.com/sharedfiles/filedetails/?id=2063066708 and there on the hint to the program oversteer.

After patching for the CSL DD, the program actually recognized, for both compatibility mode and native mode, the steering wheel with steering to the right and to the left, the gas pedal and the brake pedal. (I don't currently have a clutch pedal). That was encouraging in the first place.

However, the test with the above 3 games was disillusioning. I suspect the games are too old or the setup doesn't work that way.

Dirt Rally: It doesn't even show in the start menu that there is a/no steering wheel. Dirt 4 and F1 2017:

I still have one hope. At the moment the pedals are connected directly to the Wheelbase. As soon as I have the Clubsport USB adapter in my hands, and can connect the pedals to the PC via it, I will test this again.

Many greetings

wa-nelson commented 2 years ago

@dinuxlt My setup:

is working great in both compatibility and PC modes. I've tested it in Euro Truck Simulator 2 native and Assetto Corsa Competizione using Proton-6.19-GE-2.

I haven't mapped all of the buttons on the wheel yet but all of the ones I have tried are recognized (paddle shifters and dual clutch).

I'm on Debian stable with the 4.19 kernel

Also PC mode will only work on the next branch for now until master is updated

dinuxlt commented 2 years ago

Very good news! Thanks for update.

gotzl commented 2 years ago

@dbro86 First of all, under Archlinux I struggled a bit with the udev rules -> had to adapt for me.

Thanks your impressions. Could you elaborate on the problems with the udev rules? Why the wheel doesnt turn up in native mode puzzles me. I'll download the games to see what happens with the CSL Elite. But maybe you could try fiddling around with the .../Steam/steamapps/common/DiRT 4/share/inputdevices.json file and add your device (I think this file is in all the Feral ports) ... Search for 'Fanatec' and add a section for the CSL DD accordingly. Not sure what the effect is, though ^^

Oortael60 commented 2 years ago

Hi @gotzl,

I've tested the driver today the first time with the CSL DD in compatibility mode on Kubuntu 21.10

In ACC it seems that there is very less FFB when understeering mid corner.

Can you tell me how I should troubleshoot this? I suppose this could be either a driver "feature" or Proton issue with the game.

In case of a missing feature let me know, please. Would be happy to support you here.

Kind regards Stefan

gotzl commented 2 years ago

In ACC it seems that there is very less FFB when understeering mid corner.

So you mean, comparing the experience with windows and linux? I assume you kept the tuning-menu-settings similar? And also compared with same ACC version? With new patch I seem to feel understeer mid-corner more due the 'absence' of FFB as well .... That's certainly interesting, not sure how to troubleshoot this efficiently ... Have to think about it ;)

Also, I wonder why you're using compat mode. Is native mode still not working with head of next branch?

Oortael60 commented 2 years ago

Hi @gotzl,

yes, I have both OS running on my machine. Both settings are similar and game settings are as well as prefered by fanatec: https://forum.fanatec.com/discussion/634/assetto-corsa-competizione-pc-fanatec-recommended-settings

`CSL DD (Compatibility Mode recommended) Tuning Menu Settings:

SEN 1080
FF 100
FFS Peak
NDP 20
NFR Off
NIN 3
INT 4
FEI 100
FOR 100
SPR 100
DPR 50
BLI User Preference
SHO 100
BRF User Preference

In-Game Settings:

Steer lock: 1080
Gain: 70
Min Force: 0
Dynamic Damping: 100
Road Effects: 0`

Unfortunately I can get the wheel recognized by Assetto Corsa Competizione in Compatibility Mode only.

I used the code from the last commit of the branch "next":

s@game:~/hid-fanatecff$ git pull Bereits aktuell. s@game:~/hid-fanatecff$ git log commit de33c5f6860405c2413e7d24ccbc2c9edf631e63 (HEAD -> next, origin/next, origin/HEAD) Author: Matthias Gorzellik matthias.gorzellik@gmail.com Date: Fri Nov 26 21:42:03 2021 +0100

added DD2 PID (#9)

This is the dmesg output with the PC mode:

[  150.768443] usb 1-10: new full-speed USB device number 7 using xhci_hcd [  151.082544] usb 1-10: New USB device found, idVendor=0eb7, idProduct=0020 , bcdDevice= 0.41 [  151.082550] usb 1-10: New USB device strings: Mfr=1, Product=3, SerialNum ber=0 [  151.082551] usb 1-10: Product: FANATEC Wheel [  151.082553] usb 1-10: Manufacturer: Fanatec [  151.097926] hid_map_usage: 78 callbacks suppressed [  151.097928] Fanatec FANATEC Wheel: Invalid code 768 type 1 [  151.097931] Fanatec FANATEC Wheel: Invalid code 769 type 1 [  151.097932] Fanatec FANATEC Wheel: Invalid code 770 type 1 [  151.097933] Fanatec FANATEC Wheel: Invalid code 771 type 1 [  151.097934] Fanatec FANATEC Wheel: Invalid code 772 type 1 [  151.097935] Fanatec FANATEC Wheel: Invalid code 773 type 1 [  151.097935] Fanatec FANATEC Wheel: Invalid code 774 type 1 [  151.097936] Fanatec FANATEC Wheel: Invalid code 775 type 1 [  151.097937] Fanatec FANATEC Wheel: Invalid code 776 type 1 [  151.097938] Fanatec FANATEC Wheel: Invalid code 777 type 1 [  151.097985] input: Fanatec FANATEC Wheel as /devices/pci0000:00/0000:00:0 1.3/0000:03:00.0/usb1/1-10/1-10:1.0/0003:0EB7:0020.000A/input/input35 [  151.098111] input: Fanatec FANATEC Wheel as /devices/pci0000:00/0000:00:0 1.3/0000:03:00.0/usb1/1-10/1-10:1.0/0003:0EB7:0020.000A/input/input36 [  151.098188] hid-generic 0003:0EB7:0020.000A: input,hiddev3,hidraw7: USB H ID v1.11 Joystick [Fanatec FANATEC Wheel] on usb-0000:03:00.0-10/input0

The Compatibility Mode outputs this in dmesg:

[  794.290310] usb 1-10: USB disconnect, device number 7 [  801.054571] usb 1-10: new full-speed USB device number 8 using xhci_hcd [  801.365256] usb 1-10: New USB device found, idVendor=0eb7, idProduct=0004 , bcdDevice= 0.41 [  801.365261] usb 1-10: New USB device strings: Mfr=1, Product=3, SerialNum ber=0 [  801.365262] usb 1-10: Product: FANATEC Wheel [  801.365264] usb 1-10: Manufacturer: Fanatec [  801.380644] hid_map_usage: 34 callbacks suppressed [  801.380647] Fanatec FANATEC Wheel: Invalid code 768 type 1 [  801.380649] Fanatec FANATEC Wheel: Invalid code 769 type 1 [  801.380650] Fanatec FANATEC Wheel: Invalid code 770 type 1 [  801.380652] Fanatec FANATEC Wheel: Invalid code 771 type 1 [  801.380652] Fanatec FANATEC Wheel: Invalid code 772 type 1 [  801.380653] Fanatec FANATEC Wheel: Invalid code 773 type 1 [  801.380654] Fanatec FANATEC Wheel: Invalid code 774 type 1 [  801.380655] Fanatec FANATEC Wheel: Invalid code 775 type 1 [  801.380655] Fanatec FANATEC Wheel: Invalid code 776 type 1 [  801.380656] Fanatec FANATEC Wheel: Invalid code 777 type 1 [  801.380696] input: Fanatec FANATEC Wheel as /devices/pci0000:00/0000:00:0 1.3/0000:03:00.0/usb1/1-10/1-10:1.0/0003:0EB7:0004.000B/input/input37 [  801.380773] input: Fanatec FANATEC Wheel as /devices/pci0000:00/0000:00:0 1.3/0000:03:00.0/usb1/1-10/1-10:1.0/0003:0EB7:0004.000B/input/input38 [  801.380832] hid-generic 0003:0EB7:0004.000B: input,hiddev3,hidraw7: USB H ID v1.11 Joystick [Fanatec FANATEC Wheel] on usb-0000:03:00.0-10/input

Let me know if you need more logs / details.

Br, Stefan

gotzl commented 2 years ago

Hi @Oortael60 ,

your dmesg outputs seem a bit strange. Are you sure that the kernel-module was actually installed at that time? I would've expected to see ftec_csl_elite 0003:0EB7:0004.000B: ..., but your output shows hid-generic 0003:0EB7:0004.000B: ... (so, it selected the generic HID driver...)?

Apart from that I've tried to set my CSL Elite into compatibility mode to see if this behaves differently, but this does not work at all with my wheel for some reason... Later this month my brother gets a CSL DD, and he has windows. So maybe I can get my hands on this one at some point. Other than that I'm out of ideas ...

gotzl commented 2 years ago

Just realized that ACC uses FF_DAMPER since the recent patch, and there was some (unintentional) scaling in the driver. @Oortael60 , could you try with the latest next version and see if it feels better?

FelixElgner commented 2 years ago

Hi all, Just wanted to report that the driver works great for the CSL DD with clubsport bmw gt2 v2 in AC, ACC and Automobilista2 (native and compatibility mode). The seperate wheel motors seems to be working fine as well. Thanks a lot for your hard work.

One thing i found, is that the FFB in Automobilista2 seems to be a lot stronger and detailed on windows. The car needed a lot more force to turn into corners and the road texture was much more present. In AC the FFB seems to be about the same. (All games tested with Proton 6.3.8)

I was running the same settings both in the CSL DD as well as in the game. Could this be due to some missing FFB effects in the driver and did some of you experience simmilar things?

Best regards

Felix

Oortael60 commented 2 years ago

Just realized that ACC uses FF_DAMPER since the recent patch, and there was some (unintentional) scaling in the driver. @Oortael60 , could you try with the latest next version and see if it feels better?

Hi @gotzl ,

please apologize the long delay. I've been occupied with family business for some time :)

Yes you were right. With the new driver the device in PC mode is also show the right way, now:

`[ 223.030066] usb 1-10: USB disconnect, device number 5 [ 223.395709] usb 1-10: new full-speed USB device number 6 using xhci_hcd [ 223.705844] usb 1-10: New USB device found, idVendor=0eb7, idProduct=0020, bcdDevice= 2.97 [ 223.705849] usb 1-10: New USB device strings: Mfr=1, Product=3, SerialNumber=0 [ 223.705850] usb 1-10: Product: FANATEC Wheel [ 223.705852] usb 1-10: Manufacturer: Fanatec [ 223.721044] /home/stefan/hid-fanatecff/hid-ftec.c: ftec_probe: ifnum 0 [ 223.721212] input: Fanatec FANATEC Wheel as /devices/pci0000:00/0000:00:01.3/0000:03:00.0/usb1/1-10/1-10:1.0/0003:0EB7:0020.0009/input/input31 [ 223.721340] ftec_csl_elite 0003:0EB7:0020.0009: input,hiddev3,hidraw7: USB HID v1.11 Joystick [Fanatec FANATEC Wheel] on usb-0000:03:00.0-10/input0 [ 223.721342] /home/stefan/hid-fanatecff/hid-ftec.c: ... 1 1 1 56 -128 127 -128 127

[ 223.721345] /home/stefan/hid-fanatecff/hid-ftecff.c: ... setting FF bits [ 223.721346] /home/stefan/hid-fanatecff/hid-ftecff.c: setting range to 1080 [ 223.721437] ftec_csl_elite 0003:0EB7:0020.0009: Hires timer: period = 2 ms`

The updated driver works like a charm! The FFB in ACC 1.8.10 feels way better. Thank you.

Br, Stefan

gotzl commented 2 years ago

Basic CSL DD support is there. Please open separate tickets for advanced features or issues with specific games.