Difference between revisions of "Joystick problems (Linux)"

From Elite Wiki
m (Sensitivity Problems)
m (Button Detection & Range Problems)
Line 7: Line 7:
  
 
Prior to Oolite v1.80, deadzone and responsiveness issues in Oolite Linux could only be solved [http://aegidian.org/bb/viewtopic.php?p=178651#p178651 by making use of the ''jscal'', ''jstest'' and ''jstest-gtk'' utilities], but Oolite now has built-in joystick configuration and tuning software, which can solve these problems. A tutorial on how to set up and tune your joystick can be found [[Dizzy%27s_guide_to_Setting_up_Joystick_Axis_Profiles_in_Oolite_1.80|here]].
 
Prior to Oolite v1.80, deadzone and responsiveness issues in Oolite Linux could only be solved [http://aegidian.org/bb/viewtopic.php?p=178651#p178651 by making use of the ''jscal'', ''jstest'' and ''jstest-gtk'' utilities], but Oolite now has built-in joystick configuration and tuning software, which can solve these problems. A tutorial on how to set up and tune your joystick can be found [[Dizzy%27s_guide_to_Setting_up_Joystick_Axis_Profiles_in_Oolite_1.80|here]].
 +
  
 
== Button Detection & Range Problems ==
 
== Button Detection & Range Problems ==
Line 24: Line 25:
  
 
Using your Software Manager, install the ''jstest-gtk'' package. Launch the ''jstest-gtk'' gui (it will probably be located in the System Menu under "Administration") and, underneath the name of your joystick, it will list the device details, such as "Device:/dev/input/js1". You can now edit ''/etc/environment'' or ''.bashrc'' to reflect the correct device number, save, log out and in again, after which Oolite should correctly identify your joystick, and allow you to configure it the way you want.
 
Using your Software Manager, install the ''jstest-gtk'' package. Launch the ''jstest-gtk'' gui (it will probably be located in the System Menu under "Administration") and, underneath the name of your joystick, it will list the device details, such as "Device:/dev/input/js1". You can now edit ''/etc/environment'' or ''.bashrc'' to reflect the correct device number, save, log out and in again, after which Oolite should correctly identify your joystick, and allow you to configure it the way you want.
 
  
 
== Other Problems ==
 
== Other Problems ==
  
 
Should you require further guidance in editing the above files, or the methods given above fail to resolve, or don't address your particular problem, please don't hesitate to post a thread detailing the issue, and your attempts to fix it, to the [http://aegidian.org/bb/viewforum.php?f=9 Oolite-Linux forum]. We have several Linux gurus available, who would be more than happy to assist.
 
Should you require further guidance in editing the above files, or the methods given above fail to resolve, or don't address your particular problem, please don't hesitate to post a thread detailing the issue, and your attempts to fix it, to the [http://aegidian.org/bb/viewforum.php?f=9 Oolite-Linux forum]. We have several Linux gurus available, who would be more than happy to assist.

Revision as of 06:04, 30 September 2015

Overview

Generally speaking, Linux is quite good with joystick detection and support, but sometimes things can go wrong. Failing to detect a joystick at all is extremely uncommon, and most reported problems revolve around button detection/assignment, and/or axis range. In the vast majority of cases, Linux joystick problems in Oolite have been traced back to the SDL_JOYSTICK_DEVICE being incorrectly assigned, so this article mostly focuses on that.


Sensitivity Problems

Prior to Oolite v1.80, deadzone and responsiveness issues in Oolite Linux could only be solved by making use of the jscal, jstest and jstest-gtk utilities, but Oolite now has built-in joystick configuration and tuning software, which can solve these problems. A tutorial on how to set up and tune your joystick can be found here.


Button Detection & Range Problems

For unknown reasons, it appears that sometimes SDL (Simple DirectMedia Layer) takes its raw input from the evdev device drivers, instead of using the correct joystick device. By adding the appropriate environment variable to either the /etc/environment file, or the .bashrc startup script, you can force SDL to use the "real" joystick driver for input.

Officially speaking, /etc/environment is the correct place for system-wide environment variables. To add the environment variable to the /etc/environment file, as root, open /etc/environment in your favourite text editor, add the following line to the file, and save:

SDL_JOYSTICK_DEVICE="/dev/input/js0"

For the change to 'take', you then need to log out and back in again. Rebooting is unnecessary.

If you prefer changing the .bashrc startup script instead (since it doesn't require root access to do so), you should add the same line to .bashrc in your Home folder. As the dot in front of the filename indicates, this is a hidden file, so you may need to set the view in your file browser to "Show Hidden Files" before it will become visible. Once done, save the file and log out, then back in.


Although rare, it sometimes happens that a joystick is assigned a device number other than 'js0'. If the above fails to work for you, this is the most likely reason.

Using your Software Manager, install the jstest-gtk package. Launch the jstest-gtk gui (it will probably be located in the System Menu under "Administration") and, underneath the name of your joystick, it will list the device details, such as "Device:/dev/input/js1". You can now edit /etc/environment or .bashrc to reflect the correct device number, save, log out and in again, after which Oolite should correctly identify your joystick, and allow you to configure it the way you want.

Other Problems

Should you require further guidance in editing the above files, or the methods given above fail to resolve, or don't address your particular problem, please don't hesitate to post a thread detailing the issue, and your attempts to fix it, to the Oolite-Linux forum. We have several Linux gurus available, who would be more than happy to assist.