Mailing List archive

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

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



Sergei Haller wrote:
> 
> On Tue, 28 Aug 2001, Klaus Schmidinger wrote:
> 
> > 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).
> 
> yeah. I like the idea.
> 
> > 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.
> 
> for how long duration?

Well, let's say 10% of the MinUserInactivity parameter (but at least 1 minute).
I don't want to introduce yet another setup parameter for this (you know, you _can_
configure a system to death...)

> > Since this is a user activity,
> > a new MinUserInactivity timeout will then be started.
> >
> > 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.
> 
> what should be the default?
>   - `shutdown -h'? halt?
>     so the user could at least let the box automatically shutdown after
>     completing the record. or he would be able to use the new `intentional
>     shutdown' menu. I think one can disable the `automatical shutdown'
>     feature by setting the MinUserInactivity to 0
> 
>   - something else?

Your progra/script can do whatever it takes to shutdown the computer.
This is none of VDR's business. VDR will only call the program if there
is no recording currently going on, and it also won't exit immediately
after calling it, but rather wait for the SIGTERM that will be sent when
the computer shuts down. If anything should go wrong with the shutdown,
VDR will just continue to run (and try again after a while).

> > An additional new menu option to intentionally shutdown the machine NOW will
> > complete this.
> 
> One additional request:
> 
> it would be nice if there was a way for some external program to tell vdr
> to `shutdown' machine now (to call that external command and so on)
> 
> maybe via SVDRP ?

An external program can "tell" that to VDR by sending it the SIGTERM signal.

> (what I have in mind is the following: ATM I am using acpid to call
> `shutdown -h' on a power button press. with that new feature I would like
> to tell vdr to shutdown now)

'sutdown -h' will send a SIGTERM to any running process, and so VDR will exit.

> in both cases of the intentionally shutdown (via menu or SVDRP)
> I suppose vdr will first check for the
>   - MinEventTimeout and
>   - if there is a recording now
>   (if it is replaying or MinUserInactivity wouldn mind in that case)
> in both cases VDR should bring a message on the screen telling the user
> that the shutdown cannot be initiated because of a currently recorded
> timer or because the next timer lies within the next `MinEventTimeout` minutes

An 'intentional' shutdown will, of course, be postponed until any currently
running recording will be finished - unless the user insists. I'll provide a
suitable prompt.

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