Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input Device Reset Upon Launch #1209

Open
Chiitoo opened this issue Nov 12, 2024 · 7 comments
Open

Input Device Reset Upon Launch #1209

Chiitoo opened this issue Nov 12, 2024 · 7 comments

Comments

@Chiitoo
Copy link

Chiitoo commented Nov 12, 2024

Since 2.4 or so (not happening with the 2.3-archive), possibly when ever the input device settings were added, there seems to be some kind of a device reset upon launch, which I only noticed because my mouse sensitivity gets messed up due to this (similar to what happens if I re-plug the device after X11 is already running).

Indeed, if moving the mouse cursor around at the time, it will stop momentarily.

Additionally my keyboard numlock light flashes at the moment.

Even more additionally, a DualShock 4 gamepad seems to become "grabbed" in that it won't be visible even via evtest until the game is terminated.

A DualShock 2 gamepad isn't affected the same way, but they are in ways quite different hardware after all (I've seen the same thing happen with a .NET game before, but I suppose this might be about SDL).

Here's what dmesg has to say at the time:

[ 9363.213664] input: Logitech Logitech G710 Keyboard as /devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:10:00.0/usb3/3-6/3-6:1.0/0003:046D:C24D.0040/input/input133
[ 9363.301079] hid-generic 0003:046D:C24D.0040: input,hidraw2: USB HID v1.11 Keyboard [Logitech Logitech G710 Keyboard] on usb-0000:10:00.0-6/input0
[ 9363.374563] input: Logitech Logitech G710 Keyboard as /devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:0c.0/0000:10:00.0/usb3/3-6/3-6:1.1/0003:046D:C24D.0041/input/input134
[ 9363.427099] hid-generic 0003:046D:C24D.0041: input,hiddev97,hidraw3: USB HID v1.11 Keyboard [Logitech Logitech G710 Keyboard] on usb-0000:10:00.0-6/input1
[ 9363.437753] power_supply ps-controller-battery-58:10:31:42:4e:cf: power_supply_dev_release
[ 9363.574935] input: Logitech G403 Prodigy Gaming Mouse as /devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:08.0/0000:08:00.0/0000:09:0c.0/0000:0e:00.0/usb1/1-4/1-4:1.0/0003:046D:C083.0042/input/input136
[ 9363.574995] hid-generic 0003:046D:C083.0042: input,hidraw0: USB HID v1.11 Mouse [Logitech G403 Prodigy Gaming Mouse] on usb-0000:0e:00.0-4/input0
[ 9363.647077] input: Logitech G403 Prodigy Gaming Mouse Keyboard as /devices/pci0000:00/0000:00:02.1/0000:05:00.0/0000:06:08.0/0000:08:00.0/0000:09:0c.0/0000:0e:00.0/usb1/1-4/1-4:1.1/0003:046D:C083.0043/input/input137
[ 9363.699365] hid-generic 0003:046D:C083.0043: input,hiddev96,hidraw1: USB HID v1.11 Keyboard [Logitech G403 Prodigy Gaming Mouse] on usb-0000:0e:00.0-4/input1

Few notes on the system this is observed in:

Gentoo Linux with no systemd and no ACL support, but yes udev split from the systemd project.

Thank you!

@flibitijibibo
Copy link
Collaborator

That sounds like an SDL thing maybe - the joystick tests at https://github.com/libsdl-org/SDL/tree/main/test may behave the same way?

@Chiitoo
Copy link
Author

Chiitoo commented Nov 12, 2024

Would imagine SDL as well.

So far no luck with the tests included with release 2.30.7 (the main branch seems to not include a lot of them).

Will play with them a bit more later, and with different releases perhaps.

Thanks!

@flibitijibibo
Copy link
Collaborator

flibitijibibo commented Nov 12, 2024

One other quick test would be 2.3 and 2.4 with bleeding-edge SDL2 - a breakage would still be weird considering we aren't doing anything fancy with GameController but looking at the devices in question I wonder if libusb is fussing with the devices and causing them to restart; I eventually added a whitelisting system to SDL's libusb enumeration but I didn't think it screwed around with the endpoints just to enumerate them...?

@Chiitoo
Copy link
Author

Chiitoo commented Nov 12, 2024

I saw [SDL2] Reinit devices with SDL_HIDAPI_LIBUSB=ON [1] with a somewhat similar problem description earlier, but the variable doesn't appear to have any effect on this one.

I did not get to trying much more yet, but I did notice that, if I LD_PRELOAD="/usr/lib64/libSDL2-2.0.so" from libsdl2-2.30.7, the "reset" does not happen.

  1. [SDL2] Reinit devices with SDL_HIDAPI_LIBUSB=ON libsdl-org/SDL#8373

@flibitijibibo
Copy link
Collaborator

Just to be sure, here's a 2.30.7 binary from flibitBuild:

sdl2307.zip

If this one works we've got some kind of regression, but I'm not sure where in the Git timeline it happens...

@Chiitoo
Copy link
Author

Chiitoo commented Nov 15, 2024

This one indeed does seem to normalise things for me!

Let me know if there's anything else I can do on my side to pin and point at the issue.

Thank you!

@Chiitoo
Copy link
Author

Chiitoo commented Nov 15, 2024

Also, I did see SDL-release-2.30.0-14-g0f6a682ea in the shipped so, and thought I could re-produce the issue with that commit but... after some more tests, I couldn't any longer, so I probably fumbled something at some point there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants