[mythtv] Next Scheduler Patch
dlengel at attbi.com
Tue Feb 24 18:10:27 EST 2004
The attached patch implements the next, and major, part of my overhaul
of the MythTV scheduler. It has been in use privately for a week now
without serious problems so it's time to give it some wider testing
before it goes into CVS.
I'd like to thank Bruce Markey and Steve Davies for their suggestions,
patches and willingness to test. Their help has been invaluable.
The following is a brief description of the user visible changes made
with this patch, in no particular order.
Scheduling is always done using recording priorities. All programs
are scanned one at a time, starting with the highest priority, and are
scheduled in the best available time/card slot remaining. Some
heuristics are done to break ties in priority. See comp_priority for
the details since most of the magic occurs in how the programs are
There is a cofiguration option to allow the scheduler to move a higher
priority program to another time/card slot if it would allow a lower
priority program to be scheduled when it otherwise wouldn't be. The
option can be set on the TV Settings/Recording Priorities/General
setup screen. It is off by default.
To help make it easier when conflicts need to be resolved manually, a
program can be quickly given a recording priority boost by setting a
record override for it to do record. This will be replaced with a
better, more flexible solution when record overrides are enhanced
Card inputs can be given a preference value which is added to the
recording priority of programs. This can be used to make the
scheduler favor some inputs over others. The input preferences can be
set on the Card Input screen in the setup program.
The scheduler considers channels with the same callsign to be the same
channel. For example, if a program is originally scheduled on chanid
1003 but chanids 1003, 2003 and 2123 all have the same callsign of
KVBC, the scheduler will try to use the best time/card slot from any
of the 3 channels. If a channel does not have a callsign, the
scheduler will consider it unique.
There is a known bug concerning the callsign matching and record
overrides when used on systems with multiple video sources. The
problem is the override only applies to the chanid. This will be
The Program Guide, Program Lister and Program Finder automatically
merge channels with the same channum and callsign when displaying
them. They also show the correct status for the program no matter
what the channum is.
The scheduler partially supports card inputs that can be shared, such
as those on DVB cards.
Programs which can't be scheduled because of higher priority programs
are marked as Conflicting and are highlighted in the appropriate
places to draw attention to them.
Programs which will be recorded at another time are marked as either
Earlier Showing or Later Showing. Later Showing means a program could
not be scheduled earlier because of higher priority programs or was
moved to allow a lower priority program to be scheduled. Programs
marked as Later Showing are always shown on the View Scheduled screen
in case they need manual adjusting.
If a program is marked as Conflicting or Later Showing, the programs
that will be recorded instead are listed on the Overrides screen for
If a program has a record override set, either do or don't record, it
can be cleared on the Overrides screen for that program. This makes
it easy to try What Ifs when resolving conflicts manually.
The scheduler sends a SCHEDULE_CHANGE event when it changes the status
of any pending recording so the front ends get notified immediately.
These changes temporarily break mythweb due to some RecStatusType
In order to keep the new scheduler logic as clear as possible, I
haven't done much to optimize the algorithms yet. I know what to do
but will wait until later to do it.
dlengel at attbi.com
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 21563 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20040224/6872f47f/scheduler.patch.obj
More information about the mythtv-dev