While researching practical usability of an "analogue-gameport to USB device" for retro-computing preservation, I ran into issues on Ubuntu (12.04) Linux:
- Used jstest-gtk to calibrate
- jstest-gtk values/behavior displayed made sense
Buttons worked fine.
So something was wrong with the calibration.
It seems that there's a conflict between the joystick as "/dev/input/jsX" and "/dev/input/eventX" (X being a numerical index).
Min/Max values for /dev/input/js0 (Axis 0 - left/right)
While "evtest" shows completely different, asymmetrical values:-32767 to +32767
42 to 150
[SOLUTION]
Quoting README of "jstest-gtk" where the conflict issue of joystick-device vs. event-device is mentioned:
"To work around that you have to set an environment variable that forces SDL to use the joystick device:"Depending on what version and what compilation flags where used, your version of SDL might not use the joystick interface at all, but instead use the /dev/input/event* device directly. That means that any calibration or button/axis mapping will be ignored, as those apply to the joystick interface, not evdev.
Code: Select all
$ SDL_JOYSTICK_DEVICE="/dev/input/js0"
$ export SDL_JOYSTICK_DEVICE
Might update this article once I've tried how joystick stuff behaves in more recent versions of Linux/Ubuntu...
Links: