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 1041

Summary: Bad axes recognition
Product: SDL Reporter: Mauricio Coto <mcoto800>
Component: joystickAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2 CC: danygradilla, markus.s
Version: 1.2.14   
Hardware: x86   
OS: Linux   

Description Mauricio Coto 2010-08-08 18:53:08 UTC
Hello, 

I have a Ps3 Rock Band guitar, my system recognizes all buttons ok, but it recognizes only 1 axis. So when y call an event of other axis the software prints these error:

Segmentation fault (core dumped)

I put these print in a little program:


fprintf(stdout,"Axes: %1$d", SDL_JoystickNumAxes(joystick));

Result:

Axes: 1

When i try using jstest /dev/input/js0

It prints:

Joystick (Licensed by Sony Computer Entertainment America Harmonix Guitar for PlayStation®3) has 6 axes and 13 buttons. Driver version is 2.1.0.
Testing ... (interrupt to exit)

Any clue??
Comment 1 Markus S. 2010-08-18 03:27:00 UTC
Same here but not with a PS3 guitar.

When I press on the d-pad of my game controller, any application that uses SDL
immediately crashes with a segfault.

Extreme TuxRacer prints:

%%% etracer warning: joystick y axis mapped to axis 1 but joystick only has 1 axes
Segmentation fault


# jstest /dev/input/js0
Driver version is 2.1.0.
Joystick (PS2700 Rumble Pad) has 7 axes (X, Y, Z, Rx, Rz, Hat0X, Hat0Y)
and 13 buttons (Trigger, ThumbBtn, ThumbBtn2, TopBtn, TopBtn2, PinkieBtn, BaseBtn, BaseBtn2, BaseBtn3, BaseBtn4, BaseBtn5, BaseBtn6, BtnDead).
Testing ... (interrupt to exit)
Axes:  0:-32767  1:-32767  2:-32767  3:-32767  4:-32767  5:     0  6:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:off  9:off 10:off 11:off 12:off
Comment 2 Sheng Long Gradilla 2010-10-10 15:33:10 UTC
This problem occurs with the Linux Input Event Interface or whatever it's called. If I chmod 0000 the corresponding /dev/input/event* files for my gamepads, SDL uses the old /dev/input/js* and works fine.

Might want to check the code for handling that part.
Comment 3 Sheng Long Gradilla 2010-11-20 16:46:02 UTC
Ok, found the problem. 
The fix was commited long ago by Sam Latinga, but there hasn't been a new release of SDL 1.2, so those using the latest release (1.2.14) are having problems.

We need a new release!!

Here is the patch that fixed it:
http://hg.libsdl.org/SDL/rev/42012a6afb5b