| Summary: | Joystick calibration impossible on Linux | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Manuel Reimer <manuel.reimer> |
| Component: | joystick | Assignee: | Ryan C. Gordon <icculus> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | ahartmetz, gabomdq, icculus, tjwhaynes |
| Version: | HG 2.1 | ||
| Hardware: | All | ||
| OS: | Linux | ||
|
Description
Manuel Reimer
2014-01-19 13:39:24 UTC
There are a few things that joystick API does better than evdev, at least with SDL1.2. I am using a Logitech Attack 3 joystick and a Logitech Rumblepad 2 wireless gamepad with analog sticks. Main applications used are dxx-rebirth for the joystick and "Sir, you are being hunted" for the gamepad. My main problem is far too large, non-configurable deadzone. My joystick, uses USB and does not really need calibration because its raw data is already "well-formed", with a range of 0-255 and center readings of 127 or 128 (using the Joystick API). When games use it via evdev, the deadzone is far too large. For Descent 1 and 2 (dxx-rebirth), which use SDL1.2, no deadzone is optimal because very fine control is required for long-range shots. I have so far disabled the deadzone by calibrating the joystick using the joystick API and then setting SDL_JOYSTICK_DEVICE=dev/input/js0, which is not going to work anymore. A default deadzone of zero would work for me. But I don't know if other joysticks deliver equally good raw values, and it would be nice to support even gameport joysticks which *will* need calibration. Also, for some reason, button numbers as displayed in control setup in various games better match numbers printed on the physical buttons with the joystick API. With joystick API, worst case there is an offset of 1 (physically printed numbers are one-based, displayed numbers are zero-based). With evdev, there is some permutation as well. Overall, it seems to be a good idea to even prefer the joystick API by default for joystick-like devices (joysticks and gamepads). *** Bug 2303 has been marked as a duplicate of this bug. *** We removed the old interface thinking it was an obsolete interface, and that the generic /dev/input devices were meant to replace them. We didn't realize this important feature was exclusively part of /dev/js* I'm planning to rollback the commit that removed this support, and fix it up for 2.0.4. Sorry about that! --ryan. FWIW, I just checked and the /dev/input/js* devices do appear on the UDEV stream, so the autodetection stuff should work, it's a matter of telling them apart from the event devices. Glad to hear that this is going to be fixed. Thanks! This would have been a bit of a problem once most games use SDL2. Let's go ahead and fix this for 2.0.4. (In reply to Sam Lantinga from comment #6) > Let's go ahead and fix this for 2.0.4. Any update on this one? The lack of the calibrated joysticks makes half my controllers effectively useless for SDL2 games. Come on guys, please? Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though! |