Project

General

Profile

Bug #5760

'Clear all statistics' button does not clear disconnected channel stats

Added by Pablo R. 22 days ago. Updated 21 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
API
Target version:
-
Start date:
2019-10-27
Due date:
% Done:

0%

Estimated time:
Found in version:
4.3-1845
Affected Versions:

Description

'api/status/inputclrstats' is only clearing connected channel stats. When reusing an old channel with errors those are still there.

It could lead to doubts when seeing old and new errors.


Files

rec.gif (411 KB) rec.gif saen acro, 2019-10-27 23:05

History

#1

Updated by saen acro 21 days ago

Few seconds later, all tuners have stats before cleaning.

#2

Updated by Flole Systems 21 days ago

What exactly do you mean by "connected channel stats"? You mean an IPTV tuner thats not shown in the tuner list when pressing the button?

#3

Updated by Pablo R. 21 days ago

Flole Systems wrote:

What exactly do you mean by "connected channel stats"? You mean an IPTV tuner thats not shown in the tuner list when pressing the button?

Yes!

#4

Updated by Flole Systems 21 days ago

I think those "tuners" should clear their stats anyways when they connect, there's no point in retaining the old error counters if they might aswell connect to a completely different server, unlike all other sources that have the tuner connected to the same thing all the time (same tuner/cable, same SAT-IP server or whatever) so it helps identify issues with a server or tuner here while on IPTV it doesn't as they can connect to something completely on retuning.

#5

Updated by Pablo R. 21 days ago

Flole Systems wrote:

I think those "tuners" should clear their stats anyways when they connect, there's no point in retaining the old error counters if they might aswell connect to a completely different server, unlike all other sources that have the tuner connected to the same thing all the time (same tuner/cable, same SAT-IP server or whatever) so it helps identify issues with a server or tuner here while on IPTV it doesn't as they can connect to something completely on retuning.

Thats true, but it also happens for IPTV channels. That should be auto cleaned on disconnection.
Also, I think all these counters are stored on tvheadend/webui side, not on tuner/remote server side.

#6

Updated by Flole Systems 21 days ago

Yeah maybe also on disconnection, I'd clear it before connecting so when using gdb you might still be able to see it.

Yes those tuners are local, but the point I'm trying to make is that "IPTV #1" might connect to www.example.org now and pick up errors there, disconnect and connect to www.notexample.org next time and then show the errors there, which would be confusing so clearing it completely on connect would be the way to go.

#7

Updated by Flole Systems 21 days ago

Sorry that was written quite bad: The tuner error counters are local of course.

#8

Updated by saen acro 21 days ago

In my case DVB-C
after restart and epg start to scan there is errors
value of errors restore few seconds after button used.

#9

Updated by Flole Systems 21 days ago

For me clearing works fine for SAT-IP and DVB-C, I haven't verified IPTV as I never got errors there (I'm not really using that, just for a few local surveillance cams)

#10

Updated by saen acro 21 days ago

this is live example ;)

#11

Updated by Flole Systems 21 days ago

Ah you are talking about uncorrected errors, I don't have those here, just continuity errors from time to time.

Anyways, to fix the original issue I came up with this (untested) patch, it could work or it could cause tvheadend to crash:

Add to src/input/mpegts/iptv/iptv.c:338

  /* Reset Error Counters */
  atomic_set(&mmi->tii_stats.unc, 0);
  atomic_set(&mmi->tii_stats.cc, 0); 

#12

Updated by Flole Systems 21 days ago

Actually try to add the following aswell to completely reset everything:

  tvh_mutex_lock(&mmi->tii_stats_mutex);
  mmi->tii_stats.te = 0;
  mmi->tii_stats.ec_block = 0;
  mmi->tii_stats.tc_block = 0;
  tvh_mutex_unlock(&mmi->tii_stats_mutex);
#13

Updated by Pablo R. 21 days ago

I do not see at all bad that errors are saved, because if you are not on PC then you can review them.
What is wrong is that when you press the delete button some are not deleted, which is what causes doubt.

#14

Updated by Flole Systems 21 days ago

The problem is though for IPTV, you do not know which source they are from like I mentioned above: "IPTV #1" might connect to www.example.org now and pick up errors there, disconnect and connect to www.notexample.org next time and then show the errors there from example.org, which would be confusing so clearing it completely on connect would be the way to go. It would show errors on www.notexample.org while really example.org caused them.

They are not cleared because only "active"/existing tuners are found (are cleared), so clearing the IPTV tuners does not happen in the function that is called when the button is pressed. An IPTV tuner is created (or added) when its used and removed afterwards, that's why its not found.

#15

Updated by Luis Alves 21 days ago

Maybe change the stats to be "per mux" instead of "per adapter".

This change would fix the IPTV issue described above.

#16

Updated by Jaroslav Kysela 21 days ago

Those values are read from the driver (linuxdvb). We need to remember the old offset and compute only deltas like SAT>IP client does. Look for 'tii_stats.unc' updates in src/input/mpegts/linuxdvb/linuxdvb_frontend.c .

Also available in: Atom PDF