[vdr] Passing events to plugins or external programs

Klaus Schmidinger Klaus.Schmidinger at cadsoft.de
Wed Sep 14 18:24:10 CEST 2005

Marko Mäkelä wrote:
> I have equipped my vdr system with a solid-state relay that can power on
> and off the monitor and speakers.  The relay should be connected to the
> value of Setup.Suspend (see my patch from yesterday).
> I am not too familiar with the plugin interface of vdr, but I got the
> impression that the only way to implement such a relay control in a
> plugin would be by polling, which is inefficient.
> Are there any plans to allow plugins to register for updates of cSetup
> variables?  (Or any plans for a svdrp interface to setting and querying
> the variables, for that matter?)
> Such an event interface could also be to a popen'ed child process.
> Whenever something of interest happens, vdr would write a line to the
> pipe.  At the very least, changes to setup variables (both vdr and
> plugins) would be logged.  The child process would look for interesting
> lines, such as "Setup.Suspend=0" or "Setup.Suspend=1" in the case of
> relay control.  Other events that could be logged would be changes in
> aspect ratio and play mode.
> Making the event interface to a child process would avoid licensing
> problems.  Before I decided to build a solid-state relay box myself,
> I searched for existing solutions.  I found a manufacturer of
> USB-controlled power outlets that appeared to supply Linux drivers.
> Unfortunately, the driver turned out to be a closed-source library,
> which couldn't be used in a vdr plugin without breaking the GPL.

Just run a separate thread that checks your Setup parameter from
time to time and otherwise sleeps. I don't think there's any need
for an overly complex mechanism here.

If this suspend stuff should go into core VDR (not before version 1.4,
though) I could imagine adding a new cStatus function for this.



More information about the vdr mailing list