[maemo-developers] RFC: n800 suspend to ram

From: Mike Baker mbm at openwrt.org
Date: Wed Mar 7 13:01:08 EET 2007
Hi; I've been doing some experiments with powersave on the n800.

It seems you can't just put the n800 into suspend mode simply by doing a
"echo mem > /sys/power/state", the retu watchdog kicks in if you leave it
in that state too long. There is a flasher command to disable the retu
watchdog, although through some horrible mistranslation it only stops the
system from refreshing the watchdog -- it still goes off and brings down the
system. Luckily there's an alternative, messy as it is -

Refresh the retu watchdog, this will give you 64 seconds until it needs to
be refreshed again. Next, set the retu rtc alarm; you only get one minute
resolution, but that's jsut enough. Once the alarm is set, suspend; the
alarm will wake the device out of suspend mode and the cycle repeats.

Attached is a script to suspend the n800, the script is designed to run in
the background and take advantage of the softoff state. (If you haven't done
so already, I'd suggest editing /etc/mce/mce.ini and setting the power button
to softoff). Once the softoff state is detected, the script will attempt to
force the device into suspend.

The script will spit out debug messages as it's run -

   the script is waiting for a softoff (backlight off, touch disabled)
   it will poll the system in 10 second intervals

   updating the retu watchdog

"sleep XX"
   suspending until rtc alarm in XX seconds

"awake (asleep X:XX:XX)"
   device came back from sleep state before the alarm; likely the result
   of user interaction. X:XX:XX represents the total amount of time the 
   script -attempted- to sleep for.

Caveats -
- the script must be run as root and should be run locally (not via ssh)
- the device doesn't always suspend; particularly when the charger is attached
- loadavg after exiting suspend is extremely high; probably miscalculated
- the dsp REALLY hates it when you suspend with dsp activity

There doesn't seem to be a good way of suspending dsp activity; I've read
through the dsp documentation (http://dspgateway.sf.net) which seems to
suggest the 'dspctl suspend' and 'dspctl resume' commands, which don't work.
Once the dsp has crashed I can't find a reliable way to even restart it
without rebooting.

Requested -
- completely disabling the watchdogs
- help with dspctl/dsp_dld system

The latest version of the script can always be found at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: suspend.sh
Type: application/x-sh
Size: 1255 bytes
Desc: not available
Url : http://lists.maemo.org/pipermail/maemo-developers/attachments/20070307/60321513/attachment.sh 
More information about the maemo-developers mailing list