You are not logged in.

#1 2024-09-05 19:43:43

biskyy
Member
Registered: 2024-09-05
Posts: 9

keyboard and mouse only start working after a few seconds after boot

keyboard and mouse(both connected through usb wired) only start working after a few seconds after boot. they both light up but they dont work. ive tried searching online and while i did find relevant problems i didnt find any solutions that worked(for example adding "i8042.nopnp=1 i8042.dumbkbd=1" or "usbcore.autosuspend=-1" to boot params)

below is my kernel log obtained through dmesg -T:
https://pastebin.com/RaH4UDRh

i also uploaded it(the kernel log) to chatgpt but he couldnt find anything related.

EDIT: there is also a delay after waking up from suspend before the keyboard and the mouse start working again. maybe this helps

Last edited by biskyy (2024-09-05 21:20:06)

Offline

#2 2024-09-05 20:21:36

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: keyboard and mouse only start working after a few seconds after boot

Are you referring to login in to a tty, or is this a graphical environment?  If the latter, A) which one [and X11 or Wayland if relevant]? and B) does the problem show if only loging in to a tty?  Then if you log out, and attempt to log back in again, can you confirm that the problem does not repeat, i.e., is it linked just to boot-up and wake from suspend?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2024-09-05 21:16:05

biskyy
Member
Registered: 2024-09-05
Posts: 9

Re: keyboard and mouse only start working after a few seconds after boot

uhh.. i made a mistake and put "after login" instead of "after boot"... so what i meant to say is that the kb/mouse dont work for a few seconds after boot. the kb does work in grub tho.

so if i want to login i have to wait a few seconds for the kb to start working.
the reason i put "after login" in the title is because i have auto login set up and i got the terms confused in my head. im sorry for my mistake

Trilby, to answer your questions:
I use hyprland so wayland
The problem only appears after boot once. if i logout and login everything will work as expected. The same can be said about waking from suspend(if i logout and login after suspend it will work as expected)

I believe it has to do with the order in which the kernel sets up these devices. but idk how to tell it to load the devices first.

Offline

#4 2024-09-05 21:44:35

loqs
Member
Registered: 2014-03-06
Posts: 18,869

Re: keyboard and mouse only start working after a few seconds after boot

[Thu Sep  5 21:31:03 2024] Linux version 6.10.8-arch1-1 (linux@archlinux) (gcc (GCC) 14.2.1 20240805, GNU ld (GNU Binutils) 2.43.0) #1 SMP PREEMPT_DYNAMIC Wed, 04 Sep 2024 15:16:37 +0000
...
[Thu Sep  5 21:31:12 2024] usb 3-3: New USB device found, idVendor=258a, idProduct=0049, bcdDevice= 1.01
[Thu Sep  5 21:31:12 2024] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Thu Sep  5 21:31:12 2024] usb 3-3: Product: Gaming Keyboard
[Thu Sep  5 21:31:12 2024] usb 3-3: Manufacturer: BY Tech
[Thu Sep  5 21:31:12 2024] input: BY Tech Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/0003:258A:0049.0004/input/input12
[Thu Sep  5 21:31:12 2024] hid-generic 0003:258A:0049.0004: input,hidraw3: USB HID v1.11 Keyboard [BY Tech Gaming Keyboard] on usb-0000:00:14.0-3/input0
[Thu Sep  5 21:31:12 2024] input: BY Tech Gaming Keyboard System Control as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/0003:258A:0049.0005/input/input13
[Thu Sep  5 21:31:12 2024] input: BY Tech Gaming Keyboard Consumer Control as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/0003:258A:0049.0005/input/input14
[Thu Sep  5 21:31:12 2024] input: BY Tech Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/0003:258A:0049.0005/input/input16
[Thu Sep  5 21:31:12 2024] input: BY Tech Gaming Keyboard Mouse as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/0003:258A:0049.0005/input/input17
[Thu Sep  5 21:31:12 2024] hid-generic 0003:258A:0049.0005: input,hiddev97,hidraw4: USB HID v1.11 Keyboard [BY Tech Gaming Keyboard] on usb-0000:00:14.0-3/input1

Is USB loaded into the initrd?  It looks to me as though the USB keyboard and mouse could be probed late because USB is loaded late.

Offline

#5 2024-09-06 07:10:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,172

Re: keyboard and mouse only start working after a few seconds after boot

usbcore loads early and

[Thu Sep  5 21:31:06 2024] usb 3-1: new full-speed USB device number 2 using xhci_hcd
[Thu Sep  5 21:31:06 2024] usb 3-1: New USB device found, idVendor=046d, idProduct=c08b, bcdDevice=27.03
[Thu Sep  5 21:31:06 2024] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Thu Sep  5 21:31:06 2024] usb 3-1: Product: G502 HERO Gaming Mouse
[Thu Sep  5 21:31:06 2024] usb 3-1: Manufacturer: Logitech
[Thu Sep  5 21:31:06 2024] usb 3-1: SerialNumber: 028231523734
[Thu Sep  5 21:31:06 2024] usb 3-2: new full-speed USB device number 3 using xhci_hcd
[Thu Sep  5 21:31:06 2024] usb 3-2: New USB device found, idVendor=0d8c, idProduct=0014, bcdDevice= 1.00
[Thu Sep  5 21:31:06 2024] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Thu Sep  5 21:31:06 2024] usb 3-2: Product: USB Audio Device
[Thu Sep  5 21:31:06 2024] usb 3-2: Manufacturer: C-Media Electronics Inc.
[Thu Sep  5 21:31:06 2024] usb 3-3: new full-speed USB device number 4 using xhci_hcd
[Thu Sep  5 21:31:12 2024] usb 3-3: New USB device found, idVendor=258a, idProduct=0049, bcdDevice= 1.01
[Thu Sep  5 21:31:12 2024] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[Thu Sep  5 21:31:12 2024] usb 3-3: Product: Gaming Keyboard
[Thu Sep  5 21:31:12 2024] usb 3-3: Manufacturer: BY Tech

the gap is specifically before the "Gaming Keyboard"
Inside the gap, r8169 loads - try to add that to the MODULES

https://bbs.archlinux.org/viewtopic.php?id=296095 (though should™ have been reverted?)

Offline

#6 2024-09-06 11:32:14

biskyy
Member
Registered: 2024-09-05
Posts: 9

Re: keyboard and mouse only start working after a few seconds after boot

ty for the replies guys.

seth, i tried adding r8169 to MODULES and ran sudo mkinitcpio -P but it didnt fix the issue. i also read the forum post you linked and replaced systemd-networkd with dhcpcd but it also didnt solve the issue.

however i have some new info. this post was made yesterday in the evening. today when i powered on my pc for the first time(so a cold boot) it worked as expected: the keyboard and the mouse worked immediately after boot.
this is the kernel log: https://pastebin.com/XFv7xCHi. it seems like the usb devices all got loaded first before r8169 got to stall everything.
i rebooted and the everything went back to the way they were before(r8169 stalls the loading of the keyboard).

this is the output of

lspci -v | grep -A7 -i "network\|ethernet"

in case it's needed:

