oops.  typo correction, below:

i wrote:
 > hal wrote:
 >  > 
 >  > Can somebody give me a pointer to some sample code that will wake up a 
 >  > suspended system in 5 minutes?  I'm assuming there is some way to do this 
 >  > using the alarm interrupt from the RTC.
 > 
 > use:
 >     rtcwake -s 600 -m mem
 > 
 > to wake the system in 600 seconds, after suspending it to S3. 
 > see the man page -- but other -m options work, including "no", i

i meant to write:
    "...but NO other -m options work, ...

i should also point out that powerd uses rtcwake for its own purposes,
so if you want exclusive control, you should disable it.

paul


 > believe.  (although, if someone tries it and it does work, i'll
 > stand corrected.)
 > 
 >  > 
 >  > Can somebody confirm that sleep does what I expect on suspended systems?
 >  > 
 >  > My expectation is that the sleep timer logically ticks when suspended, 
 > but 
 >  > that the system won't get woken up when the sleep timer expires.
 >  > 
 >  > For example, suppose my program does a sleep(100), and shortly after that 
 > the 
 >  > system suspends.
 >  > 
 >  > If the next wakeup is 200 seconds after the start of the sleep, my 
 > program 
 >  > should run then (along with whatever caused the wakeup).
 >  > 
 >  > Or if the system wakes up after 50 seconds and doesn't suspend again, my 
 >  > program should run 100 seconds after it started to sleep.
 > 
 > i'm afraid not.  your sleep will be stretched by the duration of
 > the suspend.  see the following.  a 30 second sleep starts at
 > 15:42:41.  the system suspends for 15 seconds, and wakes (that's
 > where the "+r" gets printed) at 15:43:01 (2 seconds later than it
 > expected to, btw).  the sleep terminates, and prints "sleep
 > ended" and the date at 15:43:25.  that's roughly 45 seconds after
 > the 30 second sleep started.
 > 
 >     [r...@xo-a7-2a-c8 dev]# touch /var/run/powerd-inhibit-suspend/1
 >     [r...@xo-a7-2a-c8 dev]# (date; sleep 30; echo sleep ended; date) &
 >     [2] 3122
 >     Wed Jul 28 15:42:41 GMT 2010
 >     [r...@xo-a7-2a-c8 dev]# rtcwake -s 15 -m mem; date
 >     rtcwake: assuming RTC uses UTC ...
 >     rtcwake: wakeup from "mem" using /dev/rtc0 at Wed Jul 28 15:42:59 2010
 > 
 >     +rWed Jul 28 15:43:01 GMT 2010
 >     [r...@xo-a7-2a-c8 dev]# sleep ended
 >     Wed Jul 28 15:43:25 GMT 2010
 > 
 > 
 > =---------------------
 >  paul fox, p...@laptop.org

=---------------------
 paul fox, p...@laptop.org
_______________________________________________
Devel mailing list
Devel@lists.laptop.org
http://lists.laptop.org/listinfo/devel

Reply via email to