• Cameron Gutman's avatar
    Input: xpad - fix Xbox One rumble stopping after 2.5 secs · aadb3e12
    Cameron Gutman authored
    [ Upstream commit ae3b4469 ]
    Unlike previous Xbox pads, the Xbox One pad doesn't have "sticky" rumble
    packets. The duration is encoded into the command and expiration is handled
    by the pad firmware.
    ff-memless needs pseudo-sticky behavior for rumble effects to behave
    properly for long duration effects. We already specify the maximum rumble
    on duration in the command packets, but it's still only good for about 2.5
    seconds of rumble. This is easily reproducible running fftest's sine
    vibration test.
    It turns out there's a repeat count encoded in the rumble command. We can
    abuse that to get the pseudo-sticky behavior needed for rumble to behave as
    expected for effects with long duration.
    By my math, this change should allow a single ff_effect to rumble for 10
    minutes straight, which should be more than enough for most needs.
    Signed-off-by: default avatarCameron Gutman <aicommander@gmail.com>
    Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
xpad.c 49.8 KB