Mailing List Archive

HDHR offline but not really
Recordings are failing on my HDHomerun capture card. Menus on mythfrontend
(myth 31/ubuntu 18.04) say the recorder is offline, but it's not.
HDHomerun setup app on the myth box can detect channels, and I can
tune/watch HDHR channels on other devices. Grepping mythbackend.log for
hdhomerun or error shows nothing interesting. Rebooting doesn't help. Was
working fine yesterday and haven't changed anything. How to troubleshoot?
Re: HDHR offline but not really [ In reply to ]
On Tue, 11 Aug 2020 21:39:13 -0700, you wrote:

>Recordings are failing on my HDHomerun capture card. Menus on mythfrontend
>(myth 31/ubuntu 18.04) say the recorder is offline, but it's not.
>HDHomerun setup app on the myth box can detect channels, and I can
>tune/watch HDHR channels on other devices. Grepping mythbackend.log for
>hdhomerun or error shows nothing interesting. Rebooting doesn't help. Was
>working fine yesterday and haven't changed anything. How to troubleshoot?

Does it work if you restart mythbackend some time after bootup is
complete? If so, you have the boot time race condition where
mythbackend is starting up before the network is ready and when it
starts it is unable to see the HDHRs and marks them as bad. If that
is the problem, then see here for my fix:

https://lists.archive.carbon60.com/mythtv/users/633552
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: HDHR offline but not really [ In reply to ]
On Wed, Aug 12, 2020 at 2:55 AM Stephen Worthington <
stephen_agent@jsw.gen.nz> wrote:

> On Tue, 11 Aug 2020 21:39:13 -0700, you wrote:
>
> >Recordings are failing on my HDHomerun capture card. Menus on
> mythfrontend
> >(myth 31/ubuntu 18.04) say the recorder is offline, but it's not.
> >HDHomerun setup app on the myth box can detect channels, and I can
> >tune/watch HDHR channels on other devices. Grepping mythbackend.log for
> >hdhomerun or error shows nothing interesting. Rebooting doesn't help.
> Was
> >working fine yesterday and haven't changed anything. How to troubleshoot?
>
> Does it work if you restart mythbackend some time after bootup is
> complete? If so, you have the boot time race condition where
> mythbackend is starting up before the network is ready and when it
> starts it is unable to see the HDHRs and marks them as bad. If that
> is the problem, then see here for my fix:
>
> https://lists.archive.carbon60.com/mythtv/users/633552


Ah right, I had read about that before but forgot. That was the problem.
Unfortunately I don't have the server version of Ubuntu. I think I will
try the startup delay fix <https://forum.mythtv.org/viewtopic.php?t=1467>
first and if that doesn't work go to more extreme measures.
Re: HDHR offline but not really [ In reply to ]
On Wed, 12 Aug 2020 08:30:07 -0700, you wrote:

>On Wed, Aug 12, 2020 at 2:55 AM Stephen Worthington <
>stephen_agent@jsw.gen.nz> wrote:
>
>> On Tue, 11 Aug 2020 21:39:13 -0700, you wrote:
>>
>> >Recordings are failing on my HDHomerun capture card. Menus on
>> mythfrontend
>> >(myth 31/ubuntu 18.04) say the recorder is offline, but it's not.
>> >HDHomerun setup app on the myth box can detect channels, and I can
>> >tune/watch HDHR channels on other devices. Grepping mythbackend.log for
>> >hdhomerun or error shows nothing interesting. Rebooting doesn't help.
>> Was
>> >working fine yesterday and haven't changed anything. How to troubleshoot?
>>
>> Does it work if you restart mythbackend some time after bootup is
>> complete? If so, you have the boot time race condition where
>> mythbackend is starting up before the network is ready and when it
>> starts it is unable to see the HDHRs and marks them as bad. If that
>> is the problem, then see here for my fix:
>>
>> https://lists.archive.carbon60.com/mythtv/users/633552
>
>
>Ah right, I had read about that before but forgot. That was the problem.
>Unfortunately I don't have the server version of Ubuntu. I think I will
>try the startup delay fix <https://forum.mythtv.org/viewtopic.php?t=1467>
>first and if that doesn't work go to more extreme measures.

