Giter VIP home page Giter VIP logo

new-lg4ff's Introduction

new-lg4ff for Linux

Improved Linux module driver for Logitech driving wheels.

Thanks to Oleg Makarenko for adding support for the Logitech G923 Racing Wheel (PS4/PC version).

Supported devices:

  • Logitech WingMan Formula GP (without force feedback)
  • Logitech WingMan Formula Force GP
  • Logitech Driving Force
  • Logitech MOMO Force Feedback Racing Wheel
  • Logitech Driving Force Pro
  • Logitech G25 Racing Wheel
  • Logitech Driving Force GT
  • Logitech G27 Racing Wheel
  • Logitech G29 Driving Force (switch in PS3 mode)
  • Logitech G923 Racing Wheel for PlayStation 4 and PC (046d:c267, 046d:c266)
  • Logitech MOMO Racing
  • Logitech Speed Force Wireless Wheel for Wii

This module is not compatible with the Logitech G920 Driving Force and XBOX/PC version of the Logitech G923 (046d:c26d, 046d:c26e). Both wheels use the HID++ protocol and are supported by the HID++ driver as of kernel 6.3.

Reports on success or failure using this module on untested devices are welcome.

Differences with the in-tree module

It has all the features in the in-kernel hid-logitech module and adds the following ones:

  • Support for most effects defined in the Linux FF API (except inertia) rather than just constant the force effect.
  • Asynchronous operations with realtime handling of effects.
  • Rate limited FF updates with best possible latency.
  • Tunable sprint, damper and friction effects gain.
  • It can combine accelerator and clutch.
  • Use the wheel leds as a FFBmeter to monitor clipping.
  • Added a system gain setting that modulates the gain setting used by applications.
  • SYSFS entries for gain, autocenter, spring/damper/friction effect gain and FFBmeter.

Requirements

  • GMake
  • GCC
  • The linux-headers package matching the installed kernel version.

Build and install

The module can be installed with DKMS or manually. Follow just one of these procedures.

DKMS

The module will be installed in the /usr/src directory. Removal, updates, and rebuilds for kernel upgrades will be managed by dkms. The module will load automatically at system reboot.

Follow these steps:

  • Install dkms from the package manager in your system.
  • Download the project to /usr/src/new-lg4ff.
  • Install the module:

$ sudo dkms install /usr/src/new-lg4ff

Installing the module won't load it into memory. You'll have to load it manually or update your initramfs image and reboot.

When using DKMS the module will be installed as hid-logitech so it automatically replaces the old module. Once loaded, it will be displayed as hid-logitech-new though.

NOTE: If you had previously installed the module using the manual method then you must delete the module by hand: $ sudo rm /lib/modules/$(uname -r)/extra/hid-logitech-new.ko

Update initramfs image

DKMS is deprecating the feature to automatically update the initramfs image so after a reboot the default module will load instead of the new one. It needs to be done manually.

Users using the generic initramfs tool can do it with the command:

sudo update-initramfs -u

Updating

When updating the module, update the code in /usr/src/new-lg4ff and repeat the install step.

In case you want to rebuild the module, remove it and install again:

$ sudo dkms remove new-lg4ff/<version> --all
$ sudo dkms install /usr/src/new-lg4ff

Replace <version> with the version you want to remove.

Manual method

Type the following commands inside the project directory:

$ make
$ sudo make install

In some distributions, the install step might throw some SSL errors because it's trying to sign the module. These errors can be ignored.

Now the module is installed but not loaded.

To load the module:

$ sudo make load

To unload the module (restoring the in-kernel module):

$ sudo make unload

Check that the driver is loaded

Run:

sudo dmesg

You should see something like this (notice the version at the end of the module description):

[347092.750524] logitech 0003:046D:C24F.000B: Force feedback support for Logitech Gaming Wheels (0.2b)
[347092.750525] logitech 0003:046D:C24F.000B: Hires timer: period = 2 ms

Force Feedback clipping

There's been work done to be able to monitor FF clipping and avoid it. The FF force level is calculated as a maximum since we can't know the exact amount of force the wheel is applying because conditional effects are dynamic depending on wheel movements.

Games using conditional effects will report the maximum force level as if the conditional effects were playing at the maximum level. This way we may get a higher value than real one but never lower. Since the goal is to avoid clipping, this is the measure we are interested in.

Conditional effects gain can be tuned seperately for each effect type to leave more dynamic range for the other effects. The default value seems close enough to the gain used in the official Logitech driver for Windows.

Clipping isn't necesarily bad. To allow a wider dynamic range of forces to be played, it may be good to have some very light clipping, and even lots of clipping are acceptable when crashing or driving over very rough ground.

Options

You can use modinfo to query for available options.

New options available:

  • timer_msecs: Set the timer period. The timer is used to update the FF effects in the device. It changes the maximum latency and the maximum rate at which commands are sent. Maximum 4 commands every timer period get sent. The default value is 2ms, less will have no benefit and greater may add unrequired latency.

  • fixed_loop: Set the firmware loop mode to fixed or fast. In fixed mode it runs at about 500Hz. In fast mode it runs as fast as it can. The default is fast loop to try to minimize latencies.

  • timer_mode: Fixed (0), static (1) or dynamic (2). In fixed mode the timer period will not change. In static mode the period will increase as needed. In dynamic mode the timer period will be dynamic trying to maintain synch with the device to minimize latencies (default).

  • profile: Enable debug messages when set to 1.

  • spring_level: (see the corresponding SYSFS entry).

  • damper_level: (see the corresponding SYSFS entry).

  • friction_level: (see the corresponding SYSFS entry).

  • ffb_leds: (see the corresponding SYSFS entry).

New SYSFS entries

They are located in a special directory named after the driver, for example:

/sys/bus/hid/drivers/logitech/XXXX:XXXX:XXXX.XXXX/

Entries in this directory can be read and written using normal file commands to get and set property values.

combine_pedals

This entry already existed. It has been extended, setting the value to 2 combines the clutch and gas pedals in the same axis.

gain

Get/set the global FF gain (0-65535). This property is independent of the gain set by applications using the Linux FF API.

autocenter

Get/set the autocenter strength (0-65535). This property can be overwritten by applications using the Linux FF API.

spring_level

Set the level (0-100) for the spring type effects.

damper_level

Set the level (0-100) for the damper type effects.

friction_level

Set the level (0-100) for the friction type effects.

ffb_leds

Use the wheel leds (when present) to monitor FF levels.

