[mythtv-users] Delaying until HDHR tuners are up before starting mythtv-backend

James Abernathy jfabernathy at gmail.com
Mon Jan 2 22:27:36 UTC 2023


When I have my HDHR Quatro tuner connected to my router I'd just use a
local-network-pingable service to wait until the tuners were pingable.
That works, but to reduce a lot of the network errors I was getting with
the HDHR tuners I've been directly connecting them. That's been working
great with no errors due to the connection. But I've been restarting the
backend manually to make sure the tuners were up.

You can't use the pingable method of delaying the backend because the
169.254.x.x IP of the HDHR changes every boot. This doesn't affect
mythtv-backend because it uses the tuner ID so I need a new method of
waiting on the tuners.

I have been experimenting with a systemd override for
mythtv-backend.service that uses a command hdhomerun_check.py which loops
on the "hdhomerun_config discover" command thus delaying mythbackend from
starting.

All these methods I've found on the mailing-list and on the forum and I've
added some tweaks.
On my Raspberry Pi backend the hdhomerun_check.py works perfectly but on my
Intel NUC I'm having problems. On a fresh boot I see the errors listed
below. If I restart the backend manually no errors:

It acts as if the delaying override isn't there. The systemctl status in
both cases looks the same:
● mythtv-backend.service - MythTV Backend
     Loaded: loaded (/etc/systemd/system/mythtv-backend.service; enabled;
preset: disabled)
    Drop-In: /etc/systemd/system/mythtv-backend.service.d
             └─override.conf
     Active: active (running) since Mon 2023-01-02 16:53:17 EST; 32min ago
       Docs: https://www.mythtv.org/wiki/Mythbackend
    Process: 691 ExecStartPre=/usr/local/bin/hdhomerun_check.py
(code=exited, status=0/SUCCESS)
   Main PID: 760 (mythbackend)
      Tasks: 32 (limit: 18357)
     Memory: 2.8G
        CPU: 31min 46.050s
     CGroup: /system.slice/mythtv-backend.service
             ├─ 760 /usr/bin/mythbackend --quiet --syslog local7
             └─1931 /usr/bin/mythcommflag -j 4 --noprogress --verbose
general --loglevel info --quiet --syslog local7

Any Ideas?

Errors from when the system just boots:

Jan 02 16:53:18 den-pc mythbackend[760]: mythbackend[760]: N CoreContext
main_helpers.cpp:634 (run_backend) MythBackend: Starting up as the master
server.
Jan 02 16:53:19 den-pc mythbackend[760]: mythbackend[760]: I CoreContext
recorders/hdhrstreamhandler.cpp:393 (Connect) HDHRSH[0](1074C841): Added 0
devices from 1074C841
Jan 02 16:53:19 den-pc mythbackend[760]: mythbackend[760]: E CoreContext
recorders/hdhrstreamhandler.cpp:401 (Connect) HDHRSH[0](1074C841): Unable
to find a free device
Jan 02 16:53:19 den-pc mythbackend[760]: mythbackend[760]: E CoreContext
recorders/channelbase.cpp:806 (CreateChannel) ChannelBase: CreateChannel()
Error: Failed to open device 1074>
Jan 02 16:53:19 den-pc mythbackend[760]: mythbackend[760]: E CoreContext
main_helpers.cpp:234 (setupTVs) Problem with capture cards. Card 1 failed
init
Jan 02 16:53:19 den-pc mythbackend[760]: mythbackend[760]: I CoreContext
recorders/hdhrstreamhandler.cpp:393 (Connect) HDHRSH[0](1074C841): Added 0
devices from 1074C841
Jan 02 16:53:19 den-pc mythbackend[760]: mythbackend[760]: E CoreContext
recorders/hdhrstreamhandler.cpp:401 (Connect) HDHRSH[0](1074C841): Unable
to find a free device
Jan 02 16:53:19 den-pc mythbackend[760]: mythbackend[760]: E CoreContext
recorders/channelbase.cpp:806 (CreateChannel) ChannelBase: CreateChannel()
Error: Failed to open device 1074>
Jan 02 16:53:19 den-pc mythbackend[760]: mythbackend[760]: E CoreContext
main_helpers.cpp:234 (setupTVs) Problem with capture cards. Card 2 failed
init
Jan 02 16:53:20 den-pc mythbackend[760]: mythbackend[760]: I CoreContext
recorders/hdhrstreamhandler.cpp:393 (Connect) HDHRSH[0](1074C841): Added 0
devices from 1074C841
Jan 02 16:53:20 den-pc mythbackend[760]: mythbackend[760]: E CoreContext
recorders/hdhrstreamhandler.cpp:401 (Connect) HDHRSH[0](1074C841): Unable
to find a free device
Jan 02 16:53:20 den-pc mythbackend[760]: mythbackend[760]: E CoreContext
recorders/channelbase.cpp:806 (CreateChannel) ChannelBase: CreateChannel()
Error: Failed to open device 1074>
Jan 02 16:53:20 den-pc mythbackend[760]: mythbackend[760]: E CoreContext
main_helpers.cpp:234 (setupTVs) Problem with capture cards. Card 3 failed
init
Jan 02 16:53:20 den-pc mythbackend[760]: mythbackend[760]: I CoreContext
recorders/hdhrstreamhandler.cpp:393 (Connect) HDHRSH[0](1074C841): Added 0
devices from 1074C841
Jan 02 16:53:20 den-pc mythbackend[760]: mythbackend[760]: E CoreContext
recorders/hdhrstreamhandler.cpp:401 (Connect) HDHRSH[0](1074C841): Unable
to find a free device
Jan 02 16:53:20 den-pc mythbackend[760]: mythbackend[760]: E CoreContext
recorders/channelbase.cpp:806 (CreateChannel) ChannelBase: CreateChannel()
Error: Failed to open device 1074>
Jan 02 16:53:20 den-pc mythbackend[760]: mythbackend[760]: E CoreContext
main_helpers.cpp:234 (setupTVs) Problem with capture cards. Card 4 failed
init
Jan 02 16:53:20 den-pc mythbackend[760]: mythbackend[760]: W CoreContext
main_helpers.cpp:249 (setupTVs) MythBackend: No valid capture cards are
defined in the database.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20230102/d41bc370/attachment.htm>


More information about the mythtv-users mailing list