We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1918 - X360 controller does not stop rumbling when stopped without a delay
Summary: X360 controller does not stop rumbling when stopped without a delay
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: haptic (show other bugs)
Version: HG 2.0
Hardware: x86_64 Linux
: P2 major
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-15 12:24 UTC by Leszek Godlewski
Modified: 2015-02-18 05:37 UTC (History)
2 users (show)

See Also:


Attachments
gcc fftest.c -o fftest -lSDL2 (634 bytes, text/x-csrc)
2013-06-15 12:24 UTC, Leszek Godlewski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leszek Godlewski 2013-06-15 12:24:40 UTC
Created attachment 1192 [details]
gcc fftest.c -o fftest -lSDL2

When running the sample code mentioned in the SDL_haptic.h header, the Xbox 360 controller keeps rumbling after the program exits. Even when an explicit call to SDL_HapticRumbleStop() after the delay is added, it keeps rumbling.

However, when the SDL_Delay() argument is increased by 4 ms (or more), or the SDL_HapticRumblePlay() duration argument is decreased by the same number of milliseconds, the controller stops rumbling as expected.

Attached is a simple program with 100% reproducibility on my machine.
Comment 1 Ryan C. Gordon 2013-07-08 23:52:23 UTC
Putting this bug on my TODO list.

--ryan.
Comment 2 Ryan C. Gordon 2013-07-11 11:29:14 UTC
Attachment #1192 [details] works correctly on my machine. Maybe it's a driver bug? What distro+version are you running?

--ryan.
Comment 3 Leszek Godlewski 2013-07-12 02:31:54 UTC
Hmm. It's Debian testing amd64, on the libsdl2 that's bundled with the most recent Steam Linux Runtime.

I'll make another test on the tip of the trunk of libsdl2 next week.
Comment 4 sdl 2015-01-24 15:16:22 UTC
I have the same problem but with a different code: https://gist.github.com/karolherbst/413135d8152797615fac

it seems to work fine after a delay of 700 to 800 microsecconds. The issue for me is, that a SDL_HapticStopEffect call directly after SDL_HapticUpdateEffect triggers the issue for me.

I am using linux-3.18.3 and libsdl2-2.0.3-r200 (from Gentoo Linux) with commit 5192470456ae8f82f88bd3249d213a437b5906f1 patched in.
Comment 5 sdl 2015-01-24 20:56:13 UTC
this seems to be a kernel bug: https://gist.github.com/karolherbst/631e5a30347a28ae6b56 this simple code also triggers the bug sometimes. It has to be run with a single argument, passing the used device ( /dev/input/eventXX )
Comment 6 sdl 2015-01-25 10:39:49 UTC
for reference: https://bugzilla.kernel.org/show_bug.cgi?id=91991
Comment 7 Ryan C. Gordon 2015-02-18 05:37:11 UTC
Closing this as a driver bug.

--ryan.