Mailing List Archive

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)

Software cleanly installed. Mythbackend setup seems to go well. Added one
capture cards (tuners 0 on the HDHomeRun). Added video source, connected
them up in the 'Input Connections', scanned for channels. All ok at this
point, so i start up MythFrontend and view LiveTV. It works first time
(yay).

Now the issue. I stopped the frontend, went into the backend setup and
added the second HDHomeRun tuner. A quick reboot later for some updates,
and now Live TV no longer works. I get the following error in the backend
log:

Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I ProcessRequest
mainserver.cpp:1738 (HandleAnnounce) MainServer: MainServer::ANN Playback
Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I ProcessRequest
mainserver.cpp:1743 (HandleAnnounce) MainServer: adding:
mythbox(55755a9a0fc0) as a client (events: 0)
Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I TVRecEvent
tv_rec.cpp:1088 (HandleStateChange) TVRec[1]: Changing from None to
WatchingLiveTV
Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I TVRecEvent
tv_rec.cpp:3704 (TuningFrequency) TVRec[1]: TuningFrequency
Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: E TVRecEvent
dtvmultiplex.cpp:379 (ParseTuningParams) DTVMux: ParseTuningParams -- Unknown
tuner type = 0xffffffff80000000
Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: E TVRecEvent
recorders/dtvchannel.cpp:300 (SetChannelByString) DTVChan[1](12332F08-0):
SetChannelByString(1): Failed to initialize multiplex options
Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: E TVRecEvent
tv_rec.cpp:3782 (TuningFrequency) TVRec[1]: Failed to set channel to 1.
Reverting to kState_None
Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I TVRecEvent
tv_rec.cpp:1088 (HandleStateChange) TVRec[1]: Changing from WatchingLiveTV
to None
Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I
MythSocketThread(51) mainserver.cpp:7643 (connectionClosed) Playback
sock(55755a9a0fc0) 'mythbox' disconnected


ok - so I've now gone into the backend MANY times and fiddled with the
capture settings. Deleted and reinstalled the capture cards. Delete and
reinstalled the video source, inputs, and channels. updated software,
rebooted machine. Nothing works. I'm at a loss... No matter what I do,
the error is always the same - *Unknown tuner type = 0xffffffff80000000*.
Database repair via MythWeb shows no issues. Note that that I can
successfully SCAN for channels - this always works fine. It is just live
TV. I'm not trying to use multi-rec at the moment, so number of virtual
tuners is set to '1'.


I wondered if it was the HDHomeRun itself, so I tried adding the HDHomeRun
to that ancient Athlon mythbox I mentioned above. But it works just fine -
no issues at all... So its not the HDHomeRun.

I'm wondering if there is a regression in MythTV 0.29 that prevents it from
working with HDHomeRuns ? Anyone seen something like this before? Is
anyone successfully using HDHomeRun with MythTV 0.29?

Cheers
Mark
Re: MythTV 0.29 and HDHomeRun [ In reply to ]
I am running 2x HDHomeRun Connects on MythTV 0.29 without any problems.
At least none that I am aware of.

My Myth backend is KVM VM running Fedora 26. The VM isn't new and has
been through multiple Fedora and MythTV upgrades. Each HDHomeRun tuner
is configured with the maximum 5 encoders (so 20 total) and does
multiple recordings and livetv simultaneously no problem.

On 2017-11-01 11:15, Mark van Dijk wrote:

> 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)
>
> Software cleanly installed. Mythbackend setup seems to go well. Added one capture cards (tuners 0 on the HDHomeRun). Added video source, connected them up in the 'Input Connections', scanned for channels. All ok at this point, so i start up MythFrontend and view LiveTV. It works first time (yay).
>
> Now the issue. I stopped the frontend, went into the backend setup and added the second HDHomeRun tuner. A quick reboot later for some updates, and now Live TV no longer works. I get the following error in the backend log:
>
> Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I ProcessRequest mainserver.cpp:1738 (HandleAnnounce) MainServer: MainServer::ANN Playback
> Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I ProcessRequest mainserver.cpp:1743 (HandleAnnounce) MainServer: adding: mythbox(55755a9a0fc0) as a client (events: 0)
> Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I TVRecEvent tv_rec.cpp:1088 (HandleStateChange) TVRec[1]: Changing from None to WatchingLiveTV
> Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I TVRecEvent tv_rec.cpp:3704 (TuningFrequency) TVRec[1]: TuningFrequency
> Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: E TVRecEvent dtvmultiplex.cpp:379 (ParseTuningParams) DTVMux: ParseTuningParams -- Unknown tuner type = 0xffffffff80000000
> Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: E TVRecEvent recorders/dtvchannel.cpp:300 (SetChannelByString) DTVChan[1](12332F08-0): SetChannelByString(1): Failed to initialize multiplex options
> Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: E TVRecEvent tv_rec.cpp:3782 (TuningFrequency) TVRec[1]: Failed to set channel to 1. Reverting to kState_None
> Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I TVRecEvent tv_rec.cpp:1088 (HandleStateChange) TVRec[1]: Changing from WatchingLiveTV to None
> Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I MythSocketThread(51) mainserver.cpp:7643 (connectionClosed) Playback sock(55755a9a0fc0) 'mythbox' disconnected
>
> ok - so I've now gone into the backend MANY times and fiddled with the capture settings. Deleted and reinstalled the capture cards. Delete and reinstalled the video source, inputs, and channels. updated software, rebooted machine. Nothing works. I'm at a loss... No matter what I do, the error is always the same - UNKNOWN TUNER TYPE = 0XFFFFFFFF80000000. Database repair via MythWeb shows no issues. Note that that I can successfully SCAN for channels - this always works fine. It is just live TV. I'm not trying to use multi-rec at the moment, so number of virtual tuners is set to '1'.
>
> I wondered if it was the HDHomeRun itself, so I tried adding the HDHomeRun to that ancient Athlon mythbox I mentioned above. But it works just fine - no issues at all... So its not the HDHomeRun.
>
> I'm wondering if there is a regression in MythTV 0.29 that prevents it from working with HDHomeRuns ? Anyone seen something like this before? Is anyone successfully using HDHomeRun with MythTV 0.29?
>
> Cheers
> Mark
> _______________________________________________
> mythtvnz mailing list
> mythtvnz@lists.ourshack.com
> https://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: MythTV 0.29 and HDHomeRun [ In reply to ]
On Wed, 1 Nov 2017 11:15:31 +1300, you wrote:

>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)
>
>Software cleanly installed. Mythbackend setup seems to go well. Added one
>capture cards (tuners 0 on the HDHomeRun). Added video source, connected
>them up in the 'Input Connections', scanned for channels. All ok at this
>point, so i start up MythFrontend and view LiveTV. It works first time
>(yay).
>
>Now the issue. I stopped the frontend, went into the backend setup and
>added the second HDHomeRun tuner. A quick reboot later for some updates,
>and now Live TV no longer works. I get the following error in the backend
>log:
>
>Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I ProcessRequest
>mainserver.cpp:1738 (HandleAnnounce) MainServer: MainServer::ANN Playback
>Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I ProcessRequest
>mainserver.cpp:1743 (HandleAnnounce) MainServer: adding:
>mythbox(55755a9a0fc0) as a client (events: 0)
>Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I TVRecEvent
>tv_rec.cpp:1088 (HandleStateChange) TVRec[1]: Changing from None to
>WatchingLiveTV
>Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I TVRecEvent
>tv_rec.cpp:3704 (TuningFrequency) TVRec[1]: TuningFrequency
>Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: E TVRecEvent
>dtvmultiplex.cpp:379 (ParseTuningParams) DTVMux: ParseTuningParams -- Unknown
>tuner type = 0xffffffff80000000
>Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: E TVRecEvent
>recorders/dtvchannel.cpp:300 (SetChannelByString) DTVChan[1](12332F08-0):
>SetChannelByString(1): Failed to initialize multiplex options
>Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: E TVRecEvent
>tv_rec.cpp:3782 (TuningFrequency) TVRec[1]: Failed to set channel to 1.
>Reverting to kState_None
>Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I TVRecEvent
>tv_rec.cpp:1088 (HandleStateChange) TVRec[1]: Changing from WatchingLiveTV
>to None
>Nov 1 07:40:03 mythbox mythbackend: mythbackend[1050]: I
>MythSocketThread(51) mainserver.cpp:7643 (connectionClosed) Playback
>sock(55755a9a0fc0) 'mythbox' disconnected
>
>
>ok - so I've now gone into the backend MANY times and fiddled with the
>capture settings. Deleted and reinstalled the capture cards. Delete and
>reinstalled the video source, inputs, and channels. updated software,
>rebooted machine. Nothing works. I'm at a loss... No matter what I do,
>the error is always the same - *Unknown tuner type = 0xffffffff80000000*.
>Database repair via MythWeb shows no issues. Note that that I can
>successfully SCAN for channels - this always works fine. It is just live
>TV. I'm not trying to use multi-rec at the moment, so number of virtual
>tuners is set to '1'.
>
>
>I wondered if it was the HDHomeRun itself, so I tried adding the HDHomeRun
>to that ancient Athlon mythbox I mentioned above. But it works just fine -
>no issues at all... So its not the HDHomeRun.
>
>I'm wondering if there is a regression in MythTV 0.29 that prevents it from
>working with HDHomeRuns ? Anyone seen something like this before? Is
>anyone successfully using HDHomeRun with MythTV 0.29?
>
>Cheers
>Mark

If you shut down and restart mythbackend, does it work?

The reason I ask is that when you boot modern hardware with a systemd
operating system and ssd boot drive, mythbackend can be started before
the network is up. With v29, that should not matter as it should wait
for the network automatically, but I have not tested that yet. In
0.28 and before, it was a common problem.

Have you checked that scanning works on both tuners of the HDHomerun?
If you have set up Live TV the way the Wiki recommends, it will be set
to use the second tuner by preference, whereas recordings will use the
first tuner preferentially.

I have not actually used HDHomeruns myself, but I have helped someone
else to set up a system using one. Have you set the tuning timeouts?
When I was helping to set up the HDHomeruns, we found that the default
timeouts were rather too short, and scanning was missing several muxes
from Waiatarua. When we set the signal timeout to 10000 (10 seconds)
and the tuning timeout to 30000 (30 seconds), scanning worked
properly. The long signal timeout allows the tuner to tune to the
correct frequency. The long tuning timeout allows tuning of Three to
work - it seems badly set up and it takes ages longer to find all the
streams for the channel than for any other channel.

You might like to try turning on some more log output. In the
/etc/mythtv directory, create a file named additional.args. Make it
owner and user mythtv. The systemd unit that starts mythbackend
(/lib/systemd/system/mythtv-backend.service) reads this file if it
exists and treats it contents as environment variables. It then uses
a $ADDITIONAL_ARGS environment variable on its command line, so you
can set the value of that variable to add things to the mythbackend
command line. This is what I have in mine:

root@mypvr:/etc/mythtv# cat additional.args
#ADDITIONAL_ARGS=-v all --loglevel debug
ADDITIONAL_ARGS=-v record,dvbcam

In your case, I would recommend using "-v record", although if that is
not sufficient, you could try the "-v all --loglevel debug" line I
have commented out as that gives just about all possible debug output.
It slows down mythbackend though, which can cause the timing of things
to change and that can cause timing dependent problems to go away.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: MythTV 0.29 and HDHomeRun [ In reply to ]
>
> ---------- Forwarded message ----------
> From: Mark van Dijk <mark.van.dijk.74@gmail.com>
> To: mythtvnz@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
Re: MythTV 0.29 and HDHomeRun [ In reply to ]
On Wed, 1 Nov 2017 18:32:28 +1300, you wrote:

>>
>> ---------- Forwarded message ----------
>> From: Mark van Dijk <mark.van.dijk.74@gmail.com>
>> To: mythtvnz@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.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
MythTV 0.29 and HDHomeRun [ In reply to ]
---------- Forwarded message ----------
From: Stephen Worthington <stephen_agent@jsw.gen.nz>
To: MythTV in NZ <mythtvnz@lists.ourshack.com>
Cc:
Bcc:
Date: Wed, 01 Nov 2017 13:29:21 +1300
Subject: Re: [mythtvnz] MythTV 0.29 and HDHomeRun
On Wed, 1 Nov 2017 11:15:31 +1300, you wrote:


>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.

Thanks very much Stephen! This is really useful. I have now verified (via
mythbackend.log and kern.log) that the mythbackend is definitely trying to
connect to the HDHomeRun before the eth0 interface is ready.

As you suggest, I changed the IP address in my MythBackend setup to point
to the real IP address rather than 127.0.0.1. I had to modify the MYSQL
config file to bind to 0.0.0.0 rather than 127.0.0.1 so that the backend
could actually connect. Unfortunate there was no change – the issue
persists and the backend is still trying to connect to the HDHomeRun before
the network is up.



I shall have a hunt around online to see how I can delay the mythbackend
via systemmd.



Cheers
Mark
Re: MythTV 0.29 and HDHomeRun [ In reply to ]
The attached systemd unit file from the rpmfusion packages for Fedora
have plenty of hints on what to do for various issues.

On 2017-11-02 09:15, Mark van Dijk wrote:

> ---------- Forwarded message ----------
> From: Stephen Worthington <stephen_agent@jsw.gen.nz>
> To: MythTV in NZ <mythtvnz@lists.ourshack.com>
> Cc:
> Bcc:
> Date: Wed, 01 Nov 2017 13:29:21 +1300
> Subject: Re: [mythtvnz] MythTV 0.29 and HDHomeRun
> On Wed, 1 Nov 2017 11:15:31 +1300, you wrote:
>
>> 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.
>
> Thanks very much Stephen! This is really useful. I have now verified (via mythbackend.log and kern.log) that the mythbackend is definitely trying to connect to the HDHomeRun before the eth0 interface is ready.
>
> As you suggest, I changed the IP address in my MythBackend setup to point to the real IP address rather than 127.0.0.1. I had to modify the MYSQL config file to bind to 0.0.0.0 rather than 127.0.0.1 so that the backend could actually connect. Unfortunate there was no change - the issue persists and the backend is still trying to connect to the HDHomeRun before the network is up.
>
> I shall have a hunt around online to see how I can delay the mythbackend via systemmd.
>
> Cheers
>
> Mark
>
> _______________________________________________
> mythtvnz mailing list
> mythtvnz@lists.ourshack.com
> https://lists.ourshack.com/mailman/listinfo/mythtvnz
> Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: MythTV 0.29 and HDHomeRun [ In reply to ]
Mark van Dijk wrote:
> I shall have a hunt around online to see how I can delay the mythbackend
> via systemmd.

Tell me again why systemd is required ?

There MUST be a way to tell systemd that mythtv-server depends on having
networking up and running. Look at samba or NFS server systemd files for
hints.

Personally I'm moving away from the slapfest that is systemd. Devuan has
some benefits being based directly on proper debian and not some
convoluted string of ubuntu subderivatives.


Separately I have a plan to run mythbackend on a VM with a HD Homerun...
so am watching the thread with interest.


--
Criggie

http://criggie.org.nz/




_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: MythTV 0.29 and HDHomeRun [ In reply to ]
On Thu, 2 Nov 2017 09:15:55 +1300, you wrote:

>Thanks very much Stephen! This is really useful. I have now verified (via
>mythbackend.log and kern.log) that the mythbackend is definitely trying to
>connect to the HDHomeRun before the eth0 interface is ready.
>
>As you suggest, I changed the IP address in my MythBackend setup to point
>to the real IP address rather than 127.0.0.1. I had to modify the MYSQL
>config file to bind to 0.0.0.0 rather than 127.0.0.1 so that the backend
>could actually connect. Unfortunate there was no change ? the issue
>persists and the backend is still trying to connect to the HDHomeRun before
>the network is up.
>
>
>
>I shall have a hunt around online to see how I can delay the mythbackend
>via systemmd.
>
>
>
>Cheers
>Mark

I did a search of my sent emails folder and found one of the threads
with the details on how to fix this:

https://lists.gt.net/mythtv/users/602276

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: MythTV 0.29 and HDHomeRun [ In reply to ]
On Thu, 2 Nov 2017 13:30:47 +1300, you wrote:

>
>Mark van Dijk wrote:
>> I shall have a hunt around online to see how I can delay the mythbackend
>> via systemmd.
>
>Tell me again why systemd is required ?
>
>There MUST be a way to tell systemd that mythtv-server depends on having
>networking up and running. Look at samba or NFS server systemd files for
>hints.
>
>Personally I'm moving away from the slapfest that is systemd. Devuan has
>some benefits being based directly on proper debian and not some
>convoluted string of ubuntu subderivatives.
>
>
>Separately I have a plan to run mythbackend on a VM with a HD Homerun...
>so am watching the thread with interest.

Yes, there is a way to tell systemd that mythbackend needs the network
- see the thread I referenced in my previous email. It is just that
the systemd unit that is installed by the Mythbuntu packages does not
do it - it assumes that you are not using external frontends or
network tuners. And getting systemd to do what is needed is not
obvious to someone without systemd experience. It took me quite a bit
of research and testing to work it out.

Systemd is excellent for getting very short boot times with your fast
SSD boot disk. It has a number of problems, but quite a few
advantages also. I did a presentation for the Palmerston North Linux
Users Group (PLUG) a while ago about my experiences getting used to
systemd - it is available on my web server if you want to take a look
(LibreOffice format):

http://www.jsw.gen.nz/plug/Living_with_Systemd.odp

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: MythTV 0.29 and HDHomeRun [ In reply to ]
Stephen Worthington wrote:
> Systemd is excellent for getting very short boot times with your fast
> SSD boot disk. It has a number of problems, but quite a few
> advantages also.

Getting off topic here, but systemd is not mandatory, not compulsory, and
should be taken with a pinch of salt.

I'm actively avoiding systemd because I'd rather use the system than
fiddle with systemd to make stuff work. A computer is not an end-goal in
itself, its a tool.


--
Criggie

http://criggie.org.nz/




_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: MythTV 0.29 and HDHomeRun [ In reply to ]
On Thu, 2 Nov 2017 15:15:25 +1300, you wrote:

>Stephen Worthington wrote:
>> Systemd is excellent for getting very short boot times with your fast
>> SSD boot disk. It has a number of problems, but quite a few
>> advantages also.
>
>Getting off topic here, but systemd is not mandatory, not compulsory, and
>should be taken with a pinch of salt.
>
>I'm actively avoiding systemd because I'd rather use the system than
>fiddle with systemd to make stuff work. A computer is not an end-goal in
>itself, its a tool.

So you also are avoiding some of the real advantages of systemd. I
agree with you that systemd being an all-in-one take-it-or-leave-it
thing is probably wrong. But the huge advantage of systemd is that it
is now easy to write a simple systemd unit to makes a daemon work, and
work well. There is no need for a daemon to have special daemonising
code inside it, and there is no need for a complex /etc/init.d script
to get it to work properly. All the tools for normal daemons are
built into systemd. No more of the dreadful need to fork on startup,
with all its attendant complications. So you may find that in future,
people writing daemons will not bother with all the old code and you
will be forced to use systemd to use their software. Like anything
new, systemd has a learning curve to get over. In the case of
systemd, it is a pretty steep learning curve. But in regards to
starting programs, it is well worth learning as it is better than what
has come before it. I am less convinced about systemd taking over the
logging functions and a number of other things, but I am still
learning and willing to give it some leeway while I get used to how it
does things.

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.ourshack.com
https://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/