| Summary: | Dualshock 3's motion sensors overwrite analog stick | ||
|---|---|---|---|
| Product: | SDL | Reporter: | maxxus |
| Component: | joystick | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | philipp.wiesemann, sezeroz |
| Version: | 1.2.15 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
src/joystick/linux/SDL_sysjoystick.patch
linux sys_joystick patch |
||
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?
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. This patch is in: https://hg.libsdl.org/SDL/rev/3e05d58dc84f Thanks. Closing as fixed. This is fixed for SDL 2.0 here: https://hg.libsdl.org/SDL/rev/a7ee81795c75 Thanks! |
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.