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 2165 - Debian bug report: Left/Right Joystick Axis doesn't work with some controllers
Summary: Debian bug report: Left/Right Joystick Axis doesn't work with some controllers
Status: RESOLVED DUPLICATE of bug 1460
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: 2.0.0
Hardware: x86_64 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-19 19:44 UTC by manuel.montezelo
Modified: 2013-10-21 04:52 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description manuel.montezelo 2013-10-19 19:44:16 UTC
This was reported with 1.2 but I think that it persists with 2.0, and we are applying the patch in 2.0, so I am posting in the case that it's useful or to remove it in 2.0 if not necessary or fixed by another means.

Original bug report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673324

Excepts:
--------------------
# ./testjoystick
There are 1 joysticks attached
Joystick 0: Sony PLAYSTATION(R)3 Controller
       axes: 4
      balls: 0
       hats: 0
    buttons: 19
# ./testjoystick "Sony PLAYSTATION(R)3 Controller"


I don't see any reactions when moving the stick left or right. I downgraded to 
the version 1.2.14-6.1 of libsdl1.2debian from squeeze. The binary started to 
work without any problems. I would guess that this makes the bug a regression. 
An update to 1.2.15-3 instantly reintroduced the problem.

The problem is known since a while and not fixed in svn (but user fixed it):

* http://bugzilla.libsdl.org/show_bug.cgi?id=1460
--------------------

I don't know if the original submitter was right in pointing to the issue 1460, I made some comments there but Ryan didn't think that it was related or fixed the particular problem of 1460.

Still, one of the Debian maintainers of SDL verified the problem with a hardware that he had, and produced a patch, so I think that it can be still useful patch.  Hope that helps.


-----------------------------------------
From: Sam Hocevar <sam@hocevar.net>

   Thanks for the report. I could reproduce it with my SixAxis and
fixed the bug properly. It'll be in the next Debian upload.

-----------------------------------------
Index: libsdl2/src/joystick/linux/SDL_sysjoystick.c
===================================================================
--- a/src/joystick/linux/SDL_sysjoystick.c      2012-05-18 00:51:07.758390396 +0200
+++ b/src/joystick/linux/SDL_sysjoystick.c      2012-05-18 00:51:13.084998927 +0200
@@ -703,7 +703,7 @@
                 ++joystick->nbuttons;
             }
         }
-        for (i = 0; i < ABS_MISC; ++i) {
+        for (i = 0; i < ABS_MAX; ++i) {
             /* Skip hats */
             if (i == ABS_HAT0X) {
                 i = ABS_HAT3Y;
-----------------------------------------

Cheers.
Comment 1 Ryan C. Gordon 2013-10-20 06:58:45 UTC
My understanding is that the original problem is we were losing axis data because of a bug that was overwriting Axis 0.

I'll check this again in the morning. The reason this patch wasn't applied was because it was giving me bogus data from a PS3 controller, but later I was wondering if its tilt sensor actually works on Linux, and it was reporting data from that once we checked more axes.

--ryan.
Comment 2 Ryan C. Gordon 2013-10-20 19:26:43 UTC
Ok, I looked at this again. PS3 controller works, just doesn't report the tilt sensors (or what I assume is the tilt sensors) without the Debian patch, so I'm just merging this bug with Bug #1460 for now.

(I can't speak for 1.2 at the moment, but this is true for 2.0.0.)

--ryan.

*** This bug has been marked as a duplicate of bug 1460 ***
Comment 3 manuel.montezelo 2013-10-20 21:05:55 UTC
Hmm, I am confused.  You merged the report with the previous one so now it's RESOLVED-DUPLICATE (and not present/applied in the version control system), but still you think that the patch is useful because otherwise tilting doesn't work.

I assume that you will review the issue later, but in the meantime, we will keep shipping with the patch -- until/unless something new arises in these bug reports, e.g. a better patch.

Does this sound sensible?

Thanks for looking at this and so quickly.
Comment 4 Ryan C. Gordon 2013-10-21 04:52:05 UTC
> I assume that you will review the issue later, but in the meantime, we will
> keep shipping with the patch -- until/unless something new arises in these
> bug reports, e.g. a better patch.

For SDL 2.1.0, we're planning to discuss revamps to the joystick API to deal with more general purpose things, like guitar hero controllers and wiimotes, etc. It's not clear what will come from that yet, though. In the worst case, we'll probably merge this patch eventually. It's safe for Debian to keep shipping it in the meantime.

--ryan.