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 2719 - Incorrect number of axes for some gamepads (ex. PlayStation 3 Controller)
Summary: Incorrect number of axes for some gamepads (ex. PlayStation 3 Controller)
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: don't know
Hardware: All Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords: target-2.0.4, triage-2.0.4
Depends on:
Blocks:
 
Reported: 2014-09-07 23:51 UTC by spaz16
Modified: 2015-05-26 16:05 UTC (History)
3 users (show)

See Also:


Attachments
Patch for SDL 2.0.3 (664 bytes, patch)
2014-09-07 23:51 UTC, spaz16
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description spaz16 2014-09-07 23:51:13 UTC
Created attachment 1861 [details]
Patch for SDL 2.0.3

The function "SDL_JoystickNumAxes()" returns 4 axes for PS3 game controller. This device has more than 4 axes, and all of them can be read using Linux drivers. There is a bug in Linux version of "SDL_sysjoystick.c". "ABS_MISC" cannot be used to get values from all axes. I suggest to use "ABS_MAX" instead of "ABS_MISC".
Comment 1 Frank Razenberg 2014-09-14 21:30:41 UTC
I ran into this issue myself. On 2.0.0 (packaged on ubuntu) the axes show up but don't respond to button presses. On 2.0.1-2.0.3 they do not show up at all. With the suggested patch they show up and their state is correctly reported.
Comment 2 Ryan C. Gordon 2015-02-19 03:19:49 UTC
We were using ABS_MISC because some important controller was reporting incorrect axes, but this could have been a driver bug at the time, or a misunderstanding. I can't remember the exact reason at the moment.

We should put this patch in for 2.0.4.

--ryan.
Comment 3 Ryan C. Gordon 2015-02-19 05:22:18 UTC
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though!
Comment 4 spaz16 2015-02-24 09:48:39 UTC
If ABS_MISC usage is really important for other game controller, you can do an exception for PlayStation 3 Controller (and maybe for some others).
Comment 5 Ryan C. Gordon 2015-04-07 04:57:53 UTC
(sorry if you get a lot of copies of this email, I'm marking several bugs at once)

Marking bugs for the (mostly) final 2.0.4 TODO list. This means we're hoping to resolve this bug before 2.0.4 ships if possible. In a perfect world, the open bug count with the target-2.0.4 keyword is zero when we ship.

(Note that closing a bug report as WONTFIX, INVALID or WORKSFORME might still happen.)

--ryan.
Comment 6 Frank 2015-04-10 14:22:21 UTC
Just FYI, applying this patch means that Dualshock 4 touchpad events will be exposed as joystick axes since it sends ABS_MT_* events for the touchpad.

The Sony employee who wrote the DS3 HID descriptor left several axes in there that do nothing and cause the useful ones to spill over into the multitouch space so just ignoring axes above ABS_MT_SLOT won't work either.
Comment 7 Ryan C. Gordon 2015-05-26 16:05:59 UTC
This patch is now https://hg.libsdl.org/SDL/rev/6c86d3216f6a, thanks!

--ryan.