nixers
Little ACPI problem I had - Printable Version
+- nixers (https://nixers.net)
+-- Forum: Operating Systems & Administration (https://nixers.net/Forum-Operating-Systems-Administration)
+--- Forum: GNU/Linux (https://nixers.net/Forum-GNU-Linux)
+--- Thread: Little ACPI problem I had (/Thread-Little-ACPI-problem-I-had)


Little ACPI problem I had - venam - 19-08-2012

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.


RE: Little ACPI problem I had - venam - 20-08-2012

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.


RE: Little ACPI problem I had - simon - 20-08-2012

On my laptop I have to add this in Grub. acpi_osi=Linux acpi_backlight=vendor


RE: Little ACPI problem I had - htor - 21-08-2012

Are you still having this problem? If so, post your handler.sh script.


RE: Little ACPI problem I had - venam - 21-08-2012

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:



RE: Little ACPI problem I had - htor - 24-08-2012

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`.


RE: Little ACPI problem I had - venam - 25-08-2012

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


RE: Little ACPI problem I had - simon - 27-09-2012

have you tried acpi flags with grub?