You are not logged in.

#1 2011-02-06 15:07:19

VitaminJ
Member
Registered: 2009-10-19
Posts: 26

acpid vs dbus vs laptop-mode-tools - What's the relationship?

I disabled acpid from daemons, and uninstalled it, and to my surprise, the Suspend option still appears in the XFCE4 logout window, and when I open the lid the lappy comes right back. I had been under the impression that acpid was required for actions to take place on lid open/close. After a bit more research it appears that acpid is nothing more than a daemon that watches /proc and /sys for power and laptop related events, and that any daemon can do this, and in fact, cpufrequtils is such a daemon that just has a subset of events that it watches.

Then I noticed today that on my Arch that when I close the lid, my LCD brightness goes down, and I have to use the function keys to bring brightness back. If I don't have acpid or laptop-mode-tools installed, I assume that dbus is handling this dimming? Or the hardware BIOS?

Why isn't dbus handling things like AC adapter plugging and unplugging, and button events? Is there any reason to use acpid at all these days?

Offline

#2 2011-02-06 15:43:11

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: acpid vs dbus vs laptop-mode-tools - What's the relationship?

dbus is only a message-bus, any daemon/application can use it to communicate. You only need acpid if you don't have another daemon that already handles what it does, provided you require it's functionality ofcourse. I believe XFCE has a daemon called xfce4-power-manager, it might do the same stuff that non-DE users would use acpid for, though i'm not sure if it also provides a custom hooks system.


ᶘ ᵒᴥᵒᶅ

Offline

#3 2011-02-07 07:07:27

Kirurgs
Member
Registered: 2008-10-20
Posts: 144

Re: acpid vs dbus vs laptop-mode-tools - What's the relationship?

Hi!

I uninstalled acpid as well, because it constantly got stuck when waking up computer not allowing Xorg to resume properly - computer appeared to be dead, nothing worked... When I ssh to the box, I killed acpid and computer was alive as nothing ever happened...
So I inspected what acpid actually does as a standard and it does almost nothing (for me) smile It sets cpu governor to powersave on battery and to max perf. on AC, additionally it tries to react to suspend button which is working w/o acpid anyway... CPU freq is handled via on-demand governor in my case and suspend is working w/o acpid, so I didn't saw a single tiny reason why I need that package, I'm better off w/o it smile
Custom hooks is different story, if that is needed - acpid is required.

regards
Kirurgs

Last edited by Kirurgs (2011-02-07 07:08:06)

Offline

#4 2011-02-08 17:12:07

VitaminJ
Member
Registered: 2009-10-19
Posts: 26

Re: acpid vs dbus vs laptop-mode-tools - What's the relationship?

Okay! So I'm not the only one who did this. After uninstalling acpid, I lost my cpu throttling so I installed laptop-mode-tools, which I was hoping would do X/console screen blanking on lid close and cpu frequency scaling, but pacman reports the following after install:

Optional dependencies for laptop-mode-tools
    acpid: for ACPI support
    bluez: for bluetooth support
    ethtool: for ethernet support

Whaa? Why is acpid possibly required? Doesn't laptop-mode-tools read acpi messages from the kernel already?

Offline

#5 2011-02-08 17:22:22

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: acpid vs dbus vs laptop-mode-tools - What's the relationship?

"optional dependencies" doesn't imply that you are required to have them right?

For cpu throttling you only need the cpufrequtils package.


ᶘ ᵒᴥᵒᶅ

Offline

#6 2011-02-08 18:55:25

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: acpid vs dbus vs laptop-mode-tools - What's the relationship?

For me, laptop-mode-tools doesn't do most of the things I set it to do without acpid.

Basically, acpid allows laptop-mode-tools to know whether the laptop is plugged/unplugged. For me, I have the cpufreq governor change based on whether it's plugged in or not and I have the screen brightness change as well.

I have had acpid freak out a few times on me, though. I'd love to get rid of it...

Offline

#7 2011-02-08 18:57:41

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: acpid vs dbus vs laptop-mode-tools - What's the relationship?

pogeymanz wrote:

I have had acpid freak out a few times on me, though. I'd love to get rid of it...

You could write a simple script to check the actual /sys and /proc entries, there shouldn't be much to it.


ᶘ ᵒᴥᵒᶅ

Offline

#8 2011-02-18 10:24:47

VitaminJ
Member
Registered: 2009-10-19
Posts: 26

Re: acpid vs dbus vs laptop-mode-tools - What's the relationship?

Confirmed that like pogeymanz, laptop-mode-tools really does nothing without acpid. I guess it will set some of the other static values for devices listed in /etc/laptop-mode/conf.d/ but that's it. Tested by setting laptop-mode-tools to change the cpu scaling governor to powersave on battery, disabling acpid and unplugging laptop, then running cpufreq-info. No change.

Then started acpid again from the init script, plug and unplug, now governor is powersave.

It appears that acpid is a hard dependency, and that package should really be changed to fix that. If you look at the file list, there are 6 scripts placed into /etc/acpi/events/
etc/acpi/actions/lm_ac_adapter.sh
etc/acpi/actions/lm_battery.sh
etc/acpi/actions/lm_lid.sh
etc/acpi/events/lm_ac_adapter
etc/acpi/events/lm_battery
etc/acpi/events/lm_lid

So laptop-mode-tools isn't even watching the acpid socket itself (/var/run/acpid.socket), and it relies solely on acpid to tell it about AC and lid status, so any configuration that you do in laptop-mode-tools that depends on checking for normal status changes on a notebook computer will fail to change anything without acpid installed and running.

Offline

Board footer

Powered by FluxBB