Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 23 Jul 2014, 20:28
All times are UTC - 4
 Forum index » House Training » Bugs ( Submit bugs )
Suspend to RAM doesn't always turn the display back on
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Author Message
buzby01

Joined: 11 Mar 2012
Posts: 15

PostPosted: Tue 20 Mar 2012, 02:54    Post subject:  Suspend to RAM doesn't always turn the display back on  

1stly I'd like to say thanks to the open source community and I'm lovn' Puppy so far. I'm running Macpup 5.2.8 on a Pendo netbook (d425 atom, Ralink 3090 wireless network card and an Intel n10 integrated graphics controller) and it runs really well however the suspend to ram, intermittently, does not wake properly.

About 1 out of every 4 times that I put it to sleep the screen does not turn back on nor does the WLAN card. Being a netbook with a small battery a working sleep function is fairly important to me and any help with this would be much appreciated

To suspend I use acpitool-s. To get it to suspend automatically I have to install acipd and acipd support and then in setting/screensaver I set the time and suspend on blank. I can't get the sleep button or lid to make it suspend either which would be good if you could help me with this as well. I tried setting the hardware switches with no success

I'm also new to the world of open source so you'll have to talk to me like I'm a child

cheers
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 4984
Location: Charleston S.C. USA

PostPosted: Tue 20 Mar 2012, 07:10    Post subject:  

Maybe install this laptop tools pet.
http://www.murga-linux.com/puppy/viewtopic.php?p=563125#563125

_________________
I have found, in trying to help people, that the things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
Back to top
View user's profile Send private message 
buzby01

Joined: 11 Mar 2012
Posts: 15

PostPosted: Fri 23 Mar 2012, 02:37    Post subject:  

Thanks bigpup for getting back to me so quickly. The laptop.pet has helped out a lot. The lid closing and sleep button know work but it still doesn't recover from sleep properly with a blank screen and the wireless card does not come on either. The only sign of life is the led and the cpu fan.

Cheers
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3953
Location: Kiel,Germany

PostPosted: Mon 26 Mar 2012, 19:27    Post subject:  

For the screen :

Which X servers are you running ? Xorg or Xvesa ?

If Xorg, which xorg _drv.so is used ? vesa or intel or i8**[OLD] ?

Does the Xorg driver vary ? One boot intel , another boot vesa ?

Have a look in /etc/X11/xorg.conf for the lines similar like

Identifier "Card0"
Driver "i810" #card0driver
VendorName "Intel Corporation"

Do you have two cards mentioned in xorg.conf ?
like
Identifier "Card0"
Driver "nv" #card0driver
VendorName "nVidia Corporation"

Identifier "Card1"
Driver "radeonhd"
VendorName "Gammagraphx, Inc. (or missing ID)"

?

*

For the WLAN card i would suggest to find out the kernel driver name and unload it
with " modprobe -rv DRIVER_NAME "

and reinserting it with " modprobe -v DRIVER_NAME " and rerun the setup .

Otherwise a script to do this would be neccessary before running acpitool -s .

Rename acpitool to acpitool.bin and create a wrapper shellscript called /usr/bin/acpitool with content like this :

Code:
#!/bin/sh
#
#bring the network down:
function bring_down(){
#do code here

}
bring_down
pup_event_backend_modprobe_protect --stop
sleep 10s #to let the system settle
acpitool.bin -s
sleep 5s
pup_event_backend_modprobe_protec --daemon

Good Luck !
Back to top
View user's profile Send private message Visit poster's website 
buzby01

Joined: 11 Mar 2012
Posts: 15

PostPosted: Sun 01 Apr 2012, 07:10    Post subject:  

Thanks karl godt. sorry for the late reply. I selected to be notified by email from this forum but obviously It didn't. Will give what you said a try and get back to you. I probably wont be able to do this till after Easter though

Further information since my last post:

I have read that acpitool has issues with CPU scaling and I have noticed it crashes more often when switching between ac and battery, so I have been modifying the scripts from the pet big pup suggested and things have been getting better but I'm afraid I don't really know what I'm doing. ATM the computer typically sleeps and resumes as long as I don't unplug or replug the AC

Thanks again
Back to top
View user's profile Send private message 
pemasu


Joined: 08 Jul 2009
Posts: 5463
Location: Finland

PostPosted: Sun 01 Apr 2012, 09:14    Post subject:  

If it is just screen backlight which does not work...you could edit /etc/acpi/sleep.sh script by addint vbetool commands there....
You will need vbetool package for it. Probably in lucid repo.
[url]And see this post....
http://www.murga-linux.com/puppy/viewtopic.php?p=615669#615669[/url]

And the subsequent posts...
It might work or not..and there was the simpler command after that post also....

Last edited by pemasu on Mon 02 Apr 2012, 08:22; edited 1 time in total
Back to top
View user's profile Send private message 
buzby01

Joined: 11 Mar 2012
Posts: 15

PostPosted: Mon 02 Apr 2012, 08:09    Post subject:  

Thankyou Permusa but I'm sorry to say it did not work. After suspending with the modified sleep and then waking it would go back to sleep again. The second time it would wake but still had the intermittent crashes. I don't think it is a screen back-light but rather a system crash on resume.

I've had a little success modifying some of the acpi scripts but I'm afraid I don't know what I'm doing. Will post some more details about these mods and maybe they might help you pinpoint my problem

karl godt
Looked up the xorg.config and found that the driver is Intel driver and that it is the only one mentioned in then file. I will try the network stuff later. I have some assignments due and not enough time to do them

Thanks again to everybody
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3953
Location: Kiel,Germany

PostPosted: Tue 03 Apr 2012, 01:41    Post subject:  

buzby01 wrote:
ATM the computer typically sleeps and resumes as long as I don't unplug or replug the AC

Thanks again


acpitool -s suspends to RAM . If the ac gets unplugged and the battery empty, everything in RAM gets lost .

What your are looking for is apparently to suspend to disk .

This would be done by

acpitool -S (big S) .

Therefore you would need a grub entry with something like

"resume=/path/to/swap -partition" after root=/dev/xy .Don't know if this works for frugals .
Back to top
View user's profile Send private message Visit poster's website 
buzby01

Joined: 11 Mar 2012
Posts: 15

PostPosted: Tue 03 Apr 2012, 04:05    Post subject:  

sorry Karl godT, I must not have explained myself properly. The battery does not get any where near flat I was just meaning that the phenomenon ocours more often if I switch between running the computer on AC to running it on battery power alone and vise versa. For instance the netbook is running on battery power alone and then I plug in the AC and after a while I put my netbook to sleep, it is much more likely to crash.

Thanks though for the aciptool -S command. Thats handy to know
Back to top
View user's profile Send private message 
buzby01

Joined: 11 Mar 2012
Posts: 15

PostPosted: Thu 05 Apr 2012, 10:45    Post subject: Crash on resume  

Okay, Ive finally realised that it is not going to be easy to fix this. I have done everything in this post so far with no success.

This is a summary of what I have done. The results, however, must be taken with a grain of salt as the crashes seem to be completely random and therefore I will just state a range which the crashes occurred between

Initial install of laptop-acpi-batteries-tools-pet0.0.1.pet
Expected crash every 1-4 suspends

Modifications to powersave.sh ans performance.sh
Hashed out as follows:

#if [[ $? != 0 ]]; then
# exit
#fi
Expected crash every 1-8 suspends

Modifications sleep.sh
Replace /usr/local/Frisbee/disconnect and reconnect with:
wpa_cli disconnect and reconnect and add sleep 4 on the next line
Hashed out lines as follows:
#[ $$ != $PID ] && exit
#rfkill unblock all
Expected crash every 1-17 suspends

Installed xorghigh --> no change
Upgraded xdrivers --> no change
Turned of wifi and blacklisted rt2860sta and uninstalled wpa_gui --> no change (to check if it was the wifi causing the issue)

