LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-30-2005, 11:16 PM   #1
Atmchicago
Member
 
Registered: Apr 2003
Location: Baltimore
Distribution: Fedora
Posts: 220

Rep: Reputation: 32
ACPI sleeping/standby and resuming


My laptop seems to go into standby mode fine when I use KDE's power control features. However, I have a dilemma - to resume, I have to hit the power button. Just one tap on the power button also sends the shutdown signal. This means that if I go into standby mode, once I resume I automatically shut down.

I am therefore wondering if it is possible to use another button to get out of sleep mode. I want to keep the power button to be able to shut down in case I need to (I can't pull the power on a laptop as easily). I have two buttons next to my power button that look like reboot buttons or something like that, but they don't do anything. Could I possibly activate those buttons to resume?

Using: kernel 2.6.11.7
Laptop: Compal CL56, pentium M, ATI Radeon 9700.
Distro: Slackware-current.
 
Old 05-02-2005, 01:32 PM   #2
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
This probably won't help, but when I was still getting familiar with my laptop, I likewise couldn't get it to wake up successfully. After some digging, I discovered that the button needs to be pressed for a certain amount of time - a very quick "click" won't do anything, but holding it down too long will shut it off. On my machine, the "wake up call" works if I do a quick "one two" count and then release the button. Admittedly this may have no bearing on your situation, but perhaps you might be pressing the button for too long.

That being said, does the User Manual address how to do a wake up? There presumably should be some sort of commentary on it, which may be relevant. Good luck with it -- J.W.
 
Old 05-02-2005, 04:02 PM   #3
Atmchicago
Member
 
Registered: Apr 2003
Location: Baltimore
Distribution: Fedora
Posts: 220

Original Poster
Rep: Reputation: 32
Yeah I see what you are saying. My problem is that the slightest tap sends it automatically to shutdown. So if I hold it longer it doesn't change.
 
Old 05-03-2005, 03:48 AM   #4
nnsg
Member
 
Registered: Apr 2004
Distribution: Slackware 9.1/10.1, Mandrake 9.1/10.1
Posts: 75

Rep: Reputation: 15
Hi Atmchicago,

Maybe you can comment out the shutdown action in /etc/acpi/acpi_handler.sh?

For "emergency shutdown", you can always press and hold the power button for 5 seconds. (this equal to pull the power cord)

Last edited by nnsg; 05-03-2005 at 03:49 AM.
 
Old 05-03-2005, 11:57 AM   #5
Atmchicago
Member
 
Registered: Apr 2003
Location: Baltimore
Distribution: Fedora
Posts: 220

Original Poster
Rep: Reputation: 32
Cool, I didn't know those files were there. Here is my acpi_handler.sh:

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

IFS=${IFS}/
set $@

case "$1" in
  button)
    case "$2" in
      power) /sbin/init 0
         ;;
      *) logger "ACPI action $2 is not defined"
         ;;
    esac
    ;;
  *)
    logger "ACPI group $1 / action $2 is not defined"
    ;;
esac
And the "default" file in /etc/acpi/events/default:

Code:
# This is the ACPID default configuration, it takes all
# events and passes them to /etc/acpi/default.sh for further
# processing.

# event keeps a regular expression matching the event. To get
# power events only, just use something like "event=button power.*"
# to catch it.
# action keeps the command to be executed after an event occurs
# In case of the power event above, your entry may look this way:
#event=button power.*
#action=/sbin/init 0

# Optionally you can specify the placeholder %e. It will pass
# through the whole kernel event message to the program you've
# specified.

event=.*
action=/etc/acpi/acpi_handler.sh %e
Does this mean I can add something like the amount of time the button is pressed to these configuration files?

And as I said, I have two buttons next to my power button that are unused, and they are probably designed for rebooting and the like. Could I reference one of them to go into sleep mode, and the other to resume? That would be nifty, and would sidestep the entire power button issue. But I wouldn't know how to reference them. Like, the power button is "event = button power *". What would I call the other two buttons?
 
Old 05-04-2005, 09:50 AM   #6
nnsg
Member
 
Registered: Apr 2004
Distribution: Slackware 9.1/10.1, Mandrake 9.1/10.1
Posts: 75

Rep: Reputation: 15
Hi Atmchicago,

I don't think (or should I say I don't know how ) you can assign different action based on how long the button is pressed.

When you press the power button, it will generate an acpi event in /var/log/acpid:

Code:
received event "button/power PWRF 00000080 00000001"
which match the "button", "power" case in acpi_handler.sh so /sbin/init 0 will run. (power off)

You can press those two buttons and check if they generate any similar event, if so you can assign action to them. But I don't think they are supported in stock kernel, so you may have to do some search. Probably there are patches for Compal notebook support.
 
Old 05-04-2005, 07:37 PM   #7
Atmchicago
Member
 
Registered: Apr 2003
Location: Baltimore
Distribution: Fedora
Posts: 220

Original Poster
Rep: Reputation: 32
Ok, well I commented out the default action for the power button, so that pressing it won't initiate /sbin/init 0. This opens up a new can of worms for me - 1) standby doesn't come out of standby, I think it hangs up on reinitializing my USB sound card, I can check that by trying standby when I have it unplugged. 2) Coming out of hibernate screws up the video, and it freezes.

Oh well. I'll see how I can still play with it some more.
 
Old 05-05-2005, 02:24 AM   #8
nnsg
Member
 
Registered: Apr 2004
Distribution: Slackware 9.1/10.1, Mandrake 9.1/10.1
Posts: 75

Rep: Reputation: 15
Hi Atmchicago,

I don't think it will cause freezing when resume, really, by comment it out you just ask it to do nothing.

So here are my guess:

The freezing problem probably exist before you comment out the shutdown action.

Before: when resume, the system had been shutdown before it freeze (caused by USB sound card).
After: the system won't shutdown so you will notice the freeze.

USB and video system are typical causes of resume problem. I'm not sure about your system, but you can try few things (based on the experience on my IBM x40):

- I have to add "acpi_sleep=s3_bios" to boot parameter so that video system won't freeze after resume.
- Unload USB modules before standby/hibernate.
- Switch to console before standby/hibernate.

You can search through this forum, you will find many similar cases.
 
Old 05-06-2005, 03:41 PM   #9
Atmchicago
Member
 
Registered: Apr 2003
Location: Baltimore
Distribution: Fedora
Posts: 220

Original Poster
Rep: Reputation: 32
Yes, I figured that the commenting it out wasn't the actualy source of the problems. But now that I can actually resume, they start to show up

But yeah, turning off the sound card fixes the resuming issues for USB, and turning it back on works fine. I might make a little script that automates some of the stuff for me at some point.

If I use lilo, how do I add the bios setting? "acpi_sleep=s3_bios"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mandrake 10 - Resuming from Standby Gringo Linux - Newbie 1 08-03-2004 01:37 PM
ACPI problem -- not resuming from hibernate GoBillsBN Linux - Laptop and Netbook 13 04-20-2004 12:33 PM
ACPI problem -- not resuming from hibernate GoBillsBN Mandriva 2 03-24-2004 02:29 PM
mouse doesn't work after resuming from standby mode malo_umoran Slackware 0 01-09-2004 12:14 PM
how to do standby or suspend with acpi Brain Drop Linux - General 3 05-04-2003 11:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration