It breaks after S3 suspend/resume cycle. I believe there must be some flag in RC script to restart it automatically. Logs: Apr 3 01:01:01 iv keyd[26536]: device removed: 1e7d:2dbf ROCCAT ROCCAT Kone Pure Military, class 0/0, rev 2.00/2.00, addr/dev/input/event3 (/dev/input/event3) Apr 3 01:01:01 iv keyd[26536]: device removed: 0c45:1a0a vendor 0x0c45 FC660M, class 0/0, rev 2.00/0.01, addr 2 (/dev/input/event4) Apr 3 01:01:01 iv keyd[26536]: device removed: 1e7d:2dbf ROCCAT ROCCAT Kone Pure Military, class 0/0, rev 2.00/2.00, addr/dev/input/event5 (/dev/input/event5)
Created attachment 241296 [details] invoke "service keyd start" on resume Does this help? I don't have a laptop to test.
Also, check via pgrep(1) the number of keyd instances. If there's more than one try changing "start" to "restart" on "resume_cmd" line (and notify me, so I'll land the correct version).
Restarting keyd shouldn't be required as it uses libinotify to discover new/lost devices under /dev/input/. Maybe it doesn't work for some reason on FreeBSD (never tested the feature myself).
Thanks! Tested. "run_rc_command restart" is required. Otherwise nothing is restarted at all. But, the problem is: Apr 5 13:12:42 iv acpi[54418]: resumed at 20230405 13:12:42 Apr 5 13:12:42 iv keyd[58852]: Starting keyd v2.4.2 Apr 5 13:12:42 iv keyd[58852]: socket: /var/run/keyd.socket Apr 5 13:12:42 iv keyd[58852]: device added: 0000:0000 System keyboard multiplexer (/dev/input/event1) Apr 5 13:12:42 iv keyd[58852]: ignored (no matching config) Apr 5 13:12:42 iv kernel: uhub0: 6 ports with 6 removable, self powered Apr 5 13:12:42 iv kernel: uhub1: 6 ports with 6 removable, self powered Apr 5 13:12:43 iv kernel: ugen1.2: <ROCCAT ROCCAT Kone Pure Military> at usbus1 Apr 5 13:12:43 iv kernel: ums0 on uhub1 Apr 5 13:12:43 iv kernel: ums0: <ROCCAT ROCCAT Kone Pure Military, class 0/0, rev 2.00/2.00, addr 1> on usbus1 Apr 5 13:12:43 iv kernel: ums0: 5 buttons and [XYZT] coordinates ID=1 Apr 5 13:12:43 iv kernel: ukbd0 on uhub1 Apr 5 13:12:43 iv kernel: ukbd0: <ROCCAT ROCCAT Kone Pure Military, class 0/0, rev 2.00/2.00, addr 1> on usbus1 Apr 5 13:12:43 iv kernel: kbd1 at ukbd0 Apr 5 13:12:43 iv kernel: ugen1.3: <vendor 0x0c45 FC660M> at usbus1 Apr 5 13:12:43 iv kernel: ukbd1 on uhub1 Apr 5 13:12:43 iv kernel: ukbd1: <vendor 0x0c45 FC660M, class 0/0, rev 2.00/0.01, addr 2> on usbus1 Apr 5 13:12:43 iv kernel: kbd2 at ukbd1 Apr 5 13:12:43 iv kernel: uhid0 on uhub1 Apr 5 13:12:43 iv kernel: uhid0: <vendor 0x0c45 FC660M, class 0/0, rev 2.00/0.01, addr 2> on usbus1 The usb devices aren't ready at the moment of the restart
A hack resume_cmd="sleep 3; run_rc_command restart" works fine. But may be there is a better way?
Tested my hack with sleep for a 6 days. Works very well. No issues at all. Jan, you can update the port safely.
Can you report upstream (per comment 3)? I'm reluctant to add workarounds for what works "as is" (or supposed to) on Linux at least without more investigation.
Sure. Reported upstream https://github.com/rvaiya/keyd/issues/497
Created attachment 248945 [details] fixes resume issue
Hi! Any news here? The patch really fixes the issue. Tested for a long time. Have no luck with upstream fix yet. There is a similar issue. At the boot time it couldn't find the keyboard. Switch the keyboard cable off and on helps. But it's really annoying. Can we add a similar fix for delaying keyd startup?