[mythtv-users] Check for start time of next recording
Michael T. Dean
mtdean at thirdcontact.com
Thu Dec 1 22:51:30 UTC 2011
On 12/01/2011 02:54 PM, Matt Mossholder wrote:
> On Thu, Dec 1, 2011 at 1:05 PM, Brian J. Murrell 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.
>
Yeah, that's pretty much why the only approach we're offering, now, is
basically like Live TV. A script or whatever can "check out" a tuner
and release it back whenever it's done--see
http://www.gossamer-threads.com/lists/mythtv/users/475239#475239 and
some of the rest of the discussion on that thread. That way, if you end
up missing a recording that showed up on the listings at the last
minute, you can blame yourself and not MythTV (since there's no way we
can predict when/if tuners will be needed with certainty), rather than
MythTV including a functionality that users are likely to think provides
a guarantee that it will only use the tuner when they're not needed.
Mike
More information about the mythtv-users
mailing list