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 - Bad axes recognition
Summary: Bad axes recognition
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: 1.2.14
Hardware: x86 Linux
: P2 critical
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-08 18:53 UTC by Mauricio Coto
Modified: 2010-11-20 16:46 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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