Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Integration of Powersave in VDR



Peter Seyringer wrote:
> 
> Hello!
> 
> This afternoon i had a discussion with Klaus about implementation of powersave in vdr.
> My idee is:
> 
> 1) Powersave starts the computer about 5 minutes before the recording starts
> 2) after the record, vdr calculates the time to the next timer start. If this time is smaller than a value xx (like 15 minutes), vdr doesn't shutdown the system
> 3) if the time difference is long enough, vdr will program the next startup event to powersave and shutdown the computer
> 
> This cycle can break with a special menu option.
> 
> I hope you understand my bad english. So Klaus, please tell us your opinion.
> 
> Peter

I guess the most important question will be how the actual RTC programming
and shutdown sequence shall be initiated.

I see two possible ways to do this: either through an external program that
VDR calls when it is time to shut down, or through code internal to VDR.

The first version has the advantage that anybody can quickly write their own
program to set up their individual hardware, without having to patch VDR.
And that's my personal favourite, because it clearly isolates the task.

Therefore I suggest that everybody who wants to power off their VDR machine
provides a program (binary, shell script, Perl script or whatever), which can
be called by VDR with exactly one paramter, namely the time (in UTC) when the
next timer event will take place (that will be the exact starting time of the
timer, so if the system needs additional time to power up, the program should
subtract that time). The time will be given as the number of seconds since the
epoch (i.e. "time_t" type). The program shall take whatever measures are necessary
to make sure the machine will restart at the given time, and shall also initiate
the shutdown sequence. In order for VDR to exit gracefully, the program shall
return after initiating the shutdown procedure, and its exit value shall be
'0' if it was successful, '1' if there was an error (and the shutdown will not
take place).

VDR will provide two new setup parameters: MinEventTimeout and MinUserInactivity.
The shutdown program will only be called if all of the following is true:

- there is currently no replay or recording session active
- the next timer event is at least MinEventTimeout minutes in the future
- there has been no user activity (i.e.remote control input) for at least
  MinUserInactivity minutes

Before the actual call of the shutdown program there will be a prompt on the
screen, allowing the user to cancel the shutdown. Since this is a user activity,
a new MinUserInactivity timeout will then be started.

An additional new menu option to intentionally shutdown the machine NOW will
complete this.

If this is what everybody can agree on, I can implement this framework into VDR.
All you'll have to do is provide the actual shutdown program and run VDR with the
new option "--shutdown=CMD", where CMD is the name of your program.

Of course, how the machine is restarted again when the user wants to watch tv,
but there is currently no timer active, is a whole different story and has nothing
to do with VDR.

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.


Home | Main Index | Thread Index