For an extensive overview of all joystick related modules in Linux, you will need access to the Linux kernel sources -- specifically the Documentation section. Unfortunately, pacman kernel packages don't include what we need. If you have the kernel sources downloaded, have a look at <code>Documentation/input/joystick.txt</code>. You can browse the kernel source tree at [http://kernel.org/ kernel.org] by clicking the "C" (current changesets) link, then clicking the "tree" link near the top. Here's a link to the [http://www.kernel.org/git/?p=linux/kernel/git/stable/linux-2.6.17.y.git;a=blob;h=d53b857a3710ccdde5bc504f212993dcb10a20be;hb=d2350c2ad1463a973b586cadb49c2fa0c83089b8;f=Documentation/input/joystick.txt Documentation from kernel 2.6.17.11].

+

For an extensive overview of all joystick related modules in Linux, you will need access to the Linux kernel sources -- specifically the Documentation section. Unfortunately, pacman kernel packages do not include what we need. If you have the kernel sources downloaded, have a look at <code>Documentation/input/joystick.txt</code>. You can browse the kernel source tree at [http://kernel.org/ kernel.org] by clicking the "C" (current changesets) link, then clicking the "tree" link near the top. Here's a link to the [http://www.kernel.org/git/?p=linux/kernel/git/stable/linux-2.6.17.y.git;a=blob;h=d53b857a3710ccdde5bc504f212993dcb10a20be;hb=d2350c2ad1463a973b586cadb49c2fa0c83089b8;f=Documentation/input/joystick.txt Documentation from kernel 2.6.17.11].

Some joysticks need specific modules, such as the Microsoft Sidewinder controllers (<code>sidewinder</code>), or the Logitech digital controllers (<code>adi</code>). Many older joysticks will work with the simple <code>analog</code> module. If your joystick is plugging in to a gameport provided by your soundcard, you will need your soundcard drivers loaded - however, some cards, like the Soundblaster Live, have a specific gameport driver (<code>emu10k1-gp</code>). Older ISA soundcards may need the <code>ns558</code> module, which is a standard gameport module.

Some joysticks need specific modules, such as the Microsoft Sidewinder controllers (<code>sidewinder</code>), or the Logitech digital controllers (<code>adi</code>). Many older joysticks will work with the simple <code>analog</code> module. If your joystick is plugging in to a gameport provided by your soundcard, you will need your soundcard drivers loaded - however, some cards, like the Soundblaster Live, have a specific gameport driver (<code>emu10k1-gp</code>). Older ISA soundcards may need the <code>ns558</code> module, which is a standard gameport module.

Line 16:

Line 16:

==Testing Your Configuration==

==Testing Your Configuration==

−

Once the modules are loaded, you should find a new device: <code>/dev/input/js0</code>. You can simply <code>cat</code> the device to see if it works - move the stick around, press all the buttons. I found my Logitech Thunderpad Digital had two buttons that weren't working with the <code>analog</code> module. After reading some docs, I saw there was a specific <code>adi</code> module for this controller. The moral of the story is, if it doesn't work the first time, don't give up, and read those docs thoroughly! I couldn't get anything working at all until I found that documentation.

+

Once the modules are loaded, you should find a new device: <code>/dev/input/js0</code>. You can simply <code>cat</code> the device to see if it works - move the stick around, press all the buttons. I found my Logitech Thunderpad Digital had two buttons that weren't working with the <code>analog</code> module. After reading some docs, I saw there was a specific <code>adi</code> module for this controller. The moral of the story is, if it doesn't work the first time, do not give up, and read those docs thoroughly! I couldn't get anything working at all until I found that documentation.

==USB Joysticks==

==USB Joysticks==

You need to get USB working, and then modprobe your joystick driver, which is <code>usbhid</code>, as well as <code>joydev</code>.

You need to get USB working, and then modprobe your joystick driver, which is <code>usbhid</code>, as well as <code>joydev</code>.

If you use a usb mouse or keyboard, <code>usbhid</code> will be loaded already and you just have to load the <code>joydev</code> module.

If you use a usb mouse or keyboard, <code>usbhid</code> will be loaded already and you just have to load the <code>joydev</code> module.

Revision as of 23:19, 3 October 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Joysticks can be a bit of a hassle to get working in Linux. Not because they are poorly supported, but simply because you need to determine which modules to load to get your joystick working, and it's not always very obvious!

Contents

Setup

Determining Which Modules You Need

For an extensive overview of all joystick related modules in Linux, you will need access to the Linux kernel sources -- specifically the Documentation section. Unfortunately, pacman kernel packages do not include what we need. If you have the kernel sources downloaded, have a look at Documentation/input/joystick.txt. You can browse the kernel source tree at kernel.org by clicking the "C" (current changesets) link, then clicking the "tree" link near the top. Here's a link to the Documentation from kernel 2.6.17.11.

Some joysticks need specific modules, such as the Microsoft Sidewinder controllers (sidewinder), or the Logitech digital controllers (adi). Many older joysticks will work with the simple analog module. If your joystick is plugging in to a gameport provided by your soundcard, you will need your soundcard drivers loaded - however, some cards, like the Soundblaster Live, have a specific gameport driver (emu10k1-gp). Older ISA soundcards may need the ns558 module, which is a standard gameport module.

As you can see, there are many different modules related to getting your joystick working in Linux, so I couldn't possibly cover everything here. Please have a look at the documentation mentioned above for details.

Loading the Modules

You need to load a module for your gameport (ns558, emu10k1-gp, cs461x, etc...), a module for your joystick (analog, sidewinder, adi, etc...), and finally the kernel joystick device driver (joydev). Add these to your /etc/rc.conf, or simply modprobe them. The gameport module should load automatically, as this is a dependency of the other modules.

Testing Your Configuration

Once the modules are loaded, you should find a new device: /dev/input/js0. You can simply cat the device to see if it works - move the stick around, press all the buttons. I found my Logitech Thunderpad Digital had two buttons that weren't working with the analog module. After reading some docs, I saw there was a specific adi module for this controller. The moral of the story is, if it doesn't work the first time, do not give up, and read those docs thoroughly! I couldn't get anything working at all until I found that documentation.

USB Joysticks

You need to get USB working, and then modprobe your joystick driver, which is usbhid, as well as joydev.
If you use a usb mouse or keyboard, usbhid will be loaded already and you just have to load the joydev module.