LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 13 Suspend (https://www.linuxquestions.org/questions/slackware-14/slackware-13-suspend-751219/)

meetscott 08-30-2009 03:34 AM

Slackware 13 Suspend
 
Well, since no one else has started one, I guess I'll be the first on suspend for Slackware 13.

I have 2 laptops that would suspend perfectly under Slackware 12.2. Slamd64 12.2 also worked. Now, on Slackware 13, 64 bit, suspend no longer works when I close the laptop lid. It goes into suspend okay, but when I open the lid, it appears to come out of it except there is no display or keyboard available. I have to do a hard reset to get everything back.

For now, I have disabled suspend altogether in power management. I am interested to know if anyone else has suspend working. I think this might be a kde 4 issue, but I'm not sure.

Anyone with any thoughts or experience on this? I will not be upgrading my work laptop until I have found a reliable solution to this because I love coming into work, opening my display and having everything exactly as I left it. I consider it a must have feature now.

mRgOBLIN 08-30-2009 04:31 AM

Well It's been working just fine with my slackware64 laptop for some time.

I only suspend to disk as it just seems safer than suspend to ram.

vinegaroon 08-30-2009 04:40 AM

If you manually run "pm-suspend" (as root), does resuming work okay?

grissiom 08-30-2009 07:14 AM

what hardware are you using? Both suspend and hibernate work fine here in Slackware64.

onebuck 08-30-2009 08:04 AM

Hi,

Quote:

Originally Posted by meetscott (Post 3662626)
Well, since no one else has started one, I guess I'll be the first on suspend for Slackware 13.

I have 2 laptops that would suspend perfectly under Slackware 12.2. Slamd64 12.2 also worked. Now, on Slackware 13, 64 bit, suspend no longer works when I close the laptop lid. It goes into suspend okay, but when I open the lid, it appears to come out of it except there is no display or keyboard available. I have to do a hard reset to get everything back.

Hardware specifics?

Quote:

Originally Posted by meetscott (Post 3662626)
For now, I have disabled suspend altogether in power management. I am interested to know if anyone else has suspend working. I think this might be a kde 4 issue, but I'm not sure.

How? Specifics?


Quote:

Originally Posted by meetscott (Post 3662626)
Anyone with any thoughts or experience on this? I will not be upgrading my work laptop until I have found a reliable solution to this because I love coming into work, opening my display and having everything exactly as I left it. I consider it a must have feature now.

We really cannot provide help when the specifics for what you are doing or wanting to do. Not enough information.

Which kernel? Hardware information? Any commands, config files or utilities that produced the error should be posted.

I consider proper information within a post to be a must have in order to aid that same person. :)

Xelain 08-30-2009 09:24 AM

I think I had the very same problem.

My laptop would perfectly go into RAM suspension as it did with 12.2, but when I want it back, it seemed to come back to life again, but screen wouldn't show anything, and keyboard wouldn't respond to any key presses.

It was a new installation, so what I did was to install and configure the nvidia drivers, run nvidia-xconfig, edit xorg.conf to delete references to keyboard and mouse (i like how hald has managed them), and test again. From this time on, suspension is working for me as it should have always been!.

I hope this could help you!.

em21701 08-30-2009 09:48 AM

My machine suspends and resumes fine with Slackware64. I do have to hit the keyboard to get it to come back from suspend to RAM the mouse won't bring i back. The screen will flash then go black, at which time I have to hit a key again because I have lock on resume set. Perhaps you are seeing something like this?

BrZ 08-30-2009 10:04 AM

I had that same problem when using Catalyst (fglrx). Solved when x (mesa, etc.) was upgraded and I was able to use the open driver.

meetscott 08-31-2009 10:50 AM

Great responses everyone! I wasn't sure whether I wanted to spend any time on this right now. Apparently people do have it working so I'm a little more inclined to try harder. If you add up the past few years of dealing with suspend, I've probably spent more time on complete failure with that issue, than any other. When it just worked in Slackware 12.2 I was completely shocked and grateful.

