berarma / new-lg4ff

Experimental Logitech force feedback module for Linux
GNU General Public License v2.0
315 stars 20 forks source link

add 'play_on_upload' sysfs toggle for BeamNG.drive 'Fast' update type #104

Open Kethen opened 1 month ago

Kethen commented 1 month ago

Not sure if there are applications other than BeamNG.drive with this kind of expectation, are there other wheel drivers out there that just play effects on upload?

Kethen commented 1 month ago

Pinged BeamNG devs over at https://www.beamng.com/threads/workaround-to-get-ffb-to-work-on-linux-proton.93556/#post-1752678

edit: see also https://discord.com/channels/710082165253079061/1148887555991937034/1275459741073801362

It seems that the game does not fire IDirectInputEffect::Start nor use DIEP_START on IDirectInputEffect::SetParameters on the dinput level in "Fast" update type according to wine debug traces, waiting for their response

berarma commented 1 month ago

This looks like something that should be fixed in Wine. I don't think adding a workaround here is adequate.

Kethen commented 1 month ago

If I understand wine code correctly, if DIEP_START was flagged on the application side during IDirectInputEffect::SetParameters, wine would chain IDirectInputEffect::Start after updating the effect and send a play effect here eventually, going by the following test case they have

https://gitlab.winehq.org/wine/wine/-/blob/9dc1ddf801d9db287eb6e7dc13036efde38bd88e/dlls/dinput/tests/force_feedback.c#L1112

Which complies with the behavior documented in https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ee417952(v=vs.85)

So the issue lies in BeamNG fast update didn't flag DIEP_START on IDirectInputEffect::SetParameters, nor have fired any IDirectInputEffect::Start, and it is somehow working on windows, by means I don't understand so far

I hope BeamNG devs could help clarifying, or they could start flagging DIEP_START on IDirectInputEffect::SetParameters in an update

Kethen commented 1 month ago

https://discord.com/channels/710082165253079061/1148887555991937034/1275459741073801362 Discussion on the BeamNG side

berarma commented 1 month ago

https://discord.com/channels/710082165253079061/1148887555991937034/1275459741073801362 Discussion on the BeamNG side

It looks like it may be the check for an effect playing that is not working on Wine/Proton.

Kethen commented 1 month ago

https://discord.com/channels/710082165253079061/1148887555991937034/1275459741073801362 Discussion on the BeamNG side

It looks like it may be the check for an effect playing that is not working on Wine/Proton.

On that end I'm still waiting for wine devs' comment https://bugs.winehq.org/show_bug.cgi?id=57085#c0

berarma commented 1 month ago

https://discord.com/channels/710082165253079061/1148887555991937034/1275459741073801362 Discussion on the BeamNG side

It looks like it may be the check for an effect playing that is not working on Wine/Proton.

On that end I'm still waiting for wine devs' comment https://bugs.winehq.org/show_bug.cgi?id=57085#c0

Good. There might be other games relying on this flag. As discussed in the Discord, most games just play an infinite duration effect when starting and send only updates for all their run time. But there might be other uses for that flag.

berarma commented 1 month ago

Just to be clear, I don't plan to merge this PR but I'll leave it open in case someone finds it useful until the issue is fixed.