JacKeTUs / universal-pidff

GNU General Public License v2.0
56 stars 4 forks source link

Damping/friction/spring/inertia effects don't work in games #1

Closed Lawstorant closed 3 months ago

Lawstorant commented 3 months ago

Official issue to track progress.

These effects don't seem to be working when playing games/using WheelCheck.exe I can't see anything out of ordinary in dmesg logs when these affect are triggered.

For some reason, playing "conditional" example for ffbplay from https://github.com/berarma/ffbtools triggers damping/friction/spring correctly.

Lawstorant commented 3 months ago

Update

I think I found the culprit for this weird behavior. Moza FW seems to care about the direction for the Spring/damper/friction effects. I don't know that's the direction value sesnt by games and WheelCheck.exe yet, but after playing around with ffbplay in interactive mode I got these results:

I'll try hardcoding 16384 as the direction in hid-pidff.c for now to see If it'll work for games and WheelCheck.exe. Afterwards, we can decide on how to proceed with this direction stuff as it would be best to maybe try to upstream any fixes to pidff (if we manage a clean solution)

Lawstorant commented 3 months ago

Okay, I got the effects to always work by hardcoding the direction value to 16384. It's an ugly workaround, but I don't have a better one for now.

Lawstorant commented 3 months ago

I introduced quirks to hid-pidff and fixed the issue: https://github.com/JacKeTUs/moza-ff/pull/2

JacKeTUs commented 3 months ago

For reference https://www.usb.org/sites/default/files/documents/pid1_01.pdf Section 4.1, 5.3

If there is a single Condition report block for an effect with more than one axis, then the direction along which the parameters of the Condition report block are in effect is determined by the direction parameters passed in the Direction field of the Effect report block. For example, a friction condition rotated 45 degrees (in polar coordinates) would resist joystick motion in the northeast-southwest direction but would have no effect on joystick motion in the northwest-southeast direction.

JacKeTUs commented 3 months ago

Will look into that today

Lawstorant commented 3 months ago

Resolved after merging PR