[mythtv] Next Scheduler Patch
Bruce Markey
bjm at lvcm.com
Tue Feb 24 18:57:29 EST 2004
Here are some test cases and notes from testing David Engel's new
scheduler. David's explanations of his features take precedence
over my interpretations. However, these test case examples may
provide some more details about how certain features work and
things you should look for when testing and using this new
scheduler.
-- bjm
-------------- next part --------------
There are some special cases that should be tested in the scheduler:
Put back - if a short show loses to a longer show that loses to
a later show, the short show should record in the hole left by the
move of the longer show.
Card priority sort - with three or more cards, the second ranked
show in a time slot should get card 2 and the third should get 3.
Maximum shows - a one time showing episode should not lose by
conflict if one or more of the conflicts could record the same
episode in a timeslot where there are no conflicts.
Can move - If a higher ranked show occupies a card with two
source inputs and a lower ranked show can only be recorded on the
second source, the higher show should check to see if it can
move to another available input for it's source.
This new scheduler adds new cases that need verification:
Channel matching - if a station is available on more than one channel
or from more than one sourceid with identical listings, showings
on any of these channels should be interchangable. Further if the
channel priorities are not the same, the channel with a higher
priority should be preferred but not required if unavailable.
Earliest showing - if a show has multiple showings, the first showing
should always be recorded unless it loses in conflict resolution.
"Earliest showing" and "Maximum shows" oppose each other by
definition.
Prefer best card - if one or more cards in the card list produce
higher quality recordings than other cards, the user may prefer
moving an earlier showing of an episode from a lower card to a
timeslot where it will be recorded on a higher quality card.
Also to be verified:
Tie breaking - if shows with the same priority value are in conflict,
the tie should be broken in a way that is likely to be the best
default choice.
Test Environment
The test system has two tuners. The first and second cards have coax
cable from sourceid 1. The first card also has digital cable from
sourceid 2 on it's s-video input. The sources share some stations and
there are some stations on just sourceid 1 and some exclusive to
sourceid 2. The local NBC affiliate is broadcast on channel 3 but is
also transmitted digitially on channel 123:
mysql> select chanid,channum,sourceid,callsign,xmltvid from channel
where callsign = 'KVBC';
+--------+---------+----------+----------+---------------------+
| chanid | channum | sourceid | callsign | xmltvid |
+--------+---------+----------+----------+---------------------+
| 1003 | 3 | 1 | KVBC | C3kvbc.zap2it.com |
| 2003 | 3 | 2 | KVBC | C3kvbc.zap2it.com |
| 2123 | 123 | 2 | KVBC | C123kvbc.zap2it.com |
+--------+---------+----------+----------+---------------------+
3 rows in set (0.00 sec)
Output for the examples is generated by "PrintList()" shown when
running "mythbackend -v schedule". The most significant information
is the "N" column for NoRecord status and the "Pri" column for
priority.
Test Cases
Put back
Verified.
"Innovation" has the highest priority so it is placed on card 1 ahead
of "U.S. Marshals" on card 2. "Nova" has a priority lower than
"U.S. Marshals" but there is an open timeslot on card 1 for 8-9pm so
Nova is placed ahead of "U.S. Marshals":
Title - Subtitle Chan ChID Day Start End S C I O N Pri
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 1 1 0 1 0
U.S. Marshals 7 1007 24 20:00-22:40 1 2 2 0 2 1
Innovation - "SpyCatchers" 10 1010 24 21:00-22:00 1 1 1 0 1 2
Card priority sort
Verified.
For this test only, a system with three cards is used (1, 2 and 5).
Three sports shows all start at the same time. The shows with
priorities 2, 1, and 0 are assigned to cards 1, 2, and 5 respectively:
Title - Subtitle Chan ChID Day Start End S C I O N Pri
Table Tennis - "Killerspin Open" 31 1031 19 15:00-15:30 1 1 1 0 1 2
SportsCenter 30 1030 19 15:00-16:30 1 2 2 0 2 1
PGA Golf - "Nissan Open, First 34 1034 19 15:00-18:00 1 5 5 0 5 0
If the "SportsCenter" priority is lowered, it is correctly swapped
with "PGA Golf":
Table Tennis - "Killerspin Open" 31 1031 19 15:00-15:30 1 1 1 0 1 2
SportsCenter 30 1030 19 15:00-16:30 1 5 5 0 5 -1
PGA Golf - "Nissan Open, First 34 1034 19 15:00-18:00 1 2 2 0 2 0
If "SportsCenter" is raised to the highest priority, the others are
moved down to the lower cards in the correct order:
Table Tennis - "Killerspin Open" 31 1031 19 15:00-15:30 1 2 2 0 2 2
SportsCenter 30 1030 19 15:00-16:30 1 1 1 0 1 3
PGA Golf - "Nissan Open, First 34 1034 19 15:00-18:00 1 5 5 0 5 0
Maximum shows
Verified.
With "Reschedule Higher Priorities" turned on, a higher priority show
can be postponed to a later showing in order to allow recording a
lower priority title with a single showing of the episode. In this
example, Nova at 8pm is marked for a "L"aterShowing and is recorded
at 1am to allow SportsCenter to record at 8pm:
Title - Subtitle Chan ChID Day Start End S C I O N Pri
American Idol 5 1005 24 20:00-21:00 1 2 2 0 2 1
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 0 0 0 L 2
SportsCenter 30 1030 24 20:00-21:00 1 1 1 0 1 0
Nova - "Spies That Fly" 10 1010 25 01:00-02:00 1 1 1 0 1 2
Also see "Earliest showing".
Can move
Verified.
"Curb Your Enthusiasm" is only available on source 2, card 1 but
"Nova" is available on either card for source 1. If "Curb" has a
higher priority, both will record:
Title - Subtitle Chan ChID Day Start End S C I O N Pri
Curb Your Enthusiasm - "The Sur 210 2210 24 20:00-20:30 2 1 3 0 1 2
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 2 2 0 2 1
If "Curb" has a lower priority with "Reschedule Higher Priorities"
turned off, "Nova" wins card 1 and "Curb" cannot be recorded so it is
marked as a "C"onflict:
Curb Your Enthusiasm - "The Sur 210 2210 24 20:00-20:30 2 0 0 0 C 0
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 1 1 0 1 1
With the "Reschedule Higher Priorities" option turned on, "Curb" gets
its only possible input on card 1 even though Nova has higher priority.
Curb Your Enthusiasm - "The Sur 210 2210 24 20:00-20:30 2 1 3 0 1 0
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 2 2 0 2 1
Channel matching
Verified.
"Whoopi" is broadcast on KVBC which is available on chanid 1003, 2003
and 2123. These should be treated as being identical because their
callsigns match. "2123" has its channel priority boosted to "1" and
therefore should be preferred over the others.
"Whoopi" on 2123 has a priority of 1 so it wins for KVBC and is
higher than "Nova". Source 2 on card 1 is used for "Whoopi":
Title - Subtitle Chan ChID Day Start End S C I O N Pri
Whoopi - "The Last Dance" 123 2123 24 20:00-20:30 2 1 3 0 1 1
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 2 2 0 2 0
With its priority raised to 2, "Nova" wins card 1. With the only
source 2 input unavailable, "Whoopi" is moved to chanid 1003 on
card 2. 1003 has no channel priority so the total priority is now
zero.
Whoopi - "The Last Dance" 3 1003 24 20:00-20:30 1 2 2 0 2 0
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 1 1 0 1 2
Earliest showing
Verified.
With "Reschedule Higher Priorities" turned off, a higher priority show
that could be postponed to a later showing will record even if a lower
priority title will not be recorded as a result. In this example,
Nova at 8pm is marked to record and SportsCenter marked as a conflict:
Title - Subtitle Chan ChID Day Start End S C I O N Pri
American Idol 5 1005 24 20:00-21:00 1 2 2 0 2 1
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 1 1 0 1 2
SportsCenter 30 1030 24 20:00-21:00 1 0 0 0 C 0
Nova - "Spies That Fly" 10 1010 25 01:00-02:00 1 0 0 0 E 2
Prefer best card
Verified.
If all Input Connections have been set in the "setup" to have an
"Input preference" of 0, Nova will record in the first available
timeslot on card 2:
Title - Subtitle Chan ChID Day Start End S C I O N Pri
American Idol 5 1005 24 20:00-21:00 1 1 1 0 1 1
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 2 2 0 2 0
Nova - "Spies That Fly" 10 1010 25 01:00-02:00 1 0 0 0 E 0
With the card 1, input 1 "Input preference" set at a value of 1, Nova
will record in a later timeslot when it can be recorded on the
preferred card 1:
American Idol 5 1005 24 20:00-21:00 1 1 1 0 1 2
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 0 0 0 L 1
Nova - "Spies That Fly" 10 1010 25 01:00-02:00 1 1 1 0 1 1
Note that the total priority value for each item associated with card
1, input 1 has been raised as a result of increasing the "Input
preference".
If "Nova" has the highest priority so that it wins the preferred input
at 8pm, it will record in that timeslot:
American Idol 5 1005 24 20:00-21:00 1 2 2 0 2 1
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 1 1 0 1 3
Nova - "Spies That Fly" 10 1010 25 01:00-02:00 1 0 0 0 E 3
Tie breaking
Verified.
If two shows have the same priority, the show with the more specific
record rule type is preferred. A Channel record or All record may
have other showings of the same episode where a Single record or
Weekslot may not.
Here "Nova" is Weekslot and "Idol" is Channel so "Idol" is not recorded:
Title - Subtitle Chan ChID Day Start End S C I O N Pri
Curb Your Enthusiasm - "The Sur 210 2210 24 20:00-20:30 2 1 3 0 1 1
American Idol 5 1005 24 20:00-21:00 1 0 0 0 C 0
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 2 2 0 2 0
With "Nova" as Weekslot and "Idol" as Single, "Idol" wins card 2:
Curb Your Enthusiasm - "The Sur 210 2210 24 20:00-20:30 2 1 3 0 1 1
American Idol 5 1005 24 20:00-21:00 1 2 2 0 2 0
Nova - "Spies That Fly" 10 1010 24 20:00-21:00 1 0 0 0 C 0
If the pirority and type match, there are further rules to assure
that the results will be deterministic.
More information about the mythtv-dev
mailing list