Please do not use that startup delay fix. Time and time again people
try to use delays to fix race conditions and then get caught out when
something changes the timing. In this case, the timing will change
drastically whenever one of your ext partitions needs to have its
automatic fsck done at startup. So here is the scenario - you are
away on holiday and there is a power cut. The MythTV box reboots
automatically and does fsck on boot. Mythbackend does not see the
HDHRs and fails to record. When you get home, you are missing a
couple of weeks of recordings.

The instructions I post for how to fix this correctly are detailed
enough that you should be able to just follow them. If not, ask for
help. This is a problem that has been fully solved long ago, so
please do not create more future problems for yourself by not fixing
it now.

You mentioned the server version of Ubuntu - the fix I pointed you to
is for the desktop version. For the server version if it does not
have NetworkManager (I have not checked recently) the fix may need to
be modified a little. I think it is actually a little bit simpler to
fix if NetworkManager is not being used.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: HDHR offline but not really [ In reply to ]
On Wed, Aug 12, 2020 at 9:46 AM Stephen Worthington <
stephen_agent@jsw.gen.nz> wrote:

> [snip]
> You mentioned the server version of Ubuntu - the fix I pointed you to
> is for the desktop version. For the server version if it does not
> have NetworkManager (I have not checked recently) the fix may need to
> be modified a little. I think it is actually a little bit simpler to
> fix if NetworkManager is not being used.
>
>
OK I misunderstood the page and thought it was only for the server
version. I implemented it and it went smoothly. Thanks for the code.
Re: HDHR offline but not really [ In reply to ]
On 8/12/20 9:45 AM, Stephen Worthington wrote:
> On Wed, 12 Aug 2020 08:30:07 -0700, you wrote:
>
>> On Wed, Aug 12, 2020 at 2:55 AM Stephen Worthington <
>> stephen_agent@jsw.gen.nz> wrote:
>>
>>> On Tue, 11 Aug 2020 21:39:13 -0700, you wrote:
>>>
>>>> Recordings are failing on my HDHomerun capture card. Menus on
>>> mythfrontend
>>>> (myth 31/ubuntu 18.04) say the recorder is offline, but it's not.
>>>> HDHomerun setup app on the myth box can detect channels, and I can
>>>> tune/watch HDHR channels on other devices. Grepping mythbackend.log for
>>>> hdhomerun or error shows nothing interesting. Rebooting doesn't help.
>>> Was
>>>> working fine yesterday and haven't changed anything. How to troubleshoot?
>>> Does it work if you restart mythbackend some time after bootup is
>>> complete? If so, you have the boot time race condition where
>>> mythbackend is starting up before the network is ready and when it
>>> starts it is unable to see the HDHRs and marks them as bad. If that
>>> is the problem, then see here for my fix:
>>>
>>> https://lists.archive.carbon60.com/mythtv/users/633552
>>
>> Ah right, I had read about that before but forgot. That was the problem.
>> Unfortunately I don't have the server version of Ubuntu. I think I will
>> try the startup delay fix <https://forum.mythtv.org/viewtopic.php?t=1467>
>> first and if that doesn't work go to more extreme measures.
> Please do not use that startup delay fix. Time and time again people
> try to use delays to fix race conditions and then get caught out when
> something changes the timing. In this case, the timing will change
> drastically whenever one of your ext partitions needs to have its
> automatic fsck done at startup. So here is the scenario - you are
> away on holiday and there is a power cut. The MythTV box reboots
> automatically and does fsck on boot. Mythbackend does not see the
> HDHRs and fails to record. When you get home, you are missing a
> couple of weeks of recordings.
>
> The instructions I post for how to fix this correctly are detailed
> enough that you should be able to just follow them. If not, ask for
> help. This is a problem that has been fully solved long ago, so
> please do not create more future problems for yourself by not fixing
> it now.
>
> You mentioned the server version of Ubuntu - the fix I pointed you to
> is for the desktop version. For the server version if it does not
> have NetworkManager (I have not checked recently) the fix may need to
> be modified a little. I think it is actually a little bit simpler to
> fix if NetworkManager is not being used.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

