Score:1

Force Feedback Joystick support (MS Sidewinder FF2)

in flag

I want to figure out how much my force feedback joystick is actually supported in Ubuntu. Currently I have Ubuntu 20.04.05 LTS installed.

So far I can run

$ lsusb 
...
Bus 001 Device 006: ID 045e:001b Microsoft Corp. SideWinder Force Feedback 2 Joystick
...
$

and

$ jstest /dev/input/js0
Driver version is 2.1.0.
Joystick (Microsoft SideWinder Force Feedback 2 Joystick) has 6 axes (X, Y, Rz, Throttle, Hat0X, Hat0Y)
and 9 buttons (Trigger, ThumbBtn, ThumbBtn2, TopBtn, TopBtn2, PinkieBtn, BaseBtn, BaseBtn2, BtnDead).
Testing ... (interrupt to exit)
Axes:  0:  1852  1:     0  2:     0  3:     0  4:     0  5:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off  8:on

Both of them seem working fine, so the basic joystick functionality is good. Next, I want to check force feedback functionality. I read https://docs.kernel.org/input/ff.html and thus tried

$ fftest /dev/input/js0
Force feedback test program.
HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES

Device /dev/input/js0 opened
Features:
Ioctl absolute axes features query: Invalid argument

but then the documentation talks about some eventXX device file. Unfortunately it does not mention which one to use. So I added my user to the input group and tried

$ fftest /dev/input/event0
Force feedback test program.
HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES

Device /dev/input/event0 opened
Features:
  * Absolute axes: 
    [00 00 00 00 00 00 00 00 ]
  * Relative axes: 
    [00 00 ]
  * Force feedback effects types: 
    Force feedback periodic effects: 
    [00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ]
  * Number of simultaneous effects: 0

Uploading effect #0 (Periodic sinusoidal) ... Error:: Function not implemented
Uploading effect #1 (Constant) ... Error: Function not implemented
Uploading effect #2 (Spring) ... Error: Function not implemented
Uploading effect #3 (Damper) ... Error: Function not implemented
Uploading effect #4 (Strong rumble, with heavy motor) ... Error: Function not implemented
Uploading effect #5 (Weak rumble, with light motor) ... Error: Function not implemented
Enter effect number, -1 to exit

Regardless of what number I enter, my joystick behaves the same: it uses force to just center the stick. Probably just because the functions are not implemented. But then the same happens, regardless of which file I specify:

/dev/input/event0
/dev/input/event1
/dev/input/event...

Is it the case that my joystick is not supported? According to https://docs.kernel.org/input/joydev/joystick.html#microsoft-sidewinder-joysticks the Overdrive Protocol seems there.

What else could be missing?

ar flag
Please edit your question and add which distro and version of Linux you are using?
Hiran Chaudhuri avatar
in flag
Question updated.
Score:0
in flag

I may have come across the real issue. The kernel documentation https://docs.kernel.org/input/joydev/joystick.html#microsoft-sidewinder-joysticks lists these supported devices:

  • Microsoft SideWinder 3D Pro
  • Microsoft SideWinder Force Feedback Pro
  • Microsoft SideWinder Force Feedback Wheel
  • Microsoft SideWinder FreeStyle Pro
  • Microsoft SideWinder GamePad (up to four, chained)
  • Microsoft SideWinder Precision Pro
  • Microsoft SideWinder Precision Pro USB

Notice something? The Force Feedback 2 joystick is not listed. So I downloaded the kernel source code from https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.6.tar.xz and checked the file linux-6.1.6/drivers/input/joystick/sidewinder.c. It contains

static char *sw_name[] = {  "3D Pro", "GamePad", "Precision Pro", "Force Feedback Pro", "FreeStyle Pro",
                "Force Feedback Wheel" };

which matches the above list but again omits the Force Feedback 2 joystick. Seems to be a forgotten artifact.

Score:0
in flag

I stumbled across another command from the force feedback/joystick suite: evtest

Running this as root revealed a huge list of 23 devices but also mentioned their name:

# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
...
/dev/input/event23: Microsoft SideWinder Force Feedback 2 Joystick
Select the device event number [0-23]: 

With that hint, I ran fftest again and got this output:

# fftest /dev/input/event23
Force feedback test program.
HOLD FIRMLY YOUR WHEEL OR JOYSTICK TO PREVENT DAMAGES

Device /dev/input/event23 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

So it seems the Force Feedback 2 joystick is detected by the kernel, and it is known to support five different effects. Entering some effect number like 4 really makes the stick shake for a few seconds.

There is yet another nice command to play with:

ffcfstress -d /dev/input/event23

Check out https://github.com/flosse/linuxconsole:

Joystick utilities
------------------

The following utilities are provided to calibrate and test joysticks:
* ffcfstress, ffmvforce, fftest - test force-feedback devices
* ffset - set force-feedback device parameters
* jscal - calibrate joystick devices, reconfigure the axes and buttons
* jscal-store, jscal-restore - store and retrieve joystick device
  settings as configured using jscal
* jstest - test joystick devices
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.