Opened 9 months ago

Closed 9 months ago

Last modified 9 months ago

#13407 closed Patch - Bug Fix (fixed)

HDHomeRun ERROR: lock no longer held

Reported by: Klaas de Waal Owned by: Klaas de Waal <klaas.de.waal@…>
Priority: minor Milestone: 30.1
Component: MythTV - DVB Version: Master Head
Severity: medium Keywords: HDHomeRun DVB zero-byte recording EIT lock
Cc: Stuart Auchterlonie Ticket locked: no

Description

Environment:

  • Cable signal Dutch Ziggo DVB-C
  • One system with Fedora 29 on i7-7700 running MythTV master
  • One system with Fedora 29 on i5-650 running MythTV v30.
  • Each system has its own HDHomeRun HDHR3-4DC tuner plus one or more KNC-One PCIbus card tuners.

The problem described here is present on both systems.

The following error messages appear in the mythbackend log:

2019-02-12 14:30:10.424948 I  HDHRSH[1](1410F45C): Tuning channel a8qam256-6900:706750000 (was a8qam256-6900:578750000)
2019-02-12 14:30:10.425339 E  HDHRSH[1](1410F45C): DeviceSet(channel a8qam256-6900:706750000): ERROR: lock no longer held

This error appears when the HDHomeRun channel is used for active EIT scanning, selected with option "Use DVB card for active EIT scan" in mythtv-setup. The error message typically appears after a few hours of succesful active EIT scanning.

The error indicates a failure to get EIT/EPG data; also the first recording after a failed active EIT scan fails. After a failed recording the next recording or active EIT scan is always OK. Then, after a while, the error appears again.

The active EIT scanning is only done on the first HDHomeRun channel. On the other HDHomeRun channels, without active EIT scanning, this error does not appear and all recordings are OK.

An obvious solution which does not require any code change is to disable active EIT scanning on the HDHomeRun. This is however only acceptable if the system has also other, correctly working, tuners which can be used for active EIT scanning.

Examining the mythbackend log files shows that for the active EIT scanning there is an "Opening HDHR channel" message but that the "Closing HDHR channel" message is missing. This is caused by the "if" condition in TVRec::CloseChannel?() :

void TVRec::CloseChannel(void)
{
    if (channel &&
        ((genOpt.inputtype == "DVB" && dvbOpt.dvb_on_demand) ||
         genOpt.inputtype == "FREEBOX" || genOpt.inputtype == "VBOX" ||
         CardUtil::IsV4L(genOpt.inputtype)))
    {
        channel->Close();
    }
}

The HDHomeRun tuners have type HDHOMERUN and for this tuner type the channel is not closed.
The solution is to add the type HDHOMERUN to the "if" condition, as shown here:

void TVRec::CloseChannel(void)
{
    if (channel &&
        ((genOpt.inputtype == "DVB" && dvbOpt.dvb_on_demand) ||
         genOpt.inputtype == "FREEBOX" || genOpt.inputtype == "VBOX" ||
         genOpt.inputtype == "HDHOMERUN" ||                                 // KdW fix this line added
         CardUtil::IsV4L(genOpt.inputtype)))
    {
        channel->Close();
    }
}

The attached patch has been tested on both systems.

Note: on both systems the patches of ticket #13371 are applied.

Attachments (1)

20190214-hdhr-no-lock.patch (531 bytes) - added by Klaas de Waal 9 months ago.
Add HDHOMERUN input type in TVRec::CloseChannel?

Download all attachments as: .zip

Change History (4)

Changed 9 months ago by Klaas de Waal

Attachment: 20190214-hdhr-no-lock.patch added

Add HDHOMERUN input type in TVRec::CloseChannel?

comment:1 Changed 9 months ago by Klaas de Waal <klaas.de.waal@…>

Owner: set to Klaas de Waal <klaas.de.waal@…>
Resolution: fixed
Status: newclosed

In e7e2270d6/mythtv:

Don't leave HDHomeRun channels open after EIT scans.

The HDHomeRun unlocks the tuner due to inactivity but MythTV still
thinks it's open. The result is the next recording or EIT scan fails.
The fix is to always close the channel immediately after finishing
with it.

Fixes #13407

Signed-off-by: David Engel <dengel@…>

comment:2 Changed 9 months ago by Klaas de Waal <klaas.de.waal@…>

In 70a58c0a38/mythtv:

Don't leave HDHomeRun channels open after EIT scans.

The HDHomeRun unlocks the tuner due to inactivity but MythTV still
thinks it's open. The result is the next recording or EIT scan fails.
The fix is to always close the channel immediately after finishing
with it.

Refs #13407

Signed-off-by: David Engel <dengel@…>
(cherry picked from commit e7e2270d68838bf72c8a7a12a1f027905a12e199)

comment:3 Changed 9 months ago by gigem

Milestone: needs_triage30.1
Note: See TracTickets for help on using tickets.