I also started running sleep.sh in the terminal and on this line [ $$ != $PID ] && exit I was getting the following errors unitl I hashed it:
[:8541 unary operator expected
(the number would vary each time ranging from 8486-9764)
on this line[ $$ != $PID ] && exit

I also inserted echos in the lines of sleep.sh to see exactly where the script stopped. On a succesful resume it would echo the last one however on a crash it would echo to the point before "acpitool -s". I'm guessing that this means it is a crash because it didn't even run the if statement to detect the ac.

If there is a better way to log this phenomenon (so that I can help you help me) can you instruct me how. I have read something about dmesg but have no idea of how to use it.

Thanking you in advance again
Back to top
View user's profile Send private message 
d(O o O)b


Joined: 11 Apr 2012
Posts: 10
Location: Usually in the middle of some ocean

PostPosted: Thu 12 Apr 2012, 08:09    Post subject:  

I am pretty new at this, so I may be missing something obvious.

I am suspending to ram in Lucid 528 frugal hdd install without ACPItool or any other pets as far as I can see.

I simply use

echo mem > /sys/power/state

So far, everything has woken up fine everytime when I touch any key - been doing it for about a week without reboot. I have also wrote a little script which runs in the background and suspends to ram when the lid is closed:-

---------------------------------
#!/bin/sh

# event handler to automatically suspend-to-ram when laptop lid is closed.
# 2012 - d(O o O)b

while true #Endless loop.
do
if grep -q open /proc/acpi/button/lid/LID0/state
then
sleep 5 # minimise resource usage
else
echo mem > /sys/power/state # send the suspend signal
fi
done
--------------------------------------

Not sure if any of this will be of any use.
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3953
Location: Kiel,Germany

PostPosted: Thu 12 Apr 2012, 09:53    Post subject:  

Quote:
I also started running sleep.sh in the terminal and on this line [ $$ != $PID ] && exit I was getting the


Seems that PID is not filled with something:

bash-3.00# [ $$ != $PID ] && echo "PID of program NOT same as PID variable"
bash: [: 4220: unary operator expected
bash-3.00# PID=999999999
bash-3.00# [ $$ != $PID ] && echo "PID of program NOT same as PID variable"
PID of program NOT same as PID variable


Make sure the scripts dont use any binaries that are not already installed .

If they have something like

bash-3.00# dpkg-query
bash: dpkg-query: command not found

the PID var would not be set correctly
bash-3.00# PID=
bash-3.00# dpkg-query && PID=`ps -C acpid`
bash: dpkg-query: command not found
bash-3.00# echo "$PID"

bash-3.00# [ $$ != $PID ] && echo "PID of program NOT same as PID variable"
bash: [: 4220: unary operator expected

*

Puppy uses some /bin/busybox applets instead of the full ones , which may additionally lack some "-options" .

So third party scripts have to be adjusted for this.

I like Busybox very much, the only thing is losetup not working as it is needed in Puppy Linux .

To find the applets :

for dir in /bin /sbin /usr/bin /usr/sbin;do
find $dir -type l -name "*BB-NOTUSED"
done

*

FWIW : Current Debian Sid acpitool has got a weird patch for kernels 3.x.y .
Have compiled it on Racy and it suspended my asus eee 1005 two times correctly now to RAM .
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3953
Location: Kiel,Germany

PostPosted: Thu 12 Apr 2012, 11:51    Post subject:  

d(O o O)b wrote:
I am pretty new at this, so I may be missing something obvious.

I am suspending to ram in Lucid 528 frugal hdd install without ACPItool or any other pets as far as I can see.

I simply use

echo mem > /sys/power/state

So far, everything has woken up fine everytime when I touch any key - been doing it for about a week without reboot. I have also wrote a little script which runs in the background and suspends to ram when the lid is closed:-

---------------------------------
#!/bin/sh

# event handler to automatically suspend-to-ram when laptop lid is closed.
# 2012 - d(O o O)b

while true #Endless loop.
do
if grep -q open /proc/acpi/button/lid/LID0/state
then
sleep 5 # minimise resource usage
else
echo mem > /sys/power/state # send the suspend signal
fi
done
--------------------------------------

Not sure if any of this will be of any use.


Nice. I have modified it a bit first to check things :
Note : the PATH on my asus eee 1005 is slightly different :
/proc/acpi/button/lid/LID/state
Code:
while true;do
LID_STATE=$(</proc/acpi/button/lid/LID/state)
if [ "$LID_STATE" != 'open' ];then
echo "$LID_STATE" >> /tmp/proc_acpi_lid_state.state
fi
sleep 2s
done

which gave me

state: open
state: open
state: open
state: open
state: closed
state: closed
state: closed
state: closed
state: closed
state: closed
state: closed
state: open
state: open
state: open
state: open
Back to top
View user's profile Send private message Visit poster's website 
buzby01

Joined: 11 Mar 2012
Posts: 15

PostPosted: Sat 14 Apr 2012, 16:24    Post subject:  

d(O o O)b

Again there is no difference with the "echo mem > /sys/power/state" still crashed the same way but your post did shed some light on what might be happening.

Quote:
So far, everything has woken up fine everytime when I touch any key


My netbook has a strange arrangement where the mouse and keyboard are disabled in S3 mode (the only indication that it is in s3 is a blinking led). To wake you have to press the power button. Maybe when trying to resume from sleep pup is having trouble restarting the keyboard, Mouse, etc. I have no idea how to go about testing or fixing this or even if its possible but maybe you guys could help

Karl Godt

Quote:
Seems that PID is not filled with something:

bash-3.00# [ $$ != $PID ] && echo "PID of program NOT same as PID variable"
bash: [: 4220: unary operator expected
bash-3.00# PID=999999999
bash-3.00# [ $$ != $PID ] && echo "PID of program NOT same as PID variable"
PID of program NOT same as PID variable


Being a noob that post was beyond my abilities at present, I have no idea of what you wanted me to do, sorry.

Thanks again and I really appreciate the lengths you guys are going to try and help me with this

Cheers
Back to top
View user's profile Send private message 
d(O o O)b


Joined: 11 Apr 2012
Posts: 10
Location: Usually in the middle of some ocean

PostPosted: Thu 19 Apr 2012, 13:33    Post subject:  

Karl Godt wrote:
I have modified it a bit first to check things :
Note : the PATH on my asus eee 1005 is slightly different :
/proc/acpi/button/lid/LID/state
Code:
while true;do
LID_STATE=$(</proc/acpi/button/lid/LID/state)
if [ "$LID_STATE" != 'open' ];then
echo "$LID_STATE" >> /tmp/proc_acpi_lid_state.state
fi
sleep 2s
done

which gave me

state: open
state: open
state: open
state: open
state: closed
state: closed
state: closed
state: closed
state: closed
state: closed
state: closed
state: open
state: open
state: open
state: open


I have expanded the script a bit after finding that my Lucid machine died on me halfway through a movie when the battery ran out.

The script now also checks battery condition (/proc/acpi/battery/BAT0/state) and gives 2 alarms (configurable within the script thru variables 'low' and 'lowlow'). If battery reserve drops below shutdown level (also configurable thru variable 'shutdown') then a controlled shutdown is performed. I prefer this option over 'suspend-to-ram, as an unattended laptop in suspend-to-ram will eventually lose any unsaved data when the battery completely dies.

It uses 'aplay /usr/share/audio/beep_low.wav' and '/usr/share/audio/logout.wav' to give audible notifications, so if any of these are missing from the host system then it will probably hang. It may be necessary to comment them out

The remaining battery time for the warnings is calculated based on power consumption at that particular time, so the actual gap between the warnings may vary if the power consumption is varying.

I know most of this is available in acpi-laptop-tools, but my script has a small footprint and does all I need so far. It was also a nice scripting excercise.
It is listed below in case anyone feels they can use it

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

#!/bin/sh

#===========================================================================#
# event handler for basic power management 2012 - d(O o O)b #
# #
# Automatic suspend-to-ram when laptop lid is closed #
# Configurable alarms for LOW and LOWLOW battery level #
# Controlled Shutdown at LOWLOWLOW #
# #
#===========================================================================#

#------------------------USER ADJUSTABLE VALUES--------------------------------

timeout=20 # Alarm dialog timeout - allows program to continue if
# dialog not accepted

low=10 # Low alarm setpoint (minutes)
lowlow=4 # LowLow alarm setpoint (minutes)
shutdown=2 # Controlled Shutdown setpoint (minutes) - 2 is OK for frugal
# may need longer for USB Savefiles to safely save

#------------------------------------------------------------------------------

let "low += 1" let "lowlow += 1" let "shutdown += 1"
flag1=0 flag2=0 #unset the low battery flags for initialization
while true #Endless loop.
do
if grep -q open /proc/acpi/button/lid/LID0/state
then
if grep -q discharging /proc/acpi/battery/BAT0/state
then
batteryLife=$(echo "scale=0;$(grep remaining /proc/acpi/battery/BAT0/state|awk '{print $3}') * 60 / $(grep rate /proc/acpi/battery/BAT0/state|awk '{print $3}')"| bc)
if (($batteryLife < $lowlow)) && (($flag2 == 0))
then
aplay /usr/share/audio/beep_low.wav /usr/share/audio/beep_low.wav /usr/share/audio/beep_low.wav
Xdialog --title "Very Low Battery Warning" --timeout $timeout --msgbox "$batteryLife minutes remaining \n Plug in or shut down immediately," 10 50
flag2=1 flag1=1 #prevents looped reporting
fi
if (($batteryLife < $low)) && (($flag1 == 0))
then
aplay /usr/share/audio/beep_low.wav /usr/share/audio/beep_low.wav
Xdialog --title "Low Battery Warning" --timeout $timeout --msgbox "$batteryLife minutes remaining \n Plug in soon." 10 50
flag1=1 #prevents looped reporting
fi
if (($batteryLife < 3))
then
Xdialog --title "Controlled Shutdown" --timeout 5 --msgbox "$batteryLife minutes remaining \n System going into controlled shutdown." 10 50
aplay /usr/share/audio/logout.wav
wmpoweroff
fi
else
flag1=0 flag2=0 #unset the low battery flags if we are on charge
fi
sleep 5 # minimise resource usage
else
aplay /usr/share/audio/beep_low.wav
echo mem > /sys/power/state # send the suspend signal if lid is closed
fi
done
pwrman.tar.gz
Description  Basic Laptop Power Management Script
gz

 Download 
Filename  pwrman.tar.gz 
Filesize  1.03 KB 
Downloaded  278 Time(s) 

_________________
Ran away from Redmond 2012 ----- Never going back Wink
Acer 5332 -- Lucid 528.004 frugal -- usb bluetooth audio
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [17 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Bugs ( Submit bugs )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1239s ][ Queries: 13 (0.0085s) ][ GZIP on ]