Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jun 2013 23:53:16 +1000 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        Joseph Mingrone <jrm@ftfl.ca>
Cc:        freebsd-mobile@freebsd.org
Subject:   Re: Lenovo T530 - Battery Warnings 
Message-ID:  <20130615230808.N59753@sola.nimnet.asn.au>
In-Reply-To: <86sj0krdzg.fsf@gly.ath.cx>
References:  <86sj0krdzg.fsf@gly.ath.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 14 Jun 2013 10:58:11 -0300, Joseph Mingrone wrote:

 > I convinced a friend to try FreeBSD (9-STABLE amd64) on her Lenovo T530
 > and things are running quite well.  One problem is that, unlike other
 > IBM/Lenovos, there is no beep to warn her when the battery is about to
 > die.  There is also no beep when (un)plugging the power.  Beeping does
 > work before the OS is loaded (e.g. in the BIOS setup).  The BIOS version
 > is 2.04.
 > 
 > Is there a fix for this?

For AC<->battery changes, /etc/devd.conf already has devd perform:

# Switch power profiles when the AC line state changes.
notify 10 {
	match "system"          "ACPI";
	match "subsystem"       "ACAD";
	action "/etc/rc.d/power_profile $notify";
};

You won't need to mess with power_profile but it's instructive and logs 
power changes to /var/log/messages.

If you made that, say:
	action "/etc/rc.d/power_profile $notify && /root/my_script $notify";

then my_script can do whatever, with or without using parameter $notify

if '# kldload speaker && spkrtest' makes useful noises on the speaker, 
then it's easy to make up a couple of satisfactory and noticeable alert 
'tunes'.  See speaker(4).  I used these for years on an old Compaq with 
APM, which also could be configured to run alerts at every 10% battery 
level change, charging or discharging, enabling such as suspend on low 
battery where that wasn't built in, or other actions to save power.

devd.conf(5) as well as /etc/devd.conf shows:

     ACPI      Events related to the ACPI subsystem.
               Subsystem
               ACAD       AC line state ($notify=0x00 is offline, 0x01 is online).
               Button     Button state ($notify=0x00 is power, 0x01 is sleep).
               CMBAT      Battery events.
               Lid        Lid state ($notify=0x00 is closed, 0x01 is open).
               Thermal    Thermal zone events.

with an example also for thermal overheating pending shutdown, but I'm 
yet to find examples of any CMBAT battery events, regarding your first 
concern.  That is, I've wondered about this myself ..

Can anyone say, or point to, which ACPI CMBAT events get to devd?

cheers, Ian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130615230808.N59753>