Power manager specification... (request for comments).

Mike C. Fletcher mcfletch at vrplumber.com
Thu Aug 16 23:30:18 EDT 2007


Jim Gettys wrote:
...
>> There seems to be no way to manually adjust the backlight level in
>> ebook mode. What would be the policy for it? Leave it on all the time
>> or dim down after some idle time? Also CPU (and wireless?) should go
>> to suspend for most of time in ebook mode?
>>     
>
> We have code in at least our PDF viewer to literally do exactly this; as
> soon as the page is rendered and it is idle, it puts the machine to
> sleep.
>   
For the activity developers in the audience:

    This is (I believe) in the GIT read-activity/readactivity.py[1]
    module.  The implementation uses the HardwareManager[2] service
    (set_kernel_suspend) exposed over dbus to directly send the kernel
    into suspended state.  AFAICS there's no allowance for tracking
    whether something *else* might need the machine to be alive (e.g. a
    download or the like being done in the background).  The same
    Manager object has controls for various operations such as changing
    brightness and the like.

On the original topic of the thread (what the power manager should do):

    I'm guessing eventually we'll want some of the logic currently in
    the read activity to migrate into HardwareManager.  That is, allow
    for signaling "inhibit_suspend( )" and "allow_suspend()"[3], rather
    than directly setting suspend, such that a given activity can
    declare that it must be allowed to continue processing in the
    back-end.  Then you'd want something like "suggest_suspend()" so
    that a foreground activity can tell the system "hey, I don't expect
    to do anything for a second or two, if no-one objects, feel free to
    suspend".

     From there, a second level does a suggest-suspend from Sugar (or
    whoever) on no-cpu, no-network (other than the autonomous routing),
    no-input, for a given period.  No opinion on where/how to put that.

    HardwareManager should likely send dbus events so that activities
    can watch for resume, suggested-suspend, or what have you and adjust
    behaviour accordingly.  Example usage scenario: switch a per-second
    clock-updating timer to a per-minute timer.

Hope this helps,
Mike

[1] 
http://dev.laptop.org/git.do?p=projects/read-activity;a=blob;f=readactivity.py;h=3eeb858cc5ea1dc67a60faee90628100479509be;hb=HEAD
[2] 
http://dev.laptop.org/git.do?p=hardware-manager;a=blob;f=hardwaremanager.py;h=3154b17553621cc41fa947cbff2756372e6e37ec;hb=HEAD
[3] with allow-suspend happening automatically after a short-ish timeout 
if the activity doesn't re-assert the inhibition

-- 
________________________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://www.vrplumber.com
  http://blog.vrplumber.com




More information about the Devel mailing list