Bug 2084

Summary: Wrong detection of gamepad/joystick axes and crashes in applications using libSDL1.2_0
Product: Mageia Reporter: Real Name <dubigrasu>
Component: RPM PackagesAssignee: QA Team <qa-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Normal CC: lists.jjorge, misc, stormi-mageia, sysadmin-bugs
Version: 1Keywords: validated_update
Target Milestone: ---   
Hardware: i586   
OS: Linux   
Whiteboard:
Source RPM: SDL12-1.2.14-4.mga1.src.rpm CVE:
Status comment:

Description Real Name 2011-07-09 10:17:26 CEST
Description of problem:

LibSDL1.2_0 is incorrectly detecting the number of axes from gamepads/joysticks causing applications (mostly games) using such devices to crash or not function properly. The issues is present with all my gamepads (4 of them from various manufactures).
Sometimes applications are starting but crash instantly when directional buttons are used, and in other cases gamepads are usable but without axes or hats.

This is/was an very old (aprox two years) issue with SDL, but an issue solved long ago by SDL people. Unfortunately the source used by Mandriva (stable) was never updated to reflect that and I presume it is the same version you are using.
Mandriva however did fixed it in Cooker.

An example of this problem can be provided with the game Trigger (from MDV repos) started from console.

Using SDL from Mageia repos I get the following:
.........................................................................
"Found 1 joystick
Joystick 1: Logitech Logitech RumblePad 2 USB, 1 axis, 12 button, 0 hat"
.........................................................................

This is an incorrect detection of axes and hats, as opposed with the correct one:
.........................................................................
"Found 1 joystick
Joystick 1: Logitech Logitech RumblePad 2 USB, 4 axis, 12 button, 1 hat"
.........................................................................
provided when using the SDL libraries from MDV Cooker OR SDL libraries downloaded directly from the SDL site: http://www.libsdl.org/download-1.2.php

So I suppose you can build a fresh source using the latest SDL or use the patches from Cooker source (not present in Mageia source), you know better :)


Version-Release number of selected component:libSDL1.2_0-1.2.14-4.mga1.i586
Comment 1 Real Name 2011-07-10 22:53:26 CEST
Fixed also in Mandriva 2011 since (I presume):

        * Wed Apr 27 2011 Per ?yvind Karlsen <peroyvind@mandriva.org> 1.2.14-6
        + Revision: 659527
        - compile with -ffast-math
        - build with --enable-assembly
        - build nas as shared
        - enable assembly instructions on x86_64 as well
        - cleanups
        - sync in various patches from debian
Comment 2 Ahmad Samir 2011-07-11 08:10:08 CEST
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=564831

Please test SDL12 1.2.14-4.1.mga2 which should land in core/updates_testing soon.

Keywords: (none) => NEEDINFO

Comment 3 Real Name 2011-07-11 16:03:41 CEST
Yes, that fixed it. Axes are now properly detected and crashes gone.
Thank you.
Comment 4 Ahmad Samir 2011-07-12 08:21:57 CEST
Official update request:

Test case:
- Install a game that uses SDL12, and try using a joystick, it crashes
- Install the SDL12 packages from the core/updates_testing repo, then try again, the issue should be fixed

Since we already have the OP testing the issue, and the crash is gone for him, QA team could just test to make sure there're no regressions.

Fixed packages are SDL12 1.2.14-4.1.mga2 in the core/updates_testing.

Advisory:
==================================
Due to a bug in SDL12 package it would crash when using some joysticks, this update fixes this issue.
==================================

Keywords: NEEDINFO => Triaged
Assignee: bugsquad => qa-bugs

Comment 5 Samuel Verschelde 2011-07-12 09:15:29 CEST
I don't know if it's related, but yesterday evening, after installing all updates_testing packages, I tried to play slune (after compiling it for mageia 1) : the menu entries change without any action from me, as if a joystick was plugged in and in top-right position.

CC: (none) => stormi

Comment 6 Ahmad Samir 2011-07-12 09:59:59 CEST
In reply to comment #5:
Does reverting to the SDL12 packages from core/release fix that issue?
Comment 7 José Jorge 2011-07-12 10:44:00 CEST
> the menu entries change without any action from me

I already have this problem before : my laptop has a some accelerometers that are managed as joysticks, you will have the same problem with neverball.

Calibrating the joystick can help, but in the end the problem is that some games always use a joystick if they detect it.

CC: (none) => lists.jjorge

Comment 8 Samuel Verschelde 2011-07-12 19:07:17 CEST
(In reply to comment #7)
> > the menu entries change without any action from me
> 
> I already have this problem before : my laptop has a some accelerometers that
> are managed as joysticks, you will have the same problem with neverball.
> 
> Calibrating the joystick can help, but in the end the problem is that some
> games always use a joystick if they detect it.

You're right, neverball has the same problem and it looks like I have an accelerometer. I tried to calibrate it but it's not better. I'll try to find out how to have it not recognized as a joystick.
Comment 9 Samuel Verschelde 2011-07-24 14:29:28 CEST
No problem so far with this update candidate installed in games using SDL, on i586. Consider it tested on i586.

Please test on x86_64.
Comment 10 José Jorge 2011-07-25 10:17:59 CEST
Tested on x86_64.

Keywords: Triaged => validated_update

Ahmad Samir 2011-07-25 13:52:34 CEST

CC: (none) => sysadmin-bugs

Comment 11 Michael Scherer 2011-07-26 11:50:01 CEST
The accelerometer issue also happened to me, but with X on my macbook.

Anyway, this update have been pushed, so I close it.

Status: NEW => RESOLVED
CC: (none) => misc
Resolution: (none) => FIXED