0

I have two laptops (and two Raspberry pi's) connected to a 4-way usb switche, with one keyboard and mouse connected as input devices for all four. When I suspend the laptops (one is ubuntu, the other xubuntu), I cant wake them up with either keyboard or mouse. I have tried enabling wakeup on all devices found with grep . /sys/bus/usb/devices/*/power/wakeup as explained here @Pavlos Theodorou's questionand found that this will work for the device most recently suspended, but then if I press the button on the switcher to change it to a different device, the suspended device will wake up. has anyone had any experience of this with USB switchers?

edited to show output of

grep . /sys/bus/usb/devices/*/power/wakeup
lsusb
grep . /sys/bus/usb/devices/*/power/wakeup | cut -d: -f1 | cut -d/ -f1-6 | xargs -I{} sh -c 'echo {}:; cat {}/product 2>/dev/null'
matt@zakk-jr:~$ grep . /sys/bus/usb/devices/*/power/wakeup
/sys/bus/usb/devices/1-1.1/power/wakeup:disabled
/sys/bus/usb/devices/1-1/power/wakeup:disabled
/sys/bus/usb/devices/2-1/power/wakeup:disabled
/sys/bus/usb/devices/3-2.2/power/wakeup:disabled
/sys/bus/usb/devices/3-2.3.2/power/wakeup:enabled
/sys/bus/usb/devices/3-2.3/power/wakeup:disabled
/sys/bus/usb/devices/3-2/power/wakeup:disabled
/sys/bus/usb/devices/usb1/power/wakeup:disabled
/sys/bus/usb/devices/usb2/power/wakeup:disabled
/sys/bus/usb/devices/usb3/power/wakeup:enabled
/sys/bus/usb/devices/usb4/power/wakeup:disabled
matt@zakk-jr:~$ lsusb
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 04f2:b307 Chicony Electronics Co., Ltd TOSHIBA Web Camera - HD
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 003: ID 0bda:0138 Realtek Semiconductor Corp. RTS5138 Card Reader Controller
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 152d:0562 JMicron Technology Corp. / JMicron USA Technology Corp. JMS567 SATA 6Gb/s bridge
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 050: ID 195d:2030 Itron Technology iONE Func KB-460 Gaming Keyboard
Bus 003 Device 049: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 003 Device 048: ID 1c4f:0054 SiGma Micro Usb Mouse
Bus 003 Device 047: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
matt@zakk-jr:~$ grep . /sys/bus/usb/devices/*/power/wakeup | cut -d: -f1 | cut -d/ -f1-6 | xargs -I{} sh -c 'echo {}:; cat {}/product 2>/dev/null'
/sys/bus/usb/devices/1-1.1:
USB2.0-CRW
/sys/bus/usb/devices/1-1:
/sys/bus/usb/devices/2-1:
/sys/bus/usb/devices/3-2.2:
Usb Mouse
/sys/bus/usb/devices/3-2.3.2:
RUSH Mechanical Keyboard
/sys/bus/usb/devices/3-2.3:
USB2.0 Hub
/sys/bus/usb/devices/3-2:
USB2.1 Hub
/sys/bus/usb/devices/usb1:
EHCI Host Controller
/sys/bus/usb/devices/usb2:
EHCI Host Controller
/sys/bus/usb/devices/usb3:
xHCI Host Controller
/sys/bus/usb/devices/usb4:
xHCI Host Controller
matt@zakk-jr:~$ 
jarno
  • 5,600
matt cooper
  • 83
  • 1
  • 8
  • So you can not disable wakeup by the USB switcher and still enable wakeup by the attached input devices? – jarno Aug 13 '22 at 17:38
  • What does grep . /sys/bus/usb/devices/*/power/wakeup | cut -d: -f1 | cut -d/ -f1-6 | xargs -I{} sh -c 'echo {}:; cat $(ls {}/product 2>/dev/null)' give? – jarno Aug 13 '22 at 17:55
  • /sys/bus/usb/devices/1-1.1.2: Usb Mouse /sys/bus/usb/devices/1-1.1.3.2: RUSH Mechanical Keyboard /sys/bus/usb/devices/1-1.1.3: USB2.0 Hub /sys/bus/usb/devices/1-1.1: USB2.1 Hub /sys/bus/usb/devices/1-1: /sys/bus/usb/devices/2-1: /sys/bus/usb/devices/usb1: EHCI Host Controller /sys/bus/usb/devices/usb2: EHCI Host Controller – matt cooper Aug 15 '22 at 10:59
  • I wonder which one is the switch? – jarno Aug 16 '22 at 16:15
  • I'm guessing device 3-2, as grep . /sys/bus/usb/devices/*/product shows `/sys/bus/usb/devices/1-1.1/product:USB2.0-CRW

    /sys/bus/usb/devices/1-1.3/product:TOSHIBA Web Camera - HD

    /sys/bus/usb/devices/3-2.1/product:DataTraveler 2.0

    /sys/bus/usb/devices/3-2.2/product:Usb Mouse /sys/bus/usb/devices/3-2.3.2/product:RUSH Mechanical Keyboard /sys/bus/usb/devices/3-2.3/product:USB2.0 Hub /sys/bus/usb/devices/3-2/product:USB2.1 Hub` when I plug in a usb thumb drive.

    – matt cooper Aug 17 '22 at 09:07
  • What happens, if you disable wakeup from 3-2 but enable it from 3-2.3.2? – jarno Aug 18 '22 at 17:14
  • Ah, I might have confused the two laptops here, I switch between the two and might have listed the output for both of them! I'm moving house next week, so my office is all packed away. I'll try again next week and answer your question @jarno – matt cooper Aug 19 '22 at 18:15
  • Oh, and according to your listing you have 3-2 already disabled and 3-2.3.2 enabled, but that did not solve the problem apparently. – jarno Aug 20 '22 at 09:05
  • @jarno no,it seems to be a complete mystery! if i have the switcher enabled it will wake either computer up when you try and switch to another, so the only alternative is to leave both computers on all the time :( – matt cooper Aug 30 '22 at 11:08

1 Answers1

1

I had a similar problem. You should be able to enable the keyboard directly without enabling the KVM. You also have to enable the usb port it's attached to. e.g /etc/udev/rules.d

# Enable usb port 3 wakeup
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="1d6b", ATTRS{idProduct}=="0001", ATTRS{busnum}=="3", ATTR{power/wakeup}="enabled"
# Disable KVM wakeup
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="0557", ATTRS{idProduct}=="7000", ATTR{power/wakeup}="disabled"
# Disable mouse wakeup
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="1ea7", ATTRS{idProduct}=="0064", ATTR{power/wakeup}="disabled"
# Enable keyboard wakeup
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="1c4f", ATTRS{idProduct}=="0047", ATTR{power/wakeup}="enabled"

The reason for doing it in this order is because the first rule automatically enables everything attached to it.

Humpity
  • 180
  • 10