[mythtv-users] the right way to do tuner priority?
Stephen Worthington
stephen_agent at jsw.gen.nz
Mon Sep 29 15:07:27 UTC 2014
On Mon, 29 Sep 2014 09:44:57 -0400, you wrote:
>I know there has been much controversy in the past about how to properly
>assign tuner priorities and that historically, the only proper way to
>influence tuner scheduling choice was simply to add the tuners in the
>order that you want MythTV to use them. Additionally to that, I recall
>that there was a way that many people were trying to set tuner
>priorities but the reality is that it was not doing what they thought it
>was doing.
>
>But I also recall some discussion recently about how tuner priority was
>fixed so that one could actually set priorities on tuners and it would
>have the expected/desired effect. I don't recall the details however.
>
>What I am trying to fix is that in a given (2h1m) timeslot this evening,
>I have a recording occurring on a digital (clearqam) tuner on a given
>sub-channel on a given multiplex (channel "102", subchannel "936") and
>then 30 minutes into that recording, there is another show on the same
>digtial channel, different subchannel that I want to record. But rather
>than using that same digital tuner, the scheduler is scheduling it to
>record on a completely different, analog tuner.
>
>I.e.:
>
>2014-09-29 00:00:03.853011 I Dancing With the Stars 102-936 WWTI 29 20:00-22:01 2 1 1 A 1 0
>2014-09-29 00:00:03.853247 I Mom - Hepatitis and Lemon Zest 7 WWNY 29 20:31-21:00 1 12 12 A 12 0/-3
>
>Where "WWNY" also exists on 102-77.
>
>In fact, there are other less-than-satisfactory scheduling decisions
>being made in that same time-slot:
>
>2014-09-29 00:00:03.853554 I Scorpion - Single Point of Failure 100-7 CITY 29 21:00-21:59 2 8 8 A 8 0
>
>is also being shown on WWNY at 21:01-21:59 (so starting a minute later
>than the above scheduled recording).
>
>Ahhh. But one thing worth noting is that WWNY, on both analog and
>digital have a channel priority of -10, where every other channel's
>priority is at 0. The reason for the -10 is that that is CBS and they
>are horrible at keeping to their schedule on Sunday evenings.
>
>TBH, I really only want them de-prioritized on Sunday evenings and not
>really all of the time, but MythTV can't handle that. Not without some
>external database fiddling at least.
>
>So maybe the -10 on WWNY explains the Scorpion issue above, but it still
>doesn't explain why "Mom" was scheduled to record on a separate analog
>tuner when a digital multiplex was already being used at the same time.
>
>And no, I am not maxed out on virtual tuners at that time.
>
>Cheers,
>b.
The first thing you might like to consider is assigning priorities to
the digital tuners over the analogue ones. I have all my DVB-T tuners
where I get higher quality H.264 transmissions set to recpriority 4 in
the cardinput table. My DVB-S tuners (lower quality MPEG2) are all
set to recpriority -5. So when a channels is available on both DVB-T
and DVB-S (as many are), it will record from DVB-T instead of DVB-S.
However, the scheduler is a very complex beast, and while it works
pretty well most of the time, it is not perfect. I still have
problems at times with its handling of the multirec tuners. It can be
recording from one channel on a DVB-T multiplex, but then start using
another physical tuner for the same multiplex, which causes it to then
run out of physical tuners when there was no need to. That seems to
be the same problem you are running into. To fix that, I have these
entries in the powerpriority table (Custom Priorities menu), as
suggested by one of the devs:
mysql> select * from powerpriority;
+----------------------+-------------+-------------------------------------------------------+
| priorityname | recpriority | selectclause |
+----------------------+-------------+-------------------------------------------------------+
| TVNZ multiplex | 20 | channel.mplexid=2 and cardinputid in (1,2,3,4,5) |
| Mediaworks multiplex | 20 | channel.mplexid=3 and cardinputid in (11,12,13,14,15) |
| Kordia multiplex | 20 | channel.mplexid=4 and cardinputid in (6,7,8,9,10) |
+----------------------+-------------+-------------------------------------------------------+
3 rows in set (0.01 sec)
What those rules do is tell the scheduler to give any recording it is
looking at a priority boost of 20 if it matches one of the
selectclause values. So any recording from a channel on the TVNZ
multiplex gets a boost of 20 when it is on any of the virtual tuners
1-5 (the virtual tuners of my first physical DVB-T tuner). And since
that boost priority is bigger than the sum of all the other priorities
for a recording combined, it makes the scheduler always put TVNZ
multiplex recordings on the first DVB-T tuner. Similarly, all
Mediaworks multiplex recordings go on the second DVB-T tuner, and all
Kordia multiplex recordings on the third DVB-T tuner. Any recording
from the one other multiplex that was added here recently will go on
any available tuner, but since I never record from any of those
channels, that is not a problem.
You can put arbitrarily complex SQL clauses in the powerpriority
table. So if you want to, you could write one that deprioritised
certain channels at for certain parts of the week. I suspect that if
you have too many powerpriority rules, or ones that take lots of
resources to calculate, you could wind up making the scheduler run
very slowly. But it does not hurt to experiment at times you are not
recording and see what the results would be.
More information about the mythtv-users
mailing list