https://bugs.winehq.org/show_bug.cgi?id=51873
--- Comment #22 from Rémi Bernon rbernon@codeweavers.com --- (In reply to Ivo Ivanov from comment #21)
Created attachment 71063 [details] dinput-additions-and-fixes.patch
Added two new patches to support the PID_USAGE_PARAMETER_BLOCK_OFFSET usage in the Set Condition Report of dinput and UDEV lnxev + SDL backends. Added also a patch for the UDEV lnxev and SDL backends, which makes their behavior similar to the MS PID driver, in relation to the output reports being sent only when the corresponding flag in SetParameters is set. The patch also makes those backends compatible with the modified reports patch.
Thanks, is the MS PID driver actually using these reports with your device? I haven't yet found a way to have them used with the virtual HID driver we have for conformance testing. It would be really nice if we could test them too.
While looking at the backends, noted that the Logical min/max values of various usages as magnitude, offset, attack/fade level, pos/neg coefficient and saturation, deadband, ramp start/end, gain, etc., are being set to one byte max values. Thus the frontend scales them down to those ranges and sends them to the backends which pass them directly to ff_effect / SDL_HapticEffect. While those structures expect mostly 16bit signed/unsigned values in the range of -32767/+32767 or 0/65535. IMO this could be one of the reasons for non existent FFB in those backends. I'll look further when the time permits.
I just used the same kind of value range as some sample descriptors from the PID spec, or as the SideWinder HID descriptors that can be found on internet. This can definitely be modified to better match backend ranges and avoid unnecessary rounding (although SDL and evdev may have slightly different ranges).
Rebased the remaining patches to the current master b65ef71fc0a7044557e0ba530e3b95497644867c
Thanks, I have some of the patches split up locally that I'll send later, mainly about the properties which I instead moved to be handled directly in the base device class. I'll have a look and integrate your changes.