Wireless USB keyboard/mouse not responding

Continuing the discussion from Won't recognize my USB keyboard and mouse at boot:

As I couldn’t find a solution to this problem and I still encounter it today on kernel 4.19.20.1, I decided to reopen the thread.

I noticed some errors in dmesg:

[   18.120684] usb 1-2.4: device descriptor read/64, error -110

After plugging off and on again the USB dongle, the mouse and keyboard are responsive and work again.

My lsusb (after plugging off and on):

Bus 001 Device 010: ID 045e:07a5 Microsoft Corp. Wireless Receiver 1461C

Interestingly I had the same issue on Ubuntu, but I don’t remember what was the kernel, etc.

I hope I will finally find a solution with a help from the great Manjaro community! :slight_smile:

Thanks!

1 Like

Please post:

inxi -Fxxxz

Please post all terminal commands as text with code tags, (not as pics).

Information on how to properly post hardware specs and logs:

Please format any terminal output with three backticks before and after, as shown in this picture:

inxi -Fxxxz
System:    Host: Librem-13 Kernel: 4.19.20-1-MANJARO x86_64 bits: 64 compiler: gcc v: 8.2.1 Desktop: i3 4.16 info: i3bar 
           dm: LightDM 1.28.0 Distro: Manjaro Linux 
Machine:   Type: Laptop System: Purism product: Librem 13 v2 v: 2.0 serial: <filter> Chassis: type: 9 serial: <filter> 
           Mobo: Purism model: Librem 13 v2 v: 2.0 serial: <filter> BIOS: coreboot v: 4.7-Purism-3 date: 03/02/2018 
Battery:   ID-1: BAT charge: 45.5 Wh condition: 45.5/44.7 Wh (102%) volts: 8.3/7.4 model: TPS S10 type: Li-ion serial: N/A 
           status: Unknown 
CPU:       Topology: Dual Core model: Intel Core i7-6500U bits: 64 type: MT MCP arch: Skylake rev: 3 L2 cache: 4096 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 20744 
           Speed: 645 MHz min/max: 400/3100 MHz Core speeds (MHz): 1: 600 2: 600 3: 601 4: 600 
Graphics:  Device-1: Intel Skylake GT2 [HD Graphics 520] driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:1916 
           Display: x11 server: X.Org 1.20.3 driver: intel unloaded: modesetting alternate: fbdev,vesa compositor: compton 
           resolution: 1920x1080~60Hz, 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 520 (Skylake GT2) v: 4.5 Mesa 18.3.2 compat-v: 3.0 direct render: Yes 
Audio:     Device-1: Intel Sunrise Point-LP HD Audio driver: snd_hda_intel v: kernel bus ID: 00:1f.3 chip ID: 8086:9d70 
           Sound Server: ALSA v: k4.19.20-1-MANJARO 
Network:   Device-1: Qualcomm Atheros AR9462 Wireless Network Adapter vendor: Lite-On driver: ath9k v: kernel port: efa0 
           bus ID: 01:00.0 chip ID: 168c:0034 
           IF: wlp1s0 state: up mac: <filter> 
           Device-2: Lite-On Atheros AR3012 Bluetooth type: USB driver: btusb bus ID: 1-3:8 chip ID: 04ca:300d 
Drives:    Local Storage: total: 2.38 TiB used: 353.97 GiB (14.5%) 
           ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 960 EVO 500GB size: 465.76 GiB speed: 31.6 Gb/s lanes: 4 
           serial: <filter> rev: 3B7QCXE7 scheme: GPT 
           ID-2: /dev/sda vendor: BIWIN model: SSD size: 111.79 GiB speed: 3.0 Gb/s serial: <filter> rev: 7A0 scheme: MBR 
           ID-3: /dev/sdb type: USB vendor: Western Digital model: WD Elements SE 25FE size: 931.48 GiB serial: <filter> 
           rev: 1021 scheme: GPT 
           ID-4: /dev/sdc type: USB vendor: Western Digital model: WD Elements 25A2 size: 931.48 GiB serial: <filter> 
           rev: 1014 scheme: GPT 
Partition: ID-1: / size: 97.93 GiB used: 54.72 GiB (55.9%) fs: ext4 dev: /dev/nvme0n1p4 
           ID-2: swap-1 size: 16.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/nvme0n1p3 
Sensors:   System Temperatures: cpu: 48.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 194 Uptime: 3h 03m Memory: 15.58 GiB used: 3.23 GiB (20.7%) Init: systemd v: 239 Compilers: gcc: 8.2.1 
           Shell: fish v: 3.0.0 running in: urxvtd inxi: 3.0.30 
