kodi-pvr / pvr.hts

Kodi's Tvheadend HTSP client addon
GNU General Public License v2.0
136 stars 93 forks source link

Live-TV buffering issues with htsp streaming (not with http) #580

Closed m4tt075 closed 2 years ago

m4tt075 commented 2 years ago

Setup

What happens

It started occasionally about 4-6 weeks ago, but got increasingly worse. Effect is always the same. Live-TV streaming stops, the blue buffering circle occurs, streaming restarts. The kodi.log file captures "stream stalled" messages. Stalling ranges between ~5 seconds (connection to TVH server maintained), to ~15 seconds (when client and server lose the connection). I can see the client losses in the TVH logs on the server-side, but otherwise, there is nothing.

Analyses so far

Hypotheses

I've been looking at Kodi and CE forums, but apparently this is not a common issue, as otherwise there would have been way more reports. I know from @FernetMenta that there are "flaws" with the htsp protocol anyways. I suspect that this is the problem. Maybe something is disturbing the streams on the server side, and htsp cannot handle the buffering correctly whereas http can. But I don't know how to debug the issue further.

Questions

As always, any insights appreciated...

M0dj0 commented 2 years ago

I am facing the exact same problem.

Here some information to my setup:

Stream over HTTP: No Problems (Client 1 & Client 2) Stream over HTSP: Stuttering after a few seconds with "Uncorrected Blocks" increasing in TVHeadend Server. (Client 1 & Client 2). It feels like a depleted cache or so, which doesn't manage to build up anymore and then causes the dropouts.

But when I start a HTSP Stream from another Device like TVHClient Addon on Android, there are no problems at all.

For some reason there seems to be a bug or a different setting in pvr.hts 20.2.2 which pulls everything down.

ksooo commented 2 years ago

But when I start a HTSP Stream from another Device like TVHClient Addon on Android, there are no problems at all.

And you are absolutely sure that this Addon is streaming using HTSP? Do you have some proof, a log maybe?

m4tt075 commented 2 years ago

I'm not sure. I've resolved my problem in the meantime. It was caused by a Chia container that kept writing to and reading from it's database on my slow HDD NAS drives. Since I've moved the db to a quicker SSD, the stuttering is gone.

I keep believing that HTSP streaming is more error-prone than HTTP streaming though, i.e. that it is simply not as stable. Not sure this is helpful for you. But you can log into your server and use docker stats to see what is causing CPU or memory workload or anything else. I've found that helpful for the diagnostics.

Closing, as my problem was only exposed, but not caused by TVH.