Project

General

Profile

DVB-S2 Streaming issues over htsp with timeshift over nfs, pass is fine | htsp client: kodi/showtime

Added by Dennis Rassmann over 8 years ago

First of all: Hello.

What is the issue?

Streaming from my tvheadend back-end to any front-end using htsp as protocol is sometimes laggy, then after some time calms down to just a reduced framerate (about 2-3 fps) for a few seconds.
Imagine it as this (timeline):

|-e*--------eeee-----------------eeee------------------ee******-----------------*****----------------*****---------|

| = start/end
- = stream normal
e = stream lag (= video / audio pauses or jumps back and forth for a few seconds)
* = reduced fps

(discard the first error after opening, I don't care about that)

In the web interface the bandwidth throughput graph shows this:


(top: Kodi, bottom: VLC)

Kodi is constantly using less bandwidth than VLC and suddenly stops getting any data at all, while the input is unchanged. After that it starts again with double the bandwidth and goes back to normal. This behavior is sometimes also present as sort of a sinus wave which results in longer lags. (with 2 or 3 cycles)

Recordings have no issues.

The issue disappears if I disable Timeshift! (which is not on-demand)
Configuration a few lines down

What do I expect to see?

No lags or reduced fps.
Viewing a stream over VLC using the web interface as a launcher works perfectly. Though VLC uses 'pass' to get the stream.

Which Hardware am I using?

DVB-S2 receiver: Montage Technology M88DS3103
tvheadend server: Raspberry Pi 3 (also tested a mini-ITX with a Core2Quad, no changes. Rasperry CPU usage is 30% on one core with 2 streams running)
Clients: various hardware configurations (from an i7-2700K
4.5Ghz with an AMD Radeon r9 290X to a Raspberry Pi 2)

Which Software am I using?

Various OpenELEC & OSMC (which refuses to show a video altogether) versions were tried on the Raspberry Pi 2, which has codecs for MPEG2 and VC1.
Windows / Linux Kodi 16.1 using tvheadend htsp client 2.2.16

tvheadend server:
debian version:

Distributor ID:    Raspbian
Description:    Raspbian GNU/Linux 8.0 (jessie)
Release:    8.0
Codename:    jessie

kernel version:
Linux tvpi 4.4.13-v7+ #894 SMP Mon Jun 13 13:13:27 BST 2016 armv7l GNU/Linux

tvheadend version:
Compiled from source:
master 0bc30b9 webui: fix idnode_filter_fields
Configuration version: 23
Last updated from: 4.1-2134~g0bc30b9

Any Special configurations?

Saving timeshift and recordings to an NFSv4 share on a Supermicro Superserver A+ 2022G-URF in-house with 10Gbit/s bandwidth (this is not a bottleneck).
HW specs of the server: It is sufficient to say that the server is not bottle-necking anything.

mounted on the Raspbery Pi 3 as:

#storage
10.0.1.9:/export/R6ARRAY/tv /home/pi/storage nfs auto,rw 0 0

$ ls -alh /home/pi/storage
total 16K
drwxrwxrwx 4 nobody nogroup 4,0K Jun 26 00:28 .
drwxr-xr-x 9 pi     pi      4,0K Jun 26 23:26 ..
drwxrwxrwx 2 nobody nogroup 4,0K Jun 27 21:57 rec
drwxrwxrwx 3 nobody nogroup 4,0K Jun 26 10:43 time

Issue still exists if I save timeshifts to an external HDD connected to the tvheadend server.

Which fixes did I try?

Some before figuring out that it is Timeshift that is causing the issue.
Fixes as mentioned in various Google searches and all with no effect:

Setting up large caching for pvr streams in kodi
Disabling deinterlace
Disabling HW decoding
Disabling post-processing
Enabling async epg download
blocking epg download during playback
moving timeshift directory to USB-connected HDD