Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.2.15 regression: some joystick axises stopped working #690

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

1.2.15 regression: some joystick axises stopped working #690

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 1.2.15
Reported for operating system, platform: Linux, All

Comments on the original bug report:

On 2012-04-28 02:00:50 +0000, Alon Bar-Lev wrote:

Created attachment 850
libsdl-1.2.15-joystick.patch

Hello,
In 1.2.15 there was a changed:

  •           for ( i=0; i<ABS_MAX; ++i ) {
    
  •           for ( i=0; i<ABS_MISC; ++i ) {
    

This caused some axis to not be detected.

I use sixaxis, it looks like the following aixs are important, all above ABS_MISC.

index: 3b
Joystick has absolute axis: 3b
Values = { 0, 0, 1023, 3, 63 }
index: 3c
Joystick has absolute axis: 3c
Values = { 485, 0, 1023, 3, 63 }
index: 3d
Joystick has absolute axis: 3d
Values = { 388, 0, 1023, 3, 63 }
index 3e
Joystick has absolute axis: 3e
Values = { 481, 0, 1023, 3, 63 }

Attached is a patch reverting this, all works now.

On 2012-04-28 14:06:09 +0000, Alon Bar-Lev wrote:

Hello,

Found commit...

The explanation is strange, as I use "standard PlayStation 3 controller plugged in via USB" and after change SDL totally ignoring the left stick X axes.

Using linux-3.3.3 and SDL-1.2.15 with attachment# 850 works correctly.

So the problem [if exists] is in different place.


HG changeset patch

User Ryan C. Gordon icculus@icculus.org

Date 1310603889 25200

Node ID aa0e501baca0eec3568481e9f61359b3118daf96

Parent dd0f52bf2bfaa14de95268ed9e0dfaef81f2ed72

Linux: Search a smaller set of potential joystick axes.

Newer kernels seem to report bogus axes in the higher ranges, for example
with a standard PlayStation 3 controller plugged in via USB.

diff -r dd0f52bf2bfa -r aa0e501baca0 src/joystick/linux/SDL_sysjoystick.c
--- a/src/joystick/linux/SDL_sysjoystick.c Tue Jul 05 22:05:56 2011 -0400
+++ b/src/joystick/linux/SDL_sysjoystick.c Wed Jul 13 17:38:09 2011 -0700
@@ -703,7 +703,7 @@
++joystick->nbuttons;
}
}

  •    for (i = 0; i < ABS_MAX; ++i) {
    
  •    for (i = 0; i < ABS_MISC; ++i) {
           /* Skip hats */
           if (i == ABS_HAT0X) {
               i = ABS_HAT3Y;
    

On 2012-06-03 02:10:31 +0000, Ryan C. Gordon wrote:

(In reply to comment # 0)

Attached is a patch reverting this, all works now.

It works, but SDL thinks the SixAxis has 27 axes, which is probably not correct.

I just committed a patch that corrects the lost left-stick X axis...my original patch didn't take into account that the extra axes would still send data, and overwrite the first axis's state.

--ryan.

On 2012-06-06 08:18:47 +0000, Alon Bar-Lev wrote:

Confirmed!
Thanks.

On 2018-08-13 07:19:09 +0000, Rene Dudfield wrote:

Arch Linux has a patch for this here: https://git.archlinux.org/svntogit/packages.git/tree/trunk/SDL-1.2.15-ignore_insane_joystick_axis.patch?h=packages/sdl

On 2018-08-13 11:45:59 +0000, Ozkan Sezer wrote:

(In reply to Rene Dudfield from comment # 4)

Arch Linux has a patch for this here:
https://git.archlinux.org/svntogit/packages.git/tree/trunk/SDL-1.2.15-
ignore_insane_joystick_axis.patch?h=packages/sdl

That patch is already in the SDL-1.2 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant