https://bugs.winehq.org/show_bug.cgi?id=51824
Bug ID: 51824 Summary: TrueDrive, SimHub, Fanaleds,etc.: Non smooth movement tracking with severe skipping/jumping of the steering wheel/controller axis Product: Wine Version: 6.18 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: hid Assignee: wine-bugs@winehq.org Reporter: logos128@gmail.com CC: rbernon@codeweavers.com Regression SHA1: 325984ded50b354686e5a454aa5aca3aafa81432 Distribution: ArchLinux
Created attachment 70711 --> https://bugs.winehq.org/attachment.cgi?id=70711 0001-hidclass.sys-Fix-writing-all-new-reports-at-the-last.patch
All the mentioned applications use raw HID access (through HidD/HidP calls) to the devices they controll, so the movement tracking problems appear only there. DirectInput works well.
After further investigation, found that the simpler ring buffer (hidclass.sys/device.c) introduced with the mentioned regression commit is causing the issues. Appeared that all new reports are pushed at the last available ring buffer slot, due to reaching the end of the buffer before the reading has started. Usually such devices as joysticks, controllers, steering wheels, etc., use constant stream of INPUT reports to report their axis movement, so any report skipping or change of the sequence, while the interested apps are reading, would lead to such issues.
Attached a patch which fixes the issue (based on the current master aa629c4c7225166f4ee46476d98702df2e142711).