Project

General

Profile

Feature #562

Run script or program when tvheadend goes to idle state

Added by Alain Kalker over 13 years ago. Updated over 12 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-06-11
Due date:
% Done:

0%

Estimated time:

Description

It would be nice to have tvheadend run a (configurable) script or program when it goes to idle state. This would enable that script (or something like a suspend / shutdown manager) to suspend / shutdown the tvheadend server to save energy.

Use cases:
- Shutdown the server, program RTC alarm to wake up just before next recording should start.
- Setup Wake-On-Lan, suspend or shutdown the server until client or manager process sends Magic Packet to wake it up again.
- When idle scanning is off: stop tvheadend, then shutdown power-hungry or overheating DVB tuner cards until next recording / client connect.
- Probably more

I think it could be implemented by simply executing

<scriptname> <tvheadendpidfile> [nextevent]

where [nextevent] is set only if there are any upcoming, scheduled events.

The script can now decide whether to stop tvheadend, program the RTC alarm, WOL, etcetera.

Kind regards,

Alain

P.S. Loving tvheadend, keep up the good work! :-)

History

#1

Updated by Alain Kalker over 13 years ago

Come to think of it, it would be nice if tvheadend could start a script at end of recording as well. This can then for example start transcoding/commercial-filtering the latest recording, transfer it to a backup server, etc.

Script could then be run like:

<scriptname> idle|finished_recording|... [nextevent]

Kind regards, Alain

#2

Updated by Yura Scheglyuk over 13 years ago

Alain Kalker wrote:

Come to think of it, it would be nice if tvheadend could start a script at end of recording as well. This can then for example start transcoding/commercial-filtering the latest recording, transfer it to a backup server, etc.

Use tvheadend setting in Configuration - Digital Video Recorder - Post-processor command. For example I made post-processing script - see #392

#3

Updated by Alain Kalker over 13 years ago

Yura Scheglyuk wrote:

Use tvheadend setting in Configuration - Digital Video Recorder - Post-processor command. For example I made post-processing script - see #392

Thanks, missed that one completely :-)
(Had to hide the log window pane to make it visible, don't ask: running browser at low screen resolution.)

Well, that leaves just the request for idle state reporting.
I think it would be nice to unify this kind of event handling (much in the spirit of tvheadend itself) under a more general "event handling" tab.

#4

Updated by Chris Dekter - about 13 years ago

I have a potential patch for this enhancement. It is implemented as a special URL which when called replies with a soap object indicating whether a recording is in progress (idle status) and also when the next recording will start (including any extra lead time). This small change to tvheadend then makes it possible to use some external script to monitor the URL and perform power management actions based on the information there.

Andreas, would you let me know whether you will accept it? If so, I will prepare a pull request on github.

#5

Updated by Chris Dekter - about 13 years ago

Correction, it returns a JSON object not a SOAP object.

#6

Updated by Adam Sutton over 12 years ago

  • Status changed from New to Rejected

Power control related features are discussed in various areas, I'll try and pull these all together into a common issue.

Also available in: Atom PDF