Repository navigation
gameinput: a force-feedback effect with no duration or a play count of 0 runs with SDL_HAPTIC_INFINITY, not 0 iterations - #7815
Conversation
Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
…un and timer Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
… even at the same total length Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
…f 0 runs with SDL_HAPTIC_INFINITY, not 0 iterations Signed-off-by: Maxime Mansiet <AirKyzzZ@users.noreply.github.com>
|
Code read of 186fe3b: looks right. No-duration ( Small follow-ups:
AI-assisted (Claude Code). |
|
Tested
AI-assisted: yes. |
|
Tested
AI-assisted (Claude Code); I read the full diff before building. |
Claimed in the coordination issue as: new RT item (claim), from my finding in #7496 (comment) and review point 2 on #7463.
Depends on: #7463 (same lines of
ForceFeedbackEffect::sync; this branch is on top of it, which is on top of #7385, so their commits show here until they land)@ItsNotRexed: an exe/recomp PR, as you asked.
What and why
ForceFeedbackEffect::syncran an effect with no duration, and a finite one withplayCount0, throughSDL_RunHapticEffect(..., 0), on the belief that 0 iterations is "until stopped" in SDL. SDL 3.4.20's header says to passSDL_HAPTIC_INFINITYto repeat forever, and 0 is a stop where the count reaches evdev: SDL's Linux backend writes it asEV_FF's value, and under Wine, dinput'shid_joystick_effect_Startsends it as the PID loop count, which winebus writes to evdev the same way. On Windows, SDL hands it toIDirectInputEffect::Start, whose reference defines 1 andINFINITEbut not 0. So the usual "create once,SetParamsevery frame" effect could stop as soon as it started on a real wheel.The poll thread now passes
SDL_HAPTIC_INFINITYfor those effects. The play count it keeps for the timer and for #7463's same-run test is still GameInput's, so nothing else changes.Tested
Windows 10 22H2 (19045), RTX 2060 / NVIDIA 566.14, Ryzen 5 2600X, clang-cl 23.1.6 + lld-link with the VS 2022 14.44 STL, Windows SDK 10.0.26100, Ninja, SDL3 3.4.20 fetched, at
186fe3bb0:gameinput_test(ctest): 355 checks, 0 failures.gameinput.cpp(2ebd361d9, gameinput: SetParams with the same duration keeps a finite effect's run and timer #7463's head): 2 failures, the no-duration check (it now expectsSDL_HAPTIC_INFINITY, it asserted the 0 before) and the newplayCount0 check. Both read the iterations the fake haptic source records.Not run on a real force-feedback wheel, only through the fake haptic source.
No game files. AI-assisted (Claude Code).
Checklist
docs/design.md, with how it was confirmed. (no translator change)