You are not logged in.
Pages: 1
Hello, about power saving, I tried laptop-mode-tools. It's wonderful but the shutdown failed with battery (I tried to disable any option of laptop-mode-tools but I couldn't power off with battery). Actually I'm using cpufrequtils and acpi (I use gnome, so I don't need to setting pm-utils), but I have some questions.
I set /etc/acpi/handler.sh in this way
#!/bin/sh
# Default acpi script that takes an entry for all actions
minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
set $*
case "$1" in
button/power)
#echo "PowerButton pressed!">/dev/tty5
case "$2" in
PBTN|PWRF) logger "PowerButton pressed: $2" ;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
button/sleep)
case "$2" in
SBTN) echo -n mem >/sys/power/state ;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
ac_adapter)
case "$2" in
AC*|AD*)
case "$4" in
00000000)
# Brightness
echo -n 5 > /sys/class/backlight/acpi_video0/brightness
# Frequency
for i in {0..3}; do
echo -n $minspeed > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_setspeed
done
# Governor
for i in {0..3}; do
echo conservative > /sys/devices/system/cpu//cpu${i}/cpufreq/scaling_governor
done
# Hard disk
hdparm -B 128
# Terminal blanking
setterm -blank 1 -powerdown 2
;;
00000001)
echo -n 9 > /sys/class/backlight/acpi_video0/brightness
for i in {0..3}; do
echo -n $maxspeed > /sys/devices/system/cpu/cpu${i}/cpufreq/scaling_setspeed
done
for i in {0..3}; do
echo performance > /sys/devices/system/cpu//cpu${i}/cpufreq/scaling_governor
done
hdparm -B 254
setterm -blank 10 -powerdown 10
;;
esac
;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
battery)
case "$2" in
BAT0)
case "$4" in
00000000) #echo "offline" >/dev/tty5
;;
00000001) #echo "online" >/dev/tty5
;;
esac
;;
CPU0)
;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
button/lid)
case "$3" in
close)
#echo "LID closed!">/dev/tty5
;;
open)
#echo "LID opened!">/dev/tty5
;;
esac
;;
*)
logger "ACPI group/action undefined: $1 / $2"
;;
esac
In /etc/rc.conf
MODULES=(acpi-cpufreq cpufreq_conservative fuse vboxdrv)
and
DAEMONS=(@syslog-ng @crond dbus @networkmanager @cupsd @sshd acpid @alsa @zramswap @psd)
The problem are:
1) Brightness is set always to 10 (max)
2) scaling_setspeed is set always to <unsupported>
3) I don't know if hard disk speed down is set properly (how can I check it?)
I don't understand. I can set them manually... Where I'm wrong?
Last edited by cypherinside (2012-03-11 16:45:51)
To be or not to be? ...Not to be! (Last Action Hero)
Offline
I'm not certain if your handler.sh is the right conf-file to set that diverse settings.
What I do is simply create a lttle script in my /home and set different powersettings there. I let my rc.local point to the script and things are done easily....
I think that your handler.sh just handles acpi-events..hdparm settings are not part of that, are they ?
xbacklight handles brightness the easy way. Just put it in start-up programs of your DE/WM..
Cpufreq is handled in a lot of ways >> again I don't think handler.sh is part of those...
Offline
I've got settings in my handler.sh as well. However, most of my important settings are covered by pm-powersave, which is executed from /etc/acpi/power.sh (as directed by /etc/acpi/events/battery). I also have the AUR package for asus scripts installed (I've got an asus laptop), which provides some settings.
To answer your original question:
1. I use pm-powersave for managing my brightness (you can add custom scripts to /etc/pm/power.d/), and simply echo values to the file, same as you're doing. Maybe give that a shot?
2. No idea, never had that issue before, sorry.
3. As for the hdparm command, I've never had it work properly for me, and I'm not sure how to check more (than just enabled/disabled, which is done with hdparm -i /dev/sda). However, I imagine you need to specify the hard drive in your command (hdparm -B 254 /dev/sda, for example). Some people recommend adjusting the spindown_time in the /etc/hdparm.conf file. But again, I don't do so (and I have no complaints about battery life).
Lswest <- the first letter of my username is a lowercase "L".
"...the Linux philosophy is "laugh in the face of danger". Oops. Wrong one. "Do it yourself". That's it." - Linus Torvalds
Offline
Never mind. I reinstalled laptop-mode-tools and before turning off the laptop I stopped it (it's very simple... I don't know why I thought this only now )
Last edited by cypherinside (2012-03-09 13:37:01)
To be or not to be? ...Not to be! (Last Action Hero)
Offline
Why do you think laptop-mode-tools has anything to do with handler.sh? I've used LMT quite successfully as a daemon in rc.conf and never fiddled with ACPI. To manipulate LMT, there are .conf files in /etc/laptop-mode/conf.d This sounds more like a acpid issue alone (which I would start sooner at boot). AC/battery switching events are handled by LMT which queries ACPI. Cpufrequtils has it's own directory in /etc, or you can have LMT handle it.
From your first post, it looks like you're not even using LMT. You might as well uninstall it if you're going to be more hands on, writing your own scripts.
Check out: https://bbs.archlinux.org/viewtopic.php … 5#p1045475
my laptop DAEMONS=(hwclock acpid syslog-ng dbus iptables crond laptop-mode)
--------------------------The only wasted day is one in which you learn nothing.--------------------------
Offline
Why do you think laptop-mode-tools has anything to do with handler.sh?
I don't think this. I installed LMT but the system hung at power off with the battery, so i removed LMT (infact when i wrote the 1st post LMT wasn't installed). Now i found a way to use LMT, so I don't care anymore handler.sh configuration.
Last edited by cypherinside (2012-03-10 22:11:50)
To be or not to be? ...Not to be! (Last Action Hero)
Offline
Pages: 1