我想知道我的力量反馈操纵杆在Ubuntu中到底支持了多少。目前我已经安装了Ubuntu20.04.05LTS。
到目前为止我还能跑
$ lsusb
...
Bus 001 Device 006: ID 045e:001b Microsoft Corp. SideWinder Force Feedback 2 Joystick
...
$和
$ 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它们看起来都工作得很好,所以基本的操纵杆功能很好。接下来,我想检查强制反馈功能。我读了https://docs.kernel.org/input/ff.html,于是试着
$ 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但是,文档讨论了一些eventXX设备文件。不幸的是,它没有提到使用哪一个。因此,我将我的用户添加到input组中,并尝试
$ 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不管我输入的是什么号码,我的操纵杆的行为都是一样的:它使用武力来将操纵杆居中。可能仅仅是因为这些函数没有实现。但是,无论我指定哪个文件,都会发生相同的情况:
/dev/input/event0
/dev/input/event1
/dev/input/event...是因为我的操纵杆不支持吗?根据https://docs.kernel.org/input/joydev/joystick.html#microsoft-sidewinder-joysticks的说法,过载协议似乎就在那里。
还可能缺少什么?
发布于 2023-01-14 16:06:02
我偶然从部队反馈/操纵杆套件中发现了另一个命令: evtest。
将它作为root运行显示了23台设备的巨大列表,但同时也提到了它们的名称:
# 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]: 有了这个提示,我又跑了一圈,得到了这样的输出:
# 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因此,原力反馈2操纵杆似乎是由内核检测到的,它支持五种不同的效果。输入一些效果数字,如4,确实使棒摇了几秒钟。
还有另一个很好的命令可玩:
ffcfstress -d /dev/input/event23查看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发布于 2023-01-14 14:40:11
我可能遇到了真正的问题。内核文档https://docs.kernel.org/input/joydev/joystick.html#microsoft-sidewinder-joysticks列出了这些受支持的设备:
注意到什么了吗?没有列出原力反馈2操纵杆。所以我从https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.6.tar.xz下载了内核源代码,并检查了文件linux-6.1.6/drivers/input/joystick/sidewinder.c。它包含
static char *sw_name[] = { "3D Pro", "GamePad", "Precision Pro", "Force Feedback Pro", "FreeStyle Pro",
"Force Feedback Wheel" };这符合上述列表,但再次省略原力反馈2操纵杆。似乎是个被遗忘的艺术品。
https://askubuntu.com/questions/1450181
复制相似问题