Raspberry Pi 4 - LibreELEC KODI

bottletop

Active Member
Introduction
The Humax HDR Fox T2 with custom firmware is an excellent combination, so I intend to keep using it for as long as I can.
This is my plan for the eventual replacement of my Humax HDR Fox T2 (eg if the Humax hardware fails completely).
This is not my original work. I have gathered information from the internet and trying it out.
Others have done the heavy lifting, I am just documenting my attempts here. It will remind me why I did things for when I need to reinstall (like where did I put my notes?). It may help others. This is all work in progress and I will update as I go along. I am a Humax HDR FOX T2 user in the UK, so the settings will reflect me trying to set this up as my HDR replacement.

Hardware
Which Raspberry Pi?
I only considered a Pi 3B+ (£34) or 4B (2GB £34, 4GB £54, 8GB £74).
For the 3B+ you will probably need to purchase the license keys (MPEG-2 £2.40, VC-1 £1.20).

So I decided on a 4GB 4B.
The 4B is has more memory and faster than the older models.
It should cope with 1080p playback now and in the future the promised 4k should be silky smooth.
As it is not as established as the older models, some software and drivers are not fully optimised for it yet.

Breakdown of hardware costs
£54 Rasperry Pi 4GB​
£20 case (with fan and or heatsinks)​
£60 2x USB DVB-T2 tuners (or a single dual tuner)​
£10 RF aerial splitter (if using multiple USB tuners)​
£9 psu​
£20 Flirc remote control dongle (not absolutely needed, but simplifies remote control matching)​
£7 micro HDMI to HDMI cable​
£5 sd card​
£185 Total​

Other hardware
£55-70 external 2TB USB portable drive to hold recordings.
It will be possible to use 1 Raspberry DVB-T2 TV Hat and additional USB DVB-T2 dongle(s). You can only install one Raspberry DVB-T2 TV Hat on a Raspberry Pi. I decided against against the TV Hat as I may wish to use the GPIO pins for other functions in the future.
Alternative case, eg like an old STB stripped out so that you can populate the innards with the Pi, tuners, hard drive and probably a fan for good measure. It's extra work and look better than spaghetti layout of the Pi and components.
If you don't have a Raspberry Pi, you can probably try KODI out if you have a spare PC & DVB-T/DVB-T2 hardware. In this case just install KODI onto it and try KODI without buying additional hardware.

Software
What I plan to install
LibreELEC (with KODI)
TVHeadend (backend for tuners)
TVHeadend HTSP Client (to communicate with TVHeadend backend)

Other options
OSMC/KODI - alternative to LibreELEC/KODI but it's not available ready yet for the 4B
Self install KODI, TVHeadend etc - I'm not ready for that task yet.
MythTV - using this instead of KODI is an option, but I haven't tried it yet.

What I have discovered so far
Good points
  • Accurate Record - This works. Do this for each recording profile - tick option TVHeadend server Configuration/Recording/Digital Video Recorder Profiles/(Default profile)/Use EPG running state.
  • Series Recording - This indirectly works, but is not selectable via the KODI GUI (you can change guide context menu to add a timer, but this still performs program matching). Using the KODI GUI allows you to do various fuzzy matching options for channel, program titles and summary so that may be adequate for some people. You can use the backend web interface (i.e. IP-OF-LEELEC-PI:9981) to create a series link timer (this works 100%).
  • There are 2 Android apps that you can use to view the TV guide and schedule recordings, but neither of them do series link properly.
  • There are 2 IOS apps, that do allow you to view TV guide and schedule recordings, but I have not tried them.
  • HDMI-CEC - this is enabled by default, so if your TV supports it, you can use the TV remote to navigate around KODI GUI. The only issue with this is that some keys aren't mapped and some keys aren't obvious. So you end up bouncing back and forth through the menus, options, TV menu, KODI GUI. Attaching a USB keyboard to the Pi helps with the setting up greatly.

Bad points
  • Always on - as the Pi doesn't have a battery back up clock it needs to stay on all the time (ie it can't wake up from standby due to lack of clock, but it may be possible with the addition of a battery backup clock module)
  • Occasional freeze ups - although this could be due to my setup mistakes.
  • It's not as cheap as I first thought (after adding up all required parts).
  • Takes a time to set up and acclimatise to KODI.

Undecided
There are a myriad of set up options that look daunting at first, but it this is due to the complexity and range of software/hardware combinations it caters for. It does allow fine tuning to individual requirements, so you can set it up to be as simple or as comprehensive as you like..
I have only tried it with 1 USB DVB-T2 tuner, without Flirc, on a Raspberry Pi 4. It works fine and allows you to record more than 1 program simultaneously as long as they are all on the same mux. I expect more tuners allow more simultaneous recordings.