@onebuck
I didn't post specifics for a reason. I thinks that's clear. I wanted lots of responses from a broad range of people without a bunch of hardware specifics. It seemed reasonable to me that it wasn't working for a lot of people when it was a software change.

First Laptop: HP Pavilion dv5000 running the radeon graphics driver and a 64 bit Turion, single core processor. This is my Slackware64 test system.

Second Laptop: Dell Latitude D630 with a Core 2 Duo, 64 bit processor. This has Integrated Intel Graphics, I believe 965. I have not tried this on yet because it is my work computer.

I have used 2 methods, each with the same result: "pm-suspend" as root, and to answer the earlier question it does not come out of it. I have also tried with the power management in KDE. This is what I have normally used in Slackware 12.2, but "pm-suspend" also worked.

@Xelain and @BrZ
Great ideas. I do have keyboard references in xorg.conf. I will remove those. I will also try new drivers as well. Thanks for the suggestions. I'll report back the results.

botnet 08-31-2009 11:39 AM

I have been using suspend to ram by means of the following script graciously provided by a member of this forum whose name escapes me on Slackware 13 64.

Hopefully this will help.


Code:

#!/bin/sh
# Release version: 1.05/June 24 2009
# suspend2 -- offers some flexibility when locking/suspending your desktop.
# Does not use any LRMI or PCI-register weirdness-- this script is intended
# for machines with non-crappy BIOSes and proper ACPI implementations.
#
# Copyright (C) <2009> <Sasha Alexandr> <crawlingwithsnakes at hush dot com>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#
# Testing done on: Slackware 11.0 - kernel 2.6.30
# Testing hardware: MSI P6N-SLI-FI (MS-7350)
# Intel E2160 Core2 CPU
# nVidia chipset MCP51/430i BIOS 2.7
# Ethernet: Realtek 8211BL using forcedeth driver.
# Video: 2x eVGA eGeForce 7300/7200 PCI-E cards.
# Video: nVidia binary version 185.18.14
# DE: KDE 3.5.4 & xscreensaver for locking session.
#--proposed changes:    ------------------------------------
#--test 'suspend to disk' support (I don't use it yet)
#--move script to /usr/bin for execution without $PATH
#------------------------------------------------------------
#--<changelog:>    -----------------------------------------
# v1.01  - adjust 'Usage:' text; tidy some code.
#        - support _list_ of NICs; add logging yes/no option
#        - divert net-restart output to $console
# v1.02  - clean up some junk that was outputting to console
#        - clarify comments & Usage:
#        - adjustable args for net & session-lock
#        - add a bit more sanity checking.
# v1.03  - fix more unwanted junk coming on screen after wake-up.
# v1.04  - kill undead backgrounded process when cancel suspend
#        - remove one function; put that code elsewhere.
# v1.05  - shorten help-page console output horizontal chars.
#        - tighten code a bit.
#--</changelog>
#-------------------------------------------------------------
#--<known bugs:>
# - none right now..
#--</known bugs>
#------------------------------------------------------------
setup () {
#-------------------------------adjustable stuff-------------
# unplug/reinsert any kernel modules you've determined
# cause problems suspending/resuming on your machine.
# If you use the hangcheck-timer, it MUST be a module and
# it MUST be removed before suspend, reinserted after resume.
# If hangcheck-timer is built static into the kernel, suspend
# will only work once; subsequent suspends will resume
# immediately all by themselves.
unplug_list=""
insert_list="" # if empty, unplug list is used
want_to_log_the_process='y' # change to y to log the suspend
# separate multiple NICs below with spaces like 'eth0 eth1'
NIC='eth0' # stop this/these before suspending to ram/disk
#------------------------------non-adjustable stuff-----------
suspend2_log=/var/log/suspend2.log
log_pidfile=/var/run/suspend2_logpid
fork_pidfile=/var/run/suspend2_forkpid
pm_debug_exist=/sys/power/pm_test
#--------------------------------adjustable stuff-------------
# Common paths to stuff - verify/adjust for your system:
kernel_log=/var/log/kernel.log
modprobe=/sbin/modprobe
hwclock=/sbin/hwclock
tail=/usr/bin/tail
ifconfig=/sbin/ifconfig
net_init_script=/etc/rc.d/rc.inet1
net_init_script_arg='restart'
session_locker=/usr/X11R6/bin/xscreensaver-command
session_locker_arg='-lock'
console=/dev/tty1
#--------------------------------------------pm debug---------
 debug_pm_does_exist () {
  # To test/debug your system's suspend abilities, read the kernel
  # documentation about enabling/using CONFIG_PM_DEBUG
  # note: only one line must be uncommented at any time.
  #
  echo -n none > /sys/power/pm_test # really suspend (default)
  #echo -n freezer > /sys/power/pm_test # least invasive test
  #echo -n devices > /sys/power/pm_test # test device susp/resume
  #echo -n platform > /sys/power/pm_test # only w/suspend to disk
  #echo -n processors > /sys/power/pm_test # test CPU susp/resume
  #echo -n core > /sys/power/pm_test # most invasive test
 }
[ -f $pm_debug_exist ] && debug_pm_does_exist
#---------------------------------------------end pm debug-----
} # end setup
# Do not edit below here unless you know what you're doing.
#--------------------------------------------------------------

