Framework 16 wakes up in backpack, please help me stop this!

Hello!

My framework 16 laptop continuously wakes up from sleep when it is closed and placed in my bag. This is due to the device flexing and pressing keys on the keyboard while it is in my bag. I have attempted to follow the section in the unofficial wiki on this issue titled Prevent wake up in backpack but the udev rules do not seem to change the keyboard behaviour at all.

Udev rules:

services.udev.extraRules = ''
   SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0012", ATTR{power/wakeup}="disabled", ATTR{driver/1-1.1.1.4/power/wakeup}="disabled"
   SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0014", ATTR{power/wakeup}="disabled", ATTR{driver/1-1.1.1.4/power/wakeup}="disabled"
'';

lsusb output:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 32ac:0002 Framework HDMI Expansion Card
Bus 001 Device 003: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 004: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 005: ID 05e3:0610 Genesys Logic, Inc. Hub
Bus 001 Device 006: ID 0e8d:e616 MediaTek Inc. Wireless_Device
Bus 001 Device 007: ID 27c6:609c Shenzhen Goodix Technology Co.,Ltd. Goodix Fingerprint USB Device
Bus 001 Device 008: ID 32ac:0012 Framework Laptop 16 Keyboard Module - ANSI
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 05e3:0625 Genesys Logic, Inc. USB3.2 Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 0bda:5634 Realtek Semiconductor Corp. Laptop Camera
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Please help if you can as this issue causes me to type random characters into whatever code project I’m working on, as I move with my laptop, and drains my battery!

Thanks!

That’s the official wiki, actually :smiley:

This section on the arch wiki describes the important first steps, figuring out what can even cause wake and what did cause wake: Power management/Wakeup triggers - ArchWiki

I appreciate this! However I’ve already confirmed that it’s the keyboard. Once I shut my laptop, the screen turns off, and if i manually push on the lid, upon opening the laptop, I can see random text onscreen if I’m in a terminal.

Right, you should still go through those steps to figure out the actual ID of the device triggering wake. It may ultimately physically be the keyboard, but it might be the USB hub the keyboard is connected to internally or whatever that triggers the signal the kernel picks up.

I would also double check /proc/acpi/wakeup to make sure the keyboard isn’t listed there, just to make sure the udev rule is working.

3 Likes

I’m having a very hard time matching any of the various device identifier codes from any of the commands included in the site you sent me. What doesnt help is that the output of dmidecode -t system | grep -P '\tWake-up Type\: ' seems to say “Power Switch” no matter what. Is there a way for me to easily find out the direct cause of the wakeup without this command working?

Here is the output of cat /proc/acpi/wakeup if it helps:

[aurora@nixos:~]$ cat /proc/acpi/wakeup
Device    S-state     Status   Sysfs node
GPP0     S4    *disabled
GPP2     S4    *disabled
GPP5     S4    *disabled
GPP6     S4    *enabled   pci:0000:00:02.2
GPP7     S4    *disabled
GPP8     S4    *enabled   pci:0000:00:02.4
GP11     S4    *enabled   pci:0000:00:03.1
SWUS     S4    *disabled
GP12     S4    *enabled   pci:0000:00:04.1
SWUS     S4    *disabled
XHC0     S3    *enabled   pci:0000:c1:00.3
XHC1     S3    *enabled   pci:0000:c1:00.4
XHC2     S3    *disabled  pci:0000:c3:00.0
NHI0     S4    *enabled   pci:0000:c3:00.5
XHC3     S3    *enabled   pci:0000:c3:00.3
NHI1     S4    *enabled   pci:0000:c3:00.6
XHC4     S3    *enabled   pci:0000:c3:00.4

Sadly no, this likely means that the keyboard signal is indeed mixed with the other ones.

You can disable specific entries there with e.g. echo XHC4 > /proc/acpi/wakeup (as root after a sudo -s, or with tee if you want to scope the super user to a single command).

A nice low-tech way of figuring this out is to just disable wakeup for those device classes until you figure out which of them prevents your keyboard from waking your laptop; at that point you’ll at least know which pci device is the culprit.

That makes sense! I’ll give this a try and see if i can figure this out easier after a good sleep! Thank you for your help and I’ll post my results when I give it a go!

Okay, update, after rebooting with the udev rules from the wiki one final time, and running systemctl suspend, my keyboard does NOT wake my laptop now, which is excellent, I beleive that if I am sufficiently rough with my laptop however, the touchpad click does seem to wake it (i head a deeper click sounds and on trials when this happens my system seems to wake). I will poke around tomorrow to see which device is the touchpad and disable it if i keep encountering this issue! Thank you so much!

1 Like