mattanger / ckb-next

RGB Driver for Linux and OS X
http://forum.corsair.com/v3/showthread.php?t=133929
GNU General Public License v2.0
655 stars 76 forks source link

[Bug Report] udev detects ckb devices as joysticks #357

Closed WtGuy closed 6 years ago

WtGuy commented 6 years ago

Edit: Formally labelled as Daemon - Dota 2 - Text Box de-focuses when typing the letter 'h'


Devices information

ckb-dev-detect-report.gz


Bug report

General information

Source

My program was acquired using the Arch Linux Aur package ckb-next-git. Just in case, I also tried ckb-next from the aur (standard) and downloading from source and compiling. All methods displayed the same issue.

Branch

master on the time I tried from source.

Logs & crash reports

N/A

What is the program's current behavior?

This is a bug specific to Dota 2 which has been described in detail here. Essentially, using the letter 'h' in any text box instance (minus the console) causes the focused box to become de-focused. This only happens when the ckb-next-daemon is running and from the linked issue, is not an isolated case.

What is the expected behavior of the program?

Text boxes should function as normal and type the letter 'h'

Any other notes & comments?

Please view the attached issue linked above for more details. I will try and get other users to also submit their information in this issue to hopefully determine the root cause. Note that I initially thought this was a bug with Dota 2, but with other users coming out and having the same issue specifically using ckb-next, I figured it may be beneficial to submit a bug report here

ghost commented 6 years ago

Does the issue happen when you don't use ckb-next? Execute

sudo systemctl stop ckb-daemon

and then launch the game.

Ravenslofty commented 6 years ago

@light2yellow: This only happens when the ckb-next-daemon is running

Ravenslofty commented 6 years ago

@WtGuy We'll investigate, but just as a start, can you compare what xev prints for typing the h key with and without ckb-daemon running?

tatokis commented 6 years ago

@WtGuy Can you please download, compile, and run sdl2-jstest with ckb-daemon running?

./sdl2-jstest -l

You can find it here https://github.com/Grumbel/sdl-jstest

tatokis commented 6 years ago

I should add that I am unable to reproduce this bug on my machine, running Ubuntu 16.04.

WtGuy commented 6 years ago

First of all, a great thank you for the fast response. I know this is free open source software and sometimes, these things can take a bit.

@ZirconiumX I've attached two txt files associating to both the daemon running and not running.

@tatokis I've attached the txt report from the run and have tried the ckb software without my controller plugged in as well with the same results. Also, as a side note, I believe someone in the other issue posted had said they were having the issue with Ubuntu 17.10, so it may be a newer package problem.

KuriKai commented 6 years ago

Here are the results of running the command on my computer

Operating System: Ubuntu 17.10 Kernel: Linux 4.14.1-041401-generic Architecture: x86-64

sdl2-jstest.txt xev-with-ckb-next-daemon.txt xev-without-ckb-next-daemon.txt

Ravenslofty commented 6 years ago

Progress update: We think this is actually an issue in libinput. @tatokis can't reproduce on Ubuntu 16.04, because that version of Ubuntu uses evdev for input, while Ubuntu 17.10 and Arch both use libinput. After firing up a VM with 17.10, we can now reproduce. Either way, the problem isn't actually SDL's fault.

Can we get the topic renamed please? How about "libinput detects ckb devices as joysticks"?

tatokis commented 6 years ago

Quick update, turns out it's newer udev versions marking our virtual devices as a joysticks. Have been looking for a way of specifying the device type in uinput, however I can't seem to find anything so far.

In the meantime, this can be confirmed by running

udevadm info -p /sys/devices/virtual/input/inputXX/eventYY | grep ID_INPUT_

Where XX and YY are the appropriate IDs.

On my computer, there is no JOYSTICK entry:

$ udevadm info -p /sys/devices/virtual/input/input35/event22 | grep ID_INPUT_
E: ID_INPUT_KEY=1
E: ID_INPUT_KEYBOARD=1
E: ID_INPUT_MOUSE=1
WtGuy commented 6 years ago

Updated title and put a little comment in the issue information to list its former description as to not confuse new people coming over from the other thread

Ravenslofty commented 6 years ago

Our current solution is to create udev rules to remove these attributes. It's a hack, but oh well.

tatokis commented 6 years ago

We have a udev rule that appears to work. It would be appreciated if you could test it.

ACTION=="add|change", SUBSYSTEM=="input", ATTRS{name}=="ckb[0-9]: [A-Za-z0-9]*", ENV{ID_INPUT_JOYSTICK}=""

Install it in /etc/udev/rules.d/99-ckb-daemon.rules and restart ckb-daemon.

This should hopefully fix the issue.

fgblomqvist commented 6 years ago

Just tried it and it works, kudos to you!

KuriKai commented 6 years ago

This also works for me, thanks!

Baguettedood commented 6 years ago

The udev rule fixes my issues with Rocket League which I mentioned in the IRC a while ago. It looks like the issue arose in (what is most likely the udev rules included in) systemd 234, and remains in systemd 235.

WtGuy commented 6 years ago

Good to go here as well. Thank you for the fast resolution.

On a side note: I didn't close this issue on this comment in case you guys wanted to keep it open as a reference to potentially provide a more permanent fix in the future. If not needed, don't hesitate to close the issue.

Ravenslofty commented 6 years ago

@tatokis Should we create a PR for this and merge it?

tatokis commented 6 years ago

@ZirconiumX Sure. Find the right place to put it in the repo, you can commit the udev rule and I can modify quickinstall if you're okay with that. We should poke the maintainers that don't use quickinstall and tell them to manually install the rule too.