[mythtv-users] Check for start time of next recording

Matt Mossholder matt at mossholder.com
Thu Dec 1 19:54:02 UTC 2011


On Thu, Dec 1, 2011 at 1:05 PM, Brian J. Murrell <brian at interlinx.bc.ca>wrote:

> Somewhat related, what would be nice/useful is to be able to add "jobs"
> to the scheduler that require a tuner or will take a tuner offline, etc.
> so that the scheduler can schedule them to happen when the tuner is not
> needed for a recording.
>
> I would imagine some scheduling constraints like:
>
> When: daily [between start and end times], weekly, etc.
> Duration: 30mins
>
> and possibly others.
>
> Cheers,
> b.


Another way to handle that would be to have an API call that would block
until a window of a user-specified duration is available. That way you
could schedule a cron job to run at midnight, but it would sit in a blocked
state until a window of X minutes is available. This seems preferable to
me, as it means that the scheduler can still control when shows are
recorded, without needing to add to the scheduling overhead. I would assume
this could be added to the code that occurs at the end of a recording.

   // wait until there is a 30 minute opening in the schedule for the
specified tuners, then do something useful.
   waitForTimeWindow(30, {tuner_id_1 ... tuner_id_X});
   do_something_useful();

The only gotcha I can think of is that the end-user or scheduler might
change something while your job is running, which might cause nastiness. In
particular Live TV might be an issue. Maybe it would work better if when
the window opened, the tuners were disabled to prevent contention.

     --Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mythtv.org/pipermail/mythtv-users/attachments/20111201/0948a920/attachment.html 


More information about the mythtv-users mailing list