Comment 16 for bug 89269

Revision history for this message
Bart Samwel (bart-samwel) wrote : Re: [Bug 89269] Re: power.sh: wrong laptop_mode activation

Hi Andrea,

Andrea Ratto wrote:
> acpi-support does support running scripts on lid clode.
> It does not notify a "battery critical" event though. Maybe that functionality could be added to acpid and thus to acpi-support? Does it require polling?

Laptop mode tools uses the acpi battery event to check for critical
battery levels. It then checks the acpi battery state, or the sysfs
battery state (depending on what's available).

> GNU/Linux, not just Ubuntu, needs one single framework for powermanagement, be that acpi, or HAL or laptop_mode, or whatever.
> One framework with hooks for various programs is the way to go. I think we can agree on that, at least at design level. Do we?

Yup. I was missing that when I built laptop mode tools, that's why I had
to "roll my own" for everything. It's become a pretty generic framework
for power state switches, but handles no other typical laptop tasks. In
my opinion, this is correct -- power management, making-laptops-work
stuff, and suspend/hibernate are too often confused (e.g. in
acpi-support :-) ). I think that power management policy is one thing,
making-laptops-work stuff is another, and suspend/hibernate is another
thing altogether. Trying to put all of that in one framework is a big
mistake.

> Also a full powermanagement solution requires:
> disk standby,
> processor frequencies;
> panel brightness,
> services start/stop,
> actions on critical battery level,
> different configuration profiles,

For good measure, laptop mode tools supports disk standby, processor
frequencies, panel brightness, services start/stop, and specific actions
on critical battery level (not generic though -- only disabling stuff
and automatic hibernation). Furthermore, it supports extension modules
with modular configuration files in /etc/laptop-mode/conf.d.

In addition, it currently supplies modules for:
* generically swizzling configuration files for daemons based on the
power state, and signalling programs / restarting services after
switching the configuration files.
* Power saving modes for Intel IPW and iwlwifi drivers.
* Power saving modes for Intel AC97 integrated audio.
* Terminal blanking
* X screen blanking timeouts (using DPMS)

I'm definitely not saying that laptop mode tools is the ideal power
management solution. But it can handle system-wide power management
policy pretty well.

> etc...
> ...and we are far away from that:
> gnome-power-preferences uses HAL, acpi-support uses acpid, laptop_mode does by itself, as well as other things. It's a real mess.

In fact, laptop mode tools also uses acpid. The way I see it, laptop
mode tools and acpi-support are complementary: acpi-support makes
laptops work, laptop mode tools implements power management policy at
the system-wide level. Gnome power manager does it at the user level,
and this may sometimes conflict with what laptop mode tools does. The
fact that acpi-support tries to control laptop mode tools is the weird
thing that makes the acpi-support/laptop mode tools combination look a
bit messy -- it's not its core task, and IMHO it's not surprising that
it does a pretty bad job at it.

Cheers,
Bart