Led combinations:

  • All leds off: force < 7.5% (normally the force is lower than the wheel mechanical friction so it will be too weak to be noticed).
  • 1 led on from outside: 7.5%-25% force.
  • 2 leds on from outside: 25%-50% force.
  • 3 leds on from outside: 50%-75% force.
  • 4 leds on from outside: 75%-90% force.
  • 5 leds on from outside: 90%-100% force.
  • 1 led off from outside: 100%-110% force (some clipping but most probably unnoticeable).
  • 2 leds off from outside: 110%-125% force (probably noticeable light clipping).
  • 3 leds off from outside: 120%-150% force (clipping must be pretty noticeable).
  • 4 leds off from outside: force > 150% (clipping hard).

peak_ffb_level

It returns the maximum detected FF level value as an integer. It can be written to reset the value and start reading again. Values read will be always greater or equal than the last value written. Values between 0-32768 mean no clipping, greater values mean there can be clipping.

Contributing

Please, use the issues to discuss bugs, ideas, etc.

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

new-lg4ff's People

Contributors

arsconyl avatar berarma avatar jotomo avatar motolav avatar parkerlreed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

new-lg4ff's Issues

Module causing system instability

having this module installed (using dkms) caused system instability like random crashes and random softlock at bootup.
Using Pop!_OS, no other dkms modules (apart from preinstalled ones) on a Ryzen 5 1600
Edit: need to do a bit more testing, just incase this is caused by something else

Reseting on every startup

Hi! I've been using 50keda pluging FFB in ETS2 and ATS and this is far more convinient. Also, great work with adding more game inputs like engine rumble (great in trucking sim to have tactile info without looking into dash). Thanks for your work. I just have two small issues:
1st I need to reset everything every time I start computer (unload then load)
2nd Data when "centering" wheel is presented as little -kicks- that are stronger with the turning and I believe that Feral Interactive had approached the same issue by making it harder (more resistive) to turn the wheel when more offset

Also, I don't know if this made the Wreckfest getting the FFB working with G29 or they made some adjustments in game (haven't played a while), but seems to help in that game also. Once again, I know that Logitech made a mess with this model and thank you for your work.

Upstreaming the driver

Is there any plan for upstreaming this module driver to expand/replace the current in-tree hid-logitech?

Project CARS 3 has no FFB or resistance

Project CARS 3 when ran through Proton Experimental and this driver has no FFB nor resistance on the wheel. It seems fine from the default kernel module though.

Any suggestions I could do to try to debug this?

I'm not sure if the same suggestion for an older Proton build here works #30 (comment), but I'll try that in a bit

G29 choppy centering force in Euro Truck Simulator 2

I have a minor issue with centering force in ETS2/ATS with my Logitech G29 wheel.

The ingame force feedback centering setting is a speed sensitive force, which means as faster i drive the stronger become the centering force.

But when enabled, centering force feels choppy and unsmooth (like the force is pulsed).

This effect persists in both Steam versions - native Linux and when using Proton. Windows version works smooth with the same settings.

As a workaround i set the ingame force feedback centering slider to 0 and use autocenter settings from Oversteer. But Oversteer setting is constant force, not adaptive like ingame setting.

So my question - are there any settings to adjust to have a smooth centering force like in Windows?

I can't install on Manjaro

I installed linux419-headers and kmod.
I get that error on manjaro trying sudo make install:

make -C /lib/modules/`uname -r`/build M=$PWD modules_install
make[1]: se entra en el directorio '/usr/lib/modules/4.19.84-1-MANJARO/build'
  INSTALL /home/X/new-lg4ff/new-lg4ff/hid-logitech-new.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: crypto/bio/bss_file.c:76
sign-file: certs/signing_key.pem: No such file or directory
  DEPMOD  4.19.84-1-MANJARO
make[1]: se sale del directorio '/usr/lib/modules/4.19.84-1-MANJARO/build'

Any idea?

Thanks.

[Request] Higher than 100% gain

On the Windows driver, it's possible to go higher than 100% (I believe 150% is the max).

Setting the gain to somewhere between 105 and 112% on the G25/G27 reduces the FFB dead zone when the wheel is center, they added the dead zone to prevent the 2 motors from fighting each other, causing a type of reverb effect, but at ~110% it doesn't seem to happen while reducing the dead zone to almost nothing.

You can read more about the issue here: https://www.racedepartment.com/threads/bad-deadzone-on-g27.145463/

Couldn't get to install on newest arch's kernels

I used the installation from dnmodder, it has installed successfully until it went to the DKMS installation. It works but doesn't get it to work with arch kernel 5.3.12-arch-1-1 why is it asking for older kernel headers when I have the newest?

I'm still lost

G29. Even with the new driver, I'm having the worst time trying to get this working ANYWHERE

Proton doesn't see it

Euro Truck2 native doesn't see it despite it being available and working

https://i.imgur.com/09CtyGt.png

What am I doing wrong?

PS3 mode the driver attaches, the wheel does the spinning initialization but doesn't center by default. I can go into oversteer and set the rotation and autocenter and it works.

PS4 mode initializes with centering but the driver doesn't attach to that.

I'm just as lost as ever trying to get this to work in anything useful.

G29 red knob button presses

I have a G29 and I am not getting reliable button presses from the red knob on the wheel in speed dreams and jstest-gtk. I do get reliable button presses (one press per click) in oversteer.

I'm not sure the driver is installed properly:

[    1.718286] usb 1-1.4: New USB device found, idVendor=046d, idProduct=c24f
[    1.718288] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.718289] usb 1-1.4: Product: G29 Driving Force Racing Wheel
[    1.718290] usb 1-1.4: Manufacturer: Logitech
[    1.722014] hidraw: raw HID events driver (C) Jiri Kosina
[    1.725198] usbcore: registered new interface driver usbhid
[    1.725198] usbhid: USB HID core driver
[    1.727177] hid_logitech_new: loading out-of-tree module taints kernel.
[    1.727178] hid_logitech_new: loading out-of-tree module taints kernel.
[    1.727214] hid_logitech_new: module verification failed: signature and/or required key missing - tainting kernel
[    1.727529] input: Logitech G29 Driving Force Racing Wheel as /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/0003:046D:C24F.0001/input/input5
[    1.727587] logitech 0003:046D:C24F.0001: input,hidraw0: USB HID v1.11 Joystick [Logitech G29 Driving Force Racing Wheel] on usb-0000:00:1a.0-1.4/input0
[    1.727666] logitech 0003:046D:C24F.0001: Force feedback support for Logitech Gaming Wheels (0.2b)
[    1.727667] logitech 0003:046D:C24F.0001: Hires timer: period = 2 ms

I'm using the latest (Feb 4) driver version with Ubuntu 18.04.

