[mythtv-users] Bug in scheduler?

Bruce Markey bjm at lvcm.com
Fri Mar 5 03:53:34 EST 2004

Thomas, first I want to say that I fully understand what you
are asking. You are not the first, and probably not the last
to go down this road. The first thing that needs to be clarified
is that myth has two very different features that serve two
different purposes. They are both very useful if you understand
what they do and what they are for and not confuse the
characteristics of two different features which are not directly
interrelated. Secondly, creating an example where a particular
behavior would seem desirable does not mean that it would be
desirable in all cases.

Thomas Börkel wrote:
> David Engel wrote:
>>> If I use the global start early/stop later feature (BTW, this should 
>>> allow more than 10 minutes), then the scheduler will not use it, if 2 
>>> shows run right after each other, even if on different channels. If I 
>>> look at the conflicts screen, it says, it will use the same encoder 
>>> for both shows. But I have 2 capture cards.
>>> In my opinion, this is wrong.
>> Please submit a patch.  But, make it configurable because not everyone
> Not every Myth user is able to submit patches. There will always be more 
> users than developers. ;-)

At least from my perspective, the message is that if you want
some feature you should do the work (or pay someone to do the
work ;-). No one else is going to do something that they don't

>>> But it would be fatal, if the shows run on different channels, 
>>> because I might miss the end of the first show and the beginning of 
>>> the second, if things go a bit wrong.
>> If your guide data isn't accurate enough to catch the end of a show, use
> At least here, TV world is not perfect. I have NTP running, but seems 
> the stations do not. ;-) If a show is scheduled 8:00 until 9:00, it may 
> start at 7:58 and it may end at 9:02.

There are ways to deal with that but you must understand which
feature to use for which situation.
> The thing is: In 90% of the cases, I would be satisfied with one global 
> setting for start early/stop late, if it would work like the setting for 
> each recording.
> Maybe I made myself not totally clear, so here comes an example:

Fully understood. no surprises here =).

> According to the guide:
> show 1, 7:00 - 8:00, channel 1.
> show 2, 8:00 - 9:00, channel 2.
> I set globally start early 10 minutes, stop late 10 minutes. I have 2 
> capture cards, no one is watching live TV.

Careful! There is NO SUCH THING as "globally start early".
I won't let you confuse "Start Early" minutes used by the scheduler
in setting the start and end times for the scheduled times for each
show with Pre-roll seconds used by the recorder at record time to
get a head start so that a channel change scripts and such can run
ahead of time.

These two features are NOT aspects of the same system but are
used in very different ways in different parts of the code.

startoffset and endoffset are stored with each record rule and
allow you to instruct the scheduler that the record times are
modified from the program information. These values are used
when the schedule planning takes place. The recorder knows nothing
about these and only follows orders for the minute when it is time
to record. Changing the scheduled times so that shows overlap
means the the scheduler will either have to plan to used different
cards or, if there isn't a card available, plan to not record one
of the shows.

It may take a few seconds to startup the recording process, run
a channel change script, wait for a settop box's OSD to clear, etc.
Therefore, the recorder has a pre-roll seconds feature that the
recorder uses at record time when possible. This information is
used by the recorder and has nothing to do with planning the

> Now Myth will record:
> show 1 from 6:50 - 8:00 on encoder 1
> show 2 from 8:00 - 9:10 on encoder 1
> (at least this is what the scheduled recordings screen says) and encoder 
> 2 will not be used.
> But the stations will send today:
> show 1 from 7:02 - 8:02
> show 2 from 7:58 - 8:58

Then, of course, these shows must be on two different stations.
You know that there are 4 minutes that must be recorded at the
same time. There is no way to fudge the recorder to know what to
do so the schedule has to be modified to account for this.
Therefore, you must use Start Early/End Late to tell the scheduler
to plan for this. Note also that one show is early and the other
is late so they have different solutions. In myth you can set
these offset per show to handle just this kind of situation.

> OK, this is a worst case scenarion, but in this case, I will miss the 
> end of show 1 and the beginning of show 2.
> And so I cannot use the global setting and have to set it for each 
> recording, wher it works like I need it.

But even in the example you chose, the needs for the two shows
were different.

What you've been trying to propose is that the scheduler should
take the recorder warm-up time into account when planning the
schedule. Even if you had come up with a better example, it
still wouldn't take into account all the possibilities. For
example, many people have a card that has better quality than
other cards. If there are two favorite shows back-to-back, they
would want both shows to use the best card rather than having
the second show forced to the second card when there is no
real schedule conflict.

What if you had two shows from 8-9 and a show from 9-10? The 9
o'clock show couldn't start early unless the system knew it was
okay to end one of the 8 o'clock shows earlier. How would it know
that? Even if it was okay to start at 9, maybe you know that
one of the 8 o'clock shows is more likely to run later than the
other. You could tell the scheduler this with End Late but there
is no way global post-roll can give the system a hint as to what
the best solution would be.

If you need to add minutes to be sure that you will get the
entire show, specify the Start Early/End Late minutes which
you believe will be best for that station or show. Be prepared
to resolve any conflicts you create. There is no way for the
software to guess correctly at what exactly you would want in
every situation.

If you want the recorder to get a head start of a few seconds
whenever possible, use pre-roll seconds.

--  bjm

More information about the mythtv-users mailing list