Knowledgebase
XPForce on Linux
Posted by Site Admin on 17 January 2015 11:57 AM

XPForce is coming to Linux!

The plugin adds force-feedback support to X-Plane 9 and higher and will soon be available for Linux - despite the current problems with Linux and force-feedback drivers! If you would like to be involved in pre-release testing then please contact us at support@fsmissioneditor.com .

Installation

The plugin itself is very easy to install. Simply download the zip file and extract it to your "X-Plane/Resources/plugins" folder. Start X-Plane and the plugin will be picked up automatically.

Supported Controllers

At present the Linux version of XPForce is experimental, given that the underlying drivers are very limited.

  • Microsoft Sidewinder Force Feedback 2 works, but only if you apply the patch here and rebuild the kernel driver yourself. At present only one part of the patch has been accepted into the linux kernel, which means that for the forseeable future the standard driver will remain unusable without patching.
  • Iris Dynamics Yoke does not work - but I'm looking at fixing this one. This will use the same driver as the MS Sidewinder and so will need the same patches applied. There are also yoke firmware changes required as of Feb 25th 2015.
  • Logitech devices do not work. The Linux driver supports only "Rumble" and "Constant Force" effects, which XPForce does not use. It looks like it's only aware of wheel-type devices at present. However, it may be possible to extend the driver fairly easily but since I don't have a Logitech force-enabled joystick to test with it's not something I can easily do. It may also be possible to use the generic driver that works with the Iris Dynamics and MS Sidewinder controllers - but that means building it yourself...

If it's any consolation, Mac support for force-enabled controllers is even worse!

Linux Setup

Preparing the Linux system to work properly with force-feedback joysticks is considerably more complex than in Windows, where it is ready to use as soon as it is plugged in. To send force-feedback commands to the stick, a special filed called a "device node" must be set to read-write To do this, you need to know the name of the device. Unfortunately this name can change frequently, and the read-write setting can be lost if you unplug the joystick or reboot. Your Linux distribution may set all this up for you.

Find your joystick's device node

All of the following commands should be run as the root user. The method for doing this varies between Linux distributions, but will typically be "sudo" or "su -c".

# lsinput | more

This will give you lots of text on screen depending on how many input devices you have. You need to find the one that matches your joystick. The example below shows the entry for the Microsoft Force Feedback 2:

/dev/input/event4
   bustype : BUS_USB
   vendor  : 0x45e
   product : 0x1b
   version : 256
   name    : "Microsoft SideWinder Force Feedb"
   phys    : "usb-0000:00:1a.0-1.4/input0"
   uniq    : ""
   bits ev : EV_SYN EV_KEY EV_ABS EV_MSC EV_FF

The device node for this joystick is "/dev/input/event4". This may change on reboot, or if you unplug the joystick!

Test the Linux kernel force-feedback support

Again as root, run the following command to test the forces on this device. Use the correct device node name that you found.

# fftest /dev/input/event4

If the joystick is supported in Linux, you will get the following text displayed:

Device /dev/input/event4 opened
Features:
  * Absolute axes: X, Y, RZ, Throttle, Hat 0 X, Hat 0 Y,
    [63 00 03 00 00 00 00 00 ]
  * Relative axes:
    [00 00 ]
  * Force feedback effects types: Constant, Periodic, Ramp, Spring, Friction, Damper, Rumble, Inertia, Gain, Autocenter,
    Force feedback periodic effects: Square, Triangle, Sine, Saw up, Saw down,
    [00 00 00 00 00 00 00 00 00 00 FF 1F 03 00 00 00 ]
  * Number of simultaneous effects: 40

Setting master gain to 75% ... OK
Uploading effect #0 (Periodic sinusoidal) ... OK (id 0)
Uploading effect #1 (Constant) ... OK (id 1)
Uploading effect #2 (Spring) ... OK (id 2)
Uploading effect #3 (Damper) ... OK (id 3)
Uploading effect #4 (Strong rumble, with heavy motor) ... OK (id 4)
Uploading effect #5 (Weak rumble, with light motor) ... OK (id 5)
Enter effect number, -1 to exit

Note the "OK" messages after "Uploading effect". If the Linux joystick driver is broken, you will instead get "Error: Function not implemented". In current Linux kernels, the driver for the Microsoft Sidewinder Force Feedback 2 is broken. However, I have created a kernel patch which can be used to fix this driver, and will hopefully make it into the Linux kernel soon. Please see the "Patching Linux to support Force Feedback" page for instructions.

Enable force-feedback support for non-root users

As a non-root user, try the "fftest" program again. If you still get the "OK" messages and the forces work then you are ready to start X-Plane! If you get "Open device file: Permission denied", then there are more steps you need to follow.

Every time a new device is plugged in, including when you reboot, it is set up automatically by Linux. If you get "Permission denied" as a normal user then Linux is not setting it up correctly. To fix this, you need to add uDev rules to force the joystick to be set up as read-write for all users.

Again using the device node name you found, and as root, use this command to find the joystick's manufacturer and product codes:

# udevadm info -an /dev/input/event4 | grep -E "idVendor|idProduct" | head -2

    ATTRS{idVendor}=="045e"
    ATTRS{idProduct}=="001b"

Now create a new file in /etc/udev/rules.d called "99-XPlane_Joystick.rules" . You will need to be root to do this. Edit the file to contain the following line, changing the codes for "idVendor" and "idProduct" to match the ones printed by udevadm.

KERNEL=="event*", ATTRS{idProduct}=="001b", ATTRS{idVendor}=="045e", MODE="0666"

Save the file, then unplug and reconnect the joystick. Re-run the steps above to find the device node since it may now be different. Re-run fftest using the new device node name.



Attachments 
 
 xpforce.tar.gz (850.05 KB)
(401 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Help Desk Software by Kayako Fusion