Project

General

Profile

Continuity errors and subscription errors on live broadcasts

Added by Max - 14 days ago

I have a bit of a complicated problem, so I try to explain it as clear as possible.

First, these are the hardware I will refer to later:
  • Avermedia TD310 (dvb-c)
  • Raspberry Pi 4 (this is the "TV", if I have not specified, I'm speaking about this)
    • Raspberry Pi OS
    • Tvheadend 4.3-2050~g52c3ed3ef (source built, but same with the Raspberry Pi OS package (4.3-1994~gc7b713edb))
    • Kodi 19.4 (Raspberry Pi OS package, popcornmix's gbm_matrix)
  • Lenovo G550
    • Arch
    • Tvheadend 4.3-2050~g52c3ed3ef (AUR)
    • Kodi 19.4 (Arch package)
    • Nextpvr from docker image
  • Desktop (i7 8700K, RTX2080)
    • Arch
    • Kodi 19.4 (Arch package)
  • Win10 vm
    • Windows 10
    • AverTV (Official client software)

The whole hunting started about a week now, there was no problem before (or not that noticeable). The situation is that we have HD (1080i) channels that have around 10000-13000kbps bandwidth. There are no problems with them. But there are some HD channels that have only 6000-7000kpbs bandwidth, they are the problematic ones.
These channels are sometimes having artifacts when I'm watching them, like squares on the whole screen or part of it. Sometimes more, sometimes less frequent (between 3sec and 5min). But it does not happen every time. I have tested with a sports channel and the rule for it is it happens every time if it is a live broadcast, it sometimes happens if it is not a live broadcast, and there are times when no error happens.
When an error happens, the webui displays continuity errors and subscription errors. If I connect with multiple devices (Android, Linux) running Kodi every error looks exactly the same on every device and the error counters are incremented equally on the "Subscriptions" page.

Maybe related that I found an SD channel that throws 5 continuity errors/second every time, but no errors on the subscription or the screen.

What have I tried
  • Running Tvheadend and Kodi on the Raspberry PI (this is what I described above). Errors are happened.
  • Running Tvheadend on the G550 and watching from the Desktop. Errors are happened.
  • Running Nextpvr on the G550 and watching from the Desktop. There is no error happened (at least not visible)
  • Running AverTV on the Win10 vm and watching on it (AverTV says 97%-100% signal quality). There is no error happened (at least not visible)

Here is a video recorded by Tvheadend itself on the Raspberry Pi, but not all the artifacts are visible on it when I play it in VLC (Tvheadend says 9 Data Errors which is about right): https://drive.google.com/drive/folders/1QRuFCC-lYbch-JYs5dlHvsi4-nIpL4hU?usp=share_link

And here are some screen recordings which shows better the visuals of the issue: https://drive.google.com/drive/folders/17arPoE3G73Pg-14E9fb1ZR1BUS-Yty8r?usp=share_link

The attached log contains everything I can tick on the webui. It shows a local kodi subscripting to a channel, watching for a minute, and disconnecting. During the watching, about 10 errors happened.

tvhdbg.zip (1.94 MB) tvhdbg.zip Log

Replies (15)

RE: Continuity errors and subscription errors on live broadcasts - Added by Max - 13 days ago

v4.2.8 seems to work. Bisecting...

RE: Continuity errors and subscription errors on live broadcasts - Added by Max - 13 days ago

The bug is between 18f51a2 and 7b328d7.
18f51a24578cc8dd681a1dfb122bcb2ad35f52e0 is good
7b328d75adb1bfcf4a3fafa5ad0c1745ff24ca95 is bad

RE: Continuity errors and subscription errors on live broadcasts - Added by Max - 12 days ago

This diff seems to fix it, but I think it's far from an optimal fix.
I'll see if I can understand what's going on under the hood.

diff --git a/src/input/mpegts/tsdemux.c b/src/input/mpegts/tsdemux.c
index c33b185a8..04b58ff13 100644
--- a/src/input/mpegts/tsdemux.c
+++ b/src/input/mpegts/tsdemux.c
@@ -320,6 +320,9 @@ ts_remux(mpegts_service_t *t, const uint8_t *src, int len, int errors)
 {
   sbuf_t *sb = &t->s_tsbuf;

+  if (errors)
+    return;
+
   if (sb->sb_data == NULL)
     sbuf_init_fixed(sb, TS_REMUX_BUFSIZE);

RE: Continuity errors and subscription errors on live broadcasts - Added by Flole Systems 11 days ago

You're just ignoring errors now, that's not going to help. You need to find out why in your case there are MPEG-TS packets missing.

RE: Continuity errors and subscription errors on live broadcasts - Added by saen acro 11 days ago

Is Pi power supply is enough powerful?

vcgencmd measure_temp
vcgencmd measure_volts
vcgencmd get_throttled

RE: Continuity errors and subscription errors on live broadcasts - Added by Mark Clarkstone 11 days ago

saen acro wrote:

Is Pi power supply is enough powerful?

[...]

This is the main cause of issues when using TVH on the Pi. I'm currently running TVH on a Pi 3 (NOT 4), when using an off brand PSU that met the spec of the Pi, TV hat and a USB sat tuner with it's own LNB power supply. It suffered various issues, switching to the official PSU those issues disappeared.

RE: Continuity errors and subscription errors on live broadcasts - Added by Max - 11 days ago

saen acro wrote:

Is Pi power supply is enough powerful?

[...]

I'm sure that's not the Pi's problem because the errors are happening on completely different hardware too.
I'm using the official PSU.
While the channel is running for more than 15 minutes:

vcgencmd measure_temp 
temp=65.2'C
vcgencmd measure_volts 
volt=0.9260V
vcgencmd get_throttled 
throttled=0x0

RE: Continuity errors and subscription errors on live broadcasts - Added by saen acro 11 days ago

Max - wrote:

vcgencmd measure_temp
temp=65.2'C
vcgencmd measure_volts
volt=0.9260V
vcgencmd get_throttled
throttled=0x0

It's time to cool this processor!
And what are parameters of PSU?
Guessing less then 3Amps, with recommenced 5A+

Calculation is simple
Each USB2 device ~5V/1A or ~0.4 from 12V
Each USB3 device ~5V/3A or ~1.3A from 12V
this is recommended basics for external device's.
For fan and internal device's reserve 2.5A + above minimum.

RE: Continuity errors and subscription errors on live broadcasts - Added by Flole Systems 11 days ago

The CPU is rated for well beyond 100°C....

Your current calculations are also very extreme.

RE: Continuity errors and subscription errors on live broadcasts - Added by saen acro 11 days ago

Flole Systems wrote:

The CPU is rated for well beyond 100°C....

What about throttling?
This is what exactly happened, VRM send reduced pulses and capacitors cannot compensate
Lets don't forget that device don't have DMA and IRQ as on x86!

RE: Continuity errors and subscription errors on live broadcasts - Added by Flole Systems 11 days ago

Throttling is happening at 80°C

You don't seem to understand how throttling works, it has nothing todo with reduced pulses...

They do have DMA and IRQ...

RE: Continuity errors and subscription errors on live broadcasts - Added by saen acro 11 days ago

Flole Systems wrote:

Throttling is happening at 80°C

You don't seem to understand how throttling works, it has nothing todo with reduced pulses...

They do have DMA and IRQ...

Read the whole sentence not first part.

https://developer-blog.net/hitzeprobleme-beim-raspberry-pi-4/

Official PSU is 15W 5.1V/3A
Take 20W or 4A, see difference.

I sell RPi and take Jaguar board quad core Celeron x86_64 and problems gone

RE: Continuity errors and subscription errors on live broadcasts - Added by Max - 11 days ago

A new power supply or a cooler CPU will not solve the initial problem.
As I noted in my first post, the exact same problem happens on my Lenovo G550 laptop too. The G550 is x86 (not arm64), has its own PSU, and shares nothing in common with the Pi (hardware wise).

To rule out all hardware related problems, I ran Tvheadend and Kodi on my PC and connected the tuner to an externally powered USB hub. The PC has an i7-8700k CPU, an RTX2080 GPU, and a Corsair HX1000i PSU, so neither of them is weak to run Tvheadend. The errors are there, as on any other platform I tried.

RE: Continuity errors and subscription errors on live broadcasts - Added by Flole Systems 11 days ago

saen acro wrote:

Flole Systems wrote:

Throttling is happening at 80°C

You don't seem to understand how throttling works, it has nothing todo with reduced pulses...

They do have DMA and IRQ...

Read the whole sentence not first part.

https://developer-blog.net/hitzeprobleme-beim-raspberry-pi-4/

Official PSU is 15W 5.1V/3A
Take 20W or 4A, see difference.

I sell RPi and take Jaguar board quad core Celeron x86_64 and problems gone

A website that is using affiliate links to make profit obviously wants you to click on them and buy those parts.

A normal USB-C connector is only rated for 3A, using a power supply with more than 3A poses the risk of overloading that connector which may result in damage to the connector or even a fire. Depending on the PCB trace width they might not be designed for that much current either.

But as he stated the issues aren't gone with other boards. Sometimes I get the impression that you don't understand some fundamental things. That's fine, but please don't confuse others with such advice, it's not helpful if it's just plain wrong.

    (1-15/15)