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

Keyboard not detected if connected after service start #39

Open
Sudrien opened this issue Nov 16, 2019 · 3 comments
Open

Keyboard not detected if connected after service start #39

Sudrien opened this issue Nov 16, 2019 · 3 comments

Comments

@Sudrien
Copy link

Sudrien commented Nov 16, 2019

I'm running "sidewinderd version 0.4.0" on Manjaro

I just got a "Port 2 Computers Peripheral Switcher" to... easily switch my USB inputs between computers.

If I boot with the keyboard switched to the booting computer, everything is fine. Sidewinderd picks up on the keyboard (a G105) after switching away and back.

If I forget and switch to to proper computer after boot, keyboard and mouse are picked up, but the macro keys don't activate until I restart the service.

Maybe this is a udev rule to be written?

@tolga9009
Copy link
Owner

Hi Sudrien,

thanks for the bug report. We have a monitoring function, which checks for newly attached USB devices and loads the correct drivers for it. More specifically, we wait for a udev "add" action - the corresponding code can be found here: https://github.com/tolga9009/sidewinderd/blob/master/src/core/device_manager.cpp#L99.

If I boot with the keyboard switched to the booting computer, everything is fine.

If I forget and switch to to proper computer after boot [...] the macro keys don't activate until I restart the service.

This suggests DeviceManager::discover() works but doesn't get called in that situation. I suspect due to your USB peripheral switcher, udev "add" action doesn't happen. In order to further pin down the issue, I'd like you to test the following:

  1. Disconnect the USB Switcher, boot up your PC and connect the keyboard to it (w/o USB switch). Is the G105 now correctly detected and handled by sidewinderd?

  2. Restore your cable wiring and switch USB Switcher to "other PC" position. Boot up your PC and post the results of lsusb -v command (you may need to run sudo lsusb -v, if the command shows no output). Now switch to "current PC" position and post your results of lsusb -v again. You can use https://gist.github.com/ for uploading your lsusb outputs.

I think we may also need help from udevadm helper tool, in order to understand what exactly is going on in that moment. However, since it's been a while, I need to re-familiarize myself with it, so I can guide you how to get the information we need.

Cheers,
Tolga

@tolga9009
Copy link
Owner

tolga9009 commented Nov 21, 2019

Additional to the post above, please do the following:

  1. Boot your PC, while the USB switch is configured to "other PC".
  2. Run udevadm monitor --subsystem-match=usb --property in a terminal.
  3. Switch the USB switch to "this PC"
  4. Use Ctrl + C in order to stop the udevadm monitor and post the complete output to https://gist.github.com/. Also post your dmesg there using dmesg > dmesg.log, so we can check what's happening with your USB early on.

After reading more on this topic, I expect udev action "change" instead of "add". Would make sense sidewinderd is missing that event, as we're only watching for "add". But I'm waiting for you to verify my assumption.

Cheers,
Tolga

@Sudrien
Copy link
Author

Sudrien commented Nov 22, 2019

Ok, after trying to collect the data, the behavior is a little different than I thought it was.

On the first switch after a G105-less bootup (hub set to computer 2, switch back to 1), M1/M2/M3/MR sometimes, light up, but if the don't they will light up on first touch. Macro keys work as programmed.

After subsequent toggles of the hub( back to computer 2, then back to computer 1 again), Memory WILL NOT light up & macro keys do not function as expected.

--

Boot with keyboard on alternate hub output - https://gist.github.com/Sudrien/f4b6c68f44170022162b5ca30794f5a4

Boot with keyboard on alternate output, then switched - https://gist.github.com/Sudrien/d8c3b7065da9abac372eb0c8e884f9b3

udevadm of connection - things work as expected? https://gist.github.com/Sudrien/9fea6f27171a514bfd93af62a0405e32

dmesg of connection - https://gist.github.com/Sudrien/c183771bdea3c896a02a861335462a0b

2nd switch back loses both lights and function - https://gist.github.com/Sudrien/a08fb51fe829df2975954ab985446261

multiple switches dmesg - https://gist.github.com/Sudrien/e2aee498d2efc0dd84c7670268de9980

lsusb with confirmed malfunctioning macro keys - https://gist.github.com/Sudrien/ae63de67050c644c0b56bddcbc3bdf80

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

No branches or pull requests

2 participants