Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ACPI battery problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Bonkie
Guru
Guru


Joined: 28 Oct 2002
Posts: 501
Location: Antwerpen, Belgium

PostPosted: Fri Feb 07, 2003 1:43 pm    Post subject: ACPI battery problem Reply with quote

Im trying to get ACPI show my battery status. APCI should be supported by my compaq laptop as it sais here.
Quote:
ACPI compliant


I'm using the acpi-sources for my kernel & I have "acpi" in my USE variables.

Code:
# cd /usr/src/linux
# grep -i acpi .config

# CONFIG_HOTPLUG_PCI_ACPI is not set
# ACPI support
CONFIG_ACPI=y
# CONFIG_ACPI_HT_ONLY is not set
CONFIG_ACPI_BOOT=y
CONFIG_ACPI_BUS=y
CONFIG_ACPI_INTERPRETER=y
CONFIG_ACPI_EC=y
CONFIG_ACPI_POWER=y
CONFIG_ACPI_PCI=y
CONFIG_ACPI_SLEEP=y
CONFIG_ACPI_SYSTEM=y
# CONFIG_ACPI_# CONFIG_ACPI_AC is not set
CONFIG_ACPI_BATTERY=y
# CONFIG_ACPI_BUTTON is not set
# CONFIG_ACPI_FAN is not set
# CONFIG_ACPI_PROCESSOR is not set
# CONFIG_ACPI_THERMAL is not set
# CONFIG_ACPI_TOSHIBA is not set
CONFIG_ACPI_DEBUG=y


acpi seems to be loaded at boot & my log shows after starting acpid manually:
Code:
# tail /var/log/acpid

starting up
1 rule loaded


But when i see if it reads my battery status i get:
Code:
 ls -l /proc/acpi/battery/
total 0


mmm ... What am i forgetting ?? Or should I try to get APM working ??
Back to top
View user's profile Send private message
474
l33t
l33t


Joined: 19 Apr 2002
Posts: 714

PostPosted: Fri Feb 07, 2003 1:57 pm    Post subject: Reply with quote

I recommend you enable the other ACPI options also: ACPI_BUTTON, ACPI_FAN, ACPI_PROCESSOR and ACPI_THERMAL.

You could try using different versions of the ACPI layer. The vanilla-sources has an out-of-date but presumably more reliable layer. gentoo-sources-2.4.19 uses a newer layer which is only used if you emerge those sources with USE="acpi4linux". gentoo-sources-2.4.20-r1 (which is masked) uses the same as ck-sources, dated 15/12/2002. You can also get the latest ACPI layer from its hompage over at sourceforge.net and patch a vanilla kernel yourself.
Back to top
View user's profile Send private message
Bonkie
Guru
Guru


Joined: 28 Oct 2002
Posts: 501
Location: Antwerpen, Belgium

PostPosted: Fri Feb 07, 2003 5:25 pm    Post subject: Reply with quote

tried everything except the vanilla sources ...

I currently have installed it with APM support and it works so ... guess i'm gonna stick with it :)
Back to top
View user's profile Send private message
zerofunk
n00b
n00b


Joined: 23 Jul 2002
Posts: 6

PostPosted: Fri Feb 07, 2003 9:27 pm    Post subject: Reply with quote

I'm pretty sure APM support is more mature than ACPI, so as a general rule if your laptop has both available you probably want to use APM. My laptop only has ACPI and to get it to work, I had to patch the vanilla 2.4.20 sources with the ACPI patches from sourceforge. When you goto configure the kernel, you should also enable all the options for ACPI as kerframil mentioned. Especially the debugging one since it might be helpful, and I think I've read before that everything breaks without (might be fixed now?).
Back to top
View user's profile Send private message
474
l33t
l33t


Joined: 19 Apr 2002
Posts: 714

PostPosted: Fri Feb 14, 2003 11:32 am    Post subject: Reply with quote

I spoke to someone on IRC recently who had a new Athlon based laptop, and was unable to get it working with APM or ACPI. I suggested trying the new ck-sources kernel (which was updated by Con Koliva on the 10th), and it fixed the problem.
Back to top
View user's profile Send private message
stratocastor666
n00b
n00b


Joined: 13 Feb 2003
Posts: 13
Location: AZ

PostPosted: Sun Feb 16, 2003 11:16 pm    Post subject: Reply with quote

Im having very similar problems as well. Will try the ck-sources though. hope they work.
Back to top
View user's profile Send private message
gordonNgentoo
n00b
n00b


Joined: 10 Feb 2003
Posts: 38

PostPosted: Mon Feb 17, 2003 6:09 am    Post subject: ck sources? noob here. Reply with quote

ck sources? noob here, would appreciate some verbose instructions.

I'v set USE=" acpi ..." without apm because I know my motherboard only supports acpi (laptop: acer travelmate 524TE).

dmesg does say the button , fan, and all those nifty acpi detected, but when I hit the Zzz button or the power button, there's no response. I went as far as I can and searched as much forums as I can, but nothing avail. I would appreciate some verbose instructions to get this working. -Thanks Gordon
Back to top
View user's profile Send private message
gordonNgentoo
n00b
n00b


Joined: 10 Feb 2003
Posts: 38

PostPosted: Mon Feb 17, 2003 6:10 am    Post subject: ck sources? noob here. Reply with quote

ck sources? noob here, would appreciate some verbose instructions.

I'v set USE=" acpi ..." without apm because I know my motherboard only supports acpi (laptop: acer travelmate 524TE).

dmesg does say the button , fan, and all those nifty acpi detected, but when I hit the Zzz button or the power button, there's no response. I went as far as I can and searched as much forums as I can, but nothing avail. I would appreciate some verbose instructions to get this working. -Thanks Gordon .
Back to top
View user's profile Send private message
stratocastor666
n00b
n00b


Joined: 13 Feb 2003
Posts: 13
Location: AZ

PostPosted: Mon Feb 17, 2003 6:45 am    Post subject: Reply with quote

Doing an emerge ck-sources will auto emerge a 2.4.20 modified kernel into /usr/src/linux-2.4.20-ck Its supposed to have modifications for ACPI. But I tried it, and still my batter level cannot be read, and hitting power button does nothing. APM will at least show battery level, but no shutdown.
Back to top
View user's profile Send private message
474
l33t
l33t


Joined: 19 Apr 2002
Posts: 714

PostPosted: Mon Feb 17, 2003 10:37 am    Post subject: Reply with quote

Quote:
But I tried it, and still my batter level cannot be read, and hitting power button does nothing. APM will at least show battery level, but no shutdown.


Quote:
dmesg does say the button , fan, and all those nifty acpi detected, but when I hit the Zzz button or the power button, there's no response.

First, you'll need to emerge the ACPI daemon to respond to ACPI events:
Code:
emerge acpid

If you're using a newer ACPI layer other than that included in the vanilla kernel (you are if you're using ck-sources or gentoo-sources-2.4.19 with USE="acpi4linux" or gentoo-sources-2.4.20), then you need to adjust the /etc/acpi/default.sh file, which is the default ACPI event handler script for the daemon. It should look like this:
Code:
#!/bin/sh
# Default acpi script that takes an entry for all actions
                                                                               
set $*
                                                                               
case "$1" in
        button/power)
                case "$2" in
                        PWRF)   /sbin/init 0
                                ;;
                        *)      logger "ACPI action $2 is not defined"
                                ;;
                esac
                ;;
                                                                               
        *)
                logger "ACPI group $1 / action $2 is not defined"
                ;;
esac

The reason it needs to be changed is because the event signals changed in the newer ACPI layers. Stop the daemon, do cat /proc/acpi/event and press the button to discover more.

As for sleep modes and all the rest, well I don't know. Maybe more handler programs have to be defined in default.sh. This warrants futher investigation for sure. I suspect that when you press the "ZZzz" button, the event handle just ends up with "ACPI action _____ not defined" in your syslog. I believe you'd need to cat the event to see what it looks like, and add a hanler to the default.sh script. Something like this perhaps:
Code:
echo "3" > /proc/acpi/sleep

That's supposed to activate ACPI S3 mode, which is Suspend-to-Ram. Don't necessarily expect it to work properly!

As for reading the battery level, well no programs are mentioned here. Compiling things with USE="acpi -apm" might help. Or you can cat the battery status from the /proc interface probably.

By the way, be warned that pressing the power off button does /sbin/init 0 which forcefully powers down, no matter what you are doing! A better script or command could be provided which handles things more gracefully - not shutting down if you're in X for example.
Back to top
View user's profile Send private message
474
l33t
l33t


Joined: 19 Apr 2002
Posts: 714

PostPosted: Mon Feb 17, 2003 11:28 am    Post subject: Reply with quote

By the way, to get ck-sources:
Code:
emerge ck-sources
cd /usr/src/
rm linux
ln -s linux-2.4.20-ck3 linux


Then set up your kernel in the same way as you normally would. Like this:
Code:
cd /usr/src/linux
make menuconfig
make dep && make clean bzImage modules modules_install

You'll need to mount /boot and copy your bzImage over there of course. Follow the same steps you did in the install guide.

Don't forget to enable all ACPI options in kernel setup (Battery, Thermal Zone ... etc).
Back to top
View user's profile Send private message
gordonNgentoo
n00b
n00b


Joined: 10 Feb 2003
Posts: 38

PostPosted: Mon Feb 17, 2003 5:59 pm    Post subject: ck kernel? Reply with quote

I have a little concern for this new ck kernel, I have a few concerns I'd like to ask:

1) IF I upgrade my kernel to this ck version, in the future, when I AGAIN upgrade my kernel by doing "emerge gentoo-sources" what happens??? will I be able to go back to gentoo-sources ? or will I be stuck at the ck ? I have a feeling you're going to say that if I do emerge gentoo-sources, I'll get gentoo-sources kernel, and if I did emerge ck-blah blah kernel, I'll get this ck kernel? Just need confirmation.

2) vanilla kernel. What's the difference between the vanilla kernel and gentoo's kernel?

3) am I correct to assume that there's less support (tech support) for the ck kernel compared to the gentoo kernel? I'm worried about having more potential errors. (newbie).

4) if there's problem with this new layer thing, why do they even put it in the kernel??? I expect them to at least mark those as "experimental" rather than to have people waste hours of our time trying to figure out what's wrong. I've had both mandrake and redhat and they had this power mangagement configured correctly.

-Gordon
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum