3

This is Gentoo Linux with OpenRC (updated to systemd later on), and ACPI + some power management features in the kernel for Intel. ACPId is up and running. I can suspend to ram using:

echo -n "mem" > /sys/power/state

This works, but I need to use the power button to wake up. Is there a way to wake up from keyboard events like pressing the space bar? The keyboard is a wireless USB keyboard. I've looked at the content of the script in /etc/acpi and it offers no insight into doing this. Most of the information I find is usually geared at laptop users. Do I really need something like the old pm-utils to accomplish this and is there anything wrong with just using acpid?

cat /proc/acpi/wakeup
Device  S-state   Status   Sysfs node
P0P2      S4    *disabled
P0P3      S4    *disabled  pci:0000:00:06.0
P0P1      S4    *disabled  pci:0000:00:1e.0
PS2K      S4    *enabled   pnp:00:0b
EUSB      S4    *enabled   pci:0000:00:1d.7
USBE      S4    *enabled   pci:0000:00:1a.7
P0P4      S4    *disabled  pci:0000:00:1c.0
P0P5      S4    *disabled
P0P6      S4    *disabled  pci:0000:00:1c.2
P0P7      S4    *disabled
P0P8      S4    *disabled
P0P9      S4    *disabled
GBEC      S4    *disabled
USB0      S4    *enabled   pci:0000:00:1d.0
USB1      S4    *enabled   pci:0000:00:1d.1
USB2      S4    *enabled   pci:0000:00:1d.2
USB3      S4    *disabled
USB4      S4    *enabled   pci:0000:00:1a.0
USB5      S4    *enabled   pci:0000:00:1a.1
USB6      S4    *enabled   pci:0000:00:1a.2
MBT4      S4    *disabled

Seemingly relevant kernel options used (3.10.25-gentoo SMP, 64bit, IA32emul=off, no-multilib):

  • CONFIG_HOTPLUG_CPU=y and with cpu0_hotplug by default
  • Suspend to ram and standby Hibernation
  • Power mgmt debug support
  • Suspend/resume event tracing
  • ACPI support
  • CPU idle PM support
  • Cpuidle Driver for Intel Processors
  • Support for systemd through Gentoo option in kernel was enabled

BIOS setup is pretty standard:

  • I've enabled ACPI2.0 extra tables
  • Not seeing any wake events for USB but I've tried wake up events from PCI/PCIe/PS2 etc but indeed this is a wireless usb keyboard
  • Board is old school winner Maximus Formula with Q6600 Core2quad

OpenRC was updated to systemd and the kernel was recompiled to support that. Configuration was also updated like so. With systemd, apcid is not required in all instances. For instance without running you can issue systemctl suspend and the behavior is... the same as before i.e. wake up only from power button...

pstree output:

systemd 
  ├─acpid -f
  ├─at-spi-bus-laun
  │   ├─dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork--print-addres
  │   └─2*[{at-spi-bus-laun}]
  ├─at-spi2-registr --use-gnome-session
  │   └─{at-spi2-registr}
  ├─dbus-daemon --system --address=systemd: --nofork --nopidfile--systemd-activation
  ├─dbus-daemon --fork --print-pid 5 --print-address 7 --session
  ├─dbus-launch --sh-syntax --exit-with-session
  ├─dhcpcd -q --nobackground
  ├─login --    
  │   └─bash
  │       └─startx /usr/bin/startx
  │           └─xinit /etc/X11/xinit/xinitrc -- /etc/X11/xinit/xserverrc :0 -auth...
  │               ├─X -nolisten tcp :0 -auth /home/user/.serverauth.3329
  │               └─openbox --startup /usr/libexec/openbox-autostart OPENBOX
  │                   ├─firefox
  │                   │   ├─plugin-containe ...
  │                   │   │   └─6*[{plugin-containe}]
  │                   │   └─35*[{firefox}]
  │                   └─vlc
  │                       └─4*[{vlc}]
  ├─lxterminal
  │   ├─bash
  │   │   └─htop
  │   ├─bash
  │   │   └─su
  │   │       └─bash
  │   │           └─grc /usr/lib/python-exec/python2.7/grc tail -f ...
  │   │               ├─grcat /usr/lib/python-exec/python2.7/grcat conf.log
  │   │               └─tail -f /var/log/emerge.log
  │   ├─bash
  │   ├─gnome-pty-helpe
  │   └─{lxterminal}
  ├─mount.ntfs /dev/sdb1 /mnt/div -o rw
  ├─roxterm
  │   ├─bash
  │   │   └─su
  │   │       └─bash
  │   │           └─pstree -a
  │   ├─gnome-pty-helpe
  │   └─{roxterm}
  ├─systemd --user
  │   └─(sd-pam)                 
  ├─systemd-journal
  ├─systemd-logind
  ├─systemd-udevd
  ├─wbar --pos bot-right --taskbar --isize 24
  └─xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55
0

This is often also a BIOS setting. You can check it with:

grep ^PWRB /proc/acpi/wakeup  

and enable it with

echo "PWRB" > /proc/acpi/wakeup  
  • It echoes nothing with my setup. I added the output to the Q. I will try setting it up later. Thanks! – user44370 Jan 10 '14 at 23:04
  • It doesn't alter the behavior with my setup. Actually, I don't have that variable in /proc/acpi/wakeup and trying to set it doesn't make anything new appear when I do the listing I did. I enabled ACPI2.0 extra tables in the bios and tried even allowing spacebar to turn on, nothing impacts anything. I guess I'll be pressing that power button for the moment... – user44370 Jan 10 '14 at 23:57
  • What about your BIOS settings? There is often a WakeUP behaviour. – user55518 Jan 11 '14 at 0:06
0

It depends mainly on the used hardware and not on the software.

To be able to resume from a keyboard event on an USB keyboard

  1. the BIOS must support resuming from an USB event. In your case USB0, etc. in /proc/acpi/wakeup confirm the support.
  2. the USB ports must be powered while in suspend. This is often a BIOS setting or controlled by a jumper on the mainboard. The procedure is usually documented in the mainboards manual.
  3. The keyboard needs to support sending an event while the operating system isn't running. Especially wireless keyboards may not support this, mostly to save power and to simplify the firmware.

As your /proc/acpi/wakeup shows that the BIOS supports wakeup via USB from suspend and even hibernation (S4 in the second column) and wakeup is enabled for most USB ports (third column), there is a high probablility that your wireless keyboard is the culprit and nothing you change in the OS or in the BIOS will make wakeup work with it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy