LibreELEC 9.2 and KodiI recently got into a discussion with someone who had purchased a second television for their house and, knowing that I have a fondness for open source and do-it-yourself projects, they asked if there was a suitable alternative to Fire TV. For those not familiar with the device, a Fire TV stick is a small device which looks like a large USB thumb drive and attaches to the HDMI port of a television. The device connects wirelessly to local networks and can be used to stream shows and movies from a variety of services like Netflix and Disney+. The device is operated by a small, dedicated remote control.
I was pretty sure a minimal Linux distribution running on a spare, minimal personal computer or a single-board device like a Raspberry Pi would probably be a suitable replacement. I figured a distribution that ran Kodi could probably do the work, connecting to the TV through an HDMI cable. The user could likely use the Kodi mobile app in place of a dedicated remote control.
For the sake of comparison, I looked up information on the Fire TV stick which was $55 USD if i wanted it in two weeks or $60 if I wanted it in one week. The person I was talking with already had one and knew it was a "plug and play" type device, so the total set up time would be under ten minutes.
I did some on-line shopping in my area and the closest open source style equivalent I could come up with was a Raspberry Pi 3B. The Pi was $47 USD. The Pi included a Wi-Fi option, but no microSD card, no HDMI cable, and no power supply. Adding these items to my tally brought my total up to $78, including tax. In other words, even with a free software solution, it looked like the open source route was going to be slightly more expensive with parts available in my region.
Using a dedicated distribution
On the software side of things I decided to start off with LibreELEC, a minimal Linux distribution designed to run on both personal computers and a variety of ARM-powered devices, including the Raspberry Pi. The latest version of LibreELEC ships with Kodi 18.9. Kodi is a highly flexible media centre which supports a massive range of streaming and local player options through repositories of add-ons. I checked and confirmed there were third-party add-ons which were advertised to work with Netflix, YouTube, and Disney+, along with other popular streaming services.
The download for LibreELEC was 244MB for PCs and 125MB for the Raspberry Pi. These images are compressed and, when they are expanded, grow to 549MB each. We can then copy this image file to a microSD card and boot from it. LibreELEC is a very minimal distribution which basically just boots and launches the Kodi software. Or at least that was what I expected. However, the distribution would begin to boot, then restart the device, begin to boot again, and restart the device. I tried starting the distribution several times with various options and they all caused the operating system to enter a loop at boot.
I tried downloading the LibreELEC media again in case my copy of the distribution was corrupted. (As far as I can tell LibreELEC does not provide checksums or signatures for its media.) My second attempt was no better than the first. I also tried the generic PC build of LibreELEC with no better results. I could get LibreELEC to launch its installer, but not install successfully or run in live mode.
I was not discouraged however, because I felt I still had options. LibreELEC basically just runs the Kodi media centre, but I could theoretically install another distribution, such as Raspberry Pi OS, and then simply install the Kodi software on top of it.
Using a generic distribution
Setting up the general purpose distribution was straight forward enough and, once it was in place, adding the Kodi package pulled in an extra 85MB of packages. This gave me a copy of Kodi 18.5 which I could launch. Kodi's media centre can be navigated using a smart phone app, a mouse, or a keyboard, making it pleasantly flexible. I find navigating the Kodi interface a little foreign, but I gradually got the hang of things. The media centre is relatively large, using 273MB of memory without any add-ons installed and no media playing.
I then set about trying to get some streaming services set up. Kodi's documentation seems to side-step this a bit, probably to avoid potential legal issues, but there are lots of tutorials and tips on the site Kodi Guide which explain how to get the most out of the media centre.
I decided to start with accessing Netflix. Following a how-to I found a Netflix add-on package... which turn out to be depreciated. However, that add-on's GitHub repository linked to another, actively maintained one. This allowed me to download a Zip file. From within the Kodi interface I selected the Zip file as a new add-on and its installation failed. This turned out to be the result a security feature which blocks third-party plugins. I found where to disable the block against third-party add-ons in the Kodi settings and tried again. The new add-on did not include the Netflix add-on, but it did set up a repository which in turn included the Netflix add-on. I then installed Netflix and tried to run it.
I found I could sign into Netflix and browse available titles, but not view any streams. Attempting to stream a movie or show caused an error to appear telling me "inputstream.adaptive" was missing. I checked around and found this guide for adding the missing software. Unfortunately the guide assumes a category of software in the Kodi repository is available that was not present on my system, specially "VideoPlayer InputStream" was missing. This is a problem a number of other people reported in the comments under the guide, across multiple versions of Kodi, including the latest 18.9 version.
Trying to play Netflix content (full image size: 404kB, resolution: 1366x768 pixels)
I set about looking for other ways to install the inputstream.adaptive add-on, but the Kodi wiki says this software must be installed through the Kodi repository (though it is missing in my case). I tried to find more information on the missing plugin, but relevant links led me in circles on the wiki.
Missing the necessary category in the Kodi repository (full image size: 587kB, resolution: 1366x768 pixels)
Wondering if maybe I was just having bad luck with one service, I tried installing an add-on for YouTube. The YouTube add-on installed, but accessing any video streams would fail. The error message reported I would need my own API keys. There is a link to instructions on how to add these keys which requires signing into a Google Developers account and then manually configuring the add-on to use newly generated digital keys.
Encountering an error while trying to access YouTube (full image size: 221kB, resolution: 1366x768 pixels)
I also tried a Disney+ add-on. This followed a very similar process to installing Netflix where I downloaded an add-on, used that to gain access to a new repository, and then installed the Disney+ add-on from the new repository. Once again I could access the service and login, but not watch anything due to missing dependencies.
Flatpak to the rescue
At this point I was feeling as though I'd been falling down the rabbit hole for a while. Each add-on gave me an error that led me to a guide that seemed to be inaccurate or incomplete. I considered that the problem might be with the Kodi package I was running - perhaps it was too old or there was a problem with the package.
I decided to switch gears and set up Debian on a laptop and then install the latest Kodi Flatpak from Flathub. My thought was this would give me an up to date version of Kodi on a popular distribution on a popular architecture, reducing most possible issues or overlooked problems.
I downloaded the latest stable version of Kodi available on Flathub. The total download was 700MB in size. The installation went well, pulling in Kodi and its dependencies. However, Kodi failed to run, reporting that it would not find the Wayland display server. Which made sense since Wayland was not installed and I was running a window manager on the X.Org display server. There did not appear to be any way around this Wayland dependency, short installing a heavier desktop like GNOME that would have used up most of the device's available memory.
Curious if the issue was specific to me, I got a peer who sometimes reviews Linux distributions for DistroWatch and other sites to give the Kodi Flatpak a try on a Wayland-powered desktop. They successfully installed the Kodi Flatpak, but the media centre failed to run, reporting a similar error to the one I encountered: "No protocol specified. ERROR: Unable to create GUI. Exiting" It seems the Kodi Flatpak package is not yet ready for general use.
Conclusions
Trying to get Kodi running, through a variety of approaches, felt a lot like dealing with the RPM dependency issues of twenty years ago. While I know getting Kodi to work with various video providers is possible, and I know some people who have purchased it bundled on embedded devices, it seems to require a steady stream of problem solving. It is a situation which is not helped by outdated documentation (in some situations) and depreciated plugins in others. I was always on the wrong distribution, the wrong display server, installing an out of date add-on, missing a dependency, hunting down a setting, trying to find a complete guide, etc.
Including the install times for the operating systems and Kodi packages, my experiment went on for over six hours and, in the end, not a single video played successfully. This is with the benefit of my experience helping me navigate incomplete guides, knowing how to install plugins, and knowing what dependencies are and what Wayland is. I have a feeling many potential users of LibreELEC and Kodi would have more of a challenge if they were looking to replace pre-packaged solutions with this open source alternative.