gotzl / hid-fanatecff

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

Errors when switching on CSL DD #51

Closed PhilT closed 9 months ago

PhilT commented 9 months ago

Hi @gotzl ,

I managed to get the drivers compiled and installed in NixOS (thanks) but I'm getting the following when switching on my CSL DD:

Dec 08 20:21:39 spruce kernel: usb 1-8.3: new full-speed USB device number 21 using xhci_hcd
Dec 08 20:21:40 spruce kernel: usb 1-8.3: New USB device found, idVendor=0eb7, idProduct=0020, bcdDevice= 3.05
Dec 08 20:21:40 spruce kernel: usb 1-8.3: New USB device strings: Mfr=1, Product=3, SerialNumber=0
Dec 08 20:21:40 spruce kernel: usb 1-8.3: Product: FANATEC Wheel
Dec 08 20:21:40 spruce kernel: usb 1-8.3: Manufacturer: Fanatec
Dec 08 20:21:40 spruce kernel: Fanatec FANATEC Wheel: Invalid code 768 type 1
Dec 08 20:21:40 spruce kernel: Fanatec FANATEC Wheel: Invalid code 769 type 1
Dec 08 20:21:40 spruce kernel: Fanatec FANATEC Wheel: Invalid code 770 type 1
Dec 08 20:21:40 spruce kernel: Fanatec FANATEC Wheel: Invalid code 771 type 1
Dec 08 20:21:40 spruce kernel: Fanatec FANATEC Wheel: Invalid code 772 type 1
Dec 08 20:21:40 spruce kernel: Fanatec FANATEC Wheel: Invalid code 773 type 1
Dec 08 20:21:40 spruce kernel: Fanatec FANATEC Wheel: Invalid code 774 type 1
Dec 08 20:21:40 spruce kernel: Fanatec FANATEC Wheel: Invalid code 775 type 1
Dec 08 20:21:40 spruce kernel: Fanatec FANATEC Wheel: Invalid code 776 type 1
Dec 08 20:21:40 spruce kernel: Fanatec FANATEC Wheel: Invalid code 777 type 1
Dec 08 20:21:40 spruce kernel: input: Fanatec FANATEC Wheel as /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3/1-8.3:1.0/0003:0EB7:0020.0014/input/input39
Dec 08 20:21:40 spruce kernel: input: Fanatec FANATEC Wheel as /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3/1-8.3:1.0/0003:0EB7:0020.0014/input/input40
Dec 08 20:21:40 spruce kernel: hid-generic 0003:0EB7:0020.0014: input,hiddev99,hidraw17: USB HID v1.11 Joystick [Fanatec FANATEC Wheel] on usb-0000:00:14.0-8.3/input0
Dec 08 20:21:40 spruce mtp-probe[2449]: checking bus 1, device 21: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3"
Dec 08 20:21:40 spruce mtp-probe[2449]: bus: 1, device: 21 was not an MTP device
Dec 08 20:21:40 spruce mtp-probe[2466]: checking bus 1, device 21: "/sys/devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8.3"
Dec 08 20:21:40 spruce mtp-probe[2466]: bus: 1, device: 21 was not an MTP device

Also, if I run fftest /dev/input/by-id/usb-Fanatec_FANATEC_Wheel-event-joystick I get:

Force feedback test program.
HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES

Device /dev/input/by-id/usb-Fanatec_FANATEC_Wheel-event-joystick opened
Features:
  * Absolute axes: X, Y, Z, RX, RY, RZ, Throttle, Rudder, Hat 0 X, Hat 0 Y,
    [FF 00 03 00 00 00 00 00 ]
  * Relative axes:
    [00 00 ]
  * Force feedback effects types:
    Force feedback periodic effects:
    [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ]
  * Number of simultaneous effects: 0

Uploading effect #0 (Periodic sinusoidal) ... Error:: Function not implemented
Uploading effect #1 (Constant) ... Error: Function not implemented
Uploading effect #2 (Spring) ... Error: Function not implemented
Uploading effect #3 (Damper) ... Error: Function not implemented
Uploading effect #4 (Strong rumble, with heavy motor) ... Error: Function not implemented
Uploading effect #5 (Weak rumble, with light motor) ... Error: Function not implemented
Enter effect number, -1 to exit

Has it picked up the wrong driver or something? Any ideas?

PhilT commented 9 months ago

I'm not seeing /sys/module/hid_fanatec/drivers/hid:ftec_csl_elite/0003:0EB7:0005.*/ or anything at /sys/module/hid_fanatec/ so possibly not installed correctly.