usage () {
  [ "$1" = 'error' ] && echo -e "\nError: bad, missing, or extra parameter."
  for i in standby mem disk; do
    [ "`echo $methods | grep -o $i`" ] && eval $i='1' || unset i
  done;
 unset list
 echo -e "\nUsage: shows what suspend methods are currently available"
 echo -e "on your machine. To suspend immediately, just specify the type of"
 echo -e "suspend you want, and optionally the 'lock' option, which"
 echo -e "locks your desktop session before suspending."
 echo -e "If you want the machine to automatically suspend at a later time"
 echo -e "then use the additional options: 'inmins=xx' will cause suspend"
 echo -e "after xx minutes. 'insecs=xx' causes suspend after xx seconds."
 echo -e "'inhrs=xx' will suspend after xx hours. The 'time=HHMM' option allows a"
 echo -e "HHMM format of time-of-day. Due to the nature of the \`date\` command,"
 echo -e "some adjustment is done depending on the time entered."
 echo -e "If you get unsatisfactory results with the time=HHMM option"
 echo -e "give me an example & description of what happened and I will maybe"
 echo -e "look into it. Use 'cancel' to abort any pending suspends, and"
 echo -e "'status' to see if there are any pending suspends."
 echo -e "As of this writing (version 1.0x), suspend to disk has not been"
 echo -e "tested by me at all. It should work fine-- it's reputed to be"
 echo -e "less troublesome than suspending to ram. Standby and suspend to ram"
 echo -e "both work on my system. If you find a bug, i.e. something"
 echo -e "really dumb/obvious that I missed, point it out; I'll fix it."
 echo -e "If you're so inclined, you can run this from a crontab or an icon/kicker"
 echo -e "button with a command something like: kdesu /path/to/script <args> .\n"
 echo -e "Usage: $0 ` [ "$standby" ] && list="standby"; [ "$mem" ] && list="$list mem"; [ "$disk" ] && list="$list disk"; echo "$list" | sed 's/^[ ]//;s/ /|/g'` [[inmins=mm|insecs=ss|inhours=hh]|[time=HHMM] [lock]] [cancel] [status]\n"
 exit 1
}

logging () {
[ "$want_to_log_the_process" = 'n' ] && return;
case $1 in
  start) $tail -f $kernel_log > $suspend2_log &
        echo $! > $log_pidfile ;;
  stop) if [ -f $log_pidfile ]; then
        deadlog=`cat $log_pidfile`
        kill $deadlog > /dev/null 2>&1 &
        wait
        fi
        ;;
esac;
}

