[mythtvnz] MythTV 0.29 and HDHomeRun

Stephen Worthington stephen_agent at jsw.gen.nz
Wed Nov 1 07:30:49 GMT 2017


On Wed, 1 Nov 2017 18:32:28 +1300, you wrote:

>>
>> ---------- Forwarded message ----------
>> From: Mark van Dijk <mark.van.dijk.74 at gmail.com>
>> To: mythtvnz at lists.ourshack.com
>> Cc:
>> Bcc:
>> Date: Wed, 1 Nov 2017 11:15:31 +1300
>> Subject: [mythtvnz] MythTV 0.29 and HDHomeRun
>> Hi all, I have an issue with a brand new MythTV installation that i wonder
>> if anybody has seen before.  I've been using MythTV for many years on an
>> ancient AMD AthlonXP with MythBuntu 14.04 that is slowly dying, so thought
>> I would splash out and update to a nice modern setup.
>>
>> So we have:
>>   * new intel cpu, motherboard, ram
>>   * Ubuntu 17.10
>>   * MythTV 0.29
>>   * HDHomeRun Connect (NZ / AU dual tuner version)
>>
>> <SNIP>...
>>
>
>
>> Cheers
>> Mark
>>
>>
>
>Thanks Mike,   I now have more information.
>
>After removing mythtv and reinstalling, the HDHomeRun & LiveTV was working
>again.  I did nothing else - then i rebooted.  After the restart, the
>LiveTV stopped working again...
>
>Closer inspection of the backend log shows the following on startup just
>moments after the reboot:
>
>Nov  1 17:56:58 mythbox mythbackend: mythbackend[1045]: N CoreContext
>main_helpers.cpp:597 (run_backend) MythBackend: Starting up as the master
>server.
>Nov  1 17:56:58 mythbox mythbackend: mythbackend[1045]: E CoreContext
>recorders/hdhrstreamhandler.cpp:389 (Connect) HDHRSH(192.168.112.230-0): Unable
>to connect to device
>Nov  1 17:56:58 mythbox mythbackend: mythbackend[1045]: E CoreContext
>dtvmultiplex.cpp:379 (ParseTuningParams) DTVMux: ParseTuningParams --
>Unknown tuner type = 0xffffffff80000000
>Nov  1 17:56:58 mythbox mythbackend: mythbackend[1045]: E CoreContext
>recorders/dtvchannel.cpp:300 (SetChannelByString)
>DTVChan[1](192.168.112.230-0): SetChannelByString(1): Failed to initialize
>multiplex options
>Nov  1 17:56:58 mythbox mythbackend: mythbackend[1045]: E CoreContext
>recorders/hdhrstreamhandler.cpp:432 (TunerGet) HDHRSH(192.168.112.230-0): Get
>request failed#012#011#011#011eno: Network is unreachable (101)
>Nov  1 17:56:58 mythbox mythbackend: mythbackend[1045]: E CoreContext
>recorders/hdhrstreamhandler.cpp:471 (TunerSet) HDHRSH(192.168.112.230-0):
>Set request failed#012#011#011#011eno: Network is unreachable (101)
>
>
>I wonder if the backend might be staring up before the machine has
>established network connectivity?  Is there a standard way to delay startup
>of the backend?
>
>I'm unable to investigate further tonight.  Will try again later.
>
>Cheers

If you set up MythTV to use the external IP address of the PC (as you
do if you are using external frontends), then in v29 that problem
should go away.  I suspect that you are just using localhost
(127.0.0.1) to connect to the backend, and the localhost interface
comes up virtually instantly compared to the real interfaces like
Ethernet cards.  In 0.28 and before, if you used the external address
of the PC, then mythbackend could come up before it was ready and
would decided to drop back to using localhost.  In v29 that should
have been fixed and it will wait quite a long time for the specified
IP address to become available to bind to.

In 0.28 and before, the normal fix on Ubuntu with systemd was to
create a systemd override file for mythtv-backend.service to make it
wait for NetworkManager to be running.  NetworkManager normally only
signals it is running after the Ethernet interfaces are up.  There are
threads on the mythtv-users mailing list that tell you how to do that
- it is a bit involved.  But try just changing to using the external
IP address of the box first.

If mythbackend ever comes up before a tuner is ready, then it will
mark the tuner as unavailable and will not use it.  So if you have
tuners that are slow to come up, it can be a good idea to have a
systemd override file for mythtv-backend.service that tells it to wait
for those tuners before starting mythbackend.  I do not know of any
way to do that with HDHomerun tuners, so you will need to make sure
they are on and fully up before mythbackend gets started.  For
internal tuners, you create a /etc/udev/rules.d/99-tuner.rules file
containing this:

#
# Create systemd device units for capture devices
#
SUBSYSTEM=="video4linux", TAG+="systemd"
SUBSYSTEM=="dvb", TAG+="systemd"
SUBSYSTEM=="firewire", TAG+="systemd"

and then in your systemd override file you put things like this in the
[Unit] section:

Wants=dev-dvb-adapter0-frontend0.device
After=dev-dvb-adapter0-frontend0.device
Wants=dev-dvb-adapter1-frontend0.device
After=dev-dvb-adapter1-frontend0.device

A Wants line tells systemd that this unit wants that other unit
started.  An After line tells systemd to wait until that other unit
signals it is started before starting this unit.



More information about the mythtvnz mailing list