# acpi not receiving events

## jackdripper

Hello everyone,

I have been following the guide at:

http://www.gentoo.org/doc/en/power-management-guide.xml

I'm on 2.6.17

So, whatever they suggested to compile in the kernel or as a module that is what I have done.

When I look at /var/log/acpi no events are being generated.

With this test :

on_ac_power && echo AC available || echo Running on batteries

It shows "AC available" when the ac is plugged in, take the cable out, and it shows "Running on batteries"

```

# acpitool -e    

  Kernel version : 2.6.17   -    ACPI version : 20060127

  -----------------------------------------------------------

  Battery #1     : present

    Remaining capacity : 39441 mWh, 82.47%, 00:27:29

    Design capacity    : 50760 mWh

    Last full capacity : 47822 mWh, 94.21% of design capacity

    Capacity loss      : 5.788%

    Present rate       : 18295 mW

    Charging state     : charging

    Battery type       : rechargeable, Li-ION  

    Model number       : G71C0004G810

    Serial number      : 0100027803

  Battery #2     : slot empty

  AC adapter     : on-line

   Fan :  off 

  CPU type               : Intel(R) Pentium(R) M processor 2.13GHz 

  CPU speed              : 800.000 MHz 

  Cache size             : 2048 KB

  Bogomips               : 1600.29 

  Processor ID           : 0

  Bus mastering control  : yes

  Power management       : yes

  Throttling control     : no

  Limit interface        : no

  Active C-state         : C3

  C-states (incl. C0)    : 4

  Usage of state C1      : 10 (0.0 %)

  Usage of state C2      : 161443 (35.8 %)

  Usage of state C3      : 144440 (32.1 %)

  Thermal info   : <not available>

  wakeup devices : <not available>

```

I can modify this:

/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

and the processor speed with follow the governor which I set.

I can also run: acpitool -l  4 

for example, and dim the lcd display.

Also, I have th battery indication applet in gnome, this also changes correctly with respect to having the power connected, or not.

Most things seem to work as they should, except acpid is not receiving events.

```

 # ls -R /proc/acpi/

/proc/acpi/:

ac_adapter  dsdt                 event  info            processor

battery     embedded_controller  fadt   power_resource  toshiba

/proc/acpi/ac_adapter:

ADP1

/proc/acpi/ac_adapter/ADP1:

state

/proc/acpi/battery:

BAT1  BAT2

/proc/acpi/battery/BAT1:

alarm  info  state

/proc/acpi/battery/BAT2:

alarm  info  state

/proc/acpi/embedded_controller:

/proc/acpi/power_resource:

/proc/acpi/processor:

CPU0

/proc/acpi/processor/CPU0:

info  limit  power  throttling

/proc/acpi/toshiba:

fan  keys  lcd  version  video

```

Modules at run time :

```

 # lsmod

Module                  Size  Used by

cisco_ipsec           545996  0 

snd_pcm_oss            16992  0 

snd_mixer_oss          12928  1 snd_pcm_oss

snd_seq_oss            23872  0 

snd_seq_midi_event      5184  1 snd_seq_oss

snd_seq                37456  4 snd_seq_oss,snd_seq_midi_event

snd_seq_device          5708  2 snd_seq_oss,snd_seq

snd_intel8x0           24924  0 

snd_ac97_codec         78496  1 snd_intel8x0

snd_ac97_bus            1792  1 snd_ac97_codec

snd_pcm                54472  3 snd_pcm_oss,snd_intel8x0,snd_ac97_codec

snd_timer              15236  2 snd_seq,snd_pcm

snd_page_alloc          6728  2 snd_intel8x0,snd_pcm

toshiba_acpi            4756  0 

speedstep_centrino      5456  1 

processor              16896  1 speedstep_centrino

ipw2200               140268  0 

nvidia               4541396  12 

sky2                   28740  0 

```

The AC and battery modules are compiled in kernel as the guide suggests.

Any ideas of what I'm missing here?

TIA

----------

## jackdripper

Other information if it helps:

This is a Toshiba Tecra M3

```

 # ps -ef | grep [a]cpi

root         8     5  0 Mar02 ?        00:00:00 [kacpid]

root      4888     1  0 Mar02 ?        00:00:00 /usr/sbin/acpid

102       5034  5028  0 Mar02 ?        00:00:00 /usr/libexec/hald-addon-acpi

```

Is there a special user that needs to be added for hald ? As it's showing up and being owned by "102"