03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet Controller (rev 0c)
    Subsystem: Dell Device 0612
    Flags: bus master, fast devsel, latency 0, IRQ 19
    I/O ports at d000 [size=256]
    Memory at f7100000 (64-bit, non-prefetchable) [size=4K]
    Memory at f2100000 (64-bit, prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: r8169

i will try changing r8169 with r8168 and r8168-dkms, maybe that works

Offline

#7 2024-09-06 13:27:28

biskyy
Member
Registered: 2024-09-05
Posts: 9

Re: keyboard and mouse only start working after a few seconds after boot

UPDATE:
i looked into journalctl and im pretty sure the problem is the fact that the keyboard and the mouse only start getting recognized after the kernel has successfully started up(when tty starts and you are required to login).

Sep 06 15:25:52 biskyy-pc systemd[1]: Started Getty on tty1.
Sep 06 15:25:52 biskyy-pc systemd[1]: Reached target Login Prompts.
Sep 06 15:25:52 biskyy-pc systemd[1]: Reached target Multi-User System.
Sep 06 15:25:52 biskyy-pc systemd[1]: Reached target Graphical Interface.
Sep 06 15:25:52 biskyy-pc systemd[1]: Started Network Manager Script Dispatcher Service.
Sep 06 15:25:52 biskyy-pc systemd[1]: Startup finished in 7.255s (firmware) + 4.867s (loader) + 3.307s (kernel) + 2.084s (userspace) = 17.514s.
...
Sep 06 15:25:55 biskyy-pc kernel: usb 3-3: New USB device found, idVendor=258a, idProduct=0049, bcdDevice= 1.01
Sep 06 15:25:55 biskyy-pc kernel: usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Sep 06 15:25:55 biskyy-pc kernel: usb 3-3: Product: Gaming Keyboard
Sep 06 15:25:55 biskyy-pc kernel: usb 3-3: Manufacturer: BY Tech

full journalctl: https://pastebin.com/dQ6q0a22

i've also tried blacklisting r8169 and i get the same results so it's safe to say thats not the problem. here is journalctl with r8169 blacklisted: https://pastebin.com/ekHQRaBt

so then i tried adding usb modules in /etc/mkinitcpio.conf:

MODULES=(usbhid usbcore xhci_hcd ehci_hcd nvidia nvidia_modeset nvidia_uvm nvidia_drm)

sudo mkinitcpio -P again and rebooted. didnt work..
whats even more weirder is that the headphones do get recognized early and they work because i hear beeps(i have a dell optiplex, i'll have to look into it)
here is journalctl after modifying MODULES: https://pastebin.com/Lpsb5EdZ

Offline

#8 2024-09-06 13:35:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,172

Re: keyboard and mouse only start working after a few seconds after boot

You're currently running NM and dhcpcd concurrently.

Sep 06 15:25:51 biskyy-pc kernel:  sda: sda1 sda2 sda3 sda4 sda5 sda6
Sep 06 15:25:51 biskyy-pc kernel:  sdb: sdb1 sdb2
Sep 06 15:25:58 biskyy-pc kernel:  sdc: sdc1
Sep 06 15:25:57 biskyy-pc kernel:  sdd: sdd1

Is there a parallel windows installation?
Do you have the same experience w/ $5 stock office hardware (keyboard and mouse, nothing that has the word "gaming" in it)?

Offline

#9 2024-09-06 15:50:24

biskyy
Member
Registered: 2024-09-05
Posts: 9

Re: keyboard and mouse only start working after a few seconds after boot

seth wrote:

You're currently running NM and dhcpcd concurrently.

uhh.. ok, fixed that

seth wrote:

Is there a parallel windows installation?

yes im dual booting windows 10. i thought i had mentioned that in the original post but apparently i didnt. sda5 is swap, sda6 is linux root

seth wrote:

Do you have the same experience w/ $5 stock office hardware (keyboard and mouse, nothing that has the word "gaming" in it)?

i tested with another keyboard(marvo gaming something) and it did yield different results.

my current keyboard is a redragon k617
so:
if i only connect the marvo keyboard it will work immediately with no delay
if i disconnect it(the marvo keyboard) while the system is running and plug it back in it will work with no delay
if i connect both keyboards then when tty1 starts, marvo keyboard's backlight will turn off for 3 seconds(time in which neither keyboard works) and after the 3 seconds they both start working.
if i disconnect my redragon keyboard while the system is running and plug it back in i have to wait for about 5 seconds for it to start working.

so my redragon keyboard is the culprit...
is there any possible fix or do i just live with it?

Offline

#10 2024-09-06 19:08:54

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,172

Re: keyboard and mouse only start working after a few seconds after boot

First of all:

yes im dual booting windows 10.

3rd link below. Mandatory.
Disable it (it's NOT the BIOS setting!) and reboot windows and linux twice for voodo reasons.

We'll deal w/ the g4m0r5 keyboard if that actually remains an issue afterwards.

Offline

#11 2024-09-06 19:45:02

biskyy
Member
Registered: 2024-09-05
Posts: 9

Re: keyboard and mouse only start working after a few seconds after boot

i've already done that before installing arch and i've run powercfg /H off again just to be sure and rebooted as you said. the problem is still there

Offline

Board footer

Powered by FluxBB