You are not logged in.

#1 2008-12-16 07:09:37

quantumphaze
Member
From: Melbourne, Australia
Registered: 2008-11-14
Posts: 175

Acer Aspire 3680, pm-suspend works, Fn+F4 (sleep) doesn't

I can't seem to be able to get my laptop's sleep button (Fn+F4) to work. Running pm-suspend manually works perfectly though and also using KDE's shutdown thing.

I have attempted to do as the acpid wiki page has suggested to get this thing working:

I changed it to use pm-suspend instead of "echo -n mem >/sys/power/state" and tried to use SLPB and SBTN for /etc/acpi/handler.sh and got nothing.

The most disturbing part is when I run "tail -f /var/log/messages.log" (as root) and press Fn+F4 it is meant to show something. Instead I get nothing at all.

My handler.sh

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

# NOTE: This is a 2.6-centric script.  If you use 2.4.x, you'll have to
#       modify it to not use /sys                                      

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)
        #echo "PowerButton pressed!">/dev/tty5
        case "$2" in                          
            PWRF)   logger "PowerButton pressed: $2" ;;
            *)      logger "ACPI action undefined: $2" ;;
        esac                                             
        ;;                                               
    button/sleep)                                        
        case "$2" in                                     
            SBTN)   /usr/sbin/pm-suspend ;;              
            *)      logger "ACPI action undefined: $2" ;;
        esac                                             
        ;;                                               
    ac_adapter)                                          
        case "$2" in                                     
            AC)                                          
                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)   #echo "offline" >/dev/tty5
                    ;;
                    00000001)   #echo "online"  >/dev/tty5
                    ;;
                esac
                ;;
            CPU0)
                ;;
            *)  logger "ACPI action undefined: $2" ;;
        esac
        ;;
    button/lid)
        #echo "LID switched!">/dev/tty5
        ;;
    *)
        logger "ACPI group/action undefined: $1 / $2"
        ;;
esac

If I run xev it shows the keycode for it:

##Sleep press
KeyPress event, serial 34, synthetic NO, window 0x2400001,
    root 0x95, subw 0x0, time 40233356, (968,431), root:(973,456),
    state 0x10, keycode 150 (keysym 0x1008ff2f, XF86Sleep), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

##Sleep release
KeyRelease event, serial 36, synthetic NO, window 0x2400001,
    root 0x95, subw 0x0, time 40233562, (968,431), root:(973,456),
    state 0x10, keycode 150 (keysym 0x1008ff2f, XF86Sleep), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Any ideas on how to get this working right in acpid or hack a workaround with xmodmap (I never leave X willingly so it's ok) are welcome.

The button worked perfectly in Ubuntu, so there may be configuration there I can harvest if anyone knows where.


▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▏▎▍▌▋▊▉█▇▆▅▄▃▂▁

Offline

#2 2008-12-26 16:29:42

quantumphaze
Member
From: Melbourne, Australia
Registered: 2008-11-14
Posts: 175

Re: Acer Aspire 3680, pm-suspend works, Fn+F4 (sleep) doesn't

Well there is definitely a problem with acpid not recognising the sleep button event on my laptop. I believe that the problem is with whatever passes the SLPB event to handler.sh which is working if I run it manually with "/etc/acpi/handler.sh button/sleep SLPB" (that is pm-suspend whinges about not being root).

In dmesg I find:

ACPI: AC Adapter [ACAD] (on-line)
ACPI: Battery Slot [BAT1] (battery present)
input: Power Button (FF) as /class/input/input4
ACPI: Power Button (FF) [PWRF]
input: Lid Switch as /class/input/input5
ACPI: Lid Switch [LID]
input: Power Button (CM) as /class/input/input6
ACPI: Power Button (CM) [PWRB]
input: Sleep Button (CM) as /class/input/input7
ACPI: Sleep Button (CM) [SLPB]
ACPI: CPU0 (power states: C1[C1] C2[C2] C3[C3])
processor ACPI0007:00: registered as cooling_device0
ACPI: Processor [CPU0] (supports 8 throttling states)
thermal LNXTHERM:01: registered as thermal_zone0
ACPI: Thermal Zone [THRM] (30 C)

Which I believe is stuff from the 'buttons' module.

acpi_listen gives me nothing for the sleep button but it works for the lid and power buttons, though in an odd way. Every time the lid is opened or closed the last number increases (note: I pressed it multiple times here, it makes 2 to 4 entries for a press):

button/lid LID 00000080 0000002e                                                
button/lid LID 00000080 00000046
button/lid LID 00000080 00000047
button/lid LID 00000080 00000048
button/lid LID 00000080 00000049
button/lid LID 00000080 0000004a
button/lid LID 00000080 0000004b
button/lid LID 00000080 0000004c
button/lid LID 00000080 0000004d
button/lid LID 00000080 0000004e
button/lid LID 00000080 0000004f
button/lid LID 00000080 00000050
button/lid LID 00000080 00000051
button/lid LID 00000080 00000052
button/lid LID 00000080 00000053
button/power PWRF 00000080 00000009

I just have no idea where to go from here. It is recognised by the kernel as SLPB but acpid's handler.sh doesn't ever receive it.

What calls handler.sh? How does it pass on the button presses?


▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▏▎▍▌▋▊▉█▇▆▅▄▃▂▁

Offline

Board footer

Powered by FluxBB