<div dir="auto">Amazing, thanks. </div><br><div class="gmail_quote"><div dir="ltr">On Sun, Sep 30, 2018, 5:43 PM Gary Buhrmaster, <<a href="mailto:gary.buhrmaster@gmail.com">gary.buhrmaster@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My (work in progress) instructions.<br>
<br>
Use of the HDHR Premium TV service with MythTV.pdf<br>
    <a href="https://drive.google.com/file/d/19wChqgPjPtt5tw7seUl-zySe-HrH6cJV/view?usp=sharing" rel="noreferrer noreferrer" target="_blank">https://drive.google.com/file/d/19wChqgPjPtt5tw7seUl-zySe-HrH6cJV/view?usp=sharing</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
The PDF (above) looks/reads better, but here is the text in<br>
the case you do not have access to a PDF viewer app<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
Use of the HDHR Premium TV service with MythTV<br>
<br>
<br>
Caveats:<br>
<br>
<br>
As with everything MythTV related, this is all just a work in<br>
progress, with no guarantees, by just another community member.  This<br>
process worked for me when I started it a few weeks ago, but there is<br>
no way to anticipate all the specialness that is the community (i.e.<br>
caveat emptor), nor changes by others.  There is an old joke that the<br>
presentation is never finished, it just escapes to the screen.<br>
Consider these notes as having escaped.<br>
<br>
Advanced users will almost certainly want to do things differently<br>
than described below (I know I do things differently on my production<br>
system) including changing the locations of the scripts and changing<br>
the MythTV users PATH, and even automating service updates, but those<br>
advanced users should be able to translate to their environment.  And<br>
please share improved documentation (perhaps on that wiki page someone<br>
will create).<br>
<br>
I highly recommend testing these instructions in a test/development<br>
environment.  While the steps provide some methods to fall back to<br>
what was working before, there are no assurances it may not result in<br>
some breakage (and if you break it, you own it).<br>
<br>
Given that the SiliconDust HDHR Premium TV service is new I would<br>
recommend you either join, or at least quite regularly review, the<br>
SIliconDust forums where the service is discussed (there is a topic<br>
area which announces service issues (yes, as a new offering, there<br>
have been some operational service issues) that you can subscribe to<br>
if you wish to receive notifications).<br>
<br>
This example presumes you have an OTA tuner which you which to share<br>
with the HDHR Premium TV service (i.e. continue to use for OTA<br>
channels and get access to the HDHR premium channels).  If you use a<br>
dedicated tuner for the HDHR Premium service you could simplify a lot<br>
of the work below (left as an exercise to the reader).<br>
<br>
The HDHR OTA tuner(s) and the MythTV BE must exist on the same logical<br>
network (for detection purposes), and the HDHR tuners must have access<br>
to the Internet for both streaming and authorization (so you may need<br>
to adjust any firewall settings). and all must share the same external<br>
address for device association and SiliconDust account validation<br>
purposes.  Most residential networks using a gateway/router for IPv4<br>
with an internal vLAN and using NAT for their external IPv4 address<br>
will meet this requirement.<br>
<br>
As part of this process you will migrate to using guide data from<br>
Schedules Direct using the SD-JSON API and using MythTVs XMLTV guide<br>
data import process (the legacy “DataDirect” download does not support<br>
some of the required newer capabilities).  There are other (much more<br>
detailed/extensive) posts on this list about doing this conversion,<br>
and some of the changes one will experience. I would suggest it would<br>
be prudent to review those posts. In particular, migration may result<br>
in some changes in matching of programs for recording, or duplicate<br>
detection,  and because this will be a new videosource, various<br>
advanced recording rules such as “this channel” may need to be<br>
adjusted. You should carefully review your recording rules at the end<br>
of the process to insure they are producing the results you desire.<br>
<br>
MythTV's native use of the HDHR tuners does not share (i.e. use<br>
locking) with other apps using the HDHR tuners, nor provide pooling of<br>
the available tuners, nor use the TCP transport protocol, all of which<br>
I consider valuable in my environment which includes other solutions<br>
occasionally attempting to use the tuners.  The HDHR Premium TV<br>
service also requires tuning by virtual channel. The existing MythTV<br>
code has support for tuning by virtual channel for the HDHR devices<br>
(initially for CableCARD devices?), but it does not support the entire<br>
newer set of API functions. This set of instructions/steps converts<br>
your use of your gen 4 or 5 HDHR OTA tuners to using an MythTV<br>
EXTERNAL recorder that provides sharing, pooling, and transport<br>
changes, and uses virtual tuning.  Use of virtual tuning (regardless<br>
of application) does mean that an OTA tuner can be used for only one<br>
channel at a time (it cannot be used to tune/receive two stations that<br>
share a mux (for example, recording CBS and Decades at the same time<br>
using only one tuner)).<br>
<br>
The MythTV project devs have suggested that they want to better<br>
support the HDHR Premium TV service.  When that work is occurs, you<br>
should expect (that you will want) to toss all these instructions and<br>
migrate to the better integrated and documented solutions.  Most<br>
importantly because anything regarding the scripts documented here<br>
that has been integrated will probably enter EoS after any such<br>
release (there is no desire on my part to maintain code that has been<br>
supplemented by improved solutions directly from the developers).<br>
<br>
The steps will result in you not using any current packaged versions<br>
of a number of (git cloned) source files (the upstream sources have<br>
been revised in some cases to support new or improved capabilities,<br>
and not yet repackaged, or were never packaged by anyone in the first<br>
place), so you will need to regularly remember to 'git pull' to get<br>
the most recent fixes/updates (until/unless the project ships the<br>
new/improved functionality and you migrate to it, or (in the case of<br>
XMLTV) your packager starts to ship updated versions).<br>
<br>
While I will try to review specific reports posted to the mythtv-users<br>
email list, it would be useful for others to test, and if it works for<br>
you to state that, and if it doesn't, please state that too, with as<br>
much detail as possible.  Please do consider testing and respond<br>
early, as my ability to test is time limited (I will not be renewing<br>
my subscription to the service as I only subscribed in the first place<br>
to improve the scripts and to test).<br>
<br>
For the reason mentioned above, I would encourage some interested<br>
party with ongoing interest to take ownership of these instructions<br>
(and perhaps place them on the wiki when they are appropriately<br>
tested/validated/improved, and have been wiki’fied).<br>
<br>
<br>
<br>
Prereqs to MythTV configuration/setup:<br>
<br>
<br>
These instructions presume you already have a working MythTV<br>
environment.  If not, follow the docs for that.<br>
<br>
You will need a 4th or 5th generation HDHR OTA tuner that supports the<br>
modern tuning methods.  Earlier gen devices are not supported for the<br>
new tuning methods by SiliconDust for the HDHR Premium TV service.<br>
<br>
The HDHR tuner will need to have the most recent firmware (20180817 as<br>
of this writing).  Since this is a new service, I would expect you<br>
will need to track newer firmware (which would typically be announced<br>
on the SiliconDust forums).  Note that the newer firmware supports the<br>
ability to upgrade the firmware directly from the device itself off<br>
the “System Status” web page if new versions are released.<br>
<br>
You will need to be subscribing the the Schedules Direct guide service<br>
as the guide data for the HDHR Premium TV service is only known to be<br>
available from them at this time.<br>
<br>
You will need to subscribe to the SiliconDust HDHR Premium TV service.<br>
Part of the process will be to associate your tuner(s) with your<br>
account (follow the SiliconDust instructions for all of that).  After<br>
you subscribe and associate your tuner, the tuner needs to see the<br>
subscription, which it will do when it calls home next, which may be<br>
up to eight hours from now, but a restart of the tuner forces it to<br>
call home now (power cycle or cli: hdhomerun_config <ip> set<br>
/sys/restart self).  You likely should go to <a href="http://my.hdhomerun.com" rel="noreferrer noreferrer" target="_blank">http://my.hdhomerun.com</a><br>
to look at the tuners that SiliconDust believes are available on your<br>
local network (it also provides a link to get to the tuner if you are<br>
using non-stable DHCP addressing).  I believe it has been reported<br>
that the Microsoft (Edge and/or IE) browsers do not reliably work with<br>
that url (if you are primarily use Windows).<br>
<br>
You will have to run a "Channel Listing/Detect Channels" scan on the<br>
device itself (the tuners web page) to obtain a new list of channels<br>
(OTA and the Premium channels) so that the tuner knows what it can<br>
tune, and how to do that tuning.  Review the list to make sure all the<br>
OTA channels you believe you should get are there (if not, first try<br>
another scan. If the signal is marginal sometimes it will miss a<br>
channel (or two)).<br>
<br>
To obtain guide data you will need an XMLTV grabber that supports the<br>
Schedules Direct SD JSON API.  All these docs presume you will be<br>
using tv_grab_zz_sdjson_sqlite. XMLTV itself has not made a release<br>
with the latest code, and while some packagers might repackage master,<br>
many do not.  To obtain the latest you will need to issue (in your<br>
/home/mythtv directory)<br>
<br>
<br>
git clone <a href="https://github.com/garybuhrmaster/tv_grab_zz_sdjson_sqlite.git" rel="noreferrer noreferrer" target="_blank">https://github.com/garybuhrmaster/tv_grab_zz_sdjson_sqlite.git</a>)<br>
<br>
<br>
Typically, you should first install your distros xmltv-grabber<br>
package, which will pull in the appropriate dependencies, for there<br>
are many that the entire xmltv ecosystem requires. If your distros<br>
xmltv version has not been recently repackaged you may need to<br>
manually install the following perl dependencies: File-Which,<br>
File-HomeDir, JSON-XS, DateTime-Format-SQLite, List-MoreUtils-XS,<br>
Exporter-Tiny, List-MoreUtils, DBD-SQLite, LWP-UserAgent-Determined,<br>
Time-HiRes.  Test to insure you have all the prerequisites by running<br>
/home/mythtv/tv_grab_zz_sdjson_sqlite/tv_grab_zz_sdjson_sqlite --help<br>
to get help information.<br>
<br>
You will need the latest mythhdhrrecorder external recorder upstream<br>
version.  To obtain the latest you will need to issue (in your<br>
/home/mythtv directory)<br>
<br>
<br>
git clone <a href="https://github.com/garybuhrmaster/mythhdhrrecorder.git" rel="noreferrer noreferrer" target="_blank">https://github.com/garybuhrmaster/mythhdhrrecorder.git</a><br>
<br>
<br>
This external recorder is documented in the MythTV wiki at:<br>
<a href="https://www.mythtv.org/wiki/Mythhdhrrecorder" rel="noreferrer noreferrer" target="_blank">https://www.mythtv.org/wiki/Mythhdhrrecorder</a>.  You may need to install<br>
the python3 requirements which can include: sys, threading, time,<br>
requests, json, re, queue, argparse, socket, inspect, os, io,<br>
datetime, syslog, systemd.journal, natsort.  Test to insure you have<br>
all the prerequisites by running:<br>
/home/mythtv/mythhdhrrecorder/mythhdhrrecorder --help to get help<br>
information.<br>
<br>
You will need the latest upstream MythUtil utility set.  To obtain the<br>
latest you will need to issue (in your /home/mythtv directory)<br>
<br>
<br>
git clone <a href="https://github.com/garybuhrmaster/MythUtil.git" rel="noreferrer noreferrer" target="_blank">https://github.com/garybuhrmaster/MythUtil.git</a><br>
<br>
<br>
The individual scripts have wiki pages at:<br>
<a href="https://www.mythtv.org/wiki/MythUtil-Channel-XMLTV-getLineup" rel="noreferrer noreferrer" target="_blank">https://www.mythtv.org/wiki/MythUtil-Channel-XMLTV-getLineup</a><br>
<a href="https://www.mythtv.org/wiki/MythUtil-Channel-videosource" rel="noreferrer noreferrer" target="_blank">https://www.mythtv.org/wiki/MythUtil-Channel-videosource</a><br>
<a href="https://www.mythtv.org/wiki/MythUtil-Channel-HDHR-channelCheck" rel="noreferrer noreferrer" target="_blank">https://www.mythtv.org/wiki/MythUtil-Channel-HDHR-channelCheck</a><br>
<a href="https://www.mythtv.org/wiki/MythUtil-Channel-HDHR-visibilityCheck" rel="noreferrer noreferrer" target="_blank">https://www.mythtv.org/wiki/MythUtil-Channel-HDHR-visibilityCheck</a> and<br>
<a href="https://www.mythtv.org/wiki/MythUtil-Channel-visibility" rel="noreferrer noreferrer" target="_blank">https://www.mythtv.org/wiki/MythUtil-Channel-visibility</a>.  These<br>
scripts (too) have many python dependencies.  As the important one<br>
with the most dependencies is the ..getLineup one, test to insure you<br>
have all the prerequisites by running:<br>
/home/mythtv/MythUtil/MythUtil-Channgel-XMLTV-getLineup --help to get<br>
help information and install any missing dependencies.<br>
<br>
MythTV configuration/setup steps (simplified, this is not a MythTV<br>
tutorial, but intended for those with familiarity to the program):<br>
Most of the steps are one-time only (except for the part about<br>
enjoying your<br>
<br>
hard work).<br>
<br>
<br>
Note: it is presumed that you will be performing all these steps in<br>
your /home/mythtv directory, and you performed the git clones steps<br>
from above in that directory (you will need to adjust accordingly if<br>
the programs/files are elsewhere).<br>
<br>
<br>
First, run mythtv-setup and delete the input connection  between your<br>
(existing) HDHR tuner and your videosource. This should preserve the<br>
majority of your configuration so you can fairly easily revert to it<br>
by simply adding the input connection (and deleting the input<br>
connection we will create below).<br>
<br>
Add the lineups to your Schedules Direct (SDJSON) account.  All on one<br>
command line:<br>
<br>
<br>
/home/mythtv/tv_grab_zz_sdjson_sqlite/tv_grab_zz_sdjson_sqlite --manage-lineups<br>
<br>
<br>
select "Add Lineup", via the (guided) prompts select your location,<br>
and add in your OTA lineup<br>
<br>
select "Add Lineup", via the (guided) prompts select your location,<br>
and add in the HDHR Premium TV lineup which is either<br>
USA-0000001-CUSTOM for the east coast feed or USA-0000002-CUSTOM for<br>
the west coast feed.  Which one you need to choose depends on your<br>
zipcode, as SiliconDust assigns your location based on your<br>
registration with them and you get that feed. There is no option to<br>
get both feeds. If you think your location should get the east coast<br>
feed, or the west coast feed (i.e. you are in the middle of the<br>
country and you disagree with SiliconDust's choices), you need to work<br>
with them directly.<br>
<br>
(if not already done so sometime in the past) select "Initialize DB"<br>
(typically using the defaults)<br>
<br>
exit from manage lineups<br>
<br>
Add the external recorder to your MythTV system mythtv-setup, add new<br>
capture card, external (blackbox).  The path should be:<br>
<br>
<br>
/home/mythtv/mythhdhrrecorder/mythhdhrrecorder --devicename 0<br>
<br>
<br>
For the confident, create another external recorder with the same<br>
path, changing the --devicename to be 1 (each external recorder must<br>
have a unique --devicename due to a different artifact in the recorder<br>
and MythTV).  One recorder per active recording will be required, so<br>
if you have one HDHR 2-tuner device, you need two external recorders,<br>
if you have two 2-tuner devices, you need four.<br>
<br>
Add a new videosource named HDHRPremium with the grabber  "No Grabber"<br>
(this is an artifact of needing to start the BE laster)<br>
<br>
Connect your new External Recorder(s) to the videosource HDHRPremium<br>
<br>
Configure the grabber (this can be done within mythtv-setup under some<br>
scenarios, but we do it here, now, to allow some validation and<br>
testing).  All on one line command line:<br>
<br>
<br>
/home/mythtv/tv_grab_zz_sdjson_sqlite//tv_grab_zz_sdjson_sqlite<br>
--config-file /home/mythtv/.mythtv/HDHRPremium.xmltv --configure<br>
<br>
<br>
select the default database location (unless set differently during<br>
the initialize DB function).<br>
<br>
select your OTA and HDHR Premium lineups as "yes" to be included (and<br>
no for anything else).<br>
<br>
(typically) enable MythTV categories<br>
<br>
Test the the grabber by doing a download only (you should see the<br>
progress, and not get any errors).  All on one command line:<br>
<br>
<br>
/home/mythtv/tv_grab_zz_sdjson_sqlite/tv_grab_zz_sdjson_sqlite<br>
--config-file /home/mythtv/.mythtv/HDHRPremium.xmltv --download-only<br>
<br>
Make sure your backend is running (the following steps use the<br>
Services API, which requires a running BE).<br>
<br>
Adjust the video source for your new grabber, and configure it.  While<br>
using mythtv-setup is possible, because the cloned repo may make it<br>
hard to select the grabber (depending on how your set up your paths),<br>
we will use an alternative method (this will not be required when<br>
xmltv updates their packages and the distros repackage the<br>
grabber(s)).  All on one command line:<br>
<br>
<br>
/home/mythtv/MythUtil/MythUtil-Channel-videosource --backend<br>
<your_backend> --update --videosource-name "HDHRPremium" --grabber<br>
/home/mythtv/tv_grab_zz_sdjson_sqlite//tv_grab_zz_sdjson_sqlite<br>
--config /home/mythtv/.mythtv/HDHRPremium.xmltv<br>
<br>
Add the channels to your lineup.  Unfortunately, when mixing OTA and<br>
HDHR Premium TV lineups mythfilldatabase currently presumes ATSC<br>
channel numbers are scannable and not auto-added, which they are not<br>
in this virtual channel environment.  Instead we do the following all<br>
on one command line:<br>
<br>
<br>
/home/mythtv/tv_grab_zz_sdjson_sqlite/tv_grab_zz_sdjson_sqlite -q<br>
--get-lineup --config-file ~/.mythtv/HDHRPremium.xmltv |<br>
/home/mythtv/MythUtil/MythUtil-Channel-XMLTV-getLineup --backend<br>
<your_backend> --videosource-name "HDHRPremium" --add<br>
<br>
<br>
This command needs only to be done when your local OTA channels or the<br>
HDHR Premium TV service changes their lineup.  In some locations the<br>
FCC repack may delete, add, or rearrange channels. At this time<br>
SiliconDust has not indicated that they have any current plans to<br>
change their lineup, but it is prudent to watch for changes.<br>
<br>
Run mythfilldatabase and review its output.  There should be no<br>
significant errors reported (if your OTA lineup has duplicated<br>
channels, and if you have local translators you may get some unknown<br>
xmltvid messages, and this could be "normal").  This may take in<br>
excess of 30 minutes just for the new videosource, especially for a<br>
first run as there is a lot of new guide data to add. Also note that<br>
this will take around 2GB of memory due to the way mythfilldatabase<br>
operates (anyone who wants to refactor that code to do so would likely<br>
be thanked by many).  If your system is very memory constrained, plan<br>
to run mythfilldatabase with --no-allatonce and --refresh-all options<br>
(which can be set in mythtv-setup).<br>
<br>
You may want to go into the mythtv-setup channel editor (or mythweb)<br>
to set some channels as invisible (especially if your OTA reception is<br>
spotty, and the Scheduled Direct channel list is different from what<br>
you can actually receive (note that DX’ers may need to combine even<br>
more OTA lineups, beyond the scope of this set of instructions).<br>
<br>
Test the new guide and HDHR Premium TV channels (and try a test<br>
recording, perhaps of a classic movie on TCM?).  LiveTV has worked in<br>
a simple test case, but since I almost never use LiveTV, its testing<br>
is very limited.<br>
_______________________________________________<br>
mythtv-users mailing list<br>
<a href="mailto:mythtv-users@mythtv.org" target="_blank" rel="noreferrer">mythtv-users@mythtv.org</a><br>
<a href="http://lists.mythtv.org/mailman/listinfo/mythtv-users" rel="noreferrer noreferrer" target="_blank">http://lists.mythtv.org/mailman/listinfo/mythtv-users</a><br>
<a href="http://wiki.mythtv.org/Mailing_List_etiquette" rel="noreferrer noreferrer" target="_blank">http://wiki.mythtv.org/Mailing_List_etiquette</a><br>
MythTV Forums: <a href="https://forum.mythtv.org" rel="noreferrer noreferrer" target="_blank">https://forum.mythtv.org</a><br>
</blockquote></div>