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
  • 6,175
matt cooper
  • 83
  • 2
  • 8

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
  • 188
  • 13