-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Eruption sometimes fails to initialize a device connected via a KVM-Switch #161
Comments
Hi @SHU-red, thanks for this excellent bug report!
Yes, I think that this is exactly the way it works... When Eruption fails to initialize the device after being hotplugged by the KVM switch, what does the following command report? sudo systemctl list-units --failed I suspect that the The failed state can be cleared by running the following command: sudo systemctl reset-failed In case the sudo eruption-hotplug-helper hotplug Does the running |
Seems that eruption is not in failed state afterwards, but the keyboard does not load my configuration and also has a "default-behavior" Thank you for taking the time |
@SHU-red So a failed service does not seem to be the cause for Eruption failing to initialize the device. There apparently is some unknown interaction when the KVM switch is involved. Please post the output of the following command: sudo udevadm monitor Most relevant would be the output that is generated while the KVM switch hot-plugs the device. I am interested in the differences between hot-plugging the device via the KVM switch as opposed to plugging it directly into the USB root hub. |
@SHU-red I did some research on this... It seems that this class of problems is rather common when using KVM switches... Could you please verify that the following issues are ruled out, if you have not already done so:
Could you post the output of: sudo lsusb --tree -vvv and the output of: sudo lsusb -vvv Thank you for your support in getting this working! |
Self Powered |
Im not very deep into this but the KVM-Switch is connected via USB-C - USB-C cable to one of my red USB 3.1 plugs
Yes, via pressing Shift + Shift you can switch between the PCs Just tell me what i should do and it would be a pleasure for me to contribute |
@SHU-red Thanks for your support! It is much appreciated! Could you please post the output of the following command, while hot-plugging the keyboard device using the KVM switch? Please switch between the Linux PC and Windows PC while the following command is running on Linux: sudo udevadm monitor |
|
@SHU-red Thanks, that was quick! :-) Looks perfectly normal on first glance... Could you please post the output of the following commands, while switching between Linux PC and Windows PC multiple times. I would like to get the logs of the error case where the sudo journalctl -u eruption.service --follow
sudo journalctl -u eruption-hotplug-helper.service --follow |
These messages have already been there directly after starting the upper command
|
@SHU-red Okay, no errors related to hotplug logged at all... Then we need more detailed logs. Please edit: sudoedit /usr/lib/systemd/system/eruption.service Please switch to the
Reload service control manager config and sudo systemctl daemon-reload
sudo systemctl restart eruption.service Please post the output of the command below that is generated while switching multiple times between Linux PC and Windows PC, until sudo journalctl -u eruption.service --follow |
Yes, please also try other USB 2.x, 3.0 and 3.1 ports on the Linux PC if possible. I don't really believe that this is the culprit though... I have a gut feeling that this is a bug with the driver code in |
OK for some reason the behavior was different now
|
Im not 100% sure because the behavior seems to change sometimes but using other USB-Slots does not solve all problems it seems |
Introduce a short delay after each step of the initialization sequence. This is a try to fix a problem with failing device initialization, seen on some KVM switches. References #161
Yes i will try Could you just give me a quick hint how to switch to the develop path in my case? |
@SHU-red Thank you for your support! To build Eruption from source please perform the following steps:
sudo pacman -Sy libevdev hidapi systemd-libs dbus libpulse lua lua-socket gtksourceview4
sudo pacman -Sy pkgconf cmake protobuf xorg-server-devel libxrandr gtk3
git clone https://github.com/X3n0m0rph59/eruption.git
cd eruption
git switch develop
make
make stop; sudo make install
make start For detailed instructions please refer to INSTALL.md Please double check that you are running the latest version of Eruption from
|
Executing
tried the following line after searching a bit
i read, that installing |
I am not very proficient using anaconda... Could you try to set up your Rust environment using rustup? curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh The instructions from INSTALL.md are most likely to work! |
1st im so sorry that i did oversee the rustup thing
|
Hi @SHU-red,
That's no problem at all! I am very grateful that you are offering your help in getting this bug narrowed down! Edit: Please try to install the dependency first, before trying to uninstall pacman -Sy libtiff I just tried to build the conda uninstall libtiff Fixed it for some users... |
OK i think it worked
Could be, that my settings have got lost because i "only" backed up Then i re-performed:
And this is the generated log after multiple times of switching back and forth (and also switching profiles via Fn-F1-4) Basically i think it seems to work but im not sure because of the changing nature of the problem
|
Introduce a short delay after each step of the initialization sequence. This is a try to fix a problem with failing device initialization, seen on some KVM switches. This patch shortens the delay somewhat and places it in front of the status polling loop. This is done to avoid introducing lag due to excessive sleeping. References #161
OK, great! Glad that you were able to successfully build the project!
Eruption stores its state (runtime configuration) in multiple places. Namely in the user's home directory at Edit: Maybe you forgot to insert the paths into
Yes, that sounds plausible...
Apparently the delay is way too long then... I have updated the driver code and moved the delay outside of the polling loop. Additionally I reduced the sleep time as well.
Please try the following command and see if it fixes the problem: eruptionctl config soundfx false
OK, thanks for bringing this to my attention! I will have a look at the code in question... Thanks again for your patience and continued support! The next steps would be to re-build and install Eruption from the latest commit in the In the base directory where the Eruption source code resides, please execute the following commands: git switch develop
git pull origin develop
make && make stop; sudo make install; sudo sed -i 's/testing/experimental/' /etc/eruption/eruption.conf; make start This will pull the latest commits from the eruption -V
Eruption 0.3.0 (0.2.0.r88.gd470f495) (release build) |
I did run
Keyboard stayed black until i pressed FN-F1-F4 then
then
No sound anymore while typing
This try felt very good to me |
Switch `hidapi` backend from `libusb` to the linux-specific `hidapi-hidraw`. Update `FRAME_GENERATION_COUNTER` on device hotplug, to ensure that the device is in a known state. References #161
OK mate, I recognized, that when my Windows PC is off, this must be the situation which reproducable causes problems! Situation:
To filter-out the annoying "standard-errors" i have, i excluded the word "closed" Does this help?
|
Update `FRAME_GENERATION_COUNTER` when polling the device status, to ensure that disconnected devices are flagged as failed. References #161
It seems that device hotplug hangs because the Please test again with the latest commits from the In the base directory where the Eruption source code resides, please execute the following commands: git switch develop
git pull origin develop
make && make stop; sudo make install; sudo sed -i 's/testing/experimental/' /etc/eruption/eruption.conf; make start This will pull the latest commits from the develop branch, compile Eruption, install it, enable experimental driver code and finally start the eruption daemons. eruption -V
Eruption 0.3.0 (0.2.0.r94.gf0057f8e) (release build) |
After installing
the keyboard went black and stayed like this even after typing switching Linux > Win > Linux, it came back and loaded a only red profile with no effects This now is the log with Win-PC ON:
This is the log with WinPC OFF
I think this could be it 😄 |
Lower the timeout somewhat and see if it still working References #161
One last thing
|
Hi @SHU-red, thanks for testing the patches and sorting things out! Just to check whether my understanding is correct, switching between PCs is working now for you most of the time? No more problems with Eruption failing to initialize the keyboard? If that is correct, then the root cause of the problem was indeed a timing issue.
Since the problem you encountered seems to be related to a timing issue and the current fix only touches the driver for the The next step would be for me to fix the driver code of every supported device to adhere more to the USB specs.
I would recommend you to (re-)install the latest git snapshot package using: paru eruption-git |
In combination with slow USB hubs or KVM switches, some drivers apparently fail to initialize due to too strict timing constraints. So be more lenient with timings, and increase the time we wait between issuing of commands Referencs #161
In combination with slow USB hubs or KVM switches, some drivers apparently fail to initialize due to too strict timing constraints. So be more lenient with timings, and increase the time we wait between issuing of commands. Fix some more timing issues Referencs #161
I would agree with that
Thanks
Thank you for your hard work! |
@SHU-red OK, great! Glad that it is working now!
Yes, so you are currently running
You are welcome! I will leave this issue open for a while, and even going to pin it, so that others can chime in if they are encountering the same problem as well! |
Hi, just to report it also fix the issue, for the integrated KVM of the Philips 439P9H ultrawide monitor with the Vulcan 120. |
Ok, In general this is a very tough task and also causes difficulties with audo etc. I did not expect eruption to work with this out of the box and i am absolutely not sure if eruption even has something to do with this but for me it does not work also after restarting the eruption.service So im carefully asing if i can provide you some logs or execute some tasks to maybe find out that there may be a possible fix for my (and maybe someone others) special case? By Keyboard is generally working but eruption does not seem to recognize something During executing sudo systemctl restart eruption.service:
|
Hi @SHU-red, thanks for reporting your findings! This looks suspiciously like the USB initialization problem! I believe this issue can be fixed by increasing the timeouts, which should not be a problem anymore, soon... I recently implemented parallel device-probing and parallel initialization (already available in the With parallel probing and initialization, the total startup time of Eruption is the time it takes the slowest device to come up. In the meantime: If you feel comfortable with compiling Eruption from source, I can prepare a patch with much larger timeouts, otherwise you would have to wait for the next release. |
This sounds very promising and im glad that my problem may be solvable I fully aggree with your proprosal: On the other hand, i want to offer you to build and check/debug these future upgrades for you So i will do nothing and hope that in the future magically eruption starts working for me again I can not thank you enough for your effort! |
This should help slow USB hubs and KVM switches References #161
Hi there, Still running my 4K KVM setup |
Sorry i do not want to annoy you! |
Introduction
Describe The Problem To Be Solved
Describe the Solution
My System
Kernel: 5.19.9-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
Desktop: awesome v: 4.3-1529-gbde785ee6 vt: 1 dm: SDDM
Distro: Manjaro Linux base: Arch Linux
And i am switching between a LINUX PC and a WINDOWS PC
If i can provide a log which is helping you, please describe shortly exactly what commands i shall use to be able to provide the log
The text was updated successfully, but these errors were encountered: