Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Kethen
Copy link

@Kethen Kethen commented Aug 19, 2024

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
Copy link
Author

Kethen commented Aug 20, 2024

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
Copy link
Owner

berarma commented Aug 20, 2024

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

@Kethen
Copy link
Author

Kethen commented Aug 20, 2024

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
Copy link
Author

Kethen commented Aug 20, 2024

@berarma
Copy link
Owner

berarma commented Aug 21, 2024

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
Copy link
Author

Kethen commented Aug 21, 2024

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
Copy link
Owner

berarma commented Aug 21, 2024

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
Copy link
Owner

berarma commented Aug 21, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants