9

I like powertop --auto-tune because the speakers of my laptop are soughing when not being used and powertop disables the speakers completely when they're not used, stopping the noise.

However, my USB mouse gets disabled within seconds after not using it and after a few more seconds, my touchpad has a delayed response (works fine after the first delay of a fraction of a second, though).

How do I make this stop but still disable my speakers completely when no audio is put out?

UTF-8
  • 5,910
  • 10
  • 34
  • 68

3 Answers3

21

If you run powertop --auto-tune manually you could create a script like:

cat - > powertune.sh <<EOF
#!/bin/bash
powertop --auto-tune
HIDDEVICES=$(ls /sys/bus/usb/drivers/usbhid | grep -oE '^[0-9]+-[0-9\.]+' | sort -u)
for i in $HIDDEVICES; do
  echo -n "Enabling " | cat - /sys/bus/usb/devices/$i/product
  echo 'on' > /sys/bus/usb/devices/$i/power/control
done
EOF

The script will run powertop and then look at all the USB devices using the Human Interface Device driver and subsequently disable power management for them. So it should be resistant to plugging mice/keyboard in different ports.

You could also combine it with a systemd service to run it automatically at bootup.

10

Try running "sudo powertop" and tab over to the "Tunables" selection, there it should show you a list of everything that powertop is able to tune. Somewhere on that list will show your something like, "Autosuspend for USB device...,"

One of the USB devices listed should be the one you are having trouble with; try leaving it's settings as "Bad" as that is the unmodified state.

Check out the powertop users guide for additional info and tips: https://01.org/sites/default/files/page/powertop_users_guide_201406.pdf

RDK
  • 116
4

Check out my little project to create a shell script to automatically apply powertop's "good" power settings.

You can then easily edit the resulting script to comment out any configuration that's giving you trouble and run it instead of sudo powertop --auto-tune.

David Foerster
  • 36,890
  • 56
  • 97
  • 151
Jesse
  • 41