Little ACPI problem I had - GNU/Linux

Users browsing this thread: 4 Guest(s)
venam
Administrators
Hello *nixer,
I have some problems with ACPI recently.
I am not able to identify when the adapter of my laptop was connected or not, even the light of the computer that shows if the adapter is connected did not lit.
I tried some debugging:
Quote:acpi_listen

out:

battery PNP0C0A:00 00000081 00000001
battery PNP0C0A:00 00000080 00000001

in:

battery PNP0C0A:00 00000081 00000001
battery PNP0C0A:00 00000080 00000001


sudo tail -f /var/log/messages.log

Aug 16 15:15:48 venam raptor: ACPI action undefined: PNP0C0A:00

I can't see whether it is plugged in or not.
I also tried to add the action but in vain.
Somehow I saw something weird, the light of the battery was on.
I changed the command to `acpi - b` to see if the battery was recognize and it was!
I don't really know if this is a problem from my computer itself but now it works.
EDIT: It never worked after that.
venam
Administrators
Really weird! The light works now for some reasons.
Here is what I get:
Quote:battery PNP0C0A:00 00000081 00000001
battery PNP0C0A:00 00000080 00000001
ac_adapter ACPI0003:00 00000080 00000000
processor LNXCPU:00 00000081 00000000
processor LNXCPU:01 00000081 00000000
battery PNP0C0A:00 00000081 00000001
battery PNP0C0A:00 00000080 00000001
EDIT: Doesn't work anymore.
simon
Long time nixers
On my laptop I have to add this in Grub. acpi_osi=Linux acpi_backlight=vendor
htor
Members
Are you still having this problem? If so, post your handler.sh script.
venam
Administrators
The light suddenly stopped again.
It's not a problem in itself because the battery is recognized, though the adapter is not.

Quote:#!/bin/sh
# Default acpi script that takes an entry for all actions

minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"

set $*

case "$1" in
button/power)
case "$2" in
PBTN|PWRF)
logger "PowerButton pressed: $2"
poweroff
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
button/sleep)
case "$2" in
SLPB|SBTN)
echo -n mem >/sys/power/state
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
ac_adapter)
case "$2" in
AC|ACAD|ADP0|PNP)
case "$4" in
00000000)
echo -n $minspeed >$setspeed
#/etc/laptop-mode/laptop-mode start
;;
00000001)
echo -n $maxspeed >$setspeed
#/etc/laptop-mode/laptop-mode stop
;;
esac
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
battery)
case "$2" in
BAT0)
case "$4" in
00000000)
logger 'Battery online'
;;
00000001)
logger 'Battery offline'
;;
esac
;;
CPU0)
;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
button/lid)
case "$3" in
close)
logger 'LID closed'
;;
open)
logger 'LID opened'
;;
*)
logger "ACPI action undefined: $3"
;;
esac
;;
*)
logger "ACPI group/action undefined: $1 / $2"
;;
esac

# vim:set ts=4 sw=4 ft=sh et:
htor
Members
The event `ac_adapter ACPI0003:00 00000080 00000000`
reported by `acpi_listen` isn't matched against the ac_adapter rule in handler.sh, so you need to adjust that rule accordingly so that the event is handled.

Change it to:
Code:
...
ac_adapter)
case "$2" in
ACPI*)
case "$4" in
00000000)
# AC is unplugged
# do something
;;
00000001)
# AC is plugged
# do something
;;
...
As for the lights, there could be many reasons.. Try playing around with
`xset led`.
venam
Administrators
I don't think this is the problem. Most of the time acpi_listen gives me only:
battery PNP0C0A:00 00000081 00000001
battery PNP0C0A:00 00000080 00000001
battery PNP0C0A:00 00000081 00000001
battery PNP0C0A:00 00000080 00000001

and in some extremely special cases which I can't reproduce:
battery PNP0C0A:00 00000081 00000001
battery PNP0C0A:00 00000080 00000001
ac_adapter ACPI0003:00 00000080 00000000
processor LNXCPU:00 00000081 00000000
processor LNXCPU:01 00000081 00000000
battery PNP0C0A:00 00000081 00000001
battery PNP0C0A:00 00000080 00000001

which should be like that all the time.
I think it's a hardware problem or a problem with the adaptater itself.
Anyway, I can easilly resolve this problem by doing something like this instead of basing the script over the ac_adaptater base it on the battery:
battery)
case "$2" in
BAT0)
case "$4" in
00000000)
logger 'Battery online'
echo -n $maxspeed >$setspeed
;;
00000001)
logger 'Battery offline'
echo -n $minspeed >$setspeed
;;
esac
simon
Long time nixers
have you tried acpi flags with grub?