Opened 7 months ago

Closed 3 weeks ago

Last modified 2 weeks ago

#13455 closed Bug Report - General (Fixed)

EIT/ETT broadcast data; title/description mismatch

Reported by: Ronald L Humble Owned by: Klaas de Waal
Priority: minor Milestone: 31.0
Component: MythTV - EIT Version: v30-fixes
Severity: medium Keywords:
Cc: Stuart Auchterlonie Ticket locked: no

Description

Ticket #11476 closed in early 2018. Title(EIT)/Description(ETT) mismatches occur for me (ATSC over-the-air broadcast/United States) with v30 (compiled and RPMFusion). The mismatches become more numerous with time.

My libmythtv.160508.v0.28.patch and its predecessors have worked for me for 5-6 years now (though it does not conform to standard) by disabling ETT caching. This patch patches v30. I know of no problems generated by use of this patch. If I thought there was a hope some piece of this patch to be merged, I would make it conform to standard.

It would appear that the use of the ATSC <EIT ETT> parameter version_number will have to be used if title/description matching and ETT caching are to coexist.

Attachments (2)

libmythtv.190506.v0.30.patch (2.9 KB) - added by Ronald L Humble 7 months ago.
EIT/ETT Title/Description? mismatch
20190919-atsc-eit-ett-13455-v0.patch (6.1 KB) - added by Klaas de Waal 3 months ago.
Remove ETT caching; process ETT event only after the corresponding EIT event has been received.

Download all attachments as: .zip

Change History (10)

Changed 7 months ago by Ronald L Humble

EIT/ETT Title/Description? mismatch

comment:1 Changed 7 months ago by Ronald L Humble

libmythtv.190506.v0.30.patch is the patch used to patch the RPMFusion source code (commit: 20190404git8e50fcf60b). Other than path changes to make the patch applicable to the top of the source tree, it is the same as libmythtv.160508.v0.28.patch. Perhaps it might be cherry-picked by the developers for code relevant to this problem.

comment:2 Changed 3 months ago by Klaas de Waal

Cc: Stuart Auchterlonie added
Milestone: needs_triage31.0
Owner: changed from Karl Egly to Klaas de Waal
Status: newassigned

The patch libmythtv.190506.v0.30.patch​ consists of two different parts, possibly relating to two different issues.

Part 1: Adding mutex myLock in TVRec::run

TVRec::run is started once for each capturecard. The additional lock enforces that TVRec::run cannot run twice on the same capturecard. However, this should never happen and if that happens this needs further investigation. To test if it called while already running please add some error checking code to TVRec::run like this:

/// \brief Event handling method, contains event loop.
void TVRec::run(void)
{
    // KdW test ticket #13455
    if (m_myLock.tryLock(0))
    {
            m_myLock.unlock();
        LOG(VB_GENERAL, LOG_INFO, LOC + "#13455 TVRec::run GOOD");
    }
    else
    {
        LOG(VB_GENERAL, LOG_ERR, LOC + "#13455 TVRec::run ERROR called while running");
    }
    QMutexLocker mylocker(&m_myLock);

    QMutexLocker lock(&m_stateChangeLock);

If errors do happen then please run mythbackend under gdb, set a breakpoint in the line with "TVRec::run ERROR" and make a backtrace with gdb when the breakpoint is hit. N.B. Code example uses the m_ prefix as is now standard in the master code.

Part 2: Caching of ETT events

The patch can be described as follows:

Accept ETT events only after the corresponding EIT event has been received.

This does make sense as it is unlikely that an ETT event, containing additional data for an EIT event, is sent before the corresponding EIT event has been sent. There is the possibility that mythbackend starts to receive just after the EIT event and just before the ETT event but that is a corner case that does not need to be coded for, given the high repetition rate of these events.

comment:3 Changed 3 months ago by Klaas de Waal

Attached is patch 20190919-atsc-eit-eit-13455-v0.patch which removes the ETT caching completely. This patch applies to the current master.

The idea is that the first ETT event that is received after the EIT event is received will be used to make the EIT event complete. This ordering means that the ETT event has always at least the same table version as the EIT event.

Note that another possible reason for the problems encountered with EIT and ETT caching is the scope of the event ID, as described in the ATSC documentation A/65:2013, page 40:

For a particular virtual channel, an event_id identifies uniquely each
of the events programmed for the 3-hour interval of an EIT.

This means that the event ID for the same program can change 8 times per day.....

The original code also had, the way I read it, a memory leak in the case that an expected ETT event was not received. This should now be fixed.

Please note that this patch is not tested at all so there can be a few iterations needed to make it perfect. It would be greatly appreciated if this patch could be tested in ATSC country.

Changed 3 months ago by Klaas de Waal

Remove ETT caching; process ETT event only after the corresponding EIT event has been received.

comment:4 Changed 3 months ago by Klaas de Waal <kdewaal@…>

In fe0c80927f/mythtv:

Remove ATSC ETT caching

Process ATSC ETT events only after the corresponding EIT event,
as identified by the event ID, has been received.
This solves title/description mismatches in guide data.
Bug reported and bug fix tested for several years by Roanld L Humble.
Thanks for the perseverance in reporting and testing this bug.

Also fix of a memory leak in the case where EIT events are cached
awaiting a matching ETT event but the ETT event does never arrive.

Refs #13455

comment:5 Changed 6 weeks ago by Ronald L Humble

Compiled master commit 50e2f8ebaffb9 on Fedora 30 which includes the referenced commit fe0c80927f and have run on a test machine for one week. I have noticed no degradation from my patched RPMFusion (commit 5cde0578d8) packages. I am installing the commit 50e2f8ebaffb9 compile on my production machine, where much more attention will be given to Mythtv.

Perhaps I will give a one sentence update in about 30 days (or sooner if negative results).

As at least a couple of distributors of .deb or .rpm packages of Mythtv use the fixes/30 branch, I hope this patch will find its way into that branch (unless Mythtv 31 release is imminent).

Fixing a memory leak is fantastic.

Ron H.

comment:6 Changed 3 weeks ago by Ronald L Humble

Compiled master commit 50e2f8ebaffb9 on Fedora 30 which includes the referenced commit fe0c80927f continues to work very well for me. Thank you for your work. I hope this commit makes it to the fixes/30 branch. At this time, I expect to make no further comment on this issue.

comment:7 Changed 3 weeks ago by Klaas de Waal

Resolution: Fixed
Status: assignedclosed

This patch and the "EITCache check on table version" patch have now been backported to fixes/30 as requested. Thanks for the reporting and the testing for this ticket over the years. This ticket is now closed.

comment:8 Changed 2 weeks ago by Klaas de Waal <kdewaal@…>

In 205d3659a/mythtv:

Remove ATSC ETT caching

Process ATSC ETT events only after the corresponding EIT event,
as identified by the event ID, has been received.
This solves title/description mismatches in guide data.
Bug reported and bug fix tested for several years by Roanld L Humble.
Thanks for the perseverance in reporting and testing this bug.

Also fix of a memory leak in the case where EIT events are cached
awaiting a matching ETT event but the ETT event does never arrive.

Refs #13455

(cherry picked from commit fe0c80927fb6a3ec8d8e9b326c4c10df9a2c47dc)
Signed-off-by: Klaas de Waal <kdewaal@…>

Note: See TracTickets for help on using tickets.