get_jobs () {
unset fpid running_jobs
if [ -f $fork_pidfile ]; then
 fpid=`cat $fork_pidfile`; running_jobs=` ps -p $fpid -o command= `
fi;
}

message () {
[ "$1" = 'S' ] && echo -e "\n`date` (suspend2: Going into $action-sleep now.)\n" > $console
[ "$1" = 'R' ] && echo -e "\n`date` (suspend2: Waking up now.)\n" > $console
}

do_standby () {
 sleep $seconds
# 'standby' doesn't need any module-unplugging.
# I switch to vt1 just for the status messages.
 chvt 1; message S
 [ "$lock" = 'lock' ] && $session_locker $session_locker_arg > /dev/null 2>&1
 logging start
 echo -n standby > /sys/power/state
# resuming now:
 $hwclock --hctosys
 message R
 logging stop
 chvt 1
} # end of 'do_standby'

do_suspend () {
 sleep $seconds
 chvt 1; message S; sleep 2 # (legacy?) change to non-X console to prevent corrupt video
 [ "$lock" = 'lock' ] && $session_locker $session_locker_arg > /dev/null 2>&1
 logging start
# take down NIC(s) (optional - we restart whole network anyway later)
 interface_list="`echo $interfaces | sed 's/[ ]/\n/g'`"
 for NICs in `echo -e "$NIC"`; do
  $ifconfig $NICs down
 done;
# unplug modules known to give problems:
 for mod in $unplug_list; do
  [ "`lsmod | grep $mod`" ] && $modprobe -r $mod
 done;
 echo -n $action > /sys/power/state
# Resuming now;
 $hwclock --hctosys # adjust OS clock
 message R
# reinsert removed modules
 [ -z "$insert_list" ] && insert_list="$unplug_list"
 for mod in $insert_list; do
  $modprobe $mod
 done;
 sleep 1 # let things settle
# Kill any running dhcpcd & restart networking as during a cold boot:
 [ "`ps ax | grep dhcpcd`" ] && killall -q dhcpcd
 $net_init_script $net_init_script_arg > $console
 logging stop
 chvt 1
} # end of 'do_suspend'

# Script entry point:

setup

if [ "$1" = 'fork' ]; then
# we're the forked, already-configured instance:
 seconds=$3; lock=$4;
 case $2 in
  standby)
        do_standby &
        echo $! > $fork_pidfile
        exit 0
        ;;
  *)
        action=$2
        do_suspend &
        echo $! > $fork_pidfile
        exit 0
        ;;
 esac;

else # We haven't been set up yet, so deal with cmdline args:

 unset action units; let seconds=0; lock='unlocked'
 methods=`cat /sys/power/state`

 for param in $*; do
  case $param in
  lock) lock='lock' ;;
  standby|mem|disk) [ "`echo $methods | grep -o $param`" -a ! "$action" ] && action=$param || usage error ;;
  status) get_jobs
          echo -e "\nRunning suspend2 process: ` [ "$running_jobs" ] && echo -e "($fpid) $running_jobs" || echo "None." `\n"
          exit 0 ;;
  cancel)
        logging stop; get_jobs
        if [ "$fpid" ]; then
        bloody_die=`ps ax | grep $(pgrep -P $fpid) | gawk '{/^.[:digit:]+[ ]$/;print $1}'`
        kill $fpid > /dev/null 2>&1 &
        wait; kill $bloody_die > /dev/null 2>&1 &
        wait; rm -f $fork_pidfile; rm -f $log_pidfile
        fi;
        echo -e "\nAny pending suspend2 has been canceled.\n"
        exit 0
        ;;
  inmins*) [ ! "$units" ] && units='mins' || usage error
        let seconds=`echo $param | gawk -v FS== '{/^inmins=[:digit:]+$/;print $2}'`*60 ;;
  insecs*) [ ! "$units" ] && units='secs' || usage error
        let seconds=`echo $param | gawk -v FS== '{/^insecs=[:digit:]+$/;print $2}'` ;;
  inhours*) [ ! "$units" ] && units='hrs' || usage error
        let seconds=`echo $param | gawk -v FS== '{/^inhours=[:digit:]+$/;print $2}'`*3600 ;;
  time*)
        [ ! "$units" ] && units='time' || usage error
        timegiven="`echo $param | gawk -v FS== '{/^time=[:digit:][:digit:][:digit:][:digit:]$/;print $2}'`"
        [ ! "$timegiven" ] && usage error
        let unixtimethen=`date -d "$timegiven" +%s`
        [ $unixtimethen -lt `date +%s` ] && let unixtimethen=unixtimethen+86400
        let seconds=unixtimethen-`date +%s`
        ;;
  usage) usage ;;
      *) usage error ;;
  esac;
 done;

 get_jobs

 if [ "$running_jobs" ]; then
  echo -e "\nThere's already a suspend2 instance running. Cancel that one first.\n" && exit 1
 fi;
 if [ "$action" ]; then
  $0 fork $action $seconds $lock
  $0 status
  exit 0
 else
  usage error
 fi;
