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 4416

Summary: Rumble broken with dualshock3
Product: SDL Reporter: orbea
Component: hapticAssignee: Ethan Lee <flibitijibibo>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: orbea
Version: 2.0.9   
Hardware: x86_64   
OS: Linux   
Attachments: Fix Linux periodic rumble support

Description orbea 2018-12-06 15:40:11 UTC
I noticed rumble was broken with my official Sony dualshock3 controller in programs like sdl2-jstest and mupen64plus while using SDL-2.0.9 and the master, but not with 2.0.8.

So I bisected the issue and the first bad commit is 44a639b5f1af.

http://hg.libsdl.org/SDL/rev/44a639b5f1af

This can be reproduced with:

sdl2-jstest --rumble 0

Is there any more information I can provide?
Comment 1 orbea 2018-12-06 15:44:12 UTC
Also links to the affected projects, this issue was reproduced with the current git master for both of them.

https://gitlab.com/sdl-jstest/sdl-jstest
https://github.com/mupen64plus/mupen64plus-input-sdl
Comment 2 orbea 2018-12-06 19:03:57 UTC
testrumble still works.

INFO: 1 Haptic devices detected.
INFO: Device: Sony PLAYSTATION(R)3 Controller
INFO: Playing 2 second rumble at 0.5 magnitude.
INFO: Stopping rumble.
INFO: Playing 2 second rumble at 0.3 magnitude

testjoystick prints.

INFO: There are 1 joysticks attached
INFO: Joystick 0: Sony PLAYSTATION(R)3 Controller
INFO:        type: Game Controller
INFO:        axes: 6
INFO:       balls: 0
INFO:        hats: 0
INFO:     buttons: 17
INFO: instance id: 0
INFO:        guid: 030000004c0500006802000011810000
INFO:     VID/PID: 0x054c/0x0268
Comment 3 Sam Lantinga 2018-12-06 19:15:47 UTC
Ethan, can you take a look at this?

Thanks!
Comment 4 Ethan Lee 2018-12-06 19:27:29 UTC
Created attachment 3533 [details]
Fix Linux periodic rumble support

Dangit, even Linux wasn't consistent here - left/right is u16 but periodic is s16. I only have left/right devices so I didn't catch this at the time. Patch is attached.
Comment 5 orbea 2018-12-06 19:42:34 UTC
I tested the attached patch against master and rumble works with both my test cases again, thanks!
Comment 6 Sam Lantinga 2018-12-08 19:25:32 UTC
Thanks!
https://hg.libsdl.org/SDL/rev/1f8d0b1afe07
Comment 7 Sam Lantinga 2018-12-08 19:25:59 UTC
This is now fixed.
Comment 8 orbea 2018-12-08 19:50:13 UTC
Thank you for the quick fix!