dmesg | grep usb
[    0.513292] usbcore: registered new interface driver usbfs
[    0.513292] usbcore: registered new interface driver hub
[    0.513295] usbcore: registered new device driver usb
[    0.637115] usbcore: registered new interface driver usbserial_generic
[    0.637151] usbserial: USB Serial support registered for generic
[    1.078957] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[    1.078959] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.078961] usb usb1: Product: xHCI Host Controller
[    1.078962] usb usb1: Manufacturer: Linux 4.19.20-1-MANJARO xhci-hcd
[    1.078964] usb usb1: SerialNumber: 0000:00:14.0
[    1.079562] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 4.19
[    1.079564] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.079566] usb usb2: Product: xHCI Host Controller
[    1.079567] usb usb2: Manufacturer: Linux 4.19.20-1-MANJARO xhci-hcd
[    1.079569] usb usb2: SerialNumber: 0000:00:14.0
[    1.407082] usb 1-2: new high-speed USB device number 2 using xhci_hcd
[    1.561613] usb 1-2: New USB device found, idVendor=0bda, idProduct=5411, bcdDevice= 1.17
[    1.561615] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.561617] usb 1-2: Product: 4-Port USB 2.0 Hub
[    1.561618] usb 1-2: Manufacturer: Generic
[    1.674475] usb 2-2: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[    1.703940] usb 2-2: New USB device found, idVendor=0bda, idProduct=0411, bcdDevice= 1.17
[    1.703945] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.703948] usb 2-2: Product: 4-Port USB 3.0 Hub
[    1.703952] usb 2-2: Manufacturer: Generic
[    1.820380] usb 1-3: new full-speed USB device number 3 using xhci_hcd
[    1.964442] usb 1-3: New USB device found, idVendor=04ca, idProduct=300d, bcdDevice= 0.01
[    1.964444] usb 1-3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    2.037072] usb 1-2.1: new high-speed USB device number 4 using xhci_hcd
[    2.158820] usb 1-2.1: New USB device found, idVendor=0bda, idProduct=5411, bcdDevice= 1.17
[    2.158823] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.158825] usb 1-2.1: Product: 4-Port USB 2.0 Hub
[    2.158827] usb 1-2.1: Manufacturer: Generic
[    2.225396] usb 2-2.1: new SuperSpeed Gen 1 USB device number 3 using xhci_hcd
[    2.253479] usb 2-2.1: New USB device found, idVendor=0bda, idProduct=0411, bcdDevice= 1.17
[    2.253482] usb 2-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.253484] usb 2-2.1: Product: 4-Port USB 3.0 Hub
[    2.253486] usb 2-2.1: Manufacturer: Generic
[    2.370380] usb 1-4: new high-speed USB device number 5 using xhci_hcd
[    2.562005] usb 1-4: New USB device found, idVendor=058f, idProduct=d102, bcdDevice=10.09
[    2.562008] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[    2.562010] usb 1-4: Product: HD WebCam
[    2.562011] usb 1-4: Manufacturer: QUANTA
[    2.583704] usb 1-2.4: new full-speed USB device number 6 using xhci_hcd
[    2.737517] usbcore: registered new interface driver btusb
[    2.764893] input: HD WebCam: HD WebCam as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/input/input9
[    2.764947] usbcore: registered new interface driver uvcvideo
[    2.790846] usb 1-3: USB disconnect, device number 3
[    2.791040] usbcore: registered new interface driver ath3k
[   18.120684] usb 1-2.4: device descriptor read/64, error -110
[   33.697062] usb 1-2.4: device descriptor read/64, error -110
[   33.877118] usb 1-2.4: new full-speed USB device number 9 using xhci_hcd
[   38.924127] usb 2-2.2: new SuperSpeed Gen 1 USB device number 4 using xhci_hcd
[   38.941937] usb 2-2.2: New USB device found, idVendor=1058, idProduct=25fe, bcdDevice=10.21
[   38.941947] usb 2-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   38.941954] usb 2-2.2: Product: Elements SE 25FE
[   38.941961] usb 2-2.2: Manufacturer: Western Digital
[   38.941967] usb 2-2.2: SerialNumber: 575847314138385032325A4A
[   39.013709] usb 1-2.1.1: new high-speed USB device number 7 using xhci_hcd
[   39.031201] usb-storage 2-2.2:1.0: USB Mass Storage device detected
[   39.031345] scsi host2: usb-storage 2-2.2:1.0
[   39.031410] usbcore: registered new interface driver usb-storage
[   39.034200] usbcore: registered new interface driver uas
[   39.104439] usb 1-2.1.1: New USB device found, idVendor=0424, idProduct=2514, bcdDevice= b.b3
[   39.104450] usb 1-2.1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   39.180928] usb 2-2.1.2: new SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[   39.199874] usb 2-2.1.2: New USB device found, idVendor=1058, idProduct=25a2, bcdDevice=10.14
[   39.199885] usb 2-2.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   39.199893] usb 2-2.1.2: Product: Elements 25A2
[   39.199899] usb 2-2.1.2: Manufacturer: Western Digital
[   39.199905] usb 2-2.1.2: SerialNumber: 57584E3145323633355A5A44
[   39.203341] usb-storage 2-2.1.2:1.0: USB Mass Storage device detected
[   39.203945] scsi host3: usb-storage 2-2.1.2:1.0
[   39.320588] usb 1-3: new full-speed USB device number 8 using xhci_hcd
[   39.462070] usb 1-3: New USB device found, idVendor=04ca, idProduct=300d, bcdDevice= 0.02
[   39.462081] usb 1-3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   41.144001] usb 1-2.4: new full-speed USB device number 10 using xhci_hcd
[   41.240769] usb 1-2.4: New USB device found, idVendor=045e, idProduct=07a5, bcdDevice= 7.67
[   41.240779] usb 1-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   41.240786] usb 1-2.4: Product: Microsoft® 2.4GHz Transceiver v9.0
[   41.240792] usb 1-2.4: Manufacturer: Microsoft
[   41.363870] usbcore: registered new interface driver usbhid
[   41.363871] usbhid: USB HID core driver
[   41.372980] input: Microsoft Microsoft® 2.4GHz Transceiver v9.0 as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4/1-2.4:1.0/0003:045E:07A5.0001/input/input18
[   41.427530] hid-generic 0003:045E:07A5.0001: input,hidraw0: USB HID v1.11 Keyboard [Microsoft Microsoft® 2.4GHz Transceiver v9.0] on usb-0000:00:14.0-2.4/input0
[   41.427917] input: Microsoft Microsoft® 2.4GHz Transceiver v9.0 Mouse as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4/1-2.4:1.1/0003:045E:07A5.0002/input/input19
[   41.428157] input: Microsoft Microsoft® 2.4GHz Transceiver v9.0 Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4/1-2.4:1.1/0003:045E:07A5.0002/input/input20
[   41.428256] hid-generic 0003:045E:07A5.0002: input,hidraw1: USB HID v1.11 Mouse [Microsoft Microsoft® 2.4GHz Transceiver v9.0] on usb-0000:00:14.0-2.4/input1
[   41.428820] input: Microsoft Microsoft® 2.4GHz Transceiver v9.0 Consumer Control as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4/1-2.4:1.2/0003:045E:07A5.0003/input/input21
[   41.484666] input: Microsoft Microsoft® 2.4GHz Transceiver v9.0 System Control as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4/1-2.4:1.2/0003:045E:07A5.0003/input/input22
[   41.485145] hid-generic 0003:045E:07A5.0003: input,hidraw2: USB HID v1.11 Device [Microsoft Microsoft® 2.4GHz Transceiver v9.0] on usb-0000:00:14.0-2.4/input2
1 Like

