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 3193 - Dualshock 3's motion sensors overwrite analog stick
Summary: Dualshock 3's motion sensors overwrite analog stick
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: 1.2.15
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-03 16:40 UTC by maxxus
Modified: 2018-11-14 21:38 UTC (History)
2 users (show)

See Also:


Attachments
src/joystick/linux/SDL_sysjoystick.patch (2.07 KB, text/plain)
2015-12-03 16:40 UTC, maxxus
Details
linux sys_joystick patch (1.22 KB, patch)
2018-07-31 10:51 UTC, Ozkan Sezer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description maxxus 2015-12-03 16:40:26 UTC
Created attachment 2320 [details]
src/joystick/linux/SDL_sysjoystick.patch

The Dualshock 3's motion sensors don't seem to be reported by the call to EVIOCGBIT but they still send EV_ABS events.  Because they're not reported by EVIOCGBIT they're not assigned a proper axis ids and the default of 0 is used, which is the valid id for the left analog sticks left/right axis.

The attached patch sets the default axis id to ABS_MAX, and then checks the axis id before performing the update.  This will protect against EV_ABS events for axes that aren't reported or handled correctly.
Comment 1 Ozkan Sezer 2018-07-31 10:51:17 UTC
Created attachment 3275 [details]
linux sys_joystick patch

The original patch does not apply because it is whitespace-mangled.
Attaching a one that applies to current SDL-1.2 branch.

Has anyone tried this anyway?
Comment 2 maxxus 2018-08-07 03:13:12 UTC
I only know of one other person to use the patch and it seemed to fix their problem as well (https://forums.pcsx2.net/Thread-OnePAD-Dualshock-3-on-Linux?pid=490821#pid490821).

Considering that this bug report and patch is over 3 years old now, I don't know if the problem still persists for the Dualshock 3.  Maybe the motion sensors are correctly reported now, I don't have a setup to test with currently.

In general though the patch protects against any axis that isn't reported by EVIOCGBIT but still sends EV_ABS events; It's not specific to the Dualshock 3.
Comment 3 Ozkan Sezer 2018-08-07 07:10:50 UTC
This patch is in:  https://hg.libsdl.org/SDL/rev/3e05d58dc84f

Thanks.  Closing as fixed.
Comment 4 Sam Lantinga 2018-11-14 21:38:17 UTC
This is fixed for SDL 2.0 here:
https://hg.libsdl.org/SDL/rev/a7ee81795c75

Thanks!