I have followed the instructions you gave me a while ago. This seems to be working. I left the delay in place because it is not
hurting anything.

Thank you for the instructions.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: HDHR offline but not really [ In reply to ]
On Wed, 2 Sep 2020 21:30:00 -0700, you wrote:

>I have followed the instructions you gave me a while ago. This seems to be working. I left the delay in place because it is not
>hurting anything.
>
>Thank you for the instructions.

The extra delay does hurt your bootup time, but apart from that does
no damage. But as I have on a number of occasions found myself
booting up just before a recording is due to start, I would recommend
removing the extra delay. It is very annoying missing the start of a
recording.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: HDHR offline but not really [ In reply to ]
On 9/3/20 1:59 AM, Stephen Worthington wrote:
> On Wed, 2 Sep 2020 21:30:00 -0700, you wrote:
>
>> I have followed the instructions you gave me a while ago. This seems to be working. I left the delay in place because it is not
>> hurting anything.
>>
>> Thank you for the instructions.
> The extra delay does hurt your bootup time, but apart from that does
> no damage. But as I have on a number of occasions found myself
> booting up just before a recording is due to start, I would recommend
> removing the extra delay. It is very annoying missing the start of a
> recording.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

My system is set up to automatically boot itself about 30 minutes before a recording. The 30 second delay will not be a problem.

It occurred to me that this setup has a 30 second timeout, and will continue booting after 30 seconds even if the network is not up.

This means that it is no more effective at avoiding problems than a fixed 30 second delay.

It is a better solution than a 30 second delay in that it does not have to wait the full 30 seconds if the network is up.

Perhaps a much better solution would be if MythTV would re-try the network tuners every minute or so if it can't access the
tuners it has been told are there.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: HDHR offline but not really [ In reply to ]
On Thu, 3 Sep 2020 12:11:47 -0700, you wrote:

>On 9/3/20 1:59 AM, Stephen Worthington wrote:
>> On Wed, 2 Sep 2020 21:30:00 -0700, you wrote:
>>
>>> I have followed the instructions you gave me a while ago. This seems to be working. I left the delay in place because it is not
>>> hurting anything.
>>>
>>> Thank you for the instructions.
>> The extra delay does hurt your bootup time, but apart from that does
>> no damage. But as I have on a number of occasions found myself
>> booting up just before a recording is due to start, I would recommend
>> removing the extra delay. It is very annoying missing the start of a
>> recording.

>My system is set up to automatically boot itself about 30 minutes before a recording. The 30 second delay will not be a problem.
>
>It occurred to me that this setup has a 30 second timeout, and will continue booting after 30 seconds even if the network is not up.
>
>This means that it is no more effective at avoiding problems than a fixed 30 second delay.
>
>It is a better solution than a 30 second delay in that it does not have to wait the full 30 seconds if the network is up.

Yes, exactly. If the delay needed is more than 30 seconds,
mythbackend will be started anyway, but will not see the slow
tuner(s). No-one has yet reported needing more than 30 seconds
though. You can see the actual time taken in the logs. This is from
/var/log/syslog for my most recent reboot:

Sep 3 23:26:55 mypvr systemd[1]: Starting Wait for the local network
to be pingable...
Sep 3 23:26:55 mypvr /wait-until-pingable.py: Starting
Sep 3 23:26:55 mypvr /wait-until-pingable.py: ping of
switch.jsw.gen.nz succeeded
Sep 3 23:26:55 mypvr /wait-until-pingable.py: Exiting
Sep 3 23:26:55 mypvr systemd[1]: Started Wait for the local network
to be pingable.

So by the time systemd started wait-until-pingable.py, the network was
up as the ping succeeded immediately. That PC has my secondary
nameserver on it, so the lookup of the name switch.jsw.gen.nz happened
almost instantly and did not delay things either.

>Perhaps a much better solution would be if MythTV would re-try the network tuners every minute or so if it can't access the
>tuners it has been told are there.