I think the problem exposes itself here:

[   18.120684] usb 1-2.4: device descriptor read/64, error -110
[   33.697062] usb 1-2.4: device descriptor read/64, error -110

How can it be prevented from failing?

I’m also wondering if the fact I’m using TP-Link USB 3.0 hub and I have two external hard drives and USB keyboard/mouse connected causes the trouble/hiccup during a boot?
Nevertheless everything should just work, no matter if using the hub or not.

I guess the hub could be overwhelmed for current at the very startup of everything.
Did you already post the lsusb should give the device at 1-2.4:

Of course it looks like a read error I/O but I am not sure what comes first.

Full dmesg output:
https://pastebin.com/qgre7xhy

Full wireless usb dongle details from lsusb:
https://pastebin.com/mtLzr6Gk

Furthermore, it is the active hub and it has its own power supply, co the current should be stable, or am I wrong?

I don’t know you lost me @ Furthermore. Good Luck.

I would test out at least several different kernels to start with.

If that doesn’t improve things, then try this systemd service method:

This service should automatically refresh your usb devices before login.

Systemd USB Restart Service File:

With a text editor create:

/etc/systemd/system/usb-restart.service

Service file contents:

#/etc/systemd/system/usb-restart.service
#sudo systemctl enable usb-restart.service
#sudo systemctl start usb-restart.service
#systemctl list-unit-files --state=enabled
#sudo systemctl stop usb-restart.service
#sudo systemctl disable usb-restart.service
#systemctl status usb-restart.service
#sudo systemctl daemon-reload

