TVHeadend - Poor perfomance - Wetek Play 2 - LibreElec 11 Beta 1

  • Hello alltogether,

    since recently I am testing the alpha build of LibreElec 11 (from chewitt) on my Wetek Play 2 box. I have a Haupauge USB tuner (WinTV-Nova-S2) connected to the box and TVHeadend 4.2 installed. Live TV works basically, but with a poor perfomance. E.g. on startup of the box it needs around 4 minutes after the Kodi GUI is visible until the TV sections is filled with channels. Watching a channel, it now and than buffers, showing the time icon, or having artefacts in the image and has also hanged completely.


    I have a debug kodi.log (mentioning TVHeadend just once) and a TVHeadeend log (but this is 1.6GB big, too big to upload I think)

    Any idea what to do to improve the perfomance?

  • Some things I would try:

    - Test with TVH 4.3 not 4.2

    - Test the tuner on different hardware running the same LE release, e.g. x86_64

    Logs showing at least the unusual boot delay would be interesting.

  • I have now tested with TVH 4.3.

    It works indeed better. The long boot delay vanished. Start-up time is fine now.

    The video is not buffering (time icon) anymore, but I still see 'artefacts'.

    I tested:

    1) The public TV channels in Germany (e.g. Das Erste) 1280x720, 50Hz

    2) Some free HD channels (e.g. BBC World News) 1920x1080, 25 Hz

    3) Some commercial SD channels (e.g. RTL Television) 720x576, 25 Hz

    For 1) I have seen 'artefacts', but seldom

    For 2) I see 'artefacts' more often.

    3) does not work at all (only audio)

    Additionally I tried streaming from TVHeadend server to my notebook. This works for 1), 2) and 3). I have seen artefacts, but less than in Kodi.

  • Artefacts aren't something we can do much about. Handling them better is mostly a combination of the codecs, which can surely be improved but we struggle to find anyone to do the work, and the firmware which is sadly closed source.

  • Assuming you're looking 19.2E Astra 1 then

    1) and 2) are h.264 (aka 'MPEG4') compression - with 1. being 720p50 "progressive' and 2. being 1080i25 (aka 1080/50i) "interlaced"

    3) is 576i25 (aka 576/50i) "interlaced" using MPEG2 compression.

    So it sounds like there are issues with both deinterlacing and MPEG2 decoding?

  • chewitt So, you do not think it has something to do with TVHeadend and the USB SAT tuner. I thought about testing to access the TVHeadend server on the CoreElec box instead. But this will not happen soon (needing switch to connect both boxes to the ethernet and being away next week).

    Is the support for SD channels planned until release?

  • chewitt So, you do not think it has something to do with TVHeadend and the USB SAT tuner. I thought about testing to access the TVHeadend server on the CoreElec box instead. But this will not happen soon (needing switch to connect both boxes to the ethernet and being away next week).

    Is the support for SD channels planned until release?

    Are you able to test on a Windows or Mac laptop running Kodi over a network connection to your TV Headend + DVB-S capture solution box Or by running VLC and taking the http streams from TV Headend's UI?

    (To test in VLC you copy the link from the play icon - by right clicking and copying the link - next to the channel in the Services tab and then paste the link it into the Open Network option in VLC)

    That way you can confirm whether the issue is with TV Headend and the DVB Reception, or your Kodi playback environment.

    If you can't network stream - then you could copy a recording to a USB stick and try to play that on another platform?

    The fact that you get audio but not video with SD content suggests the issue is probably with your playback option (Audio and Video are all received as part of a single data stream - so the fact you're getting audio suggests the issue isn't with TV Headend or your DVB-S reception solution probably)

  • noggin I have done (a bit) streaming checking already:

    Quote

    Additionally I tried streaming from TVHeadend server to my notebook. This works for 1), 2) and 3). I have seen artefacts, but less than in Kodi.

    Streaming for the SD channels worked, so this seems to be a Kodi problem.

    I have seen less artifacts on the other channels (streaming), but I think I have seen at least one time an artifact. But I have not watched for long, maybe I should repeat it for a bit longer to be more sure.

  • If you want to rule out TVHeadend altogether you can install NextPVR Server (available on the LE11 repo under Services). It reads from /dev/dvb too so TVHeadend will need to be stopped Scan, but don't bother with the OTA EPG update for the test.

    Martin

  • Assuming you're looking 19.2E Astra 1 then

    1) and 2) are h.264 (aka 'MPEG4') compression - with 1. being 720p50 "progressive' and 2. being 1080i25 (aka 1080/50i) "interlaced"

    3) is 576i25 (aka 576/50i) "interlaced" using MPEG2 compression.

    So it sounds like there are issues with both deinterlacing and MPEG2 decoding?

    The upstream Amlogic VDEC currently has no support for hardware interlacing (we force software yadif) and you need to have 50/59.94/60 Hz modes enabled in the whitelist and 25/29.97/30 Hz modes disabled; this combination allows Kodi to render each interlaced half-frame as a whole progressive frame. There is no support for hardware MPEG2 decoding but Kodi will software decode.

  • In the meanwhile I did some more testing:

    1) There are quite often artifacts using live TV (TVHeadend) in Kodi

    a) There are more artifacts on the 1920i1080 than on the 720p50 channels

    b) 576i25 channels are not working (no video)

    c) I also regarded reconnecting to TVHeadend server, but seldom (actually only after one boot).

    2) For checking TVHeadend alone, I have done:

    a) Streaming from the Web GUI

    b) Making an recording and watching it later

    For both cases there are artifacts, but less than than using live TV in Kodi. For the recording, artifacts were shown around every 10 minutes.

    3) To check for the Haupauge USB tuner (WinTV-Nova-S2)

    I tried it on my notebook, running Kubuntu 22.04, using Kaffeine as TV application. I needed to install the packagelinux-firmware-hauppauge from hauppauge ppa.

    Until now I have seen no artifacts at all. So, in general the USB tuner should work on Linux.


    4) I tried to boot LibreElec on my notebook from USB stick, but it failed booting. I think this was because I am using secure boot. It is a multi boot installation (Windows 11, Kubuntu 22.04) using secure boot. Because the notebook is in daily use, I am hesitant to change secure boot.


    I plan to check it again during the LibreElec 11 beta cycle (My CoreElec 9.2.8 installation is still working, so there is no urgency).


    Best regards

    Kai

  • Updated to LibreElec 11.0 Beta on the weekend.

    There is one improvement: 576i25 channels are working now.

    Otherwise no improvement. I watched a film on a 720p50 channel yesterday. It was a bit jerky, seen artefact every some minutes and one time the video freezes completely (I than choosed the channel again and it continued as before).

  • There is no hardware deinterlace in any codec, forcing software deinterlace which is limited (else you hit the CPU limits). I've disabled support for MPEG2/MPEG4 hardware decoding in the latest images (as the hardware decoder is broken) which is why those 'work' now. However, ff those codecs and interlacing are important for your media; you aren't in the narrow band of users who should be using the AMLGX image. I have low expectations on progress because it's basically me solo supporting Amlogic these days, and I don't write driver code.

  • There is no hardware deinterlace in any codec, forcing software deinterlace which is limited (else you hit the CPU limits). I've disabled support for MPEG2/MPEG4 hardware decoding in the latest images (as the hardware decoder is broken) which is why those 'work' now. However, ff those codecs and interlacing are important for your media; you aren't in the narrow band of users who should be using the AMLGX image. I have low expectations on progress because it's basically me solo supporting Amlogic these days, and I don't write driver code.

    576i25 MPEG2 with software decode (and software deinterlace) I guess is working then, but 720p50 h.264 (software decode, but no deinterlace required) may be pushing the CPU to far?

    Without hardware decoding, HD h264 is usually too much for these earlier CPUs, and 720p50 with software decoder is pushing it, and 1080i25 with software decode and software deinterlace almost certainly is.

    I guess the choice now is stick with older builds that had hardware decode and deinterlace support, or change platform to something that supports mainline LE builds, or a newer AML platform and run CE?

  • OK, thank you for trying to support older hardware. I will consider a new platform.

    CoreElec may provide better performance and hardware support due to using the vendor kernel. But I was a bit dissapointed for them dropping support for the older AML hardware quite fast, just one release supported the Wetek Play 2 box.

    And, as far as i know, there is currently no hardware and distribution supporting internal tuners, which was a big advantage of Core Elec 9.2.

    I am not decided, yet, but currently I tend to go with a Rasberry PI 4 and LibreElec.

  • RPi4 is excelently supported, but DVB is an icky topic regardless of hardware. The general recommendation is to separate tuners from the playback device so you can run whatever OS and hacked version of drivers and firmware that works reliably .. with playback on something simple that you can OS bump whenever LE puts out a new release. The moment you put both functions on the same device you can have a reliable player or DVB that works; they are generally mutually exclusive and you have to chose one.

    That means you could revert to a legacy image, e.g. CE or dtech's LE 9.2.8 one for the TVH side. RPi4 is a nice playback device if you can get your hands on one.

  • RPi4 is excelently supported, but DVB is an icky topic regardless of hardware. The general recommendation is to separate tuners from the playback device so you can run whatever OS and hacked version of drivers and firmware that works reliably .. with playback on something simple that you can OS bump whenever LE puts out a new release. The moment you put both functions on the same device you can have a reliable player or DVB that works; they are generally mutually exclusive and you have to chose one.

    That means you could revert to a legacy image, e.g. CE or dtech's LE 9.2.8 one for the TVH side. RPi4 is a nice playback device if you can get your hands on one.

    Yes - though the single-tuner DVB-T/T2 TV Hat on the Pi 4B is almost an integrated tuner and is available for £6.30 on Amazon UK at the moment. (In the UK this will allow you to record any or all HD services simultaneously - as they are all on the same frequency here in the PSB3 mux - though I think the SPI interface used does struggle to stream the full 40Mbs of a PSB Mux so you may not be able to record ALL channels simultaneously...). As it's a Raspberry Pi product, driver support on Pi OSs is reasonably good I think, and the Pi team are good at mainlining their driver support AIUI.

    Raspberry Pi TV HAT
    Raspberry Pi TV hat dvb-t/t2 raspberry pi TV hat dvb-t/t2 The Raspberry brand guarantees the highest standards during the production process, to ensure an…
    www.amazon.co.uk

    You can get cases that are designed for the Pi 4B and the TV Hat too.

    However as chewitt says - it's usually better to separate your DVB/ATSC tuner and TV Headend backend from your Kodi playback solution, as it avoids your Kodi playback solution (like LibreElec) needing specific driver support.

    You can also look at HD HomeRun networked DVB-T/T2 tuners (now available again - and available in 2 and 4 tuner flavours - along with ATSC variants in North America) or SAT>IP if you are looking for DVB-S/S2 functionality. These move tuner support to a networked device, meaning you can run TV Headend on Kodi platforms (should you wish) as the driver support is removed from the OS running Kodi, or you can run TV Headend on things like NAS/Unraid/ESXi VM boxes, or a small Pi server that just sits on the network with a hard drive for recording.

    I run HDHomeRuns and SAT>IP mainly these days - with just a couple of USB DVB tuners kicking around for backups, use out and about etc.