PhilT commented 9 months ago

journal.log

Here's the full debug journal log in case that helps.

PhilT commented 9 months ago

Looks like the Invalid code 768 type 1 is coming from the steam udev rules.

gotzl commented 9 months ago

Hi,

this line

Dec 08 20:51:52 spruce kernel: hid-generic 0003:0EB7:0020.0015: input,hiddev99,hidraw17: USB HID v1.11 Joystick [Fanatec FANATEC Wheel] on usb-0000:00:14.0-8.3/input0

says, that at the time the device was plugged in, the driver wasn't installed. So it falls back to the hid-generic driver (ie no FFB capabilities). Note that the driver is only loaded when plugging in / powering on the device. So, maybe you just need to plug it in again? The make install worked w/o problems?

Looks like the Invalid code 768 type 1 is coming from the steam udev rules.

I think these messages come from the HID device that has too many buttons. I looked it up ones, but forgot the details... The gist is that the messages should be harmless.

Edit: you can also try loading the driver directly with insmod hid-fanatec.ko from within the driver src dir, and then plugging in the device. Edit2: What does modinfo hid-fanatec say?

PhilT commented 9 months ago

you can also try loading the driver directly with insmod hid-fanatec.ko from within the driver src dir, and then

Once I figured out how to build locally with NixOS I managed to get it working with insmod hid-fanatec.ko. So the problem is with NixOS not putting the module in the right place, I think.

Tested with ffbtest and I get vibrations! Yay!

I'll close this now as it's more of a NixOS issue at this point. Thanks for your help!

gotzl commented 9 months ago

Well, could be that the make install puts it into the wrong folder for NixOS. If you figure it out, please report back so that others can benefit :)

PhilT commented 9 months ago

It works!

It was indeed a folder issue. I suspected this as well and went back and took another look when you also mentioned it.

For NixOS you can set some makeFlags. "MODULEDIR=$(out)/lib/modules/${kernel.version}/kernel/drivers/hid" got it working.

I posted in the NixOS discourse with the full details and once I've updated it there I'll post the link here as well.

:heart: Thanks for all your help! Really appreciate what you've done here. Hopefully this can make into a NixOS package. Someone already requested it so I'll follow up there as well.

Now I've just got a small problem of the wheel pulling left or right in rF2 which I didn't experience in Windows but it's been a while since I played so I might just need to re-adjust some settings.

Then it's off to get VR setup. Linux is so hard! (but wonderful!)

gotzl commented 9 months ago

Great, good to hear you're making progress!

Now I've just got a small problem of the wheel pulling left or right in rF2 which I didn't experience in Windows but it's been a while since I played so I might just need to re-adjust some settings.

There is some FFB inversion stuff going on in some games. Not sure why they are doing this, or if my implementation is wrong ^^ Anyways, look at this thread for a solution, it worked for me (I've set it to -5000).

Then it's off to get VR setup. Linux is so hard! (but wonderful!)

Yea, I play VR too. It's doable ;)

PhilT commented 9 months ago

There is some FFB inversion stuff going on in some games. Not sure why they are doing this, or if my implementation is wrong ^^ Anyways, look at this thread for a solution, it worked for me (I've set it to -5000).

Thanks for that! The negative Steering effects strength sorted it and getting SteamVR working with the Index wasn't too terrible. Just had some fun around Sebring for the first time in months (while I was setting up NixOS and, y'know, work).

EDIT: Initially I set Steering effects strength to -10000 in the Controller.JSON but this didn't seem to do anything. I tried a bunch of other stuff and then came back to this and tried again with -6000 which seemed to do the trick. I had changed a bunch of wheel settings as well so maybe it was related to that but you can't mistake that feeling that the wheel is pushing away from center rather than centering it.

SynthetikzZ commented 8 months ago

I play rf2 almost exclusively. Had to tinker a lot with the controller.json to get good ffb, but now it's phenomenal. I can upload it later if you wish.

Also on some distros you have to rebuild initramfs to keep the driver installed/loaded after a computer restart.

PhilT commented 8 months ago

I play rf2 almost exclusively. Had to tinker a lot with the controller.json to get good ffb, but now it's phenomenal. I can upload it later if you wish.

Hey @SynthetikzZ , it's working pretty well for me now too. It feels super detailed. However, do post your Controller.JSON, I'd be interested in trying it out and comparing it against what I have to see if mine can be improved.

Also on some distros you have to rebuild initramfs to keep the driver installed/loaded after a computer restart.

On NixOS I think this is taken care of by initrd which is used when you specify the boot.kernelModules and boot.extraModulePackages options.