[Unit]
Description=Restart USB
Before=display-manager.service
StopWhenUnneeded=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/sudo -E  /usr/local/bin/restart_usb.sh

[Install]
WantedBy=display-manager.service

Restart USB Script

Create the script that is to be executed before login:

With a text editor create:

/usr/local/bin/restart_usb.sh

Suspend script contents:

#!/bin/bash
#Restart all USB devices
#/usr/local/bin/restart_usb.sh
set -euo pipefail
IFS=$'\n\t'

VENDOR="****"
PRODUCT="****"

for DIR in $(find /sys/bus/usb/devices/ -maxdepth 1 -type l); do
  if [[ -f $DIR/idVendor && -f $DIR/idProduct &&
        $(cat $DIR/idVendor) == $VENDOR && $(cat $DIR/idProduct) == $PRODUCT ]]; then
    echo 0 > $DIR/authorized
    sleep 1 
    echo 1 > $DIR/authorized
  fi
done

Save the file with root permissions, and exit the text editor.

Ensure the script is executable:

sudo chmod +x /usr/local/bin/restart_usb.sh

Then, enable the service.

sudo systemctl enable usb-restart.service

Then restart.

Information on writing systemd service units.

If the service does not work as is, I’m pretty sure it can be tweaked to get the job done.

It seems to work! Thanks! :smiley:

Before closing I will test it for one week to be sure it is gone forever. :wink:

What I did to tweak the scripts:

  1. List usb devices with lsusb:

Bus 001 Device 006: ID 045e:07a5 Microsoft Corp. Wireless Receiver 1461C

  1. Take part 045e:07a5 and replaced VENDOR & PRODUCT variables in /usr/local/bin/restart_usb.sh:
VENDOR="045e"
PRODUCT="07a5"
  1. I put sleep 2 before and after the first reset:
sleep 2 
echo 0 > $DIR/authorized
sleep 2 
echo 0 > $DIR/authorized

I haven’t tested whether increasing sleep to 2 is enough or putting additional sleep before echo is also required. It didn’t work initially (before tweaking the sleep). Nevertheless the whole solutions seems to work!
I will let you know if the issue occurs again or is gone.
Fingers crossed! :crossed_fingers:

2 Likes

You might want to try another method. Re-scanning USB devices with a trigger command.

poor suggestion

You might replace the exec line in the service unit

ExecStart=/usr/bin/sudo -E  /usr/local/bin/restart_usb.sh

to this

ExecStart=/usr/bin/sudo -E /usr/bin/echo 1 > /sys/bus/usb/drivers_probe

I have not tested it…
It doesn’t work… :confounded:

I appreciate all your ideas for improvements @petsam. I just want to mention one precaution. Anyone wishing to experiment with alternate versions would be best to test them on a suspend/resume unit first.

If you are testing out startup units you can easily lock yourself out of your desktop without a working keyboard or mouse. Suspend units only affect the running session. If you mess up a startup service you need know how to boot to a TTY from grub to repair any problems you may have created.

Just thought I’d add a word of warning for those experimenting with startup services.

Having said that, is it save to try this scanning trick?
I booted the system now and mouse/keyboard were not working :frowning: :disappointed:

Do you have a working input method.

Do you know how to repair this?

I have a touchpad and keyboard as this is a laptop.
The fix is easy - unplug and plug again the wireless USB dongle, but is super annoying and I would like to fix it.
I realize this is quite a challenge if nobody was able to help the author of the original thread.
Nevertheless I appreciate all your help!
Hopefully the issue is resolved soon.

Maybe that was my fault. I made a typo in the original script. I edited it out when I realized my mistake, but you might be using the version with an error.

Ensure the end of the script is like this:

#!/bin/bash
#Disable all USB devices
#/usr/local/bin/restart_usb.sh
set -euo pipefail
IFS=$'\n\t'

VENDOR="****"
PRODUCT="****"

for DIR in $(find /sys/bus/usb/devices/ -maxdepth 1 -type l); do
  if [[ -f $DIR/idVendor && -f $DIR/idProduct &&
        $(cat $DIR/idVendor) == $VENDOR && $(cat $DIR/idProduct) == $PRODUCT ]]; then
    echo 0 > $DIR/authorized
    sleep 1
    echo 1 > $DIR/authorized
  fi
done

When I tested this it was working.

Oh, of course - I echo 0 two times, which obviously is not correct - good catch! :wink:

Let me see whether it helps.

1 Like

So far, so good!
I will keep testing next week.

1 Like