From owner-freebsd-current@FreeBSD.ORG Mon Jul 25 07:12:28 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 057CA16A41F; Mon, 25 Jul 2005 07:12:28 +0000 (GMT) (envelope-from lists@yazzy.org) Received: from lapdance.yazzy.net (217-13-2-82.dd.nextgentel.com [217.13.2.82]) by mx1.FreeBSD.org (Postfix) with ESMTP id 68F8143D45; Mon, 25 Jul 2005 07:12:26 +0000 (GMT) (envelope-from lists@yazzy.org) Received: from localhost (localhost [127.0.0.1]) by lapdance.yazzy.net (8.13.4/8.13.4) with SMTP id j6P7CLnk000945; Mon, 25 Jul 2005 09:12:22 +0200 (CEST) (envelope-from lists@yazzy.org) Date: Mon, 25 Jul 2005 09:12:21 +0200 From: Marcin Jessa To: Nate Lawson Message-Id: <20050725091221.106a0368.lists@yazzy.org> In-Reply-To: <42E42F10.3030309@root.org> References: <42E1481F.5040306@root.org> <20050723133819.36efb537.lists@yazzy.org> <42E29CAA.1020007@root.org> <20050724215818.55f951ae.lists@yazzy.org> <42E42F10.3030309@root.org> Organization: YazzY.org X-Mailer: Sylpheed version 1.9.12 (GTK+ 2.6.7; i386-portbld-freebsd5.4) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: acpi@freebsd.org, kjelderg@gmail.com, freebsd-current@freebsd.org Subject: Re: acpi battery rework patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2005 07:12:28 -0000 On Sun, 24 Jul 2005 17:15:12 -0700 Nate Lawson wrote: > Marcin Jessa wrote: > > On Sun, 24 Jul 2005 12:47:13 +0900 > > Eric Kjeldergaard wrote: > >>Excellent. compiled and appears working. It does however have > >>different values than the old system for some of the sysctl variables. > >> I get > >> > >>hw.acpi.battery.life: 98 > >>hw.acpi.battery.time: 0 > >>hw.acpi.battery.state: 0 > >>hw.acpi.battery.units: 1 > >>hw.acpi.battery.info_expire: 5 > >> > >>when plugged in. But used to get time as -1 when plugged in and I > >>think state may have been 1 when plugged in before (less sure about > >>that than the time). Thanks for the enormous amount of work your > >>efforts are very much appreciated, > >> > >>Eric > > > > > > Ditto, thanks a lot. It works well here too. I can now actually correctly see whether the lapper is connected to power or runs on battery. > > Before the state change could not be detected. > > What lacks is remining time which AFAIR worked before, now showing : hw.acpi.battery.time: -1 > > I don't miss it though since showing remining percentage is more than enough. > > Thanks again for great work! > > Both of you please boot either the last 6.0 beta1 or a 5.x kernel and > let me know for sure what your original behavior was. > > As far as Eric's result, I'll check that on my systems as well. I > _think_ the previous behavior was more correct (-1 = unknown) so I'll > commit this minor change. The "state" variable should not have changed > so please let me know for sure if it has. "1" means "discharging" which > doesn't sound right if you're on AC power. If you just recently plugged > in the laptop, try polling the status a few more times (apm(8) gives > more detail) and see if it catches up. Some systems lag reporting > various values until they are sure they've restabilized after an AC line > change. > > Marcin, if your system reports a valid rate of use, we can calculate > time. If you're on AC power, there is no time available (since your > batteries aren't discharging at any rate). Try a previous > kernel/acpi.ko to be certain what the behavior used to be. One easy way > to do this is use the FreeSBIE live CD, based on 5.3-RELEASE: > > http://www.freesbie.org/ [yazzy@lapdance:~]> uname -a FreeBSD lapdance.yazzy.net 6.0-BETA1 FreeBSD 6.0-BETA1 #4: Sat Jul 23 17:35:13 CEST 2005 root@lapdance.yazzy.net:/usr/obj/usr/src/sys/LAPDANCE-6.0 i386 Running on AC: [yazzy@lapdance:~]> sysctl -a | grep battery hw.acpi.battery.life: 23 hw.acpi.battery.time: -1 hw.acpi.battery.state: 2 hw.acpi.battery.units: 1 hw.acpi.battery.info_expire: 5 Running on battery: [yazzy@lapdance:~]> sysctl -a | grep battery hw.acpi.battery.life: 23 hw.acpi.battery.time: 41 hw.acpi.battery.state: 1 hw.acpi.battery.units: 1 hw.acpi.battery.info_expire: 5 [yazzy@lapdance:~]> Cheers, Marcin.