Re: PROBLEM: Logitech G29 driving wheel input events are garbage if device is opened too soon after plugging in

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Re-sending due to a technical issue resulting in the email being rejected by the mailing list.

On 25/05/2020 16:19, Raul Tambre wrote:

When Logitech's "G29 Driving Force Racing Wheel" is plugged in and a program opens it too quickly after that (<120ms), then writing an autocenter effect returns EINVAL and values for input events are garbage.

*Example*
I've attached a C program that helps reproduce the issue.
It detects the wheel being plugged in using inotify and applies an autocenter effect. It also prints out input events.

The default device the example opens is /dev/steering_wheel. The device name can be changed in the WHEEL_DEVICE define. Add an udev rule to make the steering wheel appear with a fixed name under /dev, e.g.: SUBSYSTEM=="input", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c24f", SYMLINK+="steering_wheel"

Steps:
1. Connect the wheel.
2. Run the program. An autocenter force should be applied.
3. Remove the wheel's USB cable from your computer. You should see "wheel disconnected".
4. Plug it back in. The wheel should start its homing sequence.
5. The write() in write_autocenter() should fail with EINVAL and the printed input events should be garbage.

*Workaround*
Sleeping before opening the device after it is reconnected avoids the problem. This can be done through the SLEEP_MS define in the example.
A value higher than roughly 120ms avoids the issue on my machine.

*Input events*
With the wheel connected before the program started:
type=3 code=0 value=32914
type=0 code=0 value=0
type=3 code=0 value=32913
type=0 code=0 value=0
type=3 code=0 value=32912
type=0 code=0 value=0
type=3 code=0 value=32911

When re-connecting the wheel while the program is running:
type=58304 code=4187 value=243335168
type=58304 code=4187 value=293666816
type=58304 code=4187 value=343998464
type=58304 code=4187 value=394330112
type=58304 code=4187 value=25329665
type=58304 code=4187 value=75628544
type=58304 code=4187 value=75628544
type=62336 code=4187 value=16941055
type=62336 code=4187 value=16941055
type=62336 code=4187 value=16941055

*Kernel version* (/proc/version)
Linux version 5.7.0-rc5-amd64 (debian-kernel@xxxxxxxxxxxxxxxx) (gcc version 9.3.0 (Debian 9.3.0-12), GNU ld (GNU Binutils for Debian) 2.34) #1 SMP Debian 5.7~rc5-1~exp1 (2020-05-10)

/proc/cpuinfo, /proc/modules, /proc/ioports, /proc/iomem, lspci -vvv and usb-devices outputs are attached.
The system is an up-to-date Debian Unstable installation.




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux