[SOLVED] Fluxbox USB keyboard stops responding after disconnect/reconnect
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Fluxbox USB keyboard stops responding after disconnect/reconnect
Hello, LQ. This has been a minor annoyance for a long time. I have searched several times here and using Google and haven't found an answer.
I have multiple computers connected to my monitor on its various inputs, and to share the same keyboard with them I use a 4-port USB switch like this. Switching works fine but when using Fluxbox on this computer and after having switched from/back to it the keyboard works for one keystroke then stops until X is xlosed.
Example: Computer #1 is on button A of the switch and HDMI1 of the monitor. I'm working in an xterm window in Fluxbox, then switch to computer #2 on HDMI2 and push button B to switch the keyboard to it. Few minutes later I return to computer #1 and push button A to return the keyboard and mouse to computer #1. I begin to type something into xterm, and the first letter appears then stops responding - and it does not respond in any other app including the hotkey for the menu and Ctrl+Alt+BkSpc to close X. I have to use the mouse to open the menu and choose Exit to return to the console where the keyboard works again.
The mouse is not connected to the switch as it only takes one input and the other computers don't need a mouse. The keyboard has backlit keys and when it stops responding the backlight is still on; and the caps lock, num lock, and scroll lock keys still toggle their indicators.
As a test I have taken the keyboard off of the switch and plugged it directly into the computer. I then started Fluxbox, unplugged the keyboard, reconnected it, and the same behavior happens. I then tried it on different USB ports and get the same thing. Then I tried a different keyboard without backlight and get the same thing. The mouse does not exibit this behavior.
As another test I tried KDE and XFCE and it does not happen in those DEs. Also, if X is not started it does not happen. Also also, if I boot this computer into Windows it does not happen.
Thanks for the replay and the idea. I'll try it later if nobody else chimes in.
I just remembered another detail. I first noticed this behavior 5-6 years ago when I was using a Trendnet KVM with VGA monitor connectors and separate USB inputs for mouse and keyboard. During that time the keyboard did this same thing after switching between computers, but the mouse was unaffected. That began not long after Slackware 14.2's release and while using 4.4.x kernels, then 4.10.x, and more recently the 5.4.x and 5.10.x
I first noticed this behavior 5-6 years ago when I was using a Trendnet KVM
I've used a KVM for years. Although I'm not running Slackware on bare metal at the moment (I do have a VM), I did not have any such problem with Slackware under Fluxbox. Currently, the two computers connected to the KVM are running Magiea and Ubuntu MATE with Fluxbox. Again, no issues.
If it works in KDE and XFCE, but not in Fluxbox, perhaps you need a DBUS notification service running in Fluxbox.
As a test, you could try starting a background instance of xfce4-notifyd from a terminal in Fluxbox with
allend, I think that is working. I launched nm-applet wifi manager which loads some background dbus stuff including notifyd. Then I switched to-and-from a few times without a problem. But I think I will try it a few more times before I am fully convinced.
frankbell, does your Fluxbox have similar background services running?
If the issue is related to dbus, edit; /etc/X11/xinit/xinitrc.fluxbox
Code:
# Start the window manager:
if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
exec ck-launch-session /usr/bin/startfluxbox
else
#exec /usr/bin/startfluxbox
exec dbus-launch /usr/bin/startfluxbox
fi
Ok, I did a few more tests. First I launched Fluxbox again with almost all of my startup apps disabled - only fbsetbg and gkrellm left. After startx I launched the mrxvt terminal and checked ps x
Code:
PID TTY STAT TIME COMMAND
1482 tty1 Ss 0:00 -bash
1785 pts/0 Ss+ 0:00 bash
2298 tty1 S+ 0:00 /bin/sh /usr/bin/startx -- -dpi 92
2322 tty1 S+ 0:00 xinit /home/daniel/.xinitrc -- /usr/bin/X :0 -dpi 92
2330 tty1 S 0:00 /usr/X11R6/bin/fluxbox -log /home/daniel/.fluxbox/log
2365 tty1 S 0:00 dbus-launch --autolaunch 075a63d514a3e4aefc064fc45d3d
2366 ? Ss 0:00 /usr/bin/dbus-daemon --syslog-only --fork --print-pid
2368 ? Sl 0:00 /usr/libexec/at-spi-bus-launcher
2373 ? S 0:00 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/acces
2408 tty1 Sl 0:00 cdemu-daemon
2409 tty1 S 0:00 gkrellm -w
2410 tty1 S 0:00 volumeicon
2455 ? Sl 0:00 /usr/libexec/at-spi2-registryd --use-gnome-session
2487 ? Rs 0:00 mrxvt
2488 pts/1 Ss 0:00 bash
So a dbus daemon is launching with Fluxbox. I did the switch thing and the keyboard stopped again.
Then I exited X and re-enabled my other startup items - 3ddeskd, nm-applet and gcdemu. Again I opened mrxvt to check ps x
As part of XFCE nm-applet triggers a plasma process, gnome-keyring-daemon and some xdg services. I switched the keyboard and it stopped again.
Now I thought about what is different from the day before yesterday and in the past when using KDE. In KDE I mostly used its konsole, and in XFCE I mostly use xfce4-terminal. Recently I discovered xfce4-terminal's dropdown feature and added it to my Fluxbox menu. When I tried allend's dbus idea I was using xfce4-terminal.
So, I exited X and started again, this time opening urxvt. The keyboard didn't stop.
Tried again with xterm and xfce4-terminal. The keyboard didn't stop.
So it seems to be caused by mrxvt. Bummer, because it has been a favorite terminal of mine for many years, even this long after development was abandoned. I guess it's time to say goodbye to it
Thanks, I was messing around with this but did not think of what you found.
But FWIW, in my testing I found the issue also occurring with fvwm2.
The interesting thing is, so far, the issue did not strike fvwm3, ctwm, vtwm and cwm. I was trying different window managers to see if a pattern occurred.
I was thinking it was a elogind issue when using xdm(1), but was not sure how to test for that. Your post makes a lot of sense.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.