Absolutely. The gold standard way of doing this is for a program to
register itself with the system to get all messages about network
interfaces going up and down and then when it sees a message about a
relevant interface or IP address, it will retry any connections it
needs to make. This is a tricky bit of code, but programs like MySQL
and MariaDB operate like this, so it is clearly possible to do it.

Mythbackend however does not have any mechanism for finding tuners
except at startup. If a tuner fails I think it may still keep on
trying to use it. At best it will mark it as bad and not use it after
that, but then it would never use it ever again until the next time it
was started up. But if it keeps on trying to use a bad tuner, you
will keep on getting missed recordings that might have been able to be
recorded on another tuner. I do know that if a recording is failing
on a tuner, mythbackend will start another back-to-back recording
using the same tuner and will have that recording also fail.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: HDHR offline but not really [ In reply to ]
On Fri, Sep 4, 2020, 3:05 AM Stephen Worthington <stephen_agent@jsw.gen.nz>
wrote:

> On Thu, 3 Sep 2020 12:11:47 -0700, you wrote:
>
> >On 9/3/20 1:59 AM, Stephen Worthington wrote:
> >> On Wed, 2 Sep 2020 21:30:00 -0700, you wrote:
> >>
> >>> I have followed the instructions you gave me a while ago. This seems
> to be working. I left the delay in place because it is not
> >>> hurting anything.
> >>>
> >>> Thank you for the instructions.
> >> The extra delay does hurt your bootup time, but apart from that does
> >> no damage. But as I have on a number of occasions found myself
> >> booting up just before a recording is due to start, I would recommend
> >> removing the extra delay. It is very annoying missing the start of a
> >> recording.
>
> >My system is set up to automatically boot itself about 30 minutes before
> a recording. The 30 second delay will not be a problem.
> >
> >It occurred to me that this setup has a 30 second timeout, and will
> continue booting after 30 seconds even if the network is not up.
> >
> >This means that it is no more effective at avoiding problems than a fixed
> 30 second delay.
> >
> >It is a better solution than a 30 second delay in that it does not have
> to wait the full 30 seconds if the network is up.
>
> Yes, exactly. If the delay needed is more than 30 seconds,
> mythbackend will be started anyway, but will not see the slow
> tuner(s). No-one has yet reported needing more than 30 seconds
> though. You can see the actual time taken in the logs. This is from
> /var/log/syslog for my most recent reboot:
>
> Sep 3 23:26:55 mypvr systemd[1]: Starting Wait for the local network
> to be pingable...
> Sep 3 23:26:55 mypvr /wait-until-pingable.py: Starting
> Sep 3 23:26:55 mypvr /wait-until-pingable.py: ping of
> switch.jsw.gen.nz succeeded
> Sep 3 23:26:55 mypvr /wait-until-pingable.py: Exiting
> Sep 3 23:26:55 mypvr systemd[1]: Started Wait for the local network
> to be pingable.
>
> So by the time systemd started wait-until-pingable.py, the network was
> up as the ping succeeded immediately. That PC has my secondary
> nameserver on it, so the lookup of the name switch.jsw.gen.nz happened
> almost instantly and did not delay things either.
>
> >Perhaps a much better solution would be if MythTV would re-try the
> network tuners every minute or so if it can't access the
> >tuners it has been told are there.
>
> Absolutely. The gold standard way of doing this is for a program to
> register itself with the system to get all messages about network
> interfaces going up and down and then when it sees a message about a
> relevant interface or IP address, it will retry any connections it
> needs to make. This is a tricky bit of code, but programs like MySQL
> and MariaDB operate like this, so it is clearly possible to do it.
>
> Mythbackend however does not have any mechanism for finding tuners
> except at startup. If a tuner fails I think it may still keep on
> trying to use it. At best it will mark it as bad and not use it after
> that, but then it would never use it ever again until the next time it
> was started up. But if it keeps on trying to use a bad tuner, you
> will keep on getting missed recordings that might have been able to be
> recorded on another tuner. I do know that if a recording is failing
> on a tuner, mythbackend will start another back-to-back recording
> using the same tuner and will have that recording also fail.
>

FWIW I set it up per suggestions, and haven't had problems since.

>