Analogue joystick "sticks" on OS X

Hey all,

When working with analogue joysticks on Mac OS X (Logitech Wingman
Rumblepad, Microsoft Xbox360 wired controller) I notice that the stick gets
wedged in one direction at program initialization after I push it initially.

After I do a full circle on the stick it becomes “unstuck” but this looks
very unprofessional. Does anyone know what’s going on here? I have deadzone
code, but the wedging seems to be near 100% in the direction opposite what I
just pressed.

From what I can tell, if I start my program and push up-left on the
joystick, the game will respond to that slightly, but then repeatedly emit
down-right motion when I release the stick until I do a full circle with the
stick, after which point it acts normally.

Is SDL doing some kind of adaptive re-calibration, or is this the fault of
the OS X joystick driver? I haven’t encountered this issue on Windows or
Linux and can’t see anything in the archives about it. I am using the
SDL_Joystick code instead of the event interface, but will change over if
the bug is fixed there.

Any insight would be great, particularly if there’s some sort of "hidden"
SDL_Joystick function to force recalibration.–
Mike
http://rav.realitybytes.tk

It seems my message didn’t go through last time, so this is a re-send.
Apologies if you’re seeing this one twice.

Hey all,

When working with analogue joysticks on Mac OS X (Logitech Wingman
Rumblepad, Microsoft Xbox360 wired controller) I notice that the stick gets
wedged in one direction at program initialization after I push it initially.

After I do a full circle on the stick it becomes “unstuck” but this looks
very unprofessional. Does anyone know what’s going on here? I have deadzone
code, but the wedging seems to be near 100% in the direction opposite what I
just pressed.

From what I can tell, if I start my program and push up-left on the
joystick, the game will respond to that slightly, but then repeatedly emit
down-right motion when I release the stick until I do a full circle with the
stick, after which point it acts normally.

Is SDL doing some kind of adaptive re-calibration, or is this the fault of
the OS X joystick driver? I haven’t encountered this issue on Windows or
Linux and can’t see anything in the archives about it. I am using the
SDL_Joystick code instead of the event interface, but will change over if
the bug is fixed there.

Any insight would be great, particularly if there’s some sort of "hidden"
SDL_Joystick function to force recalibration.–
Mike
http://rav.realitybytes.tk

I seem to have the same problem with a Logitech Wingman Extreme Digital on a
MacBook Pro…
Dunno what’s going on.

Also when pressing a button there is some delay, but that may be my code.

/Jacob KoldingOn 4/23/07, mike stedman wrote:

Hey all,

When working with analogue joysticks on Mac OS X (Logitech Wingman
Rumblepad, Microsoft Xbox360 wired controller) I notice that the stick gets
wedged in one direction at program initialization after I push it initially.

After I do a full circle on the stick it becomes “unstuck” but this looks
very unprofessional. Does anyone know what’s going on here? I have deadzone
code, but the wedging seems to be near 100% in the direction opposite what I
just pressed.

From what I can tell, if I start my program and push up-left on the
joystick, the game will respond to that slightly, but then repeatedly emit
down-right motion when I release the stick until I do a full circle with the
stick, after which point it acts normally.

Is SDL doing some kind of adaptive re-calibration, or is this the fault of
the OS X joystick driver? I haven’t encountered this issue on Windows or
Linux and can’t see anything in the archives about it. I am using the
SDL_Joystick code instead of the event interface, but will change over if
the bug is fixed there.

Any insight would be great, particularly if there’s some sort of "hidden"
SDL_Joystick function to force recalibration.

Mike
http://rav.realitybytes.tk


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I seem to have the same problem with a Logitech Wingman Extreme Digital
on a MacBook Pro…
Dunno what’s going on.

Can anyone determine if there are problems with specific sticks or just
sticks in general? The OS X joystick code hasn’t been touched much
recently, but it DID work with analogue sticks last time I tried.

–ryan.

