| Summary: | SDL_HapticOpenFromJoystick() crashes!! SDL_NumHaptics() returning wrong value. | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Rodrigo Cardoso <rodrigo.alfenas> |
| Component: | haptic | Assignee: | Edgar Simo <bobbens> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | critical | ||
| Priority: | P2 | CC: | jorgen, rodrigo.alfenas |
| Version: | HG 2.0 | Keywords: | target-2.0.0 |
| Hardware: | x86 | ||
| OS: | Mac OS X 10.7 | ||
| Attachments: |
More defensive checks to make sure stuff works.
Updated version of the more defensive checks patch. |
||
|
Description
Rodrigo Cardoso
2012-04-30 14:45:43 UTC
Created attachment 851 [details]
More defensive checks to make sure stuff works.
I recall that driver being buggy back in the day, but looking over the code there's a number of things being done wrong which I've fixed and it should now properly error out instead of crashing. Also make sure you initialize the haptic subsystem before using haptic commands (which I now more explicitly try to enforce).
(Sorry if you get a lot of copies of this email, we're touching dozens of bug reports right now.) Tagging a bunch of bugs as target-2.0.0, Priority 2. This means we're in the final stretch for an official SDL 2.0.0 release! These are the bugs we really want to fix before shipping if humanly possible. That being said, we don't promise to fix them because of this tag, we just want to make sure we don't forget to deal with them before we bless a final 2.0.0 release, and generally be organized about what we're aiming to ship. Hopefully you'll hear more about this bug soon. If you have more information (including "this got fixed at some point, nevermind"), we would love to have you come add more information to the bug report when you have a moment. Thanks! --ryan. Edgar, would you mind updating your patch to apply cleanly to todays master? Created attachment 1233 [details]
Updated version of the more defensive checks patch.
Didn't reformat most of the SDL_SetErrors, which should probably be another patch (remove trailing '.'). Seems to work fine on my linux machine.
Edgar, your patch is in, thanks! http://hg.libsdl.org/SDL/rev/6d8fd70e1477 Rodrigo, if you grab the latest snapshot from here, and make sure you pass SDL_INIT_HAPTIC to SDL_Init(), does this fix the problem for you? http://www.libsdl.org/tmp/SDL-2.0.zip I tested with that testhaptic program, and now it seems to at last fail gracefully, no crashes :)
the output:
1 Haptic devices detected.
Device: Wireless 360 Controller
Supported effects [256 effects, 1 playing]:
sine
square
triangle
sawtoothup
sawtoothdown
Supported capabilities:
gain
autocenter
status
Uploading effects
effect 0: Sine Wave
UPLOADING EFFECT ERROR: Haptic: Unable to create effect: function call unsupported.
Aborting program execution.
The fact it is not working is probably a controller driver problem, the author mentioned it is buggy, but hey, no crashes, it seems to be fixed :)
[off]:
Does anyone have a wireless xbox 360 controller and a osx machine to test if it works for you?
I have no other mac compatible gamepad that reports itself as haptic , Can you recommend anyone?
Cheers!
|