I haven't removed any users from this system, it's a fresh install.

----------

## jackdripper

This also :

# acpi_available; echo $?

0

I guess zero in this case means success, acpi is available ?

As this shows when the ac cable is connected:

# on_ac_power; echo $?

0

but with the cable not connected:

# on_ac_power; echo $?

1

----------

## jackdripper

No one has any ideas at all ?

```

# grep -i "^config_acpi" .config

CONFIG_ACPI=y

CONFIG_ACPI_AC=y

CONFIG_ACPI_BATTERY=y

CONFIG_ACPI_BUTTON=m

CONFIG_ACPI_VIDEO=m

CONFIG_ACPI_FAN=m

CONFIG_ACPI_PROCESSOR=m

CONFIG_ACPI_THERMAL=m

CONFIG_ACPI_TOSHIBA=m

CONFIG_ACPI_BLACKLIST_YEAR=0

CONFIG_ACPI_EC=y

CONFIG_ACPI_POWER=y

CONFIG_ACPI_SYSTEM=y

```

----------

## dmn

Have the same problem on HP nx7300.  :Sad: 

Any bright ideas?   :Rolling Eyes: 

----------

## dmn

up?   :Sad: 

----------

## tekknokrat

i have some issues that the events generated are not taken by my scripts 

message:

```

Mar 23 02:03:55 toshi logger: ACPI event unhandled: battery BAT1 00000080 00000001

```

script in ~ $ cat /etc/acpi/events/pmg_ac_adapter

```

events=ac_adapter AC 00000080 00000000

action=/etc/acpi/actions/pmg_switch_runlevel.sh %e

```

the other script in ~ $ cat /etc/acpi/events/pmg_battery

```

event=battery BAT0 00000080 00000001

action=/etc/acpi/actions/pmg_switch_runlevel.sh %e

```

the default one from http://www.gentoo.org/doc/en/power-management-guide.xml

~ $ cat /etc/acpi/actions/pmg_switch_runlevel.sh

```
#!/bin/bash

# BEGIN CONFIGURATION

RUNLEVEL_AC="default"

RUNLEVEL_BATTERY="battery"

# END CONFIGURATION

if [ ! -d "/etc/runlevels/${RUNLEVEL_AC}" ]

        then

                logger "${0}: Runlevel ${RUNLEVEL_AC} does not exist. Aborting."

                exit 1

fi

if [ ! -d "/etc/runlevels/${RUNLEVEL_BATTERY}" ]

        then

                logger "${0}: Runlevel ${RUNLEVEL_BATTERY} does not exist. Aborting"

                exit 1

fi

if on_ac_power

        then

                if [[ "$(</var/lib/init.d/softlevel)" != "${RUNLEVEL_AC}" ]]

                        then

                                logger "Switching to ${RUNLEVEL_AC} runlevel"

                                /sbin/rc ${RUNLEVEL_AC}

                fi

elif [[ "$(</var/lib/init.d/softlevel)" != "${RUNLEVEL_BATTERY}" ]]

        then

                logger "Switching to ${RUNLEVEL_BATTERY} runlevel"

                /sbin/rc ${RUNLEVEL_BATTERY}

fi

```

can someone verify?

@dmn & @jackdripper

did you load the modules? you must put them in /etc/modules.autload/kernel-2.6

is acpid running?

----------

## tekknokrat

got my problem managed with moving the default.sh script out from /etc/acpi.

I think some tutorials needs an urgent update, whos responsible for documentation?

EDIT: 

Was wrong with moving the default.sh script out. 

This one is new for acpi and creates the ACPI event unhandled messages.

So this is to be customized for your needs...

----------

## dmn

 *tekknokrat wrote:*   

> 
> 
> did you load the modules? you must put them in /etc/modules.autload/kernel-2.6
> 
> is acpid running?

 

I did. The result was the same.  :Sad: 

----------

## tekknokrat

can you please post the syslog with the parts when the acpi modules are loaded.

For me some modules failed to load ( ok my toshiba is made <2000   :Razz:  )

Did you have acpi useflag set when emerge acpid?

Is acpid running and at least showing some error messages?

Please also post this part of syslog.

regards

----------

## dmn

I've just emerged gentoo-sources-2.6.20-r5 and acpi started to work properly!

I'm waiting impatiently stable gentoo-sources-2.6.20.   :Cool:   :Rolling Eyes:   :Very Happy: 

I'm glad!   :Very Happy: 

----------