fi;

# EOF


GrapefruiTgirl 08-31-2009 11:43 AM

http://www.linuxquestions.org/questi...cript.-734443/

You can find the lastest version at the above LQ link.

;) Sasha

onebuck 08-31-2009 12:29 PM

Hi,

Quote:

Originally Posted by meetscott (Post 3664074)
Great responses everyone! I wasn't sure whether I wanted to spend any time on this right now. Apparently people do have it working so I'm a little more inclined to try harder. If you add up the past few years of dealing with suspend, I've probably spent more time on complete failure with that issue, than any other. When it just worked in Slackware 12.2 I was completely shocked and grateful.

@onebuck
I didn't post specifics for a reason. I thinks that's clear. I wanted lots of responses from a broad range of people without a bunch of hardware specifics. It seemed reasonable to me that it wasn't working for a lot of people when it was a software change.

First Laptop: HP Pavilion dv5000 running the radeon graphics driver and a 64 bit Turion, single core processor. This is my Slackware64 test system.

Second Laptop: Dell Latitude D630 with a Core 2 Duo, 64 bit processor. This has Integrated Intel Graphics, I believe 965. I have not tried this on yet because it is my work computer.

I have used 2 methods, each with the same result: "pm-suspend" as root, and to answer the earlier question it does not come out of it. I have also tried with the power management in KDE. This is what I have normally used in Slackware 12.2, but "pm-suspend" also worked.

@Xelain and @BrZ
Great ideas. I do have keyboard references in xorg.conf. I will remove those. I will also try new drivers as well. Thanks for the suggestions. I'll report back the results.

No it was not clear!

The number with suspend problems is few. Your particular problems may not be the same as others may fair with their machine. To arbitrarily request information and apply that to your unique problems may well open or create other problems on your hardware. One must match software specifications with ones hardware.

Now if you had requested 'Slackware 13 Suspend problems with HP Pavilion dv5000' and expected to resolve with information from users of the same equipment/problem then you do have related issues or solutions. Arbitrarily requesting information to a general audience and expecting reply's to adapt to your problems may just create other problems for your hardware.

I suggest that you get your system configuration setup properly before even considering the KDE tools.

mudangel 08-31-2009 02:11 PM

Suspend doesn't work right on my laptop, but I'm pretty sure it's to do with the bios, not Slackware. It's a Toshiba Satellite L355.

manwichmakesameal 08-31-2009 02:46 PM

@ mudangel, I have a Toshiba Satellite L305D-S5934 and suspend works great.

mudangel 08-31-2009 02:56 PM

Maybe there's hope then ;^) Did you have to do anything special to get it to work? Mine has an "InsydeH20" bios, version 1.9; I was thinking that may be the problem, as I'd never heard of that 'til I got this laptop. I'll appreciate any help/information I can get with this!


All times are GMT -5. The time now is 10:07 PM.