/[gentoo]/xml/htdocs/doc/en/power-management-guide.xml
Gentoo

Diff of /xml/htdocs/doc/en/power-management-guide.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.15 Revision 1.51
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v 1.15 2005/10/28 14:48:06 so Exp $ --> 3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v 1.51 2012/03/28 23:20:12 nightmorph Exp $ -->
4<guide link="/doc/en/power-management-guide.xml"> 4
5<guide>
5<title>Power Management Guide</title> 6<title>Power Management Guide</title>
6 7
7<author title="Author"> 8<author title="Author">
8 <mail link="fragfred@gmx.de">Dennis Nienhüser</mail> 9 <mail link="swift"/>
9</author> 10</author>
10 11
11<abstract> 12<abstract>
12Power Management is the key to extend battery run time on mobile systems like 13In recent years, power management has become one of the differentiating
13laptops. This guide assists you setting it up on your laptop. 14features in the quest for finding the perfect laptop. Yet, the operating system
15must support the various power saving functionalities too. In this guide, we
16cover how to setup your Gentoo installation so it manages power-hungry resources
17in a flexible yet automated manner.
14</abstract> 18</abstract>
15 19
16<!-- The content of this document is licensed under the CC-BY-SA license --> 20<!-- The content of this document is licensed under the CC-BY-SA license -->
17<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 21<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
18<license/> 22<license/>
19 23
20<version>1.25</version> 24<version>6</version>
21<date>2005-10-02</date> 25<date>2012-03-28</date>
22 26
23<chapter> 27<chapter>
24<title>Introduction</title> 28<title>Introduction</title>
25<section> 29<section>
26<title>Why Power Management?</title> 30<title>About this document...</title>
27<body>
28
29<p>
30Capacity and lifetime of laptop batteries have improved much in the last years.
31Nevertheless modern processors consume much more energy than older ones and
32each laptop generation introduces more devices hungry for energy. That's why
33Power Management is more important than ever. Increasing battery run time
34doesn't necessarily mean buying another battery. Much can be achieved applying
35intelligent Power Management policies.
36</p>
37
38</body> 31<body>
39</section>
40 32
33<p>
34This document describes the setup of power management features on your laptop.
35Although some of the information in this guide can be applied to power
36management for servers, it is not the intention of this document to go that
37route. Please be careful when applying this on a non-laptop system.
38</p>
39
40<p>
41Within this document, we will focus primarily on the laptop mode tools since it
42offers a complete set of functionalities. However, we will also refer to other
43tools that might offer a more detailed approach on individual settings. In such
44cases, you will need to disable the feature from the laptop mode tools so that
45both tools do not fight over the same resource control.
46</p>
47
48</body>
41<section> 49</section>
42<title>A quick overview</title>
43<body>
44
45<p>
46Please notice that this guide describes Power Management for <e>laptops</e>.
47While some sections might also suite for <e>servers</e>, others do not and may
48even cause harm. Please do not apply anything from this guide to a server
49unless you really know what you are doing.
50</p>
51
52<p>
53As this guide has become rather long, here's a short overview helping you to
54find your way through it.
55</p>
56
57<p>
58The <e>Prerequisites</e> chapter talks about some requirements that should be
59met before any of the following device individual sections will work. This
60includes BIOS settings, kernel configuration and some simplifications in user
61land. The following three chapters focus on devices that typically consume
62most energy - processor, display and hard drive. Each can be configured
63seperately. <e>CPU Power Management</e> shows how to adjust the processor's
64frequency to save a maximum of energy whithout losing too much performance. A
65few different tricks prevent your hard drive from working unnecessarily often
66in <e>Disk Power Management</e> (decreasing noise level as a nice side
67effect). Some notes on graphics cards, Wireless LAN and USB finish the device
68section in <e>Power Management for other devices</e> while another chapter is
69dedicated to the (rather experimental) <e>sleep states</e>. Last not least
70<e>Troubleshooting</e> lists common pitfalls.
71</p>
72
73</body>
74</section> 50<section>
51<title>About laptop_mode</title>
52<body>
75 53
54<p>
55The <c>laptop_mode</c> setting is an in-kernel configuration setting that
56optimizes I/O, allowing disks to spin down properly (and not be woken up
57immediately afterwards for queued operations).
58</p>
59
60</body>
76<section> 61</section>
77<title>Power Budget for each component</title> 62<section>
63<title>About laptop-mode-tools</title>
78<body> 64<body>
79 65
80<figure link="/images/energy-budget.png" short="Which component consumes how
81much energy?" caption="Power budget for each component"/>
82
83<p> 66<p>
84Nearly every component can operate in different states - off, sleep, idle, 67The <e>Laptop Mode Tools</e> is a software package
85active to name a few - consuming a different amount of energy. Major parts are 68(<c>app-laptop/laptop-mode-tools</c>) which allows the user to optimize power
86consumed by the LCD display, CPU, chipset and hard drives. Often one is able to 69saving functions. It allows managing the <c>laptop_mode</c> setting in the Linux
87activate OS-independent Power Management in the BIOS, but an intelligent setup 70kernel, but has additional features allowing you to tweak other power-related
88in the operating system adapting to different situations can achieve much more. 71settings on the system.
89</p> 72</p>
90 73
91</body> 74</body>
92</section> 75</section>
93</chapter> 76</chapter>
94 77
95<chapter> 78<chapter>
96<title>Prerequisites</title> 79<title>Linux Kernel Configuration</title>
97<section>
98<title>What has to be done first</title>
99<body>
100
101<p>
102Before going into the details on making individual devices Power Management
103aware, make sure certain requirements are met. After controlling the BIOS
104settings, some kernel options want to be enabled - these are in short ACPI,
105sleep states and CPU frequency scaling. As power saving most of the time comes
106along with performance loss or increased latency, it should only be enabled
107when running on batteries. That's where a new runlevel <e>battery</e> comes in
108handy.
109</p>
110
111</body>
112</section> 80<section>
113<section> 81<title>Minimum kernel setup</title>
114<title>The BIOS part</title>
115<body>
116
117<p>
118First have a look into your BIOS Power Management settings. The best way is to
119combine BIOS and operating system policies, but for the moment it's better to
120disable most of the BIOS part. This makes sure it doesn't interfere with your
121policies. Don't forget to re-check BIOS settings after you configured
122everything else.
123</p>
124
125</body> 82<body>
126</section>
127<section>
128<title>Configuring the kernel</title>
129<body>
130 83
131<p>
132ACPI (Advanced Configuration and Power Interface) support in the kernel is
133still work in progress. Using a recent kernel will make sure you'll get the
134most out of it.
135</p> 84<p>
136
137<p>
138There are different kernel sources in Portage. I'd recommend using 85There are different kernel sources in Portage. We recommend using
139<c>gentoo-sources</c> or <c>suspend2-sources</c>. The latter contains patches 86<c>gentoo-sources</c>, but if you want advanced hibernation support you might
140for Software Suspend 2, see the chapter about sleep states for details. When 87need <c>tuxonice-sources</c>. To enable proper power management features in the
141configuring the kernel, activate at least these options: 88Linux kernel, enable at least the following settings:
142</p> 89</p>
143 90
144<pre caption="Minimum kernel setup for Power Management (Kernel 2.6)"> 91<pre caption="Minimum kernel setup for Power Management">
145Power Management Options ---&gt; 92<![CDATA[
146 [*] Power Management Support 93General setup --->
147 [ ] Software Suspend 94 [*] Configure standard kernel features (expert users) --->
148 95
96Power management and ACPI options --->
97 [*] Run-time PM core functionality
149 ACPI( Advanced Configuration and Power Interface ) Support ---&gt; 98 [*] ACPI (Advanced Configuration and Power Interface) Support --->
150 [*] ACPI Support
151 [ ] Sleep States
152 [ ] /proc/acpi/sleep (deprecated)
153 [*] AC Adapter 99 <*> AC Adapter
154 [*] Battery 100 <*> Battery
155 &lt;M&gt; Button 101 -*- Button
156 &lt;M&gt; Video 102 -*- Video
157 [ ] Generic Hotkey 103 <*> Fan
158 &lt;M&gt; Fan 104 <*> Processor
159 &lt;M&gt; Processor 105 <*> Thermal Zone
160 &lt;M&gt; Thermal Zone
161 &lt; &gt; ASUS/Medion Laptop Extras
162 &lt; &gt; IBM ThinkPad Laptop Extras
163 &lt; &gt; Toshiba Laptop Extras
164 (0) Disable ACPI for systems before Jan 1st this year
165 [ ] Debug Statements
166 [*] Power Management Timer Support 106 [*] Power Management Timer Support
167 &lt; &gt; ACPI0004,PNP0A05 and PNP0A06 Container Driver (EXPERIMENTAL) 107
168
169 CPU Frequency Scaling ---&gt; 108 [*] CPU Frequency scaling --->
170 [*] CPU Frequency scaling 109 [*] CPU Frequency scaling
171 [ ] Enable CPUfreq debugging
172 &lt; &gt; CPU frequency translation statistics
173 [ ] CPU frequency translation statistics details
174 Default CPUFreq governor (userspace)
175 &lt;*&gt; 'performance' governor 110 <*> 'performance' governor
176 &lt;*&gt; 'powersave' governor 111 <*> 'powersave' governor
177 &lt;*&gt; 'ondemand' cpufreq policy governor 112 <*> 'userspace' governor
113 <*> 'ondemand' governor
178 &lt;*&gt; 'conservative' cpufreq governor 114 <*> 'conservative' governor
179 &lt;*&gt; CPU frequency table helpers
180 &lt;M&gt; ACPI Processor P-States driver 115 <*> ACPI Processor P-States driver
181 &lt;*&gt; <i>CPUFreq driver for your processor</i> 116]]>
182</pre> 117</pre>
183 118
184<p>
185Decide yourself whether you want to enable Software Suspend, and Sleep States
186(see below). If you own an ASUS, Medion, IBM Thinkpad or Toshiba laptop, enable
187the appropriate section.
188</p> 119<p>
189 120Don't forget to enable the CPU frequency scaling driver for your CPU, located
121right after the <e>ACPI Processor P-States driver</e> mentioned above.
190<p> 122</p>
191The kernel has to know how to enable CPU frequency scaling on your processor. As 123
192each type of CPU has a different interface, you've got to choose the right
193driver for your processor. Be careful here - enabling <e>Intel Pentium 4 clock
194modulation</e> on a Pentium M system will lead to strange results for example.
195Consult the kernel documentation if you're unsure which one to take.
196</p> 124<p>
197 125Build and install the new kernel (if necessary) and reboot.
198<p> 126</p>
199Compile your kernel, make sure the right modules get loaded at startup and boot
200into your new ACPI-enabled kernel. Next run <c>emerge sys-power/acpid</c> to get
201the acpi daemon. This one informs you about events like switching from AC to
202battery or closing the lid. Make sure the modules are loaded if you didn't
203compile them into the kernel and start acpid by executing
204<c>/etc/init.d/acpid start</c>. Run <c>rc-update add acpid default</c> to load
205it on startup. You'll soon see how to use it.
206</p>
207 127
208<pre caption="Installing acpid">
209# <i>emerge sys-power/acpid</i>
210# <i>/etc/init.d/acpid start</i>
211# <i>rc-update add acpid default</i>
212</pre>
213
214</body> 128</body>
215</section>
216<section> 129</section>
217<title>Creating a "battery" runlevel</title> 130<!--
131<section id="kernelconfig">
132<title>Additional kernel configuration entries</title>
133<body>
134
135<p>
136Further down this guide, additional kernel settings might be suggested. To
137lessen the effort to maintain the guide, and to make sure settings are correctly
138identified, we will use the kernel configuration short-hand notations. These
139notations are simple strings, like <c>CONFIG_USB_SUSPEND</c>. But how to read
140this?
141</p>
142
143<p>
144Well, then you configure your kernel (through <c>make menuconfig</c>), you can
145search through the configuration settings for a particular entry. Press <c>/</c>
146while configuring the Linux kernel and type the setting
147(<c>CONFIG_USB_SUSPEND</c>). The software will tell you what the setting is,
148what it is for, when you can select it (i.e. on which settings it depends before
149you can see it) but most importantly, where you can find it.
150</p>
151
152<pre caption="Result of a search operation during menuconfig">
153<![CDATA[Symbol: USB_SUSPEND [=n]
154Type : boolean
155Prompt: USB runtime power management (autosuspend) and wakeup
156 Defined at drivers/usb/core/Kconfig:93
157 Depends on: USB_SUPPORT [=y] && USB [=y] && PM_RUNTIME [=n]
158 Location:
159 -> Device Drivers
160 -> USB support (USB_SUPPORT [=y])
161 -> Support for Host-side USB (USB [=y]) ]]>
162</pre>
163
218<body> 164</body>
165</section>
166-->
167</chapter>
219 168
169<chapter>
170<title>Using Laptop Mode Tools</title>
171<section>
172<title>Installation</title>
173<body>
174
175<p>
176It comes to no surprise that installation of the <e>Laptop Mode Tools</e>
177software is easily done through <c>emerge laptop-mode-tools</c>. However, this
178package takes on additional, optional settings through USE flag configuration.
179So let's first take a look at the supported USE flags and what they mean to the
180package.
220<p> 181</p>
221The default policy will be to enable Power Management only when needed - 182
222running on batteries. To make the switch between AC and battery convenient, 183<table>
223create a runlevel <e>battery</e> that holds all the scripts starting and 184<tr>
224stopping Power Management. 185 <th>USE flag</th>
186 <th>Description</th>
187 <th>Suggested when...</th>
188</tr>
189<tr>
190 <ti>acpi</ti>
191 <ti>
192 Depend on <c>sys-power/acpid</c> so that changes in the system are
193 captured and power saving features are automatically enabled/disabled.
194 </ti>
195 <ti>your laptop is not too old (~ year 2003 and later)</ti>
196</tr>
197<tr>
198 <ti>apm</ti>
199 <ti>
200 Depend on <c>sys-apps/apmd</c> so that changes in the system are captured
201 and power saving features are automatically enabled/disabled.
202 </ti>
203 <ti>your laptop is very old</ti>
204</tr>
205<tr>
206 <ti>bluetooth</ti>
207 <ti>
208 Depend on <c>net-wireless/bluez</c>, enabling the <c>laptop-mode-tools</c>
209 to manage bluetooth settings (enabling/disabling the service based on
210 battery availability)
211 </ti>
212 <ti>your laptop (and kernel) supports bluetooth</ti>
213</tr>
214<tr>
215 <ti>scsi</ti>
216 <ti>
217 Depend on <c>sys-apps/sdparm</c>, enabling the <c>laptop-mode-tools</c> to
218 manage SCSI (<e>and not</e> SATA) disk parameters.
219 </ti>
220 <ti>your laptop uses SCSI disks</ti>
221</tr>
222</table>
223
224<p>
225As you can see, there are two USE flags that seem to collide: <c>acpi</c> and
226<c>apm</c>. So what's the deal there?
227</p>
228
229<ul>
230 <li>
231 The <c>apm</c> USE flag enables support for <e>Advanced Power
232 Management</e>, an older (before year 2000) standard for power management
233 features within a system.
234 </li>
235 <li>
236 The <c>acpi</c> USE flag enables support for <e>Advanced Configuration and
237 Power Interface</e>, the successor of APM. All modern laptops support ACPI.
238 </li>
239</ul>
240
241<p>
242Depending on your system, you will either need <c>acpi</c> or <c>apm</c> set. In
243the remainder of this guide, we assume that your laptop is recent enough to use
244ACPI.
245</p>
246
247<p>
248So, with the USE flags set, let's install <c>laptop-mode-tools</c>.
225</p> 249</p>
226 250
227<note> 251<note>
228You can safely skip this section if you don't like the idea of having another 252If you have USE="acpi" set, the installation will pull in <c>acpid</c>. However,
229runlevel. However, skipping this step will make the rest a bit trickier to set 253the current stable ACPI daemon (2.0.9) does not support the new ACPI interfaces
230up. The next sections assume a runlevel <e>battery</e> exists. 254within the Linux kernel (using the netlink interface). As such, we recommend
255unmasking <c>sys-power/acpid-2.0.12</c> (or higher). For more information about
256unmasking packages, please read
257<uri link="/doc/en/handbook/handbook-amd64.xml?part=3&amp;chap=3">Mixing Software
258Branches</uri> in the Gentoo Handbook.
231</note> 259</note>
232 260
233<pre caption="Creating a battery runlevel"> 261<pre caption="Installing laptop-mode-tools">
234# <i>cd /etc/runlevels</i> 262# <i>emerge laptop-mode-tools</i>
235# <i>cp -a default battery</i>
236</pre>
237
238<p>
239Finished. Your new runlevel <e>battery</e> contains everything like
240<e>default</e>, but there is no automatic switch between both yet. Time to
241change it.
242</p> 263</pre>
243 264
244</body> 265</body>
245</section>
246<section> 266</section>
247<title>Reacting on ACPI events</title> 267<section>
268<title>Configuration</title>
269<body>
270
271<p>
272Having <c>laptop-mode-tools</c> installed on your system does not automatically
273enable the power management features that you might need. To configure the
274package, first take a look at <path>/etc/laptop-mode/laptop-mode.conf</path>.
275This is the main configuration file for the package and is pretty well described
276(through comments).
277</p>
278
279<p>
280But it is not the only configuration file to work with. The Laptop Mode Tools
281package supports plugins (or modules) which have their own configuration
282file(s). These files are located in <path>/etc/laptop-mode/conf.d</path> and are
283named after the module they represent (such as
284<path>intel-sata-powermgmt.conf</path>).
285</p>
286
287<p>
288Now, one of the important settings in each configuration file is if the Laptop
289Mode Tools package should govern a particular setting or not. This is important
290when you want to combine <c>laptop-mode-tools</c> with other services like
291<c>cpufreqd</c>. In this example case, you will need to set
292<c>CONTROL_CPU_FREQUENCY=0</c>:
293</p>
294
295<pre caption="Editing /etc/laptop-mode/conf.d/cpufreq.conf">
296# <i>nano -w /etc/laptop-mode/conf.d/cpufreq.conf</i>
297CONTROL_CPU_FREQUENCY=<i>0</i>
298</pre>
299
300<p>
301The next few sections will help you configure <c>laptop-mode-tools</c> to suit
302your needs. When you are finished, start the <c>laptop_mode</c> service and make
303sure it is started when you boot up your system.
304</p>
305
306<pre caption="Starting the laptop_mode service">
307# <i>/etc/init.d/laptop_mode start</i>
308# <i>rc-update add laptop_mode default</i>
309</pre>
310
248<body> 311</body>
312</section>
313<section>
314<title>How does laptop-mode-tools work</title>
315<body>
249 316
250<p>
251Typical ACPI events are closing the lid, changing the power source or pressing
252the sleep button. An important event is changing the power source, which should
253cause a runlevel switch. A small script will take care of it.
254</p> 317<p>
255 318When running the <c>laptop_mode</c> service, the software will check in which
319state your system is in. The states are defined as:
256<p> 320</p>
257First you need a script which changes the runlevel to <c>default</c> 321
258respectively <c>battery</c> depending on the power source. The script uses the 322<ul>
259<c>on_ac_power</c> command from <c>sys-power/powermgmt-base</c> - make sure the 323 <li>
260package is installed on your system. 324 <e>Battery</e>, in the configuration files using the <c>BATT_</c> prefix, is
325 active when the system is running on battery power
326 </li>
327 <li>
328 <e>AC</e>, in the configuration files using the <c>AC_</c> prefix, is active
329 when the system is running on AC power
330 </li>
331 <li>
332 <e>Laptop Mode</e>, in the configuration files using the <c>LM_</c> prefix,
333 is active when <e>laptop mode</e> is enabled
334 </li>
335 <li>
336 <e>No Laptop Mode</e>, in the configuration files using the <c>NOLM_</c>
337 prefix, is active when <e>laptop mode</e> is disabled
338 </li>
339</ul>
340
261</p> 341<p>
262 342The <c>AC/BATT_</c> and <c>LM/NOLM_</c> prefixes can be combined (so you can
263<pre caption="Installing powermgt-base"> 343have a <c>AC_LM_</c> prefix).
264<i># emerge powermgmt-base</i>
265</pre>
266
267<p> 344</p>
268You are now able to determine the power source by executing 345
269<c>on_ac_power &amp;&amp; echo AC available || echo Running on batteries</c> in
270a shell. The script below is responsible for changing runlevels. Save it as
271<path>/etc/acpi/actions/pmg_switch_runlevel.sh</path>.
272</p> 346<p>
273 347When the <c>laptop_mode</c> service is started, it will switch modes based on
274<pre caption="/etc/acpi/actions/pmg_switch_runlevel.sh"> 348events that occur (and of course based on the configuration settings). For
275#!/bin/bash 349instance, the setting <c>ENABLE_LAPTOP_MODE_ON_BATTERY=1</c> will make sure that
276 350the laptop mode tools switch to <e>laptop mode</e> when battery power is used.
277<comment># BEGIN configuration</comment> 351If that is the case, then the settings starting with <c>LM_</c>,
278RUNLEVEL_AC="default" 352<c>LM_BATT_</c>, <c>BATT_LM_</c> and <c>BATT_</c> will be used.
279RUNLEVEL_BATTERY="battery"
280<comment># END configuration</comment>
281
282
283if [ ! -d "/etc/runlevels/${RUNLEVEL_AC}" ]
284then
285 logger "${0}: Runlevel ${RUNLEVEL_AC} does not exist. Aborting."
286 exit 1
287fi
288
289if [ ! -d "/etc/runlevels/${RUNLEVEL_BATTERY}" ]
290then
291 logger "${0}: Runlevel ${RUNLEVEL_BATTERY} does not exist. Aborting."
292 exit 1
293fi
294
295if on_ac_power
296then
297 if [[ "$(cat /var/lib/init.d/softlevel)" != "${RUNLEVEL_AC}" ]]
298 then
299 logger "Switching to ${RUNLEVEL_AC} runlevel"
300 /sbin/rc ${RUNLEVEL_AC}
301 fi
302elif [[ "$(cat /var/lib/init.d/softlevel)" != "${RUNLEVEL_BATTERY}" ]]
303then
304 logger "Switching to ${RUNLEVEL_BATTERY} runlevel"
305 /sbin/rc ${RUNLEVEL_BATTERY}
306fi
307</pre>
308
309<p> 353</p>
310Dont forget to run <c>chmod +x /etc/acpi/actions/pmg_switch_runlevel.sh</c> to 354
311make the script executable. The last thing that needs to be done is calling the
312script whenever the power source changes. That's done by catching ACPI events
313with the help of <c>acpid</c>. First you need to know which events are
314generated when the power source changes. The events are called
315<e>ac_adapter</e> and <e>battery</e> on most laptops, but it might be different
316on yours.
317</p> 355<p>
318 356To make sure settings to not collide, it is not allowed to have overlapping
319<pre caption="Determining ACPI events for changing the power source"> 357settigns. In the next example, the first set (for <c>CPU_MAXFREQ</c>) is valid,
320<i># tail -f /var/log/acpid | grep "received event"</i> 358but the second one (for <c>CPU_GOVERNOR</c>) isn't.
321</pre>
322
323<p> 359</p>
324Run the command above and pull the power cable. You should see something 360
325like this: 361<pre caption="Colliding settings">
362<comment>## Valid set</comment>
363BATT_CPU_MAXFREQ=fastest
364LM_AC_CPU_MAXFREQ=fastest
365NOLM_AC_CPU_MAXFREQ=fastest
366
367<comment>## Invalid set</comment>
368BATT_CPU_MINFREQ=fastest
369LM_AC_CPU_MINFREQ=fastest
370<comment># The following includes AC and BATT, but BATT is already defined</comment>
371NOLM_CPU_MINFREQ=fastest
372</pre>
373
374</body>
375</section>
376<section>
377<title>Configuring CPU frequency management</title>
378<body>
379
326</p> 380<p>
327 381The support for CPU frequency management in the laptop mode tools allows
328<pre caption="Sample output for power source changes"> 382switching frequencies. It supports setting the CPU frequency governor, minimum
329[Tue Sep 20 17:39:06 2005] received event "ac_adapter AC 00000080 00000000" 383frequency and maximum frequency. The configuration file used here is
330[Tue Sep 20 17:39:06 2005] received event "battery BAT0 00000080 00000001" 384<path>/etc/laptop-mode/conf.d/cpufreq.conf</path>.
331</pre>
332
333<p> 385</p>
334The interesting part is the quoted string after <e>received event</e>. It will 386
335be matched by the event line in the files you are going to create below. Don't
336worry if your system generates multiple events or always the same. As long as
337any event is generated, runlevel changing will work.
338</p> 387<p>
339 388The <e>CPU frequency governor</e> is a kernel-level policy that defines how the
340<pre caption="/etc/acpi/events/pmg_ac_adapter"> 389kernel will select the CPU frequency. We already selected the governors we want
341<comment># replace "ac_adapter" below with the event generated on your laptop</comment> 390to use in the kernel configuration earlier. Let's recap:
342<comment># For example, ac_adapter.* will match ac_adapter AC 00000080 00000000</comment>
343event=ac_adapter.*
344action=/etc/acpi/actions/pmg_switch_runlevel.sh %e
345</pre>
346
347<pre caption="/etc/acpi/events/pmg_battery">
348<comment># replace "battery" below with the event generated on your laptop</comment>
349<comment># For example, battery.* will match battery BAT0 00000080 00000001</comment>
350event=battery.*
351action=/etc/acpi/actions/pmg_switch_runlevel.sh %e
352</pre>
353
354<p> 391</p>
355Finally acpid has to be restarted to recognize the changes. 392
393<ul>
394 <li>
395 <c>performance</c> always picks the highest frequency
396 </li>
397 <li>
398 <c>powersave</c> always picks the lowest frequency
399 </li>
400 <li>
401 <c>userspace</c> does not pick anything, but let the user decide (or any
402 process that the user is running that will decide for the user)
403 </li>
404 <li>
405 <c>ondemand</c> will scale the CPU frequency up to the highest frequency
406 when load is available
407 </li>
408 <li>
409 <c>conservative</c> will scale the CPU frequency up gradually when load is
410 available
411 </li>
412</ul>
413
356</p> 414<p>
357 415When switching between AC or battery, or (no) laptop mode, the appropriate
358<pre caption="Finishing runlevel switching with acpid"> 416governor (as well as its minimum and maximum frequency) is selected.
359<i># /etc/init.d/acpid restart</i>
360</pre>
361
362<p> 417</p>
363Give it a try: Plug AC in and out and watch syslog for the "Switching to AC 418
364mode" or "Switching to battery mode" messages. See the Troubleshooting 419</body>
365section if the script is not able to detect the power source correctly. 420</section>
421<section>
422<title>Configuring display brightness</title>
423<body>
424
366</p> 425<p>
367 426With <path>/etc/laptop-mode/conf.d/lcd-brightness.conf</path>, you can have the
427laptop mode tools govern the brightness of your LCD screen.
368<p> 428</p>
369Due to the nature of the event mechanism, your laptop will boot into runlevel 429
370<e>default</e> regardless of the AC/battery state. This is fine when running
371from AC, but we'd like to boot into the battery runlevel otherwise. One
372solution would be to add another entry to the boot loader with the parameter
373<c>softlevel=battery</c>, but it's likely to forget choosing it. A better way
374is faking an ACPI event in the end of the boot process and letting
375<path>pmg_switch_runlevel.sh</path> script decide whether a
376runlevel change is necessary. Open <path>/etc/conf.d/local.start</path> in your
377favourite editor and add these lines:
378</p> 430<p>
379 431The file currently uses the <path>/proc/acpi/video/VID/LCD/brightness</path>
380<pre caption="Runlevel adjustment at boot time by editing local.start"> 432file to set brightness values. Recent kernels do not provide this anymore -
381<comment># Fake acpi event to switch runlevel if running on batteries</comment> 433you will need to adjust this to <path>/sys/class/backlight/acpi_video0/brightness</path>
382/etc/acpi/actions/pmg_switch_runlevel.sh "battery/battery" 434instead.
383</pre>
384
385<p> 435</p>
386Prepared like this you can activate Power Management policies for individual 436
387devices. 437<p>
438The values you can use are between 0 and 15, with 0 being the lowest brightness
439value.
440</p>
441
442</body>
443</section>
444<section>
445<title>Configuring other services</title>
446<body>
447
448<p>
449An interesting feature of <c>laptop-mode-tools</c> is to support reloading
450particular services (like the system logger) after switching its configuration
451file. This is handled through
452<path>/etc/laptop-mode/conf.d/configuration-file-control.conf</path>.
453</p>
454
455<p>
456If enabled, the <c>laptop_mode</c> application will switch the configuration
457file(s) of the mentioned services with the same file, but suffixed with
458<path>-nolm-ac</path>, <path>-lm-ac</path> or <path>-batt</path>. It willl then
459signal or reload the appropriate services so they can use the new configuration
460file.
388</p> 461</p>
389 462
390</body> 463</body>
391</section> 464</section>
392</chapter> 465</chapter>
393 466
394<chapter> 467<chapter>
395<title>CPU Power Management</title> 468<title>Using cpufreqd</title>
396<section>
397<title>Some technical terms</title>
398<body>
399
400<p>
401CPU frequency scaling brings up some technical terms that might be unknown to
402you. Here's a quick introduction.
403</p>
404
405<p>
406First of all, the kernel has to be able to change the processor's frequency.
407The <e>CPUfreq processor driver</e> knows the commands to do it on your CPU.
408Thus it's important to choose the right one in your kernel. You should
409already have done it above. Once the kernel knows how to change frequencies,
410it has to know which frequency it should set. This is done according to the
411<e>policy</e> which consists of a <e>CPUfreq policy</e> and a
412<e>governor</e>. A CPUfreq policy are just two numbers which define a range
413the frequency has to stay between - minimal and maximal frequency. The
414governor now decides which of the available frequencies in between minimal
415and maximal frequency to choose. For example, the <e>powersave governor</e>
416always chooses the lowest frequency available, the <e>performance
417governor</e> the highest one. The <e>userspace governor</e> makes no decision
418but chooses whatever the user (or a program in userspace) wants - which means
419it reads the frequency from
420<path>/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed</path>.
421</p>
422
423<p>
424This doesn't sound like dynamic frequency changes yet and in fact it isn't.
425Dynamics however can be accomplished with various approaches. For example,
426the <e>ondemand governor</e> makes its decisions depending on the current CPU
427load. The same is done by various userland tools like <c>cpudyn</c>,
428<c>cpufreqd</c>, <c>powernowd</c> and many more. ACPI events can be used to
429enable or disable dynamic frequency changes depending on power source.
430</p>
431
432</body>
433</section> 469<section>
434<section> 470<title>Installation</title>
435<title>Setting the frequency manually</title>
436<body>
437
438<p>
439Decreasing CPU speed and voltage has two advantages: On the one hand less
440energy is consumed, on the other hand there is thermal improvement as your
441system doesn't get as hot as running on full speed. The main disadvantage is
442obviously the loss of performance. Decreasing processor speed is a trade off
443between performance loss and energy saving.
444</p>
445
446<note>
447Not every laptop supports frequency scaling. If unsure, have a look at the list
448of supported processors in the <e>Troubleshooting</e> section to verify your's
449is supported.
450</note>
451
452<p>
453It's time to test whether CPU frequency changing works. Let's install another
454tool which is very handy for debugging purposes: <c>sys-power/cpufrequtils</c>
455</p>
456
457<pre caption="Checking CPU frequency">
458# <i>emerge cpufrequtils</i>
459# <i>cpufreq-info</i>
460</pre>
461
462<p>
463Here is an example output:
464</p>
465
466<pre caption="Sample output from cpufreq-info">
467cpufrequtils 0.3: cpufreq-info (C) Dominik Brodowski 2004
468Report errors and bugs to linux@brodo.de, please.
469analyzing CPU 0:
470 driver: centrino
471 CPUs which need to switch frequency at the same time: 0
472 hardware limits: 600 MHz - 1.40 GHz
473 available frequency steps: 600 MHz, 800 MHz, 1000 MHz, 1.20 GHz, 1.40 GHz
474 available cpufreq governors: conservative, ondemand, powersave, userspace, performance
475 current policy: frequency should be within 924 MHz and 1.40 GHz.
476 The governor "performance" may decide which speed to use
477 within this range.
478 current CPU frequency is 1.40 GHz.
479</pre>
480
481<p>
482Now play around with <c>cpufreq-set</c> to make sure frequency switching works.
483Run <c>cpufreq-set -g ondemand</c> for example to activate the ondemand
484governor and verify the change with <c>cpufreq-info</c>. If it doesn't work as
485expected, you might find help in the Troubleshooting section in the end of this
486guide.
487</p>
488
489</body> 471<body>
490</section>
491<section>
492<title>Automated frequency adaption</title>
493<body>
494 472
495<p> 473<p>
496The above is quite nice, but not doable in daily life. Better let your system 474The <c>cpufreqd</c> application allows you to manage CPU frequencies in a more
497set the appropriate frequency automatically. There are many different 475granular approach then what <c>laptop-mode-tools</c> supports. But before we
498approaches to do this. The following table gives a quick overview to help you 476dive into the installation of <c>cpufreqd</c>, let's first look at the USE flags
499decide on one of them. It's roughly seperated in three categories 477it supports.
500<e>kernel</e> for approaches that only need kernel support, <e>daemon</e> for
501programs that run in the background and <e>graphical</e> for programs that
502provide a GUI for easy configuration and changes.
503</p> 478</p>
504 479
505<table> 480<table>
506<tr> 481<tr>
507 <th>Name</th> 482 <th>USE flag</th>
508 <th>Category</th> 483 <th>Description</th>
509 <th>Switch decision</th> 484 <th>Suggested when...</th>
510 <th>Kernel governors</th>
511 <th>Further governors</th>
512 <th>Comments</th>
513</tr>
514<tr> 485</tr>
515 <ti>'ondemand' governor</ti> 486<tr>
516 <ti>Kernel</ti> 487 <ti>acpi</ti>
517 <ti>CPU load</ti>
518 <ti>N.A.</ti>
519 <ti>N.A.</ti>
520 <ti>
521 Chooses maximal frequency on CPU load and slowly steps down when the CPU is
522 idle. Further tuning through files in
523 <path>/sys/devices/system/cpu/cpu0/cpufreq/ondemand/</path>. Still requires
524 userland tools (programs, scripts) if governor switching or similar is
525 desired.
526 </ti> 488 <ti>
527</tr> 489 Enable support for ACPI, allowing <c>cpufreqd</c> to be notified about
528<tr> 490 specific events as well as govern power through the ACPI interface
529 <ti>'conservative' governor</ti>
530 <ti>Kernel</ti>
531 <ti>CPU load</ti>
532 <ti>N.A.</ti>
533 <ti>N.A.</ti>
534 <ti> 491 </ti>
535 Unlike the ondemand governor, conversative doesn't jump to maximum 492 <ti>your laptop is not too old (~ year 2003 and later)</ti>
536 frequency when CPU load is high, but increases the frequency step by 493</tr>
537 step. Further tuning through files in 494<tr>
538 <path>/sys/devices/system/cpu/cpu0/cpufreq/ondemand/</path>. Still 495 <ti>apm</ti>
539 requires userland tools (programs, scripts) if governor switching or
540 similar is desired.
541 </ti> 496 <ti>
542</tr> 497 Enable support for APM, allowing <c>cpufreqd</c> to be notified about
543<tr> 498 specific events as well as govern power through the APM interface
544 <ti><uri link="http://mnm.uib.es/~gallir/cpudyn/">cpudyn</uri></ti>
545 <ti>Daemon</ti>
546 <ti>CPU load</ti>
547 <ti>Performance, powersave</ti>
548 <ti>Dynamic</ti>
549 <ti> 499 </ti>
550 Also supports disk standby - notice however that <e>laptop mode</e> in most 500 <ti>your laptop is very old</ti>
551 cases will do a better job. 501</tr>
502<tr>
503 <ti>lm_sensors</ti>
552 </ti> 504 <ti>
553</tr> 505 Enable support for the Linux hardware sensors (through
554<tr> 506 <c>sys-apps/lm_sensors</c>), allowing to switch profiles based on hardware
555 <ti><uri link="http://sourceforge.net/projects/cpufreqd/">cpufreqd</uri></ti> 507 sensor results
556 <ti>Daemon</ti>
557 <ti>Battery state, CPU load, temperature, running programs</ti>
558 <ti>All available</ti>
559 <ti>None</ti>
560 <ti> 508 </ti>
561 Sophisticated (but also complicated) setup.
562 </ti> 509 <ti>
563</tr> 510 you want to use advanced events through lm_sensors
564<tr>
565 <ti> 511 </ti>
566 <uri link="http://www.deater.net/john/powernowd.html">powernowd</uri> 512</tr>
513<tr>
514 <ti>nforce2</ti>
567 </ti> 515 <ti>
568 <ti>Daemon</ti> 516 Enable support for NForce, allowing <c>cpufreqd</c> to change the NForce FSB
569 <ti>CPU load</ti> 517 clock and video card frequency
570 <ti>None</ti>
571 <ti>Passive, sine, aggressive</ti>
572 <ti> 518 </ti>
573 Supports SMP.
574 </ti> 519 <ti>
575</tr> 520 you have an NVidia graphical card based on the NForce chipset
576<tr>
577 <ti> 521 </ti>
578 <uri link="http://fatcat.ftj.agh.edu.pl/~nelchael/index.php?cat=projs&amp;subcat=ncpufreqd&amp;language=en">ncpufreqd</uri> 522</tr>
523<tr>
524 <ti>nvidia</ti>
579 </ti> 525 <ti>
580 <ti>Daemon</ti> 526 Enable support for NVidia graphical card configuration (through the NVidia
581 <ti>Temperature</ti> 527 <e>nvclock</e> interface), allowing <c>cpufreqd</c> to change the video card
582 <ti>None</ti> 528 frequency of NVidia graphical cards
583 <ti>Powersave, performance</ti>
584 <ti> 529 </ti>
585 Toggles the used governor between performance and powersave depending on
586 system temperature. Very useful on laptops with notorious heat problems.
587 </ti> 530 <ti>
588</tr> 531 you have an NVidia graphical card
589<tr>
590 <ti><uri link="http://www.goop.org/~jeremy/speedfreq/">speedfreq</uri></ti>
591 <ti>Daemon</ti>
592 <ti>CPU load</ti>
593 <ti>None</ti>
594 <ti>Dynamic, powersave, performance, fixed speed</ti>
595 <ti> 532 </ti>
596 Easy to configure with a nice client/server interface. Requires a 2.6 533</tr>
597 kernel. Unmaintained, broken and thus removed from Portage. Please switch 534<tr>
598 to cpufreqd if you're still using it. 535 <ti>pmu</ti>
599 </ti> 536 <ti>
600</tr> 537 Enable the Power Management Unit plug-in of <c>cpufreqd</c>. This allows the
601<tr> 538 software to poll the Linux kernel Power Supply interface, getting more
602 <ti><uri link="http://cpuspeedy.sourceforge.net/">gtk-cpuspeedy</uri></ti> 539 detailed information on battery charge.
603 <ti>Graphical</ti>
604 <ti>None</ti>
605 <ti>None</ti>
606 <ti>None</ti>
607 <ti> 540 </ti>
608 Gnome application, a graphical tool to set CPU frequency manually. It does
609 not offer any automation.
610 </ti> 541 <ti>
611</tr> 542 your laptop does not support ACPI or APM
612<tr>
613 <ti>klaptopdaemon</ti>
614 <ti>Graphical</ti>
615 <ti>Battery state</ti>
616 <ti>All available</ti>
617 <ti>None</ti>
618 <ti>
619 KDE only, 'ondemand' governor required for dynamic frequency scaling.
620 </ti> 543 </ti>
621</tr> 544</tr>
622</table> 545</table>
623 546
624<p> 547<p>
625While adjusting the frequency to the current load looks simple at a first 548The USE flags <c>acpi</c>, <c>apm</c> and <c>pmu</c> overlap, so you should only
626glance, it's not such a trivial task. A bad algorithm can cause switching 549have one active. If your laptop is sufficiently recent, <c>acpi</c> is your best
627between two frequencies all the time or wasting energy when setting frequency 550bet. If not, <c>apm</c> offers all that is needed. When even APM isn't
628to an unnecessary high level. 551supported, you can try <c>pmu</c>.
629</p>
630
631<p> 552</p>
632Which one to choose? If you have no idea about it, try <c>cpufreqd</c>: 553
554<p>
555With the USE flags configured, it is time to install <c>cpufreqd</c>.
633</p> 556</p>
634 557
635<pre caption="Installing cpufreqd"> 558<pre caption="Installing cpufreqd">
636# <i>emerge cpufreqd</i> 559# <i>emerge cpufreqd</i>
637</pre> 560</pre>
638 561
562</body>
563</section>
564<section>
565<title>Configuration</title>
566<body>
567
568<p>
569The <c>cpufreqd</c> application monitors the status of the system through
570several plugins. Based on the feedback it receives from those plugins, it will
571adjust the policy used to govern the CPU frequency.
639<p> 572</p>
573
574<p>
640<c>cpufreqd</c> can be configured by editing <path>/etc/cpufreqd.conf</path>. 575<c>cpufreqd</c> can be configured by editing <path>/etc/cpufreqd.conf</path>. It
641The default one that ships with cpufreqd may look a bit confusing. I recommend 576contains three different sections:
642replacing it with the one from Gentoo developer Henrik Brix Andersen (see 577</p>
643below). 578
579<ol>
580 <li>
581 The <c>[General]...[/General]</c> section contains general configuration
582 information
583 </li>
584 <li>
585 The <c>[Profile]...[/Profile]</c> section defines the policies that the
586 <c>cpufreqd</c> daemon can switch to. The section is very similar to the
587 information you use when manually setting the CPU frequency policy using
588 <c>cpufreq-set</c>.
589 </li>
590 <li>
591 The <c>[Rule]...[/Rule]</c> section is the work-horse of the <c>cpufreqd</c>
592 daemon, defining when the daemon decides to switch to a different profile.
593 </li>
594</ol>
595
644</p> 596<p>
597Let's take a quick look at an example rule.
598</p>
645 599
646<pre caption="/etc/cpufreqd.conf"> 600<pre caption="Sample cpufreqd rule">
647[General]
648pidfile=/var/run/cpufreqd.pid
649poll_interval=2
650pm_type=acpi
651verbosity=5
652
653[Profile] 601[Profile]
654name=ondemand 602name=On Demand High
655minfreq=0% 603minfreq=40%
656maxfreq=100% 604maxfreq=100%
657policy=ondemand 605policy=ondemand
658
659[Profile] 606[/Profile]
660name=conservative
661minfreq=0%
662maxfreq=100%
663policy=conservative
664
665[Profile]
666name=powersave
667minfreq=0%
668maxfreq=100%
669policy=powersave
670
671[Profile]
672name=performance
673minfreq=0%
674maxfreq=100%
675policy=performance
676 607
677[Rule] 608[Rule]
678name=battery 609name=AC Off - High Power
679ac=off 610ac=off
680profile=conservative
681
682[Rule]
683name=battery_low
684ac=off
685battery_interval=0-10 611battery_interval=70-100
686profile=powersave 612profile=On Demand High
687
688[Rule] 613[/Rule]
689name=ac
690ac=on
691profile=ondemand
692</pre> 614</pre>
693 615
616<p>
617In the above example, <c>cpufreqd</c> will switch the system to the <e>On Demand
618High</e> profile (also shown in the above excerpt). This profile by itself uses
619the <c>ondemand</c> governor with a minimum frequency of 40% (iow, a CPU of 2Ghz
620will have by this policy a minimum frequency of 800Mhz).
694<p> 621</p>
695Now you can start the cpufreqd daemon. Add it to the <e>default</e> and 622
696<e>battery</e> runlevel as well. 623<p>
624As you can see, the <c>cpufreqd</c> application can offer a more granular
625approach on CPU frequency scaling. But not only that, you can tweak the CPU
626frequency scaling based on various other metrics available. The default
627configuration offers a sample rule for when you watch a movie, where you want
628maximum performance, unless the CPU temperature is getting too high.
629</p>
630
631<p>
632When you have configured <c>cpufreqd</c>, it is time to start it (and make sure
633the service is loaded automatically). Make sure that CPU frequency handling by
634other tools (like <c>laptop-mode-tools</c>) is disabled!
697</p> 635</p>
698 636
699<pre caption="Starting cpufreqd"> 637<pre caption="Starting cpufreqd">
700# <i>rc-update add cpufreqd default battery</i> 638# <i>rc-service add cpufreqd default</i>
701# <i>rc</i> 639# <i>/etc/init.d/cpufreqd start</i>
702</pre>
703
704<warn>
705Do not run more than one of the above programs at the same time. It may cause
706confusion like switching between two frequencies all the time.
707</warn>
708
709</body>
710</section>
711
712<section>
713<title>Verifying the result</title>
714
715<body>
716
717<p>
718The last thing to check is that your new policies do a good job. An easy way to
719do so is monitoring CPU speed while working with your laptop:
720</p> 640</pre>
721
722<pre caption="Monitoring CPU speed">
723# <i>watch grep \"cpu MHz\" /proc/cpuinfo</i>
724</pre>
725
726<p>
727If <path>/proc/cpuinfo</path> doesn't get updated (see Troubleshooting),
728monitor the CPU frequency with:
729</p>
730
731<pre caption="Alternative CPU speed monitoring">
732# <i>watch x86info -mhz</i>
733</pre>
734
735<p>
736Depending on your setup, CPU speed should increase on heavy load, decrease on
737no activity or just stay at the same level. When using cpufreqd and verbosity
738set to 5 or higher in <path>cpufreqd.conf</path> you'll get additional
739information about what's happening reported to syslog.
740</p>
741 641
742</body> 642</body>
743</section> 643</section>
744</chapter> 644</chapter>
745 645
746<chapter> 646<chapter>
747<title>LCD Power Management</title> 647<title>Resources</title>
748<section>
749<title>Energy consumer no. 1</title>
750<body>
751
752<p>
753As you can see in <uri link="#doc_chap1_fig1">figure 1.1</uri>, the LCD display
754consumes the biggest part of energy (might not be the case for non-mobile
755CPU's). Thus it's quite important not only to shut the display off when not
756needed, but also to reduce it's backlight if possible. Most laptops offer the
757possibility to control the backlight dimming.
758</p>
759
760<p>
761First thing to check is the standby/suspend/off timings of the display. As this
762depends heavily on your windowmanager, I'll let you figure it out yourself.
763Just two common places: Blanking the terminal can be done with <c>setterm
764-blank &lt;number-of-minutesM&gt;</c>, <c>setterm -powersave on</c> and
765<c>setterm -powerdown &lt;number-of-minutesM&gt;</c>.
766For X.org, modify <path>/etc/X11/xorg.conf</path> similar to this:
767</p>
768
769<pre caption="LCD suspend settings in X.org and XFree86">
770Section "ServerLayout"
771 Identifier [...]
772 [...]
773 Option "BlankTime" "5" <comment># Blank the screen after 5 minutes (Fake)</comment>
774 Option "StandbyTime" "10" <comment># Turn off screen after 10 minutes (DPMS)</comment>
775 Option "SuspendTime" "20" <comment># Full suspend after 20 minutes</comment>
776 Option "OffTime" "30" <comment># Turn off after half an hour</comment>
777 [...]
778EndSection
779
780[...]
781
782Section "Monitor"
783 Identifier [...]
784 Option "DPMS" "true"
785 [...]
786EndSection
787</pre>
788
789<p>
790This is the same for XFree86 and <path>/etc/X11/XF86Config</path>.
791</p>
792
793<p>
794Probably more important is the backlight dimming. If you have access to the
795dimming settings via a tool, write a small script that dims the backlight in
796battery mode and place it in your <e>battery</e> runlevel. The following script
797should work on most IBM Thinkpads. It needs the <c>app-laptop/ibm-acpi</c>
798package or the appropriate option in your kernel has to be enabled.
799</p>
800
801<warn>
802Support for setting brightness is marked experimental in ibm-acpi. It accesses
803hardware directly and may cause severe harm to your system. Please read the
804<uri link="http://ibm-acpi.sourceforge.net/">ibm-acpi website</uri>
805</warn>
806
807<p>
808To be able to set the brightness level, the ibm_acpi module has to be loaded
809with the experimental parameter.
810</p>
811
812<pre caption="automatically loading the ibm_acpi module">
813<comment>(Please read the warnings above before doing this!)</comment>
814<i># emerge ibm-acpi</i>
815<i># echo "options ibm_acpi experimental=1" >> /etc/modules.d/ibm_acpi</i>
816<i># /sbin/modules-update</i>
817<i># echo ibm_acpi >> /etc/modules.autoload.d/kernel-2.6</i>
818<i># modprobe ibm_acpi</i>
819</pre>
820
821<p>
822This should work without error messages and a file
823<path>/proc/acpi/ibm/brightness</path> should be created after loading the
824module. An init script will take care of choosing the brightness according
825to the power source.
826</p>
827
828<pre caption="/etc/conf.d/lcd-brightness">
829<comment># See /proc/acpi/ibm/brightness for available values</comment>
830<comment># Please read /usr/share/doc/ibm-acpi-*/README.gz</comment>
831
832<comment># brigthness level in ac mode. Default is 7.</comment>
833BRIGHTNESS_AC=7
834
835<comment># brightness level in battery mode. Default is 4.</comment>
836BRIGHTNESS_BATTERY=4
837</pre>
838
839<pre caption="/etc/init.d/lcd-brightness">
840#!/sbin/runscript
841
842set_brightness() {
843 if on_ac_power
844 then
845 LEVEL=${BRIGHTNESS_AC:-7}
846 else
847 LEVEL=${BRIGHTNESS_BATTERY:-4}
848 fi
849
850 if [ -f /proc/acpi/ibm/brightness ]
851 then
852 ebegin "Setting LCD brightness"
853 echo "level ${LEVEL}" > /proc/acpi/ibm/brightness
854 eend $?
855 else
856 ewarn "Setting LCD brightness is not supported."
857 ewarn "Check that ibm_acpi is loaded into the kernel"
858 fi
859}
860
861start() {
862 set_brightness
863}
864
865stop () {
866 set_brightness
867}
868</pre>
869
870<p>
871When done, make sure brightness is adjusted automatically by adding it to the
872battery runlevel.
873</p>
874
875<pre caption="Enabling automatic brightness adjustment">
876<i># chmod +x /etc/init.d/lcd-brightness</i>
877<i># rc-update add lcd-brightness battery</i>
878<i># rc</i>
879</pre>
880
881</body>
882</section> 648<section>
883</chapter> 649<title>Tools</title>
884
885<chapter>
886<title>Disk Power Management</title>
887<section>
888<title>Sleep when idle</title>
889<body>
890
891<p>
892Let's bring the hard disk to sleep as early as possible whenever it is not
893needed. I'll show you two possibilities to do it. First <c>cpudyn</c> supports
894Disk Power Management. Uncomment the lines in the "Disk Options" section in
895<path>/etc/conf.d/cpudyn</path>. To put your first disk to sleep after 60
896seconds of no activity, you would modify it like this:
897</p>
898
899<pre caption="Using cpudyn for disk standby">
900<comment>################################################
901# DISK OPTIONS
902# (disabled by default)
903################################################
904
905#
906# Timeout to put the disk in standby mode if there was no
907# io during that period (in seconds)
908#
909</comment>
910TIMEOUT=60
911<comment>
912#
913# Specified disks to spindown (comma separated devices)
914#
915</comment>
916DISKS=/dev/hda
917</pre>
918
919<p>
920The second possibility is using a small script and hdparm. Create
921<path>/etc/init.d/pm.hda</path> like this:
922</p>
923
924<pre caption="Using hdparm for disk standby">
925#!/sbin/runscript
926
927depend() {
928 after hdparm
929}
930
931start() {
932 ebegin "Activating Power Management for Hard Drives"
933 hdparm -q -S12 /dev/hda
934 eend $?
935}
936
937stop () {
938 ebegin "Deactivating Power Management for Hard Drives"
939 hdparm -q -S253 /dev/hda
940 eend $?
941}
942</pre>
943
944<p>
945See <c>man hdparm</c> for the options. If your script is ready, add it to the
946battery runlevel.
947</p>
948
949<pre caption="Automate disk standby settings">
950# <i>chmod +x /etc/init.d/pm.hda</i>
951# <i>/sbin/depscan.sh</i>
952# <i>rc-update add pm.hda battery</i>
953</pre>
954
955<impo>
956Be careful with sleep/spin down settings of your hard drive. Setting it to
957small values might wear out your drive and lose warranty.
958</impo>
959
960</body> 650<body>
961</section>
962<section>
963<title>Increasing idle time - laptop-mode</title>
964<body>
965 651
966<p>
967Recent kernels (2.6.6 and greater, recent 2.4 ones and others with patches)
968include the so-called <e>laptop-mode</e>. When activated, dirty buffers are
969written to disk on read calls or after 10 minutes (instead of 30 seconds). This
970minimizes the time the hard disk needs to be spun up.
971</p>
972
973<pre caption="Automated start of laptop-mode">
974# <i>emerge laptop-mode-tools</i>
975</pre>
976
977<p>
978<c>laptop-mode-tools</c> has it's configuration file in
979<path>/etc/laptop-mode/laptop-mode.conf</path>. Adjust it the way you like it,
980it's well commented. Run <c>rc-update add laptop_mode battery</c> to start it
981automatically.
982</p>
983
984</body>
985</section>
986<section>
987<title>Other tricks</title>
988<body>
989
990<p>
991Besides putting your disk to sleep state as early as possible, it is a good
992idea to minimize disk accesses. Have a look at processes that write to your
993disk frequently - the syslogd is a good candidate. You probably don't want to
994shut it down completely, but it's possible to modify the config file so that
995"unnecessary" things don't get logged and thus don't create disk traffic. Cups
996writes to disk periodically, so consider shutting it down and only enable it
997manually when needed.
998</p>
999
1000<pre caption="Disabling cups in battery mode">
1001# <i>rc-update del cupsd battery</i>
1002</pre>
1003
1004<p>
1005Another possibility is to deactivate swap in battery mode. Before writing a
1006swapon/swapoff switcher, make sure there is enough RAM and swap isn't used
1007heavily, otherwise you'll be in big problems.
1008</p>
1009
1010<p>
1011If you don't want to use laptop-mode, it's still possible to minimize disk
1012access by mounting certain directories as <e>tmpfs</e> - write accesses are not
1013stored on a disk, but in main memory and get lost with unmounting. Often it's
1014useful to mount <path>/tmp</path> like this - you don't have to pay special
1015attention as it gets cleared on every reboot regardless whether it was mounted
1016on disk or in RAM. Just make sure you have enough RAM and no program (like a
1017download client or compress utility) needs extraordinary much space in
1018<path>/tmp</path>. To activate this, enable tmpfs support in your kernel and
1019add a line to <path>/etc/fstab</path> like this:
1020</p>
1021
1022<pre caption="Editing /etc/fstab to make /tmp even more volatile">
1023none /tmp tmpfs size=32m 0 0
1024</pre>
1025
1026<warn>
1027Pay attention to the size parameter and modify it for your system. If you're
1028unsure, don't try this at all, it can become a perfomance bottleneck easily. In
1029case you want to mount <path>/var/log</path> like this, make sure to merge the
1030log files to disk before unmounting. They are essential. Don't attempt to mount
1031/var/tmp like this. Portage uses it for compiling...
1032</warn>
1033
1034</body>
1035</section>
1036</chapter>
1037
1038<chapter>
1039<title>Power Management for other devices</title>
1040<section>
1041<title>Graphics cards</title>
1042<body>
1043
1044<p>
1045In case you own an ATI graphics card supporting PowerPlay (dynamic clock
1046scaling for the the graphics processing unit GPU), you can activate this
1047feature in X.org. Open <path>/etc/X11/xorg.conf</path> and add (or enable)
1048the <c>DynamicClocks</c> option in the Device section. Please notice that
1049this feature will lead to crashes on some systems.
1050</p>
1051
1052<pre caption="Enabling ATI PowerPlay support in X.org">
1053Section "Device"
1054[...]
1055Option "DynamicClocks" "on"
1056EndSection
1057</pre>
1058
1059</body>
1060</section>
1061<section>
1062<title>Wireless Power Management</title>
1063<body>
1064
1065<p>
1066Wireless LAN cards consume quite a few energy. Put them in Power Management
1067mode in analogy to the pm.hda script.
1068</p>
1069
1070<pre caption="WLAN Power Management automated">
1071#!/sbin/runscript
1072start() {
1073 ebegin "Activating Power Management for Wireless LAN"
1074 iwconfig wlan0 power on power max period 3
1075 eend $?
1076}
1077
1078stop () {
1079 ebegin "Deactivating Power Management for Wireless LAN"
1080 iwconfig wlan0 power off
1081 eend $?
1082}
1083</pre>
1084
1085<p>
1086Starting this script will put wlan0 in Power Management mode, going to sleep at
1087the latest three seconds after no traffic.
1088Save it as <path>/etc/init.d/pm.wlan0</path> and add it to the battery runlevel
1089like the disk script above. See <c>man iwconfig</c> for details and more
1090options. If your driver and access point support changing the beacon time, this
1091is a good starting point to save even more energy.
1092</p>
1093
1094<pre caption="Power Management for WLAN">
1095# <i>chmod +x /etc/init.d/pm.wlan0</i>
1096# <i>/sbin/depscan.sh</i>
1097# <i>rc-update add pm.wlan0 battery</i>
1098</pre>
1099
1100</body>
1101</section>
1102<section>
1103<title>USB Power Management</title>
1104<body>
1105
1106<p>
1107There are two problems with USB devices regarding energy consumption: First,
1108devices like USB mice, digital cameras or USB sticks consume energy while
1109plugged in. You cannot avoid this (nevertheless remove them in case they're not
1110needed). Second, when there are USB devices plugged in, the USB host controller
1111periodically accesses the bus which in turn prevents the CPU from going into
1112sleep mode. The kernel offers an experimental option to enable suspension of
1113USB devices through driver calls or one of the <path>power/state</path> files
1114in <path>/sys</path>.
1115</p>
1116
1117<pre caption="Enabling USB suspend support in the kernel">
1118Device Drivers
1119 USB support
1120 [*] Support for Host-side USB
1121 [*] USB suspend/resume (EXPERIMENTAL)
1122</pre>
1123
1124</body>
1125</section>
1126</chapter>
1127
1128<chapter>
1129<title>Sleep states: sleep, standby, suspend to disk</title>
1130<section>
1131<title>Overview</title>
1132<body>
1133
1134<p>
1135ACPI defines different sleep states. The more important ones are
1136</p>
1137
1138<ul> 652<ul>
1139 <li>S1 aka Standby</li> 653 <li>
1140 <li>S3 aka Suspend to RAM aka Sleep</li> 654 <uri link="http://samwel.tk/laptop_mode/">Laptop Mode Tools Homepage</uri>,
1141 <li>S4 aka Suspend to Disk aka Hibernate</li> 655 includes <uri link="http://samwel.tk/laptop_mode/laptop_mode">About laptop
656 mode</uri>.
657 </li>
658 <li>
659 <uri link="http://www.lesswatts.org/projects/powertop/">PowerTOP</uri>, an
660 interactive application helping users to find out which processes are
661 forcing wakeups on the CPU most often.
662 </li>
1142</ul> 663</ul>
1143 664
1144<p>
1145They can be called whenever the system is not in use, but a shutdown is not
1146wanted due to the long boot time.
1147</p>
1148
1149</body> 665</body>
1150</section>
1151<section> 666</section>
1152<title>Sleep (S3)</title>
1153<body>
1154
1155<p>
1156The ACPI support for these sleep states is marked experimental for good reason.
1157APM sleep states seem to be more stable, however you can't use APM and ACPI
1158together.
1159</p>
1160
1161<pre caption="Kernel configuration for the various suspend types">
1162 Power Management Options ---&gt;
1163 [*] Power Management support
1164 ACPI (Advanced Configuration and Power Interface) Support ---&gt;
1165 [*] ACPI Support
1166 [*] Sleep States
1167</pre>
1168
1169<p>
1170Once your kernel is prepared like above, you can use the
1171<c>hibernate-script</c> to activate suspend or sleep mode. Let's install that
1172first.
1173</p>
1174
1175<pre caption="Installing the hibernate-script">
1176<i># emerge hibernate-script</i>
1177</pre>
1178
1179<p>
1180Some configuration has to be done in <path>/etc/hibernate</path> The default
1181package introduces two configuration files <path>hibernate.conf</path> and
1182<path>ram.conf</path>.
1183</p>
1184
1185<p>
1186To configure sleep, edit <path>ram.conf</path> in <path>/etc/hibernate</path>.
1187<c>UseSysfsPowerState mem</c> is already setup correctly, but you have to go
1188through the rest of the configuration file and set it up for your system. The
1189comments and option names will guide you. If you use nfs or samba shares over
1190the network, make sure to shutdown the appropriate init scripts to avoid
1191timeouts.
1192</p>
1193
1194<p>
1195Ready? Now is the last chance to backup any data you want to keep after
1196executing the next command. Notice that you probably have to hit a special key
1197like <e>Fn</e> to resume from sleep.
1198</p>
1199
1200<pre caption="Calling sleep">
1201<i># hibernate-ram</i>
1202</pre>
1203
1204<p>
1205If you're still reading, it seems to work. You can also setup standby (S1) in
1206a similar way by copying <path>ram.conf</path> to <path>standby.conf</path>
1207and creating a symlink <path>/usr/sbin/hibernate-standby</path> pointing to
1208<path>/usr/sbin/hibernate</path>. S3 and S4 are the more interesting sleep
1209states due to greater energy savings however.
1210</p>
1211
1212</body>
1213</section> 667<section>
1214<section> 668<title>Articles and Guides</title>
1215<title>Hibernate (S4)</title>
1216<body>
1217
1218<p>
1219This section introduces hibernation, where a snapshot of the running system is
1220written to disk before powering off. On resume, the snapshot is loaded and you
1221can go on working at exactly the point you called hibernate before.
1222</p>
1223
1224<warn>
1225Don't exchange non hot-pluggable hardware when suspended. Don't attempt to load
1226a snapshot with a different kernel image than the one it was created with.
1227Shutdown any NFS or samba server/client before hibernating.
1228</warn>
1229
1230<p>
1231There are two different implementations for S4. The original one is swsusp,
1232then there is the newer suspend2 with a nicer interface (including
1233fbsplash support). A <uri link="http://suspend2.net/features.html#compare">
1234feature comparison</uri> is available at the <uri link="http://suspend2.net">
1235suspend2 Homepage</uri>. There used to be Suspend-to-Disk (pmdisk), a fork of
1236swsusp, but it has been merged back.
1237</p>
1238
1239<p>
1240Suspend2 is not included in the mainline kernel yet, therefore you either have
1241to patch your kernel sources with the patches provided by
1242<uri link="http://suspend2.net">suspend2.net</uri> or use
1243<c>sys-kernel/suspend2-sources</c>.
1244</p>
1245
1246<p>
1247The kernel part for both swusp and suspend2 is as follows:
1248</p>
1249
1250<pre caption="Kernel configuration for the various suspend types">
1251Power Management Options ---&gt;
1252 <comment>(hibernate with swsusp)</comment>
1253 [*] Software Suspend
1254 <comment>(replace /dev/SWAP with your swap partition)</comment>
1255 (/dev/SWAP) Default resume partition
1256
1257 <comment>(hibernate with suspend2)</comment>
1258 Software Suspend 2
1259 --- Image Storage (you need at least one writer)
1260 [*] File Writer
1261 [*] Swap Writer
1262 --- General Options
1263 [*] LZF image compression
1264 <comment>(replace /dev/SWAP with your swap partition)</comment>
1265 (swap:/dev/SWAP) Default resume device name
1266 [ ] Allow Keep Image Mode
1267</pre>
1268
1269<p>
1270The configuration for swsusp is rather easy. If you didn't store the location
1271of your swap partition in the kernel config, you can also pass it as a
1272parameter with the <c>resume=/dev/SWAP</c> directive. If booting is not
1273possible due to a broken image, use the <c>noresume</c> kernel parameter. The
1274<c>hibernate-cleanup</c> init script invalidates swsusp images during the
1275boot process.
1276</p>
1277
1278<pre caption="Invalidating swsusp images during the boot process">
1279<i># rc-update add hibernate-cleanup boot</i>
1280</pre>
1281
1282<p>
1283To activate hibernate with swsusp, use the hibernate script and set
1284<c>UseSysfsPowerState disk</c> in <path>/etc/hibernate/hibernate.conf</path>.
1285</p>
1286
1287<warn>
1288Backup your data before doing this. Run <c>sync</c> before executing one of the
1289commands to have cached data written to disk. First try it outside of X, then
1290with X running, but not logged in.
1291</warn>
1292
1293<p>
1294If you experience kernel panics due to uhci or similar, try to compile USB
1295support as module and unload the modules before sending your laptop to sleep
1296mode. There are configuration options for this in <path>hibernate.conf</path>
1297</p>
1298
1299<pre caption="Hibernating with swsusp">
1300<i># nano -w /etc/hibernate.conf</i>
1301<comment>(Make sure you have a backup of your data)</comment>
1302<i># hibernate</i>
1303</pre>
1304
1305<p>
1306The following section discusses the setup of suspend2 including fbsplash
1307support for a nice graphical progress bar during suspend and resume.
1308</p>
1309
1310<p>
1311The first part of the configuration is similar to the configuration of
1312swsusp. In case you didn't store the location of your swap partition in the
1313kernel config, you have to pass it as a kernel parameter with the
1314<c>resume2=swap:/dev/SWAP</c> directive. If booting is not possible due to a
1315broken image, append the <c>noresume2</c> parameter. Additionally, the
1316<c>hibernate-cleanup</c> init script invalidates suspend2 images during the
1317boot process.
1318</p>
1319
1320<pre caption="Invalidating suspend2 images during the boot process">
1321<i># rc-update add hibernate-cleanup boot</i>
1322</pre>
1323
1324<p>Now edit <path>/etc/hibernate/hibernate.conf</path>, enable the
1325<e>suspend2</e> section and comment everything in the <e>sysfs_power_state</e>
1326and <e>acpi_sleep</e> sections. Do not enable the fbsplash part in global
1327options yet.
1328</p>
1329
1330<pre caption="Hibernating with suspend2">
1331<i># nano -w /etc/hibernate.conf</i>
1332<comment>(Make sure you have a backup of your data)</comment>
1333<i># hibernate</i>
1334</pre>
1335
1336<p>
1337Please configure fbsplash now if you didn't do already. To enable fbsplash
1338support during hibernation, the <c>sys-apps/suspend2-userui</c> package is
1339needed. Additionally, you've got to enable the <e>fbsplash</e> USE flag.
1340</p>
1341
1342<pre caption="Installing suspend2-userui">
1343<i># mkdir -p /etc/portage</i>
1344<i># echo sys-apps/suspend2-userui fbsplash >> /etc/portage/package.use</i>
1345<i># emerge suspend2-userui</i>
1346</pre>
1347
1348<p>
1349The ebuild tells you to make a symlink to the theme you want to use. For
1350example, to use the <c>livecd-2005.1</c> theme, run the following command:
1351</p>
1352
1353<pre caption="Using the livecd-2005.1 theme during hibernation">
1354<i># ln -sfn /etc/splash/livecd-2005.1 /etc/splash/suspend2</i>
1355</pre>
1356
1357<p>
1358If you don't want a black screen in the first part of the resume process, you
1359have to add the <c>suspend2ui_fbsplash</c> tool to your initrd image. Assuming
1360you created the initrd image with <c>splash_geninitramfs</c> and saved it as
1361<path>/boot/fbsplash-emergence-1024x768</path>, here's how to do
1362that.
1363</p>
1364
1365<pre caption="Adding suspend2ui_fbsplash to an initrd image">
1366<i># mount /boot</i>
1367<i># mkdir ~/initrd.d</i>
1368<i># cp /boot/fbsplash-emergence-1024x768 ~/initrd.d/</i>
1369<i># cd ~/initrd.d</i>
1370<i># gunzip -c fbsplash-emergence-1024x768 | cpio -idm --quiet -H newc</i>
1371<i># rm fbsplash-emergence-1024x768</i>
1372<i># cp /usr/sbin/suspend2ui_fbsplash sbin/</i>
1373<i># find . | cpio --quiet --dereference -o -H newc | gzip -9 > /boot/fbsplash-suspend2-emergence-1024x768</i>
1374</pre>
1375
1376<p>
1377Afterwards adjust <path>grub.conf</path> respectively <path>lilo.conf</path>
1378so that your suspend2 kernel uses
1379<path>/boot/fbsplash-suspend2-emergence-1024x768</path> as initrd image. You
1380can now test a dry run to see if everything is setup correctly.
1381</p>
1382
1383<pre caption="Test run for fbsplash hibernation">
1384<i># suspend2ui_fbsplash -t</i>
1385</pre>
1386
1387<p>
1388Afterwards open <path>/etc/hibernate/hibernate.conf</path> again and activate
1389the fbsplash options. Execute <c>hibernate</c> and enjoy.
1390</p>
1391
1392</body> 669<body>
1393</section>
1394</chapter>
1395 670
1396<chapter> 671<ul>
1397<title>Troubleshooting</title> 672 <li>
1398<section> 673 A ThinkWiki article on <uri
1399<title>If things go wrong...</title> 674 link="http://www.thinkwiki.org/wiki/How_to_reduce_power_consumption">How to
1400<body> 675 reduce power consumption</uri> (on Linux). This article offers an exhaustive
1401 676 list of measures one can take. However, it should be noted that the laptop
1402<p> 677 mode tools implements the majority of these (if properly configured).
1403<e>Q:</e> I'm trying to change the CPU frequency, but 678 </li>
1404<path>/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor</path> does not 679</ul>
1405exist.
1406</p>
1407
1408<p>
1409<e>A:</e> Make sure your processor supports CPU frequency scaling and you chose
1410the right CPUFreq driver for your processor. Here is a list of processors that
1411are supported by cpufreq (kernel 2.6.7): ARM Integrator, ARM-SA1100,
1412ARM-SA1110, AMD Elan - SC400, SC410, AMD mobile K6-2+, AMD mobile K6-3+, AMD
1413mobile Duron, AMD mobile Athlon, AMD Opteron, AMD Athlon 64, Cyrix Media GXm,
1414Intel mobile PIII and Intel mobile PIII-M on certain chipsets, Intel Pentium 4,
1415Intel Xeon, Intel Pentium M (Centrino), National Semiconductors Geode GX,
1416Transmeta Crusoe, VIA Cyrix 3 / C3, UltraSPARC-III, SuperH SH-3, SH-4, several
1417"PowerBook" and "iBook2" and various processors on some ACPI 2.0-compatible
1418systems (only if "ACPI Processor Performance States" are available to the
1419ACPI/BIOS interface).
1420</p>
1421
1422<p>
1423<e>Q:</e> My laptop supports frequency scaling, but
1424<path>/sys/devices/system/cpu/cpu0/cpufreq/</path> is empty.
1425</p>
1426
1427<p>
1428<e>A:</e> Look for ACPI related error messages with <c>dmesg | grep ACPI</c>.
1429Try to update the BIOS, especially if a broken DSDT is reported. You can also
1430try to fix it yourself (which is beyond the scope of this guide).
1431</p>
1432
1433<p>
1434<e>Q:</e> My laptop supports frequency scaling, but according to /proc/cpuinfo
1435the speed never changes.
1436</p>
1437
1438<p>
1439<e>A:</e> Probably you have activated symmetric multiprocessing support
1440(CONFIG_SMP) in your kernel. Deactivate it and it should work. Some older
1441kernels had a bug causing this. In that case, run <c>emerge x86info</c>,
1442update your kernel as asked and check the current frequency with
1443<c>x86info -mhz</c>.
1444</p>
1445
1446<p>
1447<e>Q:</e> I can change the CPU frequency, but the range is not as wide as in
1448another OS.
1449</p>
1450
1451<p>
1452<e>A:</e> You can combine frequency scaling with ACPI throttling to get a lower
1453minimum frequency. Notice that throttling doesn't save much energy and is
1454mainly used for thermal management (keeping your laptop cool and quiet). You
1455can read the current throttling state with <c>cat
1456/proc/acpi/processor/CPU/throttling</c> and change it with <c>echo -n "0:x" >
1457/proc/acpi/processor/CPU/limit</c>, where x is one of the Tx states listed in
1458<path>/proc/acpi/processor/CPU/throttling</path>.
1459</p>
1460
1461<p>
1462<e>Q:</e> When configuring the kernel, powersave, performance and userspace
1463governors show up, but that ondemand thing is missing. Where do I get it?
1464</p>
1465
1466<p>
1467<e>A:</e> The ondemand governor is only included in recent kernel sources. Try
1468updating them.
1469</p>
1470
1471<p>
1472<e>Q:</e> Battery life time seems to be worse than before.
1473</p>
1474
1475<p>
1476<e>A:</e> Check your BIOS settings. Maybe you forgot to re-enable some of the
1477settings.
1478</p>
1479
1480<p>
1481<e>Q:</e> My battery is charged, but KDE reports there would be 0% left and
1482immediately shuts down.
1483</p>
1484
1485<p>
1486<e>A:</e> Check that battery support is compiled into your kernel. If you use
1487it as a module, make sure the module is loaded.
1488</p>
1489
1490<p>
1491<e>Q:</e> I have a Dell Inspiron 51XX and I don't get any ACPI events.
1492</p>
1493
1494<p>
1495<e>A:</e> This seems to be a kernel bug. Read on <uri
1496link="http://bugme.osdl.org/show_bug.cgi?id=1752">here</uri>.
1497</p>
1498
1499<p>
1500<e>Q:</e> I activated the DynamicClocks option in <path>xorg.conf</path> and
1501now X.org crashes / the screen stays black / my laptop doesn't shutdown
1502properly.
1503</p>
1504
1505<p>
1506<e>A:</e> This happens on some systems. You have to disable DynamicClocks.
1507</p>
1508
1509<p>
1510<e>Q:</e> I want to use suspend2, but it tells me my swap partition is too
1511small. Resizing is not an option.
1512</p>
1513
1514<p>
1515<e>A:</e> If there is enough free space on your system, you can use the
1516filewriter instead of the swapwriter. The <c>hibernate-script</c> supports it
1517as well. More information can be found in
1518<path>/usr/src/linux/Documentation/power/suspend2.txt</path>.
1519</p>
1520
1521<p>
1522<e>Q:</e> I just bought a brand new battery, but it only lasts for some
1523minutes! What am I doing wrong?
1524</p>
1525
1526<p>
1527<e>A:</e> First follow your manufacturer's advice on how to charge the battery
1528correctly.
1529</p>
1530
1531<p>
1532<e>Q:</e> The above didn't help. What should I do then?
1533</p>
1534
1535<p>
1536<e>A:</e> Some batteries sold as "new" are in fact old ones. Try the following:
1537</p>
1538
1539<pre caption="Querying battery state">
1540$ <i>grep capacity /proc/acpi/battery/BAT0/info</i>
1541design capacity: 47520 mWh
1542last full capacity: 41830 mWh
1543</pre>
1544
1545<p>
1546If the "last full capacity" differs significantly from the design capacity,
1547your battery is probably broken. Try to claim your warranty.
1548</p>
1549
1550<p>
1551<e>Q:</e> My problem is not listed above. Where should I go next?
1552</p>
1553
1554<p>
1555<e>A:</e> Don't fear to contact me, <mail link="fragfred@gmx.de">Dennis
1556Nienhüser</mail>, directly.
1557</p>
1558 680
1559</body> 681</body>
1560</section> 682</section>
1561</chapter> 683</chapter>
1562</guide> 684</guide>

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.51

  ViewVC Help
Powered by ViewVC 1.1.20