Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Weird X behavior with FR-Tec Joystick(Rebranded VKB Gladiator Mk.II) (Read 328 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Weird X behavior with FR-Tec Joystick(Rebranded VKB Gladiator Mk.II)

Dear Artix community,

I've been experiencing a strange minor issue with my FR-Tec Raptor Mach 2 joystick which I recently found out is in fact a rebranded VKB Gladiator Mk. II, if that makes any difference.

The behavior is as follows:

  • Boot up, enjoying OpenRC speed.
  • Check if Joystick is detected, using AntiMicroX or Steam
  • No joystick is detected
  • Pkill Xorg
  • Log in again
  • Check for Joystick with same tools
  • Joystick is perfectly detected and works flawlessly

Indeed it's a minor issue, I just have to re-login once if I want to play any flight sims/games, however I'm still curious and the Internet yielded few answers.

So, here's my xorg.conf.d:

Code: [Select]
yuri@~›—» ls /etc/X11/xorg.conf.d/
01-modules.conf  05-devices.conf  10-input  15-quirks.conf  20-monitors.conf  25-screens.conf  45-joysticks.conf  99-layout.conf

Here are the contents of 45-joysticks.conf

Code: [Select]
/etc/X11/xorg.conf.d/45-joysticks.conf 
# Set up Joysticks

Section "InputClass"
Identifier "Joystick"
MatchisJoystick "on"
MatchDevicePath "/dev/input/event*"
MatchDevicePath "/dev/input/js*"
Driver "evdev"
EndSection

Due to the 40k character limit, I'll attach the  Xorg logs at boot and after resetting, "Xorg.0.log" is after pkill and "Xorg.0.log.old" is the previous one at boot.

The actual relevant lines as far as I'm concerned at boot are:
Code: [Select]
[     9.700] (II) config/udev: Adding input device Sanmos Group FR-TEC Raptor MACH 2 (/dev/input/js0)
[     9.700] (II) No input driver specified, ignoring this device.

and

[     9.838] (II) config/udev: Adding input device Sanmos Group FR-TEC Raptor MACH 2 (/dev/input/event20)
[     9.838] (II) No input driver specified, ignoring this device.
[     9.838] (II) This device may have been added with another device file.


And the lines X after pkilling it, you'll notice that I'm running libinput now because I played a bit with /usr/share/X11/xorg.conf.d to see if it changed anything, however it does not in the slightest, other than mice and keyboards being assigned libinput, they still work the same though.

Code: [Select]
[   342.495] (II) config/udev: Adding input device Sanmos Group FR-TEC Raptor MACH 2 (/dev/input/event20)
[   342.495] (II) No input driver specified, ignoring this device.
[   342.495] (II) This device may have been added with another device file.
[   342.496] (II) config/udev: Adding input device Sanmos Group FR-TEC Raptor MACH 2 (/dev/input/js0)
[   342.496] (II) No input driver specified, ignoring this device.

What really stumps me is that I'm pretty sure I specified "evdev" for the driver, and also that the device is in fact always recognized by udev when calling udevadm from the terminal. Plus, the fact simply forcing X to restart the rough way makes it "just work" is also very confusing.

I welcome all suggestions/ideas, this question is definetly more curiosity on how Xorg works internally and knowing how to configure it than to actually needing to fix anything.

Also, if I missed any of the guidelines, please advise so that I may correct immediately.

Thanks to all in advance!
Have a great one!

Re: Weird X behavior with FR-Tec Joystick(Rebranded VKB Gladiator Mk.II)

Reply #1
So, quick update after some more digging.

I just saw that the X configuration file was wrongly written by me, specifically:

Code: [Select]
MatchisJoystick   "on"

Should be

MatchIsJoystick "on"

That is now fixed, unfortunately the strange behavior persists and everything seems to point to Xorg being unable to recognize the Joystick as a Joystick, in fact, all the logs after changing some trivial parameter in the configs and restarting Xorg (by my equivalent of Ctrl+Alt+Backspace, Super+Shift+Esc) keep showing that all devices are added with either evdev or libinput, BUT the Joystick.

So, how is Xorg not detecting the Joystick, but somehow after pkill Xorg it still doesn't detect the Joystick but games magically can?

Again, this is incredibly strange and I'm all out of ideas to test, check, etc...

Any input(pun intended) is highly appreciated.

Have a great one!

Re: Weird X behavior with FR-Tec Joystick(Rebranded VKB Gladiator Mk.II)

Reply #2
From the Arch wiki:
Quote
/dev/input/jsX maps to the Joystick API interface and /dev/input/event* maps to the evdev ones (this also includes other input devices such as mice and keyboards).
And in their examples below there's only one line with MatchDevicePath
So, maybe try removing the  MatchDevicePath "/dev/input/js*"  line from your config?

Re: Weird X behavior with FR-Tec Joystick(Rebranded VKB Gladiator Mk.II)

Reply #3
Hi, and thank you for the suggestion!

I commented out the "js*" MatchDevicePath, and I got these lines:
Code: [Select]
[    10.270] (II) config/udev: Adding input device Sanmos Group FR-TEC Raptor MACH 2 (/dev/input/js0)
[    10.270] (II) No input driver specified, ignoring this device.

and then:

[    10.750] (II) config/udev: Adding input device Sanmos Group FR-TEC Raptor MACH 2 (/dev/input/event20)
[    10.750] (**) Sanmos Group FR-TEC Raptor MACH 2: Applying InputClass "Joystick"
[    10.750] (II) Using input driver 'evdev' for 'Sanmos Group FR-TEC Raptor MACH 2'
[    10.750] (**) Sanmos Group FR-TEC Raptor MACH 2: always reports core events
[    10.750] (**) evdev: Sanmos Group FR-TEC Raptor MACH 2: Device: "/dev/input/event20"
[    10.810] (--) evdev: Sanmos Group FR-TEC Raptor MACH 2: Vendor 0x11c0 Product 0x5606
[    10.810] (--) evdev: Sanmos Group FR-TEC Raptor MACH 2: Found absolute axes
[    10.810] (--) evdev: Sanmos Group FR-TEC Raptor MACH 2: Found x and y absolute axes
[    10.810] (II) evdev: Sanmos Group FR-TEC Raptor MACH 2: Forcing relative x/y axes to exist.
[    10.810] (II) evdev: Sanmos Group FR-TEC Raptor MACH 2: Configuring as mouse
[    10.810] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:02.1/0000:04:00.0/0000:05:0c.0/0000:10:00.0/usb1/1-9/1-9.1/1-9.1:1.0/0003:11C0:5606.0002/input/input20/event20"
[    10.810] (II) XINPUT: Adding extended input device "Sanmos Group FR-TEC Raptor MACH 2" (type: MOUSE, id 9)
[    10.810] (II) evdev: Sanmos Group FR-TEC Raptor MACH 2: initialized for relative axes.
[    10.810] (WW) evdev: Sanmos Group FR-TEC Raptor MACH 2: ignoring absolute axes.
[    10.810] (**) Sanmos Group FR-TEC Raptor MACH 2: (accel) keeping acceleration scheme 1
[    10.810] (**) Sanmos Group FR-TEC Raptor MACH 2: (accel) acceleration profile 0
[    10.810] (**) Sanmos Group FR-TEC Raptor MACH 2: (accel) acceleration factor: 2.000
[    10.810] (**) Sanmos Group FR-TEC Raptor MACH 2: (accel) acceleration threshold: 4


Which should mean it's fixed, alas the behavior persists, applications will not detect the joystick until Xorg is pkilled.

Then I removed the "event*" MatchDevicePath and I got this:

Code: [Select]
[    10.412] (II) config/udev: Adding input device Sanmos Group FR-TEC Raptor MACH 2 (/dev/input/event20)
[    10.412] (II) No input driver specified, ignoring this device.
[    10.412] (II) This device may have been added with another device file.
[    10.413] (II) config/udev: Adding input device Sanmos Group FR-TEC Raptor MACH 2 (/dev/input/js0)
[    10.413] (**) Sanmos Group FR-TEC Raptor MACH 2: Applying InputClass "Joystick"
[    10.413] (II) Using input driver 'evdev' for 'Sanmos Group FR-TEC Raptor MACH 2'
[    10.413] (**) Sanmos Group FR-TEC Raptor MACH 2: always reports core events
[    10.413] (**) evdev: Sanmos Group FR-TEC Raptor MACH 2: Device: "/dev/input/js0"
[    10.466] (EE) evdev: Sanmos Group FR-TEC Raptor MACH 2: Unable to query fd: Invalid argument

Which is new. After a quick search I came accross this:
Linux Gamepad No Input Events

Even though it's not quite the same since I do get all the input events after pkilling it, the fact that PreInit seems to need a response that the gamepad/Joystick won't return could very well be the cause. Therefore not really an Xorg issue.

So I pkilled Xorg to check the logs after to see if then there is no complaint, however:

Code: [Select]
[   403.375] (II) config/udev: Adding input device Sanmos Group FR-TEC Raptor MACH 2 (/dev/input/js0)
[   403.375] (**) Sanmos Group FR-TEC Raptor MACH 2: Applying InputClass "Joystick"
[   403.375] (II) Using input driver 'evdev' for 'Sanmos Group FR-TEC Raptor MACH 2'
[   403.375] (**) Sanmos Group FR-TEC Raptor MACH 2: always reports core events
[   403.375] (**) evdev: Sanmos Group FR-TEC Raptor MACH 2: Device: "/dev/input/js0"
[   403.433] (EE) evdev: Sanmos Group FR-TEC Raptor MACH 2: Unable to query fd: Invalid argument
[   403.473] (EE) PreInit returned 2 for "Sanmos Group FR-TEC Raptor MACH 2"
[   403.473] (II) UnloadModule: "evdev"

The full logs are attached as:
Xorg.0.log.event.txt => The log where only 'MatchDevicePath "/dev/input/event*"' is present, taken right after reboot.
Xorg.0.log.js.txt => The log where only 'MatchDevicePatch "/dev/input/js*"' is present, taken right after reboot.
Xorg.0.log.js_pkill.txt => The log where only 'MatchDevicePatch "/dev/input/js*"' is present, taken after "pkill Xorg".

If in the end it's a matter of hardware, then I'll just mark the thread as solved and move on pkilling Xorg, however if anyone has an idea on how to "fix"/patch/work around this behavior or any other logs to check, I'll be grateful.

Thank you kindly to all in advance!
Have a great one!


 

Re: Weird X behavior with FR-Tec Joystick(Rebranded VKB Gladiator Mk.II)

Reply #4
Hi again!

Playing around with launching non-steam games with proton I came accross this interesting piece looking at the logs when exiting Steam completely:

Code: [Select]
Removing HIDAPI device 'Sanmos Group FR-TEC Raptor MACH 2' VID 0x11c0, PID 0x5606, bluetooth 0, version 1026, serial NONE, interface 0, interface_class 0, interface_subclass 0, interface_protocol 0, usage page 0x0001, usage 0x0004, path = /dev/hidraw1, driver = NONE (DISABLED)

So Steam does recognize the Joystick, both at boot and after pkilling Xorg, however it shows the exact same log in both cases.

Searching a bit more on the net I came across this nice wiki which advises to use the xf86-input-joystick driver for Xorg.
The thing is that it's not on official repos anymore so you need to get it from the AUR, which can be done no problem, however the driver itself tells you to not use it for games with native Joystick support.
Since the Joystick is in fact detected by Steam and other games(fgfs, X-Plane...), It shouldn't necessarily solve the issue to install the old driver.

All in all, it seems to be a hardware issue. Some response bytes are probably not being sent to Xorg so it can't actually assign a driver, but for some magical reason after rebooting only Xorg by pkilling it programs can then understand the Joystick.

I'm marking the thread as "Solved" since even though it's technically not solved, it still can help someone in the same position to know that they need to pkill Xorg instead of being 6 hours at their computer trying all the small tweaks with no success.

If anyone else wants to give a suggestion, feel welcome to message me on this nice forum.

Have a good one!