Post History
2020-11-25 It's nearly Christmas so I thought I'd release this info. It also gives others a rough idea in terms of material cost, time and effort.

Sources of information
https://libreelec.tv/
https://libreelec.tv/raspberry-pi-4/
https://osmc.tv/
https://osmc.tv/download/
KODI/TVH series record via menu (post 7, last) https://tvheadend.org/boards/14/topics/21175
https://raspberrytips.com/kodi-guide-osmc/
 
Last edited:
Installation Steps
1. I intend to use manual IP, 192.168.1.45, for my installation. Yours may be different.
I suggest following this tutorial from the section - Tvheadend configuration
https://thepihut.com/blogs/raspberr...e-raspberry-pi-tv-hat#Tvheadend configuration
2. Download image from https://libreelec.tv/raspberry-pi-4/, overwrite contents of a micro sd card with the downloaded image using your preferred method.
3. Connect the DVB-T2 dongle(s) to the black USB2 ports. Connect micro HDMI to HDMI cable to leftmost micro HDMI port 0 (nearest USB-C power socket).
4. Power up and wait for it to boot up and perform initialisation steps. It may reboot once or twice.
5. On next reboot, wait for the LibreELEC wizard to appear and click Next and follow the steps.
6. I Connected it to my network using WiFi for convenience. After it connected using DHCP, I updated it to use static IP instead (eg IP 192.168.1.45).
7. Install backend TVHeadEnd - KODI/Add-ons/Install from repository/Services/TVheadend Server (4.2.8-36) 9.2.0.123
8. Use a web browser on another pc/laptop and access the backend port 9981, so in my case http://192.168.1.45:9981
9. Follow the TVHeadEnd settings wizard add 2 users, admin (with password admin) and * (with * , ie blank password)
10. Install client for TVHeadEnd - KODI/Add-ons/Install from repository/PVR clients/Tvheadend HTSP Client (4.4.21.1)
11. After the client installs, configure it - user * (with password blank) - KODI/Add-ons/Install from repository/PVR clients/Tvheadend HTSP Client (4.4.21.1)/configure
12. We will follow the steps similar to https://zedt.eu/tech/linux/dvb-c-tv-raspberry-pi-libreeleckodi/
but bear in mind we are using DVB-T2 tuner instead of DVB-C.
13. Recheck the backend TVHeadEnd settings, eg http://192.168.1.45:9981 log in as admin
Configuration/Users/Access Entries - should show the 2 users we set up earlier - admin, *
Configuration/DVB Inputs/TV Adapters - should show your DVB adapters
Configuration/Channel EPG - only have 2 enabled - Over-the-air EIT DVB Grabber, Over-the-air UK Freeview.
Configuration/Recording/Timeshift - set this to your required duration eg 120 to emulate the Humax. Although I didn't set this during testing.
Configuration/Recording/Digital Video Recorder profiles/(default profile) - enable Use EPG running state (note: what we term as Accurate Record)
If you have further profiles, enable this for all that you wish to use Accurate Record.
14. Recheck the client TVHeadEnd settings - KODI/Add-ons/Install from repository/PVR clients/Tvheadend HTSP Client (4.4.21.1)
Connection settings
Username - (blank)
Password - (blank)
15. Hopefully it should all now work. Check by KODI/TV/Channels, KODI/TV/Guide, etc
16. Tidy up and check remaining settings & customisation (mostly personal preference)
KODI/Settings/PVR & Live TV/Guide/
Future days to display - (set this 7, but increase it slowly otherwise KODI may freeze!)
Default select action - Show context menu (required for series link record from guide -add timer-enter)

KODI/Add-ons/ My add-ons/Services
DVB drivers for TBS - disabled
DVB drivers from the latest kernel - enabled
Tvheadend server 4.2 - enabled
KODI/Add-ons/ My add-ons/PVR clients
Tvheadend HTSP Client - enabled

KODI/Add-ons/ My add-ons/Web interface/Arch, Chorus, Hax, Kodi web interface - Chorus2
KODI/Add-ons/ My add-ons/Skin/Confluence, Estouchy, Estuary

KODI/Settings/Services/Control
Web interface - select the one you prefer for your mobile/remote access

KODI/Settings/Interface/Regional - your personal preference
KODI/Settings/Systems/Input/Peripherals/CEC Adapter
(these are my personal settings because during testing the Pi switched off my TV once too often!)
Switch source tp this device on startup - disable
Devices to power on during startup - None
Devices to power on during shutdown - None
KODI/System/LibreELEC/System/Identification/System Name - LEPi4
KODI/System/LibreELEC/System/Keyboard/Keyboard Layout - uk
KODI/System/LibreELEC/System/Network/Wireless Networks/Wireless Regulatory Domain - United Kingdon (GB)

17. To do - add portable drive to blue USB port.
18. To do - test 2 tuners.
 
Last edited:
Back
Top