Opened 9 years ago

Last modified 8 weeks ago

#11018 assigned Patch - Bug Fix

Distortion of Recordings/LiveTV if EIT-Scan is processing on another capturecard

Reported by: Shinck@… Owned by: Klaas de Waal
Priority: minor Milestone: needs_triage
Component: MythTV - General Version: 0.25-fixes
Severity: medium Keywords: EIT
Cc: Ticket locked: no

Description

After upgrading from MythTV 0.21 / Mythbuntu 08.10 to MythTV 0.24 / Mythbuntu 10.04 I detected distortions and artefacts in video/audio in recordings/LiveTV of my BT878/BTTV based DVB-S capturecard. After further investigations I saw that this was caused by an active EIT-Scan on my other DIBcom-3000mc based DVB-T card. If both two cards are active I saw lots of this lines in backend-log:

  E DVBRead mpeg/pespacket.cpp:79 (AddTSPacket) AddTSPacket: Out of sync!!! Need to wait for next payloadStart PID: 0x12, continuity counter: 6 (expected 5).

So I decided to switch of EIT-Scanning of the DVB-T card and the distortions were gone (But as DVB-T and DVB-S in my setup don't based on the same Video-Source I lost EPG-Information of DVB-T and had to record or look LiveTV on the DVB-T channels to update the information). I don't know If this was caused by mythtv or the LinuxTV-v4l/DVB driver framework but I hoped that updating to 0.25 makes things better. As the problem wasn't gone with 0.25 I decided to write a patch that switches of the EIT-Scanning at all capture-cards if a program records or I look liveTV. After the last record finishes the timer eitCrawlIdleStart is set again on all cards. With this attempt I also resolve another problem: I've setup my system to shutdown(hibernate) if it's idle and ACPI-wakeup before new recordings, but it never shutdown after a recording because a EIT-Scan on another card than the recording-card was running after the recording.

So now I provide the patch. Perhaps it could be helpful for some other people.

Attachments (5)

0002-libmythtv-EIT-ActiveScan-Control-optimized.patch (15.8 KB) - added by Shinck@… 9 years ago.
Stop EIT-Scan on all capture cards if record or liveTV is ongoing and start again afterwards
version-linux.txt (865 bytes) - added by Shinck@… 9 years ago.
Version information
0003-libmythtv-EIT-ActiveScan-Control-optimized-026.commit (9.0 KB) - added by Shinck@… 9 years ago.
Patch for master / 0.26-rc
version026-linux.txt (876 bytes) - added by Shinck@… 9 years ago.
Version information
20201230-trac11018.patch (7.9 KB) - added by Klaas de Waal 2 months ago.
Active EIT scan only when backend is idle, updated to compile against master of 20201230

Download all attachments as: .zip

Change History (18)

Changed 9 years ago by Shinck@…

Stop EIT-Scan on all capture cards if record or liveTV is ongoing and start again afterwards

Changed 9 years ago by Shinck@…

Attachment: version-linux.txt added

Version information

comment:1 Changed 9 years ago by Raymond Wagner

Are these all PCI devices? Is it possible you are simply putting too much traffic on the bus, and starving your framegrabbers of bandwidth to their frame buffers?

comment:2 Changed 9 years ago by Shinck@…

I don't think so. I've 3 capture-cards. And all stays on different busses. One Bt878-Bttv based DVB-S card on the PCI-Bus, It is for SD-Content only and worked flawlessly at Mythbuntu/Ubuntu? 08.10 with one USB1.1-DVB-T card (Dibcom-3000mc-based) with an hardware PID filter (table count: 16). The third an newest one (but the problem was also before) is an SAA716x_TBS/TBS6928fe based DVB-S2 card on the PCI-express-bus for the DVB-S HD-Content.

comment:3 Changed 9 years ago by Shinck@…

Annotation: None of my cards is an analog framegrabber, all cards are digital DVB-cards.

comment:4 Changed 9 years ago by Shinck@…

Annotation2: And the distortion and discontinuities of video/audio are on the DVB-S card which resides on the PCI bus not the USB1.1 device (it has no problems).

comment:5 Changed 9 years ago by Shinck@…

Recently I switched from fixes/0.25 to master. After some adaptions the patch also works here fine. So I will attach it here.

Changed 9 years ago by Shinck@…

Patch for master / 0.26-rc

Changed 9 years ago by Shinck@…

Attachment: version026-linux.txt added

Version information

comment:6 Changed 9 years ago by stuartm

What level of logging are you using? Extremely verbose logging (i.e.non standard levels) can have an effect on performance e.g. high disk I/O that has been known to cause problems on some systems. During normal operation the defaults for verbosity/level should be used and greater verbosity only turned on when debugging an issue.

comment:7 Changed 9 years ago by Shinck@…

At daily use I leave the Standard levels (verbose: general and LogLevel?: info). With these levels the distortions were existent. For debugging purposes sometimes I change verbose to idle,eit,record,dvbcam but leave LogLevel? at info.

But since I've switched of EIT-Scanning during recording or LiveTV with the patch the error is gone. So it works now for me.

comment:8 Changed 12 months ago by Klaas de Waal

This might be useful for low-end devices such as the RPI when used as a backend. Let's keep this one open for now.

comment:9 Changed 12 months ago by Stuart Auchterlonie

Owner: set to Klaas de Waal
Status: newassigned

comment:10 Changed 8 months ago by Stuart Auchterlonie

Milestone: unknownneeds_triage

comment:11 Changed 2 months ago by Klaas de Waal

This can be a useful feature if the backend is very low power, e.g. a RPi3B, and there is more than one video source used with EIT for the guide data.

The implementation is updated to make it compile against today's master.

It works largely as documented:

  • No recording and no Live TV then active EIT scan is running on all inputs
  • When recording there is passive EIT on that input; the active scan on the other inputs is paused
  • When the recording is stopped then the active EIT on all inputs is restored
  • With Live TV there is no EIT collection at all. The expected behavior is that there is passive EIT from the input used for Live TV, so this is not yet perfect.
  • When Live TV is stopped then the active EIT on all inputs is restored.

Patch is attached.

Changed 2 months ago by Klaas de Waal

Attachment: 20201230-trac11018.patch added

Active EIT scan only when backend is idle, updated to compile against master of 20201230

comment:12 Changed 2 months ago by Stuart Auchterlonie

As LiveTV is a recording, i'd expect passive EIT collection behaviour

comment:13 Changed 8 weeks ago by Klaas de Waal

Figured out why LiveTV does not collect EIT as described in comment 11. It has nothing to do with the code in this ticket.

The reason is that EIT is only collected on the real capture card.

The real capturecard is the entry with parentid=0 in table capturecard. All entries with parentid!=0 are multirec instances and use the capture card identified by the parentid.

To select the input for LiveTV all available inputs are sorted on LiveTV priority. All available inputs includes both the real and the multirec instances. So it is possible that the LiveTV is started on a multirec instance in which case there is no EIT collected.

There is definitely room for improvement here; it would be great if there is passive EIT collection on any input.

Note: See TracTickets for help on using tickets.