[mythtv-users] Scheduler seems to think I am recording too many programs at once

David Engel david at istwok.net
Sat May 4 18:55:20 UTC 2013


On Sat, May 04, 2013 at 10:03:42PM +1200, Stephen Worthington wrote:
> On Fri, 03 May 2013 13:33:48 -0500, you wrote:
> 
> >On Sat, May 04, 2013 at 03:50:30AM +1200, Stephen Worthington wrote:
> >> On Fri, 03 May 2013 09:35:46 -0500, you wrote:
> >> 
> >> >On Fri, May 03, 2013 at 02:19:52PM +1200, Stephen Worthington wrote:
> >> >> On Thu, 02 May 2013 13:26:44 -0500, you wrote:
> >> >> 
> >> >> >On Fri, May 03, 2013 at 03:01:42AM +1200, Stephen Worthington wrote:
> >> >> >> On Thu, 02 May 2013 09:25:17 -0500, you wrote:
> >> >> >> 
> >> >> >> >On Fri, May 03, 2013 at 12:04:03AM +1200, Stephen Worthington wrote:
> >> >> >> >> On Thu, 02 May 2013 07:18:50 -0400, you wrote:
> >> >> >> >> 
> >> >> >> >> >On 05/02/2013 12:56 AM, Stephen Worthington wrote:
> >> >> >> >> >> I was just checking the scheduling for the new EPG received today, and
> >> >> >> >> >> I found that one program "Seven Sharp" was not recording at its usual
> >> >> >> >> >> time of 19:00 on TV ONE, but instead was recording at 20:00 from the
> >> >> >> >> >> TVONE PLUS1 channel which retransmits TV ONE an hour later, but in SD
> >> >> >> >> >> instead of HD.  I have occasionally seen this sort of thing happen
> >> >> >> >> >> before, always when I am recording lots of programs at the same time.
> >> >> >> >> >> It has always seemed to me that the scheduler must have some limit for
> >> >> >> >> >> the number of programs it will record at one time and when it goes
> >> >> >> >> >> over that limit, it tries to reschedule one or more of them.  If I add
> >> >> >> >> >> an override to force "Seven Sharp" to record from TV ONE at 19:00, the
> >> >> >> >> >> scheduler is happy to do that and does not seem to make any other
> >> >> >> >> >> changes.
> >> >> >> >> >>
> >> >> >> >> >> Here is the schedule for that time period, without the override:
> >> >> >> >> >> [Time]       [Callsign]-[Program name]
> >> >> >> >> >> 17:30:18:30  DISCO - Mythbusters
> >> >> >> >> >> 18:00-19:03  TV ONE - One News At 6pm
> >> >> >> >> >> 18:00-19:03  TV3 - 3 News
> >> >> >> >> >> 18:30-19:03  ChoiceTV - Bath Crashers
> >> >> >> >> >> 19:00-19:33  TV ONE - Seven Sharp  (yellow, "Find Daily -3 Later
> >> >> >> >> >> Showing")
> >> >> >> >> >> 19:00-19:33  TV ONE-S - Seven Sharp (yellow, "Find Daily -7 Later
> >> >> >> >> >> Showing")
> >> >> >> >> >> 19:00-19:33  TV3 - Campbell Live
> >> >> >> >> >> 19:30-19:33  TV2 - Police Ten 7
> >> >> >> >> >> 19:30-20:30  HISCH - Mysteries At The Museum (yellow, "Channel Record
> >> >> >> >> >> +0 Later Showing")
> >> >> >> >> >> 19:30-20:30  KNOWLGE - Who Do You Think You Are? Aus
> >> >> >> >> >> 19:30-20:33  PRIME - Great Rift: Africas Wild
> >> >> >> >> >> 19:30-20:33  TV3 - Grand Designs Revisited
> >> >> >> >> >> 20:00-20:30  CRIME&  - Traffic Blues (yellow "Channel Record +0 Later
> >> >> >> >> >> Showing")
> >> >> >> >> >> 20:00-20:33  TV2 - RBT
> >> >> >> >> >> 20:00-20:33  TVONE PLUS1 - Seven Sharp
> >> >> >> >> >> 20:29-21:33  TV3 - Bones
> >> >> >> >> >>
> >> >> >> >> >> In the above, TV ONE, TV2 and TVONE PLUS1 are transmitted on the same
> >> >> >> >> >> DVB-T multiplex, PRIME and ChoiceTV are on the same DVB-T mux, and TV3
> >> >> >> >> >> is on the third DVB-T mux.  TV ONE-S is an SD version of TV ONE on a
> >> >> >> >> >> DVB-S mux.  The other channels are all on Sky TV which is recorded
> >> >> >> >> >> from a set top box via one S-Video card (so there is only one tuner
> >> >> >> >> >> for those channels).  The three DVB-T muxes are on one source, the
> >> >> >> >> >> DVB-S muxes on another source, and Sky TV is on the third source.  All
> >> >> >> >> >> the DVB-T and DVB-S tuners are set up with 4 multirec virtual tuners
> >> >> >> >> >> each, and I have 3 DVB-T tuners and 2 DVB-S ones.  Since I have as
> >> >> >> >> >> many DVB-T tuners as there are DVB-T muxes being transmitted, I should
> >> >> >> >> >> never have to use the TVONE PLUS1 channel at all as I should always
> >> >> >> >> >> have enough tuners to record everything I need on the first showing.
> >> >> >> >> >>
> >> >> >> >> >> So, does anyone know if there is some sort of limit in the scheduler
> >> >> >> >> >> on the number of programs that will record at any one time?  And if
> >> >> >> >> >> so, what it is and how it works?  Is there a setting I can adjust for
> >> >> >> >> >> it?
> >> >> >> >> >
> >> >> >> >> >No limit.  The only limit is the number of tuners (physical and virtual) 
> >> >> >> >> >you have.  MythTV will gladly work your system so hard that the hardware 
> >> >> >> >> >fails to keep up and everything fails miserably if you tell it to.
> >> >> >> >> >
> >> >> >> >> >> I have 5 recording drives, so whatever is causing this sort of
> >> >> >> >> >> rescheduling is not taking that into account, as I can easily record
> >> >> >> >> >> at least 10 programs simultaneously, and probably more, as long as the
> >> >> >> >> >> recordings use all the drives (and they normally do).
> >> >> >> >> >
> >> >> >> >> >It is almost definitely a priority modifier on the other showing causing 
> >> >> >> >> >it to be preferred.  This could be channel or input or HDTV or any of a 
> >> >> >> >> >number of other priority modifiers.  You can see what's happening by 
> >> >> >> >> >running:
> >> >> >> >> >
> >> >> >> >> >mythbackend -v schedule --loglevel debug --printsched
> >> >> >> >> >
> >> >> >> >> >before the shows air and without the override in place.
> >> >> >> >> >
> >> >> >> >> >> Also, is there a way to mark the TVONE PLUS1 channel as SD and the TV
> >> >> >> >> >> ONE channel as HD and tell the scheduler to always record the HD
> >> >> >> >> >> programming unless there is an actual clash?
> >> >> >> >> >
> >> >> >> >> >No, there's no such thing as an "HD" channel--only channels that have 
> >> >> >> >> >programs which may or may not be HDTV.  So, it's up to your guide data 
> >> >> >> >> >to properly mark programs as HDTV or not.
> >> >> >> >> >
> >> >> >> >> >You can set priority modifiers on channels (and starting with 0.27, 
> >> >> >> >> >they'll work the way you think they would work), but then again, 
> >> >> >> >> >priority modifiers you've already set are probably what's causing MythTV 
> >> >> >> >> >to record shows in such a way that you think the scheduler is wrong...  ;)
> >> >> >> >> >
> >> >> >> >> >Mike
> >> >> >> >> 
> >> >> >> >> The --printsched option looks like it is really useful.  I have put
> >> >> >> >> the result on my web server here:
> >> >> >> >> 
> >> >> >> >>   http://www.jsw.gen.nz/mythtv/sched.txt
> >> >> >> >> 
> >> >> >> >> If I paste it into a post, its gets word wrapped and unreadable.  For
> >> >> >> >> readability I also cut down the output to just the bit between times
> >> >> >> >> where there is nothing recording, so in theory nothing before or after
> >> >> >> >> the bit posted would affect the scheduling at the problem time.
> >> >> >> >> 
> >> >> >> >> If, as I am assuming, the P=Priority column is the fully calculated
> >> >> >> >> priority value for the scheduled recording, the I do not understand
> >> >> >> >> what is going on.  The "Seven Sharp" scheduled to actually record from
> >> >> >> >> TVONE PLUS1 has a priority of -4, but the one that is not going to
> >> >> >> >> record from TV ONE has a priority of -3.
> >> >> >> >> 
> >> >> >> >> The channel priorities are: TV ONE is 0, TVONE PLUS1 is -1, which
> >> >> >> >> explains the difference between the two recording priorities.  But it
> >> >> >> >> is still going to record the wrong one.
> >> >> >> >
> >> >> >> >I'm pretty sure Mike meant that to be --testsched and not
> >> >> >> >--printsched.  And don't snip any of the output.  It's the cryptic
> >> >> >> >details that explains what is going on and why.
> >> >> >> >
> >> >> >> >David
> >> >> >> 
> >> >> >> OK, that has a lot more detail.  I have put it here:
> >> >> >> 
> >> >> >>   http://www.jsw.gen.nz/mythtv/testsched.txt
> >> >> >
> >> >> >Here's what's happening in a nutshell.  In the initial scheduling
> >> >> >pass, none of the HD showings can be scheduled due to conflicts.  In
> >> >> >the first retry scheduling pass, none of the conflicting programs can
> >> >> >be moved.  In the second retry pass, lower priority showings are tried
> >> >> >and the SD showing at 20:00 is chosen.
> >> >> >
> >> >> >The reason adding an override sometimes works is it essentially limits
> >> >> >the second retry pass to the current showing.  FWIW, there are some
> >> >> >minor changes to this area in master (aka pre-0.27).  They might or
> >> >> >might ot help in this particular case.
> >> >> >
> >> >> >David
> >> >> 
> >> >> But what I do not understand is that there are no conflicts at all for
> >> >> the DVB-T channels.  There are enough DVB-T tuners to record all the
> >> >> programs, so why are there conflicts to resolve?  The scheduler should
> >> >> just be able to assign the available tuners.  The conflicts are only
> >> >> for the S-Video input.
> >> >
> >> >There are conflicts with:
> >> >
> >> >!Bath Crashers                  12 ChoiceT 09 18:30-19:03  1 1 1  C 1 4/1
> >> >!Grand Designs Revisited         3 TV3     09 19:30-20:33  1 5 5  C 5 4/5
> >> >!Great Rift: Africa's Wild -    10 PRIME   09 19:30-20:33  1 10 10  C 10 4/9
> >> >
> >> >David
> >> 
> >> As I said, I have 3 DVB-T tuners.  There are only 3 DVB-T multiplexes
> >> being transmitted in New Zealand.  So there is no way to get a
> >> conflict on DVB-T except by running out of virtual tuners.  Which
> >> would require recording from 5 channels at once on one of the DVB-T
> >> multiplexes.  The TVNZ multiplex and the Mediaworks multiplex have
> >> only 4 channels transmitted on each.  The Kordia multiplex has more
> >> channels, around 12 I think including the radio ones, but I only ever
> >> record from 3 of them.  So I always have enough DVB-T tuners and
> >> enough virtual tuners on each DVB-T tuner so that there is no conflict
> >> possible.
> >> 
> >> So where is the conflict coming from?  The source of the non-existent
> >> conflict would seem to be the source of the problem.
> >
> >I told you exactly where the conflicts were, but you aparently refuse
> >to see them.  If you close your eyes, do you think you're invisible,
> >too?
> 
> Clearly I do not know what you mean by a conflict here then.  Sure,
> the scheduler is seeing a conflict - it is saying so.  But there is no
> actual conflict for me to relate that back to.  Since I have few clues
> about how the scheduler works, from the outside, it appears to me to
> be a bug.  If it is actually normal and expected behaviour from the
> scheduler to decide there is a conflict where there is not one (for
> reasons known only to the scheduler), then it would be helpful to know
> that is what it does.
> 
> >You seem to have the mistaken impression the scheduler will
> >automagically utitlize every tuner and multiplex like it's playing a
> >perfect game of tetris.  It doesn't work that way.  The scheduler
> >tries to balance many different goals using the priority hints given
> >to it.  It's not perfect, doesn't claim to be and never will be.
> >
> >David
> 
> Well, mostly the scheduler does seem to be able to automagically get
> everything right!  It does very well for me with the difficult job of
> scheduling my one S-Video input from my Sky set top box.  So when I am
> seeing it go wrong, if not badly, in the "easier" job of scheduling my
> DVB-T tuners where conflicts are impossible, I wonder why.  And since
> I am getting this problem quite repeatably every Thursday at the
> moment until one of the channels changes their schedule, surely it
> would be a good idea to use my setup to collect some information on
> where it is going wrong so that it might be possible to improve the
> scheduler.
> 
> As I said in my original post, the problem feels to me, as a person
> looking on from the outside with no knowledge of the internals of the
> scheduler, that it is hitting some sort of fixed limit, such as too
> many channels to schedule at once.  For example, maybe it is going
> around a loop N times and is unable to schedule in those N loops, so
> it declares a conflict and changes the conditions it is working on and
> then tries another N loops and succeeds, when if N was a bit bigger
> (to cope with more channels and/or more tuners), it might have been
> able to schedule properly on the first try.  Or maybe it is filling up
> a table and stopping when it is full.  Just some wild-ass guesses.
> 
> And if I am right and the problem is triggered by recording more
> things at once, as the number of channels being broadcast increases
> and people have more tuners, more people are likely to come up against
> this problem.
> 
> So, is there anything more I can do to get data that might illuminate
> the source of this problem?

I won't go into all of the details (it's all in the testsched output
if you want to see it), but here is what's happening at the high
level.

  +Bath Crashers                     12 ChoiceT 09 18:30-19:03  1 1 1  C 1 4/1
  +Police Ten 7                       2 TV2     09 19:30-20:03  1 1 1  C 1 4/1

Bath Crashers and Police Ten 7 have the relatively high priority of 4
and are scheduled on input 1.

  #Grand Designs Revisited            3 TV3     09 19:30-20:33  1 1 1  C - 4/1
     !Police Ten 7                    2 TV2     09 19:30-20:03  1 1 1  C 1 4/1
  +Grand Designs Revisited            3 TV3     09 19:30-20:33  1 5 5  C 5 4/5

Grand Designs Revisited also has priority 4, but comes later in the
scheduling order.  It conflicts with Police Ten 7 on inputs 1-4, so it
is scheduled on input 5.

  #Grand Designs Revisited            3 TV3     09 19:30-20:33  1 1 1  C - 4/1
     !Police Ten 7                    2 TV2     09 19:30-20:03  1 1 1  C 1 4/1
  #Great Rift: Africa's Wild - Hea   10 PRIME   09 19:30-20:33  1 5 5  C - 4/5
     !Grand Designs Revisited         3 TV3     09 19:30-20:33  1 5 5  C 5 4/5
  +Great Rift: Africa's Wild - Hea   10 PRIME   09 19:30-20:33  1 10 10  C 10 4/9

Great Rift: Africa's Wild also has priority 4, but it also comes later
int the scheduling order.  It conflicts with Police Ten 7 on inputs
1-4 and Grand Designs Revisited on inputs 5-8, so it is scheduled on
input 10.

  #Seven Sharp                        1 TV ONE  09 19:00-19:33  1 1 1  d - -3/1
     !Bath Crashers                  12 ChoiceT 09 18:30-19:03  1 1 1  C 1 4/1
  #Seven Sharp                        1 TV ONE  09 19:00-19:33  1 5 5  d - -3/5
     !Grand Designs Revisited         3 TV3     09 19:30-20:33  1 5 5  C 5 4/5
  #Seven Sharp                        1 TV ONE  09 19:00-19:33  1 10 10  d - -3/9
     !Great Rift: Africa's Wild -    10 PRIME   09 19:30-20:33  1 10 10  C 10 4/9

Seven Sharp has the relatively low priority of -4 and the attempt to
schedule it comes much later.  It conflicts with Bash Crashers on
input 1-4, Grand Designs Revisited revisited on inputs 5-8 and Great
Rift: Africa's Wild on inputs 10-13.

  /Seven Sharp                        1 TV ONE  09 19:00-19:33  1 13 13  d - -3/12
     >Great Rift: Africa's Wild -    10 PRIME   09 19:30-20:33  1 10 10  C 10 4/9
     %Great Rift: Africa's Wild -    10 PRIME   09 19:30-20:33  1 1 1  C L 4/1
        !Police Ten 7                 2 TV2     09 19:30-20:03  1 1 1  C 1 4/1
     %Great Rift: Africa's Wild -    10 PRIME   09 19:30-20:33  1 5 5  C L 4/5
        !Grand Designs Revisited      3 TV3     09 19:30-20:33  1 5 5  C 5 4/5

Attempts to move Great Rift: Africa's Wild from input 10 fail.

  /Seven Sharp                        1 TV ONE  09 19:00-19:33  1 8 8  d - -3/8
     >Grand Designs Revisited         3 TV3     09 19:30-20:33  1 5 5  C 5 4/5
     %Grand Designs Revisited         3 TV3     09 19:30-20:33  1 1 1  C L 4/1
        !Police Ten 7                 2 TV2     09 19:30-20:03  1 1 1  C 1 4/1
     %Grand Designs Revisited         3 TV3     09 19:30-20:33  1 10 10  C L 4/9
        !Great Rift: Africa's Wild   10 PRIME   09 19:30-20:33  1 10 10  C 10 4/9

Attempts to move %Grand Designs Revisited from input 5 fail.

  /Seven Sharp                        1 TV ONE  09 19:00-19:33  1 4 4  d - -3/4
     >Bath Crashers                  12 ChoiceT 09 18:30-19:03  1 1 1  C 1 4/1
     %Bath Crashers                  12 ChoiceT 09 18:30-19:03  1 5 5  C L 4/5
        !3 News                       3 TV3     09 18:00-19:03  1 5 5  T 5 -3/5
     %Bath Crashers                  12 ChoiceT 09 18:30-19:03  1 10 10  C L 4/9
        !One News At 6pm              1 TV ONE  09 18:00-19:03  1 10 10  d 10 -3/9

Attempts to move Bath Crashers from input 1 fail.

  ?Seven Sharp                        1 TV ONE  09 19:00-19:33  1 13 13  d - -3/12
     >Seven Sharp                     1 TV ONE  09 19:00-19:33  1 13 13  d - -3/12
     -Seven Sharp                     1 TV ONE  09 19:00-19:33  1 13 13  d L -3/12
     +Seven Sharp                     7 TVONE P 09 20:00-20:33  1 3 3  d 3 -4/3

At this point, the scheduler will look for any other showing of even
Sharp that can be scheduled before trying (slightly) harder to move
other programs.  It finds showing on TVONE PLUS1 is free and schedules
it.

Okay, so where does that leave you?  

Not counting start-early and end-late complications, you have enough
physical tuners to cover all of your channels and multiplexes.  That
is by far not the norm.  Most users have way more channels than
tuners.  They should use recording priorities to indicate importance
of programs so the most important programs always get scheduled and
the less important one get scheduled when possible.  You should
probably use recording priorities differently.  You can use recording
priorities to cause recordings on the same channels to try to use the
same tuners.  Here's one way to do that.

Say you have the following 3 multiplexes4 with 4 channels each:

  multiplex 1: channels 1a, 1b, 1c and 1d
  multiplex 2: channels 2a, 2b, 2c and 2d
  multiplex 3: channels 3a, 3b, 3c and 3d

Give them the following channel priorities:

  1a = 20, 1b = 19, 1c = 18, 1d = 17
  2a = 16, 2b = 15, 2c = 14, 2d = 13
  3a = 12, 3b = 11, 3c = 10, 3d = 9

Now, if you have 4 virtual tuners per physical tuner and set all of
your other priorities to 0 (and don't use start-early or end-late),
the scheduler will fill up all of your virtual tuners in the most
efficient way.  Note that the way things currently work, any use of
start-early or end-late could negatively affect that.  The only
solution to that right now is to add more virtual tuners.

David
-- 
David Engel
david at istwok.net


More information about the mythtv-users mailing list