I seem to have the same problem with a Logitech Wingman Extreme Digital
on a MacBook Pro…
Dunno what’s going on.

Can anyone determine if there are problems with specific sticks or just
sticks in general? The OS X joystick code hasn’t been touched much
recently, but it DID work with analogue sticks last time I tried.

Just tested with at GameCube controller using a super joy box 13 USB
converter.
Same behaviour…

/Jacob Kolding

–ryan.On 4/27/07, Ryan C. Gordon wrote:


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

My problem is also on a Macbook Pro. Wonder if it’s some sort of vestigal
endianness concern from the Universal transition.

Anyone else with an Intel or PPC Mac encountering this?On 4/27/07, Jacob Ole Juul Kolding wrote:

On 4/27/07, Ryan C. Gordon wrote:

I seem to have the same problem with a Logitech Wingman Extreme
Digital
on a MacBook Pro…
Dunno what’s going on.

Can anyone determine if there are problems with specific sticks or just
sticks in general? The OS X joystick code hasn’t been touched much
recently, but it DID work with analogue sticks last time I tried.

Just tested with at GameCube controller using a super joy box 13 USB
converter.
Same behaviour…

/Jacob Kolding

–ryan.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Mike
http://rav.realitybytes.tk

When working with analogue joysticks on Mac OS X (Logitech Wingman
Rumblepad, Microsoft Xbox360 wired controller) I notice that the stick
gets wedged in one direction at program initialization after I push it
initially.

This is definitely broken on Mac OS X, even going back to a stock SDL
1.2.8, but it definitely wasn’t broken when I shipped UT2004, since we
explicitly tested the joystick support on the Mac…so I think it’s
something that broke or changed in a newer Mac OS X release.

Does anyone know of a Mac game that supports joysticks and does not use
SDL? Everything I’ve tried (Gish, Jets’n’Guns, etc) turns out to be
using SDL and is broken in the same way. I would like to confirm that
this is SDL making a wrong assumption about how to use the HID Manager
which came back to bite it in OS X 10.4.9, and not just a bug in the
10.4.9 HID Manager.

Has anyone tried this on older Mac OS X releases? PowerPC or Intel?

Also, this issue is now being tracked in Bugzilla:

 http://bugzilla.libsdl.org/show_bug.cgi?id=430

–ryan.

When working with analogue joysticks on Mac OS X (Logitech Wingman
Rumblepad, Microsoft Xbox360 wired controller) I notice that the
stick
gets wedged in one direction at program initialization after I
push it
initially.

This is definitely broken on Mac OS X, even going back to a stock SDL
1.2.8, but it definitely wasn’t broken when I shipped UT2004,
since we
explicitly tested the joystick support on the Mac…so I think it’s
something that broke or changed in a newer Mac OS X release.

Does anyone know of a Mac game that supports joysticks and does not
use
SDL? Everything I’ve tried (Gish, Jets’n’Guns, etc) turns out to be
using SDL and is broken in the same way. I would like to confirm that
this is SDL making a wrong assumption about how to use the HID Manager
which came back to bite it in OS X 10.4.9, and not just a bug in the
10.4.9 HID Manager.

Has anyone tried this on older Mac OS X releases? PowerPC or Intel?

Heh… I had always rather assumed that was a function of the
joystick that if you started a program while it was pressed a certain
direction it would get stuck that way… ^_^;; As far back as I can
remember I’ve had this issue with most any program on my Macs.

–ScottOn 2007/05/28, at 23:29, Ryan C. Gordon wrote:

Also, this issue is now being tracked in Bugzilla:

 http://bugzilla.libsdl.org/show_bug.cgi?id=430

–ryan.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Heh… I had always rather assumed that was a function of the
joystick that if you started a program while it was pressed a certain
direction it would get stuck that way… ^_^;; As far back as I can
remember I’ve had this issue with most any program on my Macs.

The bug is that it starts centered, but the first time you nudge the
stick in-game, the game thinks you left the stick in a corner…rotating
the stick around fixes it, and it stays fixed until you quit the app.

It’s not “the stick doesn’t work if you’re holding it at startup.”

–ryan.

Does anyone know of a Mac game that supports joysticks and does not use
SDL? Everything I’ve tried (Gish, Jets’n’Guns, etc) turns out to be
using SDL and is broken in the same way. I would like to confirm that
this is SDL making a wrong assumption about how to use the HID Manager
which came back to bite it in OS X 10.4.9, and not just a bug in the
10.4.9 HID Manager.

Sorry to be spammy on this topic, but I just found something that works
correctly with joysticks on Mac OS X and doesn’t use SDL: snes9x.

So it’s not an OS-level issue. I’m looking into it.

–ryan.

This is definitely broken on Mac OS X, even going back to a stock SDL
1.2.8, but it definitely wasn’t broken when I shipped UT2004, since we
explicitly tested the joystick support on the Mac…so I think it’s
something that broke or changed in a newer Mac OS X release.

This is now fixed, in svn revision #3030.

–ryan.

Does anyone know of a Mac game that supports joysticks and does
not use
SDL? Everything I’ve tried (Gish, Jets’n’Guns, etc) turns out to be
using SDL and is broken in the same way. I would like to confirm that
this is SDL making a wrong assumption about how to use the HID
Manager
which came back to bite it in OS X 10.4.9, and not just a bug in the
10.4.9 HID Manager.

Sorry to be spammy on this topic, but I just found something that
works
correctly with joysticks on Mac OS X and doesn’t use SDL: snes9x.

I was actually going to suggest that one! >.< Stole my idea. What
was the issue, then, since I saw you have fixed it…?

– ScottOn 2007/05/29, at 1:28, Ryan C. Gordon wrote:

I was actually going to suggest that one! >.< Stole my idea. What
was the issue, then, since I saw you have fixed it…?

The OS X code queries the min/max values a given piece of hardware will
supply so it can scale input events to what SDL wants (-32k to 32k).
Since hardware tends to misreport these values, the code is set up to
adjust the min/max values as the stick reports something out of the
bounds it specified.

The problem is that we assigned it backwards (the min value to the max
variable and vice versa).

I think this probably worked in older OS X versions because it always
reported the min/max as zero, and we depended entirely on the code that
adjusts the bounds the first time you moved the stick. Once these values
were reported by the OS correctly, they became seriously bogus in the
wrong direction due to our variables being flipped, so SDL would
overcorrect input in the wrong direction as soon as you moved the stick
(and the bounds-adjusting code would fix it when you moved the stick in
the other direction, hence why rotating the stick fixed it).

–ryan.

Thanks for the bug fix, Ryan! You rock.

I figured it was something like that (calibrating the bounds automatically)
but wasn’t prepared to look through all that scary HID code to get to it.On 5/29/07, Ryan C. Gordon wrote:

I was actually going to suggest that one! >.< Stole my idea. What
was the issue, then, since I saw you have fixed it…?

The OS X code queries the min/max values a given piece of hardware will
supply so it can scale input events to what SDL wants (-32k to 32k).
Since hardware tends to misreport these values, the code is set up to
adjust the min/max values as the stick reports something out of the
bounds it specified.

The problem is that we assigned it backwards (the min value to the max
variable and vice versa).

I think this probably worked in older OS X versions because it always
reported the min/max as zero, and we depended entirely on the code that
adjusts the bounds the first time you moved the stick. Once these values
were reported by the OS correctly, they became seriously bogus in the
wrong direction due to our variables being flipped, so SDL would
overcorrect input in the wrong direction as soon as you moved the stick
(and the bounds-adjusting code would fix it when you moved the stick in
the other direction, hence why rotating the stick fixed it).

–ryan.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Mike
http://rav.realitybytes.tk