Option to generate keyboard events for extra buttons

Background info: F1 2020 on Google Stadia, or perhaps any other game on Google Stadia, does not support more than the standard 17 buttons on a gamepad-like device.
The extra buttons do work in the Chromium browser (checked with https://gamepad-tester.com), just not in Stadia.
I patched the Chromium browser to recognise the DFGT as a Standard gamepad device, but you could also use a browser extension like ControlStadia.

I have created a new module option in new-lg4ff to have the extra buttons generate regular keyboard events on my Driving Force GT.
That way, I can use all buttons on Google Stadia.

Would you consider adopting this option in the mainline?

vibration in wheel when slowly turning against a const force

I'm having a problem with a vibration in the wheel when slowly turning the wheel against a constant force. I noticed this in speed dreams and vdrift in certain corners on certain tracks. I'm able to reproduce the problem with fftest_buffer_overrun (https://github.com/Eliasvan/Linux-Force-Feedback/tree/master/tools/RateLimiting).

I had to increase the device buffer length in fftest_buffer_overrun.c to get fftest_buffer_overrun to work.

diff --git a/tools/RateLimiting/fftest_buffer_overrun.c b/tools/RateLimiting/fftest_buffer_overrun.c
index 25a46ef..00c8784 100644
--- a/tools/RateLimiting/fftest_buffer_overrun.c
+++ b/tools/RateLimiting/fftest_buffer_overrun.c
@@ -33,7 +33,7 @@ enum {

 void print_help(char *device_file_name, unsigned long update_period, unsigned long total_time)
 {
-   printf("Usage: %s /dev/input/eventXX [updatePeriodMicros (default=%d) [totalTimeMicros (default=%d)]]\n",
+   printf("Usage: %s /dev/input/eventXX [updatePeriodMicros (default=%lu) [totalTimeMicros (default=%lu)]]\n",
            device_file_name, update_period, total_time);
    printf("Tests the force feedback driver\n");
    exit(1);
@@ -45,7 +45,7 @@ int main(int argc, char **argv)
    struct input_event play, stop;
    unsigned long update_period, total_time;
    int fd;
-   char device_file_name[64];
+   char device_file_name[512];
    int i;

    printf("Force feedback test program.\n");
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
            print_help(argv[0], update_period, total_time);
        switch (i) {
        case 1:
-           strncpy(device_file_name, argv[i], 64);
+           strncpy(device_file_name, argv[i], sizeof(device_file_name));
            break;
        case 2:
            update_period = atol(argv[i]);

~/Linux-Force-Feedback/tools/RateLimiting$ ./fftest_buffer_overrun /dev/input/by-id/usb-Logitech_G29_Driving_Force_Racing_Wheel-event-joystick 1000 10000000
Force feedback test program.
HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES

Device /dev/input/by-id/usb-Logitech_G29_Driving_Force_Racing_Wheel-event-joystick opened
Now Playing CONSTANT/RUMBLE effect with almost unnoticable magnitude...
Now Playing CONSTANT/RUMBLE effect with large magnitude...
The CONSTANT/RUMBLE effect has been stopped.

If feel the vibration when slowly turning the wheel in the direction of the force.

I started having this problem when I installed this driver. I don't have this problem when playing other racing games on Windows 7.

I would like to see if others can reproduce the problem. I would like to know if my wheel is going bad or that's just the way the g29 works.

No damping or friction with G29 in some games/programs

Everything works fine in Eurotruck Sim 2, F1 2017 and Dirt Rally 2.0 (as far as I can tell).

In F1 2019 (Proton 5.13-1) there doesn't seem to be any damping or friction effects whatsoever (other effects do work).

In Oversteer, adjusting the sliders for force feedback gain, and spring, damper and friction force levels has no effect.

In fftest I get a listing the following effects, but effects 2, 4 and 5 do not work. Interestingly the damper effect does work here.

Setting master gain to 75% ... OK
Uploading effect #0 (Periodic sinusoidal) ... OK (id 0)
Uploading effect #1 (Constant) ... OK (id 1)
Uploading effect #2 (Spring) ... OK (id 2)
Uploading effect #3 (Damper) ... OK (id 3)
Uploading effect #4 (Strong rumble, with heavy motor) ... OK (id 4)
Uploading effect #5 (Weak rumble, with light motor) ... OK (id 5)

Unless you have some ideas straight away, I'll be happy to do some more digging, if only I get some instructions on how to do so.

Thank you for your work, it is much appreciated.

Can't install with DKMS?

Hi!

Just tried to install new-lg4ff on Ubuntu Mate 20.10 system. I used dkms like described in the README. It completed without errors.

Now, dkms status shows:

tsuikki@puucee:~$ dkms status
acpi-call, 1.1.0, 5.8.0-33-generic, x86_64: installed
new-lg4ff, 0.3.1, 5.8.0-33-generic, x86_64: installed
nvidia, 455.45.01, 5.8.0-33-generic, x86_64: installed

But, lsmod doesn't find logitech module:

tsuikki@puucee:~$ lsmod |grep logitech
tsuikki@puucee:~$ 

Also there is absolutely nothing related in my syslog or dmesg.

All my other DKMS modules are loaded fine, like the nvidia driver..

Add range to sysfs

Is there a reason it isn't added yet? I'd love to be able to control rc cars via sysfs.

Manual compiling issue

Sorry but maybe I'm just too stupid, I get an error when compiling the code:

micha@gamertux ~/Desktop/new-lg4ff-0.3 $ LC_MESSAGES=C make
make -C /lib/modules/`uname -r`/build M=$PWD
make[1]: Entering directory '/usr/src/linux-4.19.97-gentoo'
  CC [M]  /home/micha/Desktop/new-lg4ff-0.3/hid-lgff.o
/home/micha/Desktop/new-lg4ff-0.3/hid-lgff.c:116:5: error: redefinition of ‘lgff_init’
  116 | int lgff_init(struct hid_device* hid)
      |     ^~~~~~~~~
In file included from /home/micha/Desktop/new-lg4ff-0.3/hid-lgff.c:23:
/home/micha/Desktop/new-lg4ff-0.3/hid-lg.h:13:19: note: previous definition of ‘lgff_init’ was here
   13 | static inline int lgff_init(struct hid_device *hdev) { return -1; }
      |                   ^~~~~~~~~
make[2]: *** [scripts/Makefile.build:304: /home/micha/Desktop/new-lg4ff-0.3/hid-lgff.o] Error 1
make[1]: *** [Makefile:1522: _module_/home/micha/Desktop/new-lg4ff-0.3] Error 2
make[1]: Leaving directory '/usr/src/linux-4.19.97-gentoo'
make: *** [Makefile:5: default] Error 2

I tried to compile it with 5.4 kernel sources but got the same result. Not sure what I'm doing wrong here. I've no experience in compiling code manually. Thanks!

Cannot use Make

when trying to use make on Solus, it shows
make
make -C /lib/modules/uname -r/build M=$PWD
make[1]: *** /lib/modules/5.15.43-215.current/build: No such file or directory. Stop.
make: *** [Makefile:5: default] Error 2

Any help would be appreciated
Solus 4.3
Kernal 5.15.43-215.current

Thank you!

Sorry if it's not an issue or recommandation, but I really want to thank you very much, beacuse now I can really enjoy Linux thanks to this and Oversteer.

I tested it on my Manjaro laptop and PC and they both run this very well, using it with linux57 kernel.

System message complains about kernel being tainted

Hey - Thanks for putting the time into improving the FF experience for linux sim racers. When I installed, there is a message in dmesg complaining that the kernel is tainted. Details are below.

OS: Xubuntu 19.10
Kernel: 5.3.0-23-generic
dmesg:
[48323.780734] hid_logitech_new: loading out-of-tree module taints kernel. [48323.780763] hid_logitech_new: module verification failed: signature and/or required key missing - tainting kernel

G923 support

Hello,

I noticed this driver doesn't work with the G923, which also doesn't work with stock linux. 😞

What does work with stock linux:

  • The buttons and paddle shifters (most of them at least)
  • The directional buttons, detected as a joystick with four axes (but only on or off)

What doesn't work:

  • The wheel
  • Force feedback
  • The pedals
  • +/-, enter, and the click wheel

Any luck that this could be supported? I have this wheel and a little kernel programming experience, although not in HID devices. I can provide whatever information you need.

There is this project, but they don't appear to have gotten very far.

dmesg output on attach:

[112950.561289] input: Logitech G923 Racing Wheel for PlayStation 4 and PC as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/0000:03:08.0/0000:08:00.3/usb5/5-3/5-3:1.0/0003:046D:C267.0090/input/input113
[112950.561382] hid-generic 0003:046D:C267.0090: input,hiddev3,hidraw4: USB HID v1.10 Gamepad [Logitech G923 Racing Wheel for PlayStation 4 and PC] on usb-0000:08:00.3-3/input0
[112950.567061] hid-generic 0003:046D:C267.0091: hiddev4,hidraw5: USB HID v1.11 Device [Logitech G923 Racing Wheel for PlayStation 4 and PC] on usb-0000:08:00.3-3/input1
[112950.573017] hid-generic 0003:046D:C267.0092: hiddev5,hidraw6: USB HID v1.11 Device [Logitech G923 Racing Wheel for PlayStation 4 and PC] on usb-0000:08:00.3-3/input2

lsusb -v output:

Bus 005 Device 008: ID 046d:c267 Logitech, Inc. G923 Racing Wheel for PlayStation 4 and PC
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x046d Logitech, Inc.
  idProduct          0xc267 
  bcdDevice           38.00
  iManufacturer           1 Logitech
  iProduct                2 G923 Racing Wheel for PlayStation 4 and PC
  iSerial                 3 YFAJAJYHYFOKOTYQAXAGUWIZO
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0062
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              200mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     193
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               5
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               5
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      54
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0014  1x 20 bytes
        bInterval               5
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      30
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

fftest doesn't do anything

All the effects say they uploaded fine but there's no response selecting any of them. Is there any way to test the effects in general?

[parker@e55 bin]$ fftest /dev/input/event20
Force feedback test program.
HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES

Device /dev/input/event20 opened
Features:
  * Absolute axes: X, Y, Z, RZ, Hat 0 X, Hat 0 Y, 
    [27 00 03 00 00 00 00 00 ]
  * Relative axes: 
    [00 00 ]
  * Force feedback effects types: Constant, Periodic, Ramp, Spring, Friction, Damper, Rumble, Gain, Autocenter, 
    Force feedback periodic effects: Square, Triangle, Sine, Saw up, Saw down, 
    [00 00 00 00 00 00 00 00 00 00 BF 1F 03 00 00 00 ]
  * Number of simultaneous effects: 16

Setting master gain to 75% ... OK
Uploading effect #0 (Periodic sinusoidal) ... OK (id 0)
Uploading effect #1 (Constant) ... OK (id 1)
Uploading effect #2 (Spring) ... OK (id 2)
Uploading effect #3 (Damper) ... OK (id 3)
Uploading effect #4 (Strong rumble, with heavy motor) ... OK (id 4)
Uploading effect #5 (Weak rumble, with light motor) ... OK (id 5)
Enter effect number, -1 to exit
4
Now Playing: Strong Rumble
Enter effect number, -1 to exit
5
Now Playing: Weak Rumble
Enter effect number, -1 to exit
^C

Feedback for Dirt Rally 2.0 with Logitch G27

Name of the game: DIRT Rally 2
Steam ID: 690790
Game version: 1.10.1
Game Type (native/proton/wine): Proton
Proton/Wine version: 4.11-8
Wheel Model: Logitech G27
Compatibility Mode: None
Distribution: Arch Linux
Kernel version: 5.3.11-zen1-1-zen

Previously I've using an older proton build with SDL-Joystick support disabled to work around an issue in proton to make FFB work. With that and the normal kernel hid-logitech module, FFB worked in game when replugging the wheel after game start (as a side-effect the wheel showed up twice, causing funky things when not mapping buttons the same on both). This was without ffbwrap.

I've switched now to proton 4.11-8, using ffbwrap with --update-fix and hid-logitch-new module and compared FFB on Windows and Linux, activating one game FFB setting (wheel friction, suspension etc) at a time to compare. The result is that it's the same but for one effect, wheel friction: with the car stationary (easiest to produce the effect), turning the wheel quickly gives a constant force against the turning motion. Turning at a slower speed the motors seem to try to create the friction by changing direction at high frequency. This makes the wheel rather stiff, while sending a lot of small vibrations through the mounting while also being rather loud.
I've seen this effect elsewhere (I think it was Project Cars 2 on Windows), but never with DR2.
So overall it works rather well, except for the issue mentioned (hopefully explained in an understandable way).
If that issue is considered an error (functionally it works, but the noise makes me wonder if I'll wake up anybody if drive late) I'd produce logs (with both setups) to help with debugging.

Installing with DKMS not work

I tried to install using DKMS on Fedora 31 (5.4.17-200.fc31.x86_64) and DKMS status show this:

$ sudo dkms status
new-lg4ff, 0.3, 5.4.17-200.fc31.x86_64, x86_64: installed

but on dmesg command do not show any change, and only work like the old kernel driver.
Using the manual installations works and show the 0.3 version on dmesg.

Support for shifting LEDs

It would be great, if the shifting LEDs of my G29 wheel would be supported.

What needs to be done here? Would gladly try to help out but have only very limited experience with driver development....

Cant use this on Fedora.

make install
make -C /lib/modules/uname -r/build M=$PWD modules_install
make[1]: ingresso nella directory "/usr/src/kernels/5.3.6-200.fc30.x86_64"
  INSTALL /home/madbad/Development/git/forcefeedback-driver/new-lg4ff/hid-logitech-new.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: crypto/bio/bss_file.c:76
sign-file: certs/signing_key.pem: No such file or directory
  DEPMOD  5.3.6-200.fc30.x86_64
make[1]: uscita dalla directory "/usr/src/kernels/5.3.6-200.fc30.x86_64"
[root@localhost new-lg4ff]# depmod -A
[root@localhost new-lg4ff]# rmmod hid-logitech
rmmod: ERROR: Module hid_logitech is not currently loaded
[root@localhost new-lg4ff]# modprobe hid-logitech-new

make install complain because the module cant be signed (but that should not be a problem).

The hid-logitech module for Fedora is built into the kernel (that's why it cant be unloaded)
This make not possible to use the new module (would require to rebuild the whole kernel)

Follow logs of when attaching the wheel

dmesg | grep "logitec"
[  764.710291] logitech 0003:046D:C294.0002: input,hidraw1: USB HID v1.00 Joystick [Driving Force GT] on usb-0000:03:00.0-11/input0
[  765.398409] logitech 0003:046D:C29A.0003: input,hidraw1: USB HID v1.11 Joystick [Driving Force GT] on usb-0000:03:00.0-11/input0
[  765.398422] logitech 0003:046D:C29A.0003: Force feedback support for Logitech Gaming Wheels (new)
[  765.398423] logitech 0003:046D:C29A.0003: HZ (jiffies) = 1000, timer period = 4
[  765.726680] Error: Driver 'logitech' is already registered, aborting...
[  765.848867] Error: Driver 'logitech' is already registered, aborting...

wheel not centered after boot

At boot time the wheel is turned from stop to stop and then is centered but it is centered one turn off. That means when I start a race the car makes a hard left turn and I have to turn it a full turn right to go straight.

The wheel is centered for straight ahead in windows.

Solved F1 2018 FFB problem

With F1 2018 I had the problem that the game would apply a constant force to the wheel and keep it there even during cutscenes, in the menu or after closing the game. I was afraid that it could burn the motor inside the wheel, so I had to use some workarounds.
This module solved this problem.
If someone else has similar problems you should try installing this module.
Wheel is G25, the problem was present both in Ubuntu 20.04 and PopOS 20.10.

Thank you!

Any extra steps to make G29 work?

Hello, thank you for the great project!
I've just got my G29 wheel only yesterday and I'm trying to get it to work today on a opensuse machine.
So far Dirt rally works out of the box.
But on Dirt rally 2.0 I can't have FFB to work (0 feedback).
I've installed the mod following the tutorial and it all went through and I can see the mod is loaded.
However I still don't get no ffb in the game at all.
My questions are:
1.What proton versions are recommended? So far 4.11 and 4.2 did not work.
2.And do I need to add some launch options for the game?
3.BTW I found pyLinuxwheel to set up the wheel and no problem there, since when I launch it I can see that at least centering spring is working. Should I switch to oversteer to get this to work?
4.Do I need ffbtools to get this to work.
Sorry for the newbie questions!

SnowRunner FFB problems

I was trying to get my Logitech G29 wheel to work with SnowRunner, but I'm having problems with it.

First of all I tested that my G29 works with ETS2, so the new-lg4ff installation should be correct.

Using Proton 7.0-1 and 6.3-8 I was able to get the SnowRunner game recognize the wheel using -e flag in steam launch arguments. In the game settings the wheel is recognized when the steering wheel API is set to either DirectInput or Thrustmaster. Setting it to Logitech Legacy or Logitech Trueforce doesn't detect the wheel. When I have been playing the game with Windows 10, the Logitech Legacy has been the correct option.

I can map the buttons and use the wheel to steer but the FFB isn't working properly. I don't have any FFB when turning the wheel but sometimes it applies a huge spike of FFB, I think. This lasts maybe a half second and makes a pretty bad noise from the wheel base.

I'm ready to test and debug the problem further, if you can give me hints what to look for and what tools to use. I'm new to the whole world of Linux gaming and getting this game to work with the wheel would be fantastic!

Can't load module on Linux Mint 19.2

Make & install worked as described. However loading module complains it doesn't have module directory.

Output:

> simon@simon-PC:~/Work/GIT-private/new-lg4ff$ make
make -C /lib/modules/`uname -r`/build M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-5.3.0-23-generic'
  Building modules, stage 2.
  MODPOST 1 modules
make[1]: Leaving directory '/usr/src/linux-headers-5.3.0-23-generic'
> simon@simon-PC:~/Work/GIT-private/new-lg4ff$ sudo make install
make -C /lib/modules/`uname -r`/build M=$PWD modules_install
make[1]: Entering directory '/usr/src/linux-headers-5.3.0-23-generic'
  INSTALL /home/simon/Work/GIT-private/new-lg4ff/hid-logitech-new.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:72
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:79
sign-file: certs/signing_key.pem: No such file or directory
  DEPMOD  5.3.0-23-generic
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[1]: Leaving directory '/usr/src/linux-headers-5.3.0-23-generic'
> simon@simon-PC:~/Work/GIT-private/new-lg4ff$ sudo rmmod hid-logitech
rmmod: ERROR: Module hid_logitech is not currently loaded
> simon@simon-PC:~/Work/GIT-private/new-lg4ff$ sudo modprobe hid-logitech-new
modprobe: FATAL: Module hid-logitech-new not found in directory /lib/modules/5.3.0-23-generic
> simon@simon-PC:~/Work/GIT-private/new-lg4ff$ ls /lib/modules/5.3.0-23-generic
build   kernel             modules.builtin      modules.dep.bin  modules.softdep      vdso
extra   modules.alias      modules.builtin.bin  modules.devname  modules.symbols
initrd  modules.alias.bin  modules.dep          modules.order    modules.symbols.bin
> simon@simon-PC:~/Work/GIT-private/new-lg4ff$ ls /lib/modules/5.3.0-23-generic/extra
hid-logitech-new.ko

Steam doesn't see my steering wheel

This likely isn't an issue with lg4ff, but I don't know where else to ask.
I've installed lg4ff with dkms as instructed and the wheel is detecte in Oversteer, but it doesn't show up in Steam. It says "no controllers detected" and it doesn't show up in BeamNG.

What would be the next thing to check or try?

Fedora 33, Logitech Driving Force GT.

Plan

The goal for this project is getting a more complete FF module into the mainstream Linux kernel. I hope @mungewell, @edwin-v, @Eliasvan and any others involved in previous similar efforts can contribute ideas and oppinions helping make this possible.

The current module in the Linux kernel only supports constant force and that's a big constraint for some developers since the same wheel in Windows supports all effects. The hardware is capable of doing more but not as much as would be needed.

My first effort (current code in this repository) is an experimental module that tries to provide all the hardware features. For now I'm focusing on the Logitech Driving Force G29 since it's what I have. It doesn't support envelopes and I guess there will be some bugs but it's functional and it showcases what can be done.

It only supports 4 force slots. It's based on ff-core instead of ff-memless since we need to do things differently.

Some hardware quirks I've found with the the new module:

  • The friction force type plays as a damper force.
  • The rectangle force type (and maybe others) won't play at the same time than conditional forces unless it's on the first slot. (Needs more testing.)

But this approach is constrained too since it only offers 4 force slots and doesn't support some common effects. After some time working with the module I've concluded that the solution should be implemented half by hardware and half by software so that we can have a full feature set with minimal effort and processing. Emulating forces in user space wouldn't allow us fully take advantage of the hardware so it must be implemented in the driver module.

The best way to take advantage of the hardware would be using 3 slots for conditional forces since these can be easily aggregated and they're the hardest to emulate (reading the wheel position is required). The remaining slot would be used to emulate all the other force types (non-conditional) using constant force (maybe ramp force to smooth it).

ff-memless is alreading emulating envelopes and asynchronous start and stop of the forces. This would take it a step further. All Logitech wheels with FF would have a similar set of features as they have in Windows, right now the G920 is the only wheel that has the same features.

Edit: I've just realized it wouldn't be so easy to aggregate spring effects when the center and/or deadband is different. This is a corner case, we could approximate the result or just emulate the spring effect when needed. Anyway, it's the easiest conditional effect to emulate since it only depends on position while the others depend on velocity.

PS3 vs PS4 mode for Logitech G29?

I've noticed that when using my G29 on Linux, the PS4 mode doesn't seem to present any force-feedback option. But in PS3 mode, it presents force-feedback with both the stock driver and this module.

  1. Are there any technical reasons why the PS4 mode doesn't seemingly work in Linux? It's the preferred mode for Windows.
  2. Can this driver be modified to work with the PS4 mode?
  3. What are the actual differences between the PS3 and PS4 mode? I believe on the surface, the RPM meter on the wheel doesn't work on PS3 mode, but on a technical level, I'm interested to know why this is, and other differences

module won't compile w/ kernel 4.18.0-348.7.1.el8_5.x86_64

Hi, getting this error with kernel 4.18.0-348.7.1.el8_5.x86_64:
# dkms install /usr/src/new-lg4ff
Deprecated feature: REMAKE_INITRD
Deprecated feature: REMAKE_INITRD
Creating symlink /var/lib/dkms/new-lg4ff/0.3.3/source -> /usr/src/new-lg4ff-0.3.3

Building module:
cleaning build area...
make -j16 KERNELRELEASE=4.18.0-348.7.1.el8_5.x86_64 KVERSION=4.18.0-348.7.1.el8_5.x86_64...(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.18.0-348.7.1.el8_5.x86_64 (x86_64)
Consult /var/lib/dkms/new-lg4ff/0.3.3/build/make.log for more information.


# cat /var/lib/dkms/new-lg4ff/0.3.3/build/make.log
DKMS make.log for new-lg4ff-0.3.3 for kernel 4.18.0-348.7.1.el8_5.x86_64 (x86_64)
Sat Jan 22 12:45:17 EST 2022
make -C /lib/modules/4.18.0-348.7.1.el8_5.x86_64/build M=$PWD
make[1]: Entering directory '/usr/src/kernels/4.18.0-348.7.1.el8_5.x86_64'
CC [M] /var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg.o
CC [M] /var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.o
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c:1043:5: error: redefinition of ‘lg4ff_adjust_input_event’
int lg4ff_adjust_input_event(struct hid_device *hid, struct hid_field *field,
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c:22:
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.h:15:19: note: previous definition of ‘lg4ff_adjust_input_event’ was here
static inline int lg4ff_adjust_input_event(struct hid_device *hid, struct hid_field *field,
^~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c:1069:5: error: redefinition of ‘lg4ff_raw_event’
int lg4ff_raw_event(struct hid_device *hdev, struct hid_report *report,
^~~~~~~~~~~~~~~
In file included from /var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c:22:
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.h:17:19: note: previous definition of ‘lg4ff_raw_event’ was here
static inline int lg4ff_raw_event(struct hid_device *hdev, struct hid_report *report,
^~~~~~~~~~~~~~~
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c: In function ‘lg4ff_alternate_modes_store’:
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c:1545:60: error: ‘lg4ff_no_autoswitch’ undeclared (first use in this function); did you mean ‘lg4ff_compat_mode_switch’?
if (target_product_id == USB_DEVICE_ID_LOGITECH_WHEEL && !lg4ff_no_autoswitch) {
^~~~~~~~~~~~~~~~~~~
lg4ff_compat_mode_switch
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c:1545:60: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c: In function ‘lg4ff_handle_multimode_wheel’:
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c:2070:7: error: ‘lg4ff_no_autoswitch’ undeclared (first use in this function); did you mean ‘lg4ff_compat_mode_switch’?
!lg4ff_no_autoswitch) {
^~~~~~~~~~~~~~~~~~~
lg4ff_compat_mode_switch
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c: At top level:
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c:2095:5: error: redefinition of ‘lg4ff_init’
int lg4ff_init(struct hid_device *hid)
^~~~~~~~~~
In file included from /var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c:22:
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.h:19:19: note: previous definition of ‘lg4ff_init’ was here
static inline int lg4ff_init(struct hid_device *hdev) { return -1; }
^~~~~~~~~~
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c:2306:5: error: redefinition of ‘lg4ff_deinit’
int lg4ff_deinit(struct hid_device *hid)
^~~~~~~~~~~~
In file included from /var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.c:22:
/var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.h:20:19: note: previous definition of ‘lg4ff_deinit’ was here
static inline int lg4ff_deinit(struct hid_device *hdev) { return -1; }
^~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:316: /var/lib/dkms/new-lg4ff/0.3.3/build/hid-lg4ff.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1571: module/var/lib/dkms/new-lg4ff/0.3.3/build] Error 2
make[1]: Leaving directory '/usr/src/kernels/4.18.0-348.7.1.el8_5.x86_64'
make: *** [Makefile:5: default] Error 2


Any guidance would be appreciated.

Thanks.

Version 0.2 not working

Hi Bernat,

Firstly thanks for taking the trouble to create a working driver for us, I've got a G29 and have been using version 0.1 in pcars2, ATS and Mudrunner and it's been working well.

I updated to version 0.2 a short while ago using dkms, rebooted and connected the wheel and get an oops https://pastebin.com/aY4y5n31

Reverted to 0.1 and working again.

Regards,
Geoff

Force feedback command queue

I'm able to reproduce an issue consistently whereby the force feedback command queue builds up into the thousands.

Whilst playing Assetto Corsa (via Proton Experimental), during the start of a race whilst the cars are sat on the grid, the "Force feedback command queue contains x commands, causing substantial delays!" kernel message is written several times a second, sometimes incrementing by one or two hundred. Whilst sat on the grid, I can feel the feedback through the wheel, however the number continues to climb. It is only after the race begins that the number starts to decrease - whereby for the first lap the wheel goes a bit insane trying to catch up (assuming it's emptying the queue as the number is going down).

Using latest new-lg4ff (commit e7a3b24) with Logitech G920 (apparently the same if not very similar to the G29).

I'm wondering if it might be worth having an upper limit on the number of items in the queue, as realistically any commands sent in the past which weren't executed immediately are useless, negatively affecting the game experience.

readme not updated

sudo dkms remove new-lg4ff/0.3 --all
should be updated to
sudo dkms remove new-lg4ff/0.3.3 --all
in README.md

Fails to compile on 5.4rc7

xpad also has this issue and I reported it there. Seems something was removed in master.

I'm currently on master with a patch as they broke my soundcard with some new usb descriptor validation... I'll have to compile the distro 5.3.11 with the same patch to be able to compile this project. Just wanted to give you a heads up.

[parker@e55 new-lg4ff]$ make -j10
make -C /lib/modules/`uname -r`/build M=$PWD
make[1]: Entering directory '/usr/lib/modules/5.4.0-rc7-g96b95eff4a59/build'
  AR      /home/parker/build/new-lg4ff/built-in.a
  CC [M]  /home/parker/build/new-lg4ff/hid-lgff.o
  CC [M]  /home/parker/build/new-lg4ff/hid-lg.o
  CC [M]  /home/parker/build/new-lg4ff/hid-lg3ff.o
  CC [M]  /home/parker/build/new-lg4ff/hid-lg4ff.o
  CC [M]  /home/parker/build/new-lg4ff/hid-lg2ff.o
In file included from ./include/linux/power_supply.h:17,
                 from ./include/linux/hid.h:27,
                 from /home/parker/build/new-lg4ff/hid-lgff.c:21:
./include/linux/leds.h:11:10: fatal error: dt-bindings/leds/common.h: No such file or directory
   11 | #include <dt-bindings/leds/common.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:266: /home/parker/build/new-lg4ff/hid-lgff.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ./include/linux/power_supply.h:17,
                 from ./include/linux/hid.h:27,
                 from /home/parker/build/new-lg4ff/hid-lg3ff.c:13:
./include/linux/leds.h:11:10: fatal error: dt-bindings/leds/common.h: No such file or directory
   11 | #include <dt-bindings/leds/common.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:266: /home/parker/build/new-lg4ff/hid-lg3ff.o] Error 1
In file included from ./include/linux/power_supply.h:17,
                 from ./include/linux/hid.h:27,
                 from /home/parker/build/new-lg4ff/hid-lg2ff.c:14:
./include/linux/leds.h:11:10: fatal error: dt-bindings/leds/common.h: No such file or directory
   11 | #include <dt-bindings/leds/common.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from ./include/linux/power_supply.h:17,
                 from ./include/linux/hid.h:27,
                 from /home/parker/build/new-lg4ff/hid-lg.c:17:
./include/linux/leds.h:11:10: fatal error: dt-bindings/leds/common.h: No such file or directory
   11 | #include <dt-bindings/leds/common.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:266: /home/parker/build/new-lg4ff/hid-lg2ff.o] Error 1
make[2]: *** [scripts/Makefile.build:266: /home/parker/build/new-lg4ff/hid-lg.o] Error 1
In file included from ./include/linux/power_supply.h:17,
                 from ./include/linux/hid.h:27,
                 from /home/parker/build/new-lg4ff/hid-lg4ff.c:15:
./include/linux/leds.h:11:10: fatal error: dt-bindings/leds/common.h: No such file or directory
   11 | #include <dt-bindings/leds/common.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:266: /home/parker/build/new-lg4ff/hid-lg4ff.o] Error 1
make[1]: *** [Makefile:1652: /home/parker/build/new-lg4ff] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.4.0-rc7-g96b95eff4a59/build'
make: *** [Makefile:9: default] Error 2

G25 SDL_HAPTIC_CONSTANT effect, direction not correct on Raspberry PI 4

Hi Dear,
I request you assistance as I think there may be a bug in new-lg4ff.
When I install new-lg4ff module driver on my PI4, I remark that it is not possible anymore to execute a constant effect on my Logitech G25, with direction to right (-1); it always react as left.
The same code on the same machine with default drivers is working well.

SDL version is 2.0.14 (but I also tested with previous version and had the same problem).

Here is an extract of my test code:
<<
...
void TriggerConstantEffect(int direction, double strength)
{
printf("TriggerConstantEffect-direction=%d\n", direction);

debug(1, "TriggerConstantEffect\n");
if (supported & SDL_HAPTIC_CONSTANT) 
{
	SDL_HapticEffect tempEffect;
	SDL_memset(&tempEffect, 0, sizeof(SDL_HapticEffect));
	tempEffect.type = SDL_HAPTIC_CONSTANT;
	tempEffect.constant.direction.type = SDL_HAPTIC_CARTESIAN;
	tempEffect.constant.direction.dir[0] = direction;
	tempEffect.constant.direction.dir[1] = 0;
	tempEffect.constant.direction.dir[2] = 0;
	tempEffect.constant.length = SDL_HAPTIC_INFINITY;
	tempEffect.constant.delay = 0;
	tempEffect.constant.level = level;

	if(SDL_HapticUpdateEffect(haptic, effects.effect_constant_id, &tempEffect)!=0)
		debug(1, "Error updating effect: %s\n", SDL_GetError());
	else if(SDL_HapticRunEffect(haptic, effects.effect_constant_id, SDL_HAPTIC_INFINITY)!=0)
		debug(1, "Error executing effect: %s\n", SDL_GetError());
	else
		debug(1,"->success\n");	
	sleep(5);
}

}
...

Thank you in advance for your support
Fred

Force Feedback doesn't work in Project Cars 2

Hello guys,

this driver is really fantastic, thanks for your great work!
However, I have a problem with Project Cars 2 as I don't have any Force Feedback effects, though, the racing wheel is recognized and I can use it.
Is that a known problem?
Have I done something wrong?

Thanks in advance!

Further Explanation and Uninstalling?

This looks super interesting, but I am having some trouble understanding the full effects of this module.

Could you explain how this will improve my G27 wheel which is working on my windows 10 computer with Logitech profiler?

Also if I wish to uninstall in the future, how would I go about this?

Thanks!

Compatibility with secure boot?

I followed the instructions and it seems that I can not get lg4ff to work because I am using secure boot.

When doing sudo make load I get modprobe: ERROR: could not insert 'hid_logitech_new': Operation not permitted.
When Googling around for this error message various pages suggested turning off secure boot. I do not want to disable secure boot.

Is there anything else I can do to get the software to work, without disabling secure boot?

Here's the full install log:

user@machine:~/Documents/new-lg4ff$ make
make -C /lib/modules/`uname -r`/build M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-27-generic'
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-27-generic'
user@machine:~/Documents/new-lg4ff$ sudo make install
make -C /lib/modules/`uname -r`/build M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-27-generic'
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-27-generic'
make -C /lib/modules/`uname -r`/build M=$PWD modules_install
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-27-generic'
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support
  INSTALL /lib/modules/5.15.0-27-generic/extra/hid-logitech-new.ko
  SIGN    /lib/modules/5.15.0-27-generic/extra/hid-logitech-new.ko
At main.c:160:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75
sign-file: certs/signing_key.pem: No such file or directory
  DEPMOD  /lib/modules/5.15.0-27-generic
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-27-generic'
depmod -A
user@machine:~/Documents/new-lg4ff$ sudo make load
make -C /lib/modules/`uname -r`/build M=$PWD
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-27-generic'
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-27-generic'
make -C /lib/modules/`uname -r`/build M=$PWD modules_install
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-27-generic'
arch/x86/Makefile:142: CONFIG_X86_X32 enabled but no binutils support
  INSTALL /lib/modules/5.15.0-27-generic/extra/hid-logitech-new.ko
  SIGN    /lib/modules/5.15.0-27-generic/extra/hid-logitech-new.ko
At main.c:160:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75
sign-file: certs/signing_key.pem: No such file or directory
  DEPMOD  /lib/modules/5.15.0-27-generic
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-27-generic'
depmod -A
rmmod hid-logitech 2> /dev/null || true
rmmod hid-logitech-new 2> /dev/null || true
modprobe hid-logitech-new 
modprobe: ERROR: could not insert 'hid_logitech_new': Operation not permitted
make: *** [Makefile:16: load] Error 1
user@machine:~/Documents/new-lg4ff$

Thanks for reading, I am looking forward to your answers and knowledge!

Meaning of the direction field in the effects struct

This is a call for anyone that can share any info to understand how the direction field should be interpreted for driving wheel devices.

The Linux FF API provides a field to specify and angle at which to play an effect, 0º would mean down, 90º left, 135º is left and up. Wheels are supposed to be able to play FF effects only by rotating the wheel in one direction or the other. So this direction value gets decomposed by the kernel driver into its horizontal and vertical axis values and only the horizontal value is used. This means that an effect with a vertical direction will never be played.

Still, some games send effects with a vertical direction that never get played. I don't understand why any game would send such effect if it's not going to be played. Can someone explain why this might be happening?

ETS2 does this, and other games running with Proton do too.

Dirt Rally 2.0 issues

Hi there, I'm positive I have something wrong in my system but I can't find what, hopefully you'll be able to help me.

First of all, THANKS A LOT for all you efforts!

I have PCARS2 and DR2 exclusively, and thanks to your help and contribution, PCARS2 is running flawlessly with Proton 4.11-11 (although it looses ffb after I alt-tab in/out of the game, but I couldn't care less).

Now Dirt Rally 2.0 was working fine for me with Proton 4.2-9 + FFBWrap tweak of yours, but now, FFB won't work at all. I've tried:
-The already mentioned versions of proton both WITH and WITHOUT ffbwrap.
-Kernels 5.3 and 5.4 (with both versions of proton and both with and w/o ffbwrap).
-I've re-download and re-compiled ffbwrap
-And finally, downloaded and dkms the driver in.
Still no luck

I do see:
[user@manjaro-big ~]$ sudo dmesg | grep -i feedback [ 2.960476] logitech 0003:046D:C299.0004: Force feedback support for Logitech Gaming Wheels
Also, when I install ffbwrap, I do see this error (might be related?):
$ /home/user/Downloads/ffbtools-master/bin/ffbwrap --update-fix /dev/input/by-id/usb-046d_G25_Racing_Wheel-event-joystick -- glxgears ERROR: ld.so: object '/home/mudo/Downloads/ffbtools-master/bin/../build/libffbwrapper-i386.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

Let me know what else I can look for or where to look for and I'll happily return the info.
Thanks a lot in advance.
-Aldo

Module is named "hid-logitech" instead of "hid-logitech-new" on Ubuntu

[19:20] [root@risadinha dkms]# dkms install /usr/src/new-lg4ff

Creating symlink /var/lib/dkms/new-lg4ff/0.1/source ->
                 /usr/src/new-lg4ff-0.1

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j16 KERNELRELEASE=5.0.0-23-lowlatency KVERSION=5.0.0-23-lowlatency...
Signing module:
 - /var/lib/dkms/new-lg4ff/0.1/5.0.0-23-lowlatency/x86_64/module/hid-logitech.ko
Secure Boot not enabled on this system.
cleaning build area...

DKMS: build completed.

hid-logitech.ko:
Running module version sanity check.
 - Original module
 - Multiple same named modules!
   - 2 named hid-logitech.ko in /lib/modules/5.0.0-23-lowlatency/
 - Installation
   - Installing to /lib/modules/5.0.0-23-lowlatency/updates/dkms/

depmod...

DKMS: install completed.

[19:21] [root@risadinha dkms]# ls -la /lib/modules/5.0.0-23-lowlatency/updates/dkms/hid*
-rw-r--r-- 1 root root    60613 dez 15 19:20 hid-logitech.ko

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.