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 259

Summary: application hangs during joystick / pad autodetection
Product: SDL Reporter: Carlos Hoyos <karlos1982>
Component: joystickAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED WORKSFORME QA Contact: Sam Lantinga <slouken>
Severity: major    
Priority: P1    
Version: 1.2.10   
Hardware: x86   
OS: Windows (All)   

Description Carlos Hoyos 2006-06-21 13:30:11 UTC
I am unable to use my pad in a game that uses the SDL library (Super Mario War); The App frozes everytime it tries to detect my pad, unless it is unplugged. I have experienced the same problem with other Free Projects (Dosbox, Indiana Jones and the Fountain of Youth), but not with commercial games that use DirectX from 6.0 to 9.0 (Final Fantasy, Guilty Gear, etc...)

The PAD is the AGILER JOYPAD (which I suspect is a generic one, as it uses drivers from other joysticks). I have tested with the drivers for Genius Maxfire G08, and the ones for the Saitek 8-button Game Controller, but none of these work.
Comment 1 Sam Lantinga 2006-06-24 00:34:16 UTC
If you run the game in the debugger, what call is it hanging in?
Is there any chance you could send it to me so I can check it out?
Comment 2 Michael Schaffer 2006-06-27 00:14:36 UTC
I'm one of the devs on the super mario war project.  This sounds like when you are using the gamepad or holding left or down on the joystick, that the SDL_PollEvent() method is continually giving me back events so I enter into a loop to keep reading the events and never continue with the game loop.
Comment 3 Sam Lantinga 2007-07-05 23:20:49 UTC
Have you tried debugging this at all?  SDL should be ignoring duplicate events within a certain jitter threshold.  Is the driver returning wild values?

If you can't figure it out and want to loan me the joystick, I'll be happy to take a look.
Comment 4 Ryan C. Gordon 2007-07-08 23:50:41 UTC
Bumping some bugs' priorities to P1 for consideration before the 1.2.12 release (though some may not be resolved for 1.2.12).

--ryan.

Comment 5 Carlos Hoyos 2007-07-10 03:18:29 UTC
(In reply to comment #3)
> Have you tried debugging this at all?  SDL should be ignoring duplicate events
> within a certain jitter threshold.  Is the driver returning wild values?
> 
> If you can't figure it out and want to loan me the joystick, I'll be happy to
> take a look.
> 
Hi! I'm not the game developer, just an user. I can download the source code from the game and compile it with Visual Studio to test the Pad in the debugger, but I'm not used to work with devices and I would like to know where can I look the values that the driver returns (I guess you get them from a function, but that function might be getting them wrong, I don't know). If I don't find anything this week, I can loan you the Pad if you are from Europe, and you pay the shipping costs to send it back to me (I pay the costs to send it to you). It's not the best deal, so I'll see what can I do with what I have.
Thanks!

Carlos.
Comment 6 Sam Lantinga 2007-07-19 01:16:06 UTC
Can you try with the pre-release SDL DLL:
http://www.libsdl.org/tmp/SDL-1.2.12-win32.zip
Comment 7 Carlos Hoyos 2007-07-23 16:17:32 UTC
(In reply to comment #6)
> Can you try with the pre-release SDL DLL:
> http://www.libsdl.org/tmp/SDL-1.2.12-win32.zip
> 
I've tested with the pre-release DLL you posted. Games hangs as long as the joystick (a wingman 2-axis, but also happens with other Pads and joysticks I have) is on the lowermost right corner. If Joystick is left untouched, the character moves to the left. If moving right, the character just stops moving left. I tested it on various games to make sure it was not game dependant.

I've past the last week been trying to compile on VC6 (the only compiler I have right now) ANY program that handled joystick input on SDL, without luck. I keep getting @#!" Linking errors related to wxWidgets and such (which I installed following a @#!" WxWidgets tutorial that wasted two days of my life). It's very frustrating.
Comment 8 Sam Lantinga 2007-12-29 14:37:26 UTC
If you can debug it, you can look in SDL_SYS_JoystickUpdate() and see what values are being returned (in particular paying attention to JOY_AXIS_THRESHOLD.)

Have you calibrated your joysticks using the Windows control panel?
Comment 9 Sam Lantinga 2009-09-20 22:33:49 UTC
No response in almost 2 years, closing this for now.  Please reopen if this is still active in SDL 1.3.