Streaming services on LibreELEC 9.0 with Kodi 18.0

Popcorn Cinema

© Lead Image © Natalia Lukiyanova, 123RF.com

© Lead Image © Natalia Lukiyanova, 123RF.com

Author(s):

Thanks to Kodi 18.0, LibreELEC 9.0 now supports the DRM encryption used by many streaming services. However, integrating Netflix, Amazon, and other streaming services does involve some manual work.

One of the most common tasks for the Raspberry Pi is still deployment as a media center. In combination with the Kodi media center software, the Rasp Pi can turn every "dumb" TV into a smart TV. Content from locally connected data carriers, an intranet, or the web can then be played back. These features are now available on even the simplest of modern TVs; however, with appropriate hardware upgrades and advanced configuration, the Rasp Pi media center can also record TV shows or stream them to the network so you can watch TV on your PC or smartphone.

The LibreELEC Kodi distribution serves as the basis for many Rasp Pi media centers. Under the hood, the operating system available for the Raspberry Pi and other small-board computers (SBCs), as well as for PCs, follows the "just enough operating system" principle – that is, Linux reduced to the bare bones.

Shortly after the release of Kodi 18.0, dubbed "Leia" by its developers, the LibreELEC project also announced the latest edition of its distribution, version 9.0.0. In this article, I take a look at what has happened in both projects and investigate how well new features, such as retro games and streaming services, perform on a Raspberry Pi.

New in Kodi 18.0

The developers of Kodi 18.0 deliver the first major release since February 2017 [1]. The media center was given completely new functions: Classic video games can now be launched and played directly on Kodi. However, Kodi itself does not run the games: The gamer is expected to provide the emulators, games, and ROMs.

Kodi 18 uses the Libretro library [2] from the RetroArch project [3] (Figure 1). Many emulators such as MAME [4] now support the library directly. Additionally, typical gaming input devices such as joysticks, gamepads, and other controllers can be integrated into the system, which means nothing can get in the way of enjoying a round of a Jump-n-Run classic like Super Mario Bros. or The Great Giana Sisters – if you have the right software offerings.

Figure 1: Kodi integrates retro gaming into version 18.0. The system supports various emulators, from the Amiga and C64 to game consoles.

In addition to your own video collection, streaming services such as Netflix, Amazon Prime Video, and Hulu deliver movies and series in digital form directly to your living room. Zattoo, Pluto TV, and other providers do the same for TV programs; thus, you can receive digital TV without cable access or satellite equipment. However, to protect against unlicensed copying, most services encrypt their content. Kodi 18 now knows how to handle these Digital Rights Management (DRM) routines, although compatibility essentially depends on the hardware and operating system you use.

The developers of Kodi 18 (Figure 2) also improved the music player and music library management. Indexed titles can now be organized more flexibly. For example, you can filter songs by source or the artist's gender. The improved API allows faster access to music collection content, which is particularly beneficial for users of a Kodi app on a smartphone or tablet.

Figure 2: The new Kodi version makes it easier to browse the music database. API access to the music collection has also been optimized.

Owners of a full-fledged media center PC will be especially pleased with the improved video player, which can process content faster and better in 4K and 8K resolution, as well as HDR. The media player now has priority over other functions when accessing the CPU and GPU, so it can play content as smoothly as possible. If the device on which you are using Kodi 18 has radio reception, it now displays station information with the help of the Radio Data System (RDS), which is standard on most car radios and hi-fi tuners today. RDS enables the transmission of additional digital information with analog FM radio.

New in LibreELEC 9.0

LibreELEC builds a fully functional system around Kodi. LibreELEC 9.0 [5], introduced in the wake of the new Kodi version, is based on the Kodi 18.x branch and integrates its new functions, such as DRM support for streaming media, as well as the RetroPlayer framework for running console games (assuming an appropriate add-on). Under the hood, the rapidly updated LibreELEC 9.0.1 MR uses the 4.19.23 kernel. (See the "Installing LibreELEC" box for instructions on getting LibreELEC on your Raspberry Pi.)

Installing LibreELEC

To install LibreELEC on an SBC like the Raspberry Pi, I recommend using the LibreELEC USB-SD Creator [6]. The program offered for Linux, macOS, and Windows prepares the required memory card in four simple steps. First, you select the desired version (usually Raspberry Pi 2 and 3) and then click Download to download the corresponding version from the web. In the third step, you specify the disk on which the wizard will install the image. Proceed with caution here, because all data on the storage medium is lost when you install. Finally, pressing Write puts the downloaded image to the SD card (Figure 3).

Figure 3: The LibreELEC USB-SD Creator makes installation on an SD card designed for the Raspberry Pi easy. The program is available for Linux, macOS, and Windows.

Now plug your SD card into the Raspberry Pi and boot the system. A setup wizard will guide you through the most important configuration steps. The best way to proceed is to plug a keyboard into the Pi, but you don't necessarily need a mouse. Start by assigning a computer name and setting up the network connection; wireless on a Rasp Pi 3 (RPi3) is supported by default. Next, enable SSH and Samba network services. In the case of SSH, the wizard automatically prompts you for a new password.

As a media center, a LibreELEC installation is in the category "install once, neglect forever"; very few users even think about security. Often, updates are not even installed, let alone default passwords changed. As a result, unprotected LibreELEC systems repeatedly end up directly on the Internet (e.g., when a user digs a tunnel into the network via a VPN).

Therefore, one of the new features of LibreELEC 9.0 that appears in the setup wizard is an interface for changing the SSH password. Alternatively, you can do this later in the gear menu under LibreELEC | Services | SSH | SSH password (Figure 4).

Figure 4: If you enable SSH access from the setup wizard, LibreELEC 9.0 immediately prompts you to change the default password, but you can also change the password from the Settings screen.

Moreover, a basic configuration of the iptables firewall provides additional security. In home mode, LibreELEC blocks incoming connections that do not come from the local network and thus protects active services such as SSH, Samba, and the Internet against unwanted access. If obsolete add-ons repeatedly cause problems when starting the system, a Safe Mode now provides a remedy. The system then starts with the basic configuration so that misbehaving add-ons and settings can be disabled.

The Games category will initially be empty. Two games can be installed quite easily for demonstration purposes. Open Add-on browser | Offline Games and set up 2048 and Mr.Boom (Bomberman), just as you would set up any other add-on. The corresponding game engines, including DOS (DOSBox), ScummVM, and Commodore-C64 (VICE C64), are automatically retrieved by the system.

If you plug a gamepad into the USB port, LibreELEC automatically registers the new device and offers to configure it. Alternatively, you can initialize the input device from the gear menu and the options System | Input | Peripherals | Configure attached controllers. Step by step, you can then hardwire the gamepad's buttons to console-specific buttons (e.g., A, B, X, and Y) (Figure 5).

Figure 5: When you connect a gamepad to the system, Kodi automatically opens a wizard to configure the new game input device.

In the RPi3 test, only the very simple 2048 game worked (Figure 6). Although the funnier and more action-packed Mr.Boom (Bomberman) is executed by the Rasp Pi, the screen remains blank. After pressing Esc, a menu appears to let you quit the game; strangely, the screen then shows the game itself in the background.

Figure 6: LibreELEC comes with two games out the box: the simple 2048 and the multiplayer Bomberman, which did not work in a test on a RPi3.

C64 Games on LibreELEC

As a practical test, I installed the Commodore-C64 (VICE C64) emulator under Add-ons | Install from repository | All repositories | Game Add-ons | Emulators. It then appears in the main level below Games as an independent extension. However, if you select the add-on directly, you will end up at the light blue prompt typical for the C64 – only insiders will know that you now have to type:

LOAD":*",8,1

It is easier to pick up a game from a collection like the GameBase64 Collection [7], transfer the downloaded ZIP file via Samba (or the Windows network environment) to the LibreELEC Rasp Pi, and unpack it there (e.g., in the Downloads/ folder). If you then select Games from the main menu, the library manager appears. Go to Add games | Browse | Root file system and select the folder with the uploaded games.

Kodi integrates the folder into the Games menu. When you select it, a file manager appears; you can use the manager to select the game as a disk image (e.g., in D64 format) or a program file (in P00 format) [8]. During the game, Vice forwards all keystrokes to the emulator. Only the Esc key still interacts with Kodi. From the menu, you can now control the game with Pause/Resume, Reset, Exit, or individual Settings.

Other innovations in Kodi 18.0 and LibreELEC 9.0 still need a little time to mature, however. The Zattoo add-on, for example, can be activated from the repositories and also accepts your login credentials. The TV section, where the Zattoo add-on adds itself as the PVR service (personal video recorder, which has a mass storage device, instead of a tape drive, and intelligent additional functions), remains empty, however. Even for Netflix, Kodi/LibreELEC does not yet offer a solution that works out of the box.

Netflix

For Netflix on LibreELEC you have to enable the repository first. Download the repository.netflix-1.0.1.zip file (the version available at the time of the test) from the kodinerds repository [9] and copy it over the network to your Kodi Rasp Pi. Select the gear menu and Add-ons | Install from zip file to enable the package source in the home folder. You might have to allow the installation of add-ons from unknown sources first; a prompt to this effect will appear automatically.

You can then install the Netflix add-on in the gear menu with Add-ons | Install from repository | Netflix add-on repository | Video add-ons. In the settings, you must enter both the login and password for your Netflix account. If you launch Netflix from the Add-ons menu, you can browse through the provider's digital video library (Figure 7). However, as soon as you play a video, error messages appear: The system requires the InputStream Adaptive add-on, which can be found in the add-on manager under Videoplayer InputStream Add-ons.

Figure 7: In the Kodi 18.0 announcement, the developers claimed that the media center supported streaming services such as Netflix. However, integrating them still requires a great deal of manual work. (Note: Some shows shown here might not be available in your country of origin.)

The next time you try to play a Netflix video, Kodi complains about the lack of the Widevine CDM library it needs to decrypt the DRM-protected video streams [10]. For legal reasons, LibreELEC is not allowed to integrate the library directly into the system or keep it in its own package sources. Instead, a wizard jumps in to download a suitable Google Chrome OS image [11] and extract the ARM version of the library from the image. The process on an RPi3B+ takes about a quarter of an hour and requires 2GB of free disk space.

Finallly, LibreELEC plays Netflix videos. However, the computing capacity of the fastest current RPi3B+ model is not sufficient to play the videos in full HD (1080p): Playback is interrupted frequently or stops completely at intermittent intervals. However, the playback resolution cannot be changed from within the player and is only possible by configuring the InputStream Adaptive add-on (Add-ons | My add-ons | VideoPlayer InputStream | InputStream Adaptive). In the Max. Resolution general decoder and Max. Resolution secure decoder fields, enter the value 720p. The Netflix videos then play on the RPi3 with virtually no jerkiness (Figure 8).

Figure 8: After installing the Netflix add-on, the InputStream extension, and the Widevine library for decrypting streams, the system plays Netflix movies reliably.

Amazon Prime Video

Amazon Prime is now also slightly better integrated into LibreELEC – even if you still need to indulge in a great deal of manual work. Just like the Netflix add-on, the Amazon counterpart also needs the InputStream extension and the Widevine library. Here, I assume that you have already experimented with Netflix and have already installed both extensions.

Setting up the Amazon add-on again requires a number of intermediate steps: First, select Add-ons | Install from repository | All repositories | Add-on repository and then Kodinerds add-ons [12] from the gear menu.

From this package source you can now enable Sandmann79s Repository from Add-ons | Install from repository | Kodinerds add-ons | Add-on repository. Sandmann79 is the pseudonym for a developer on whose work the integration of video services such as Netflix and Amazon is based. The additional repository finally lets you install the desired Amazon add-on under Installing from repository | Sandmann79s Repository | Video add-ons (see also the "Two Amazon Plugins" box).

Two Amazon Plugins

The Sandmann79s repository contains two add-ons for Amazon's streaming service: Amazon and Amazon VOD. The difference between the two variants is that the Amazon add-on (without VOD) maintains a local database, whereas Amazon VOD always loads all titles and menus fresh from Amazon. The database-supported version offers the advantage of faster browsing through Amazon videos after the initial fill. However, you do need to refresh the database regularly, which happens automatically with the VOD version [13].

With the Amazon add-on, you also need to enter your account login and password. The system does not save the data, but creates an individual token used for authentication against Amazon in the future. Like the Netflix add-on, Kodi lists the Amazon extension below Add-ons. After launch, you can browse the Amazon movie collection. In contrast to Netflix, Amazon playback is always smooth, but only at 540p and without the possibility of increasing the resolution (Figure 9).

Figure 9: Amazon Prime overhead in LibreELEC is similar to that for Netflix. However, Amazon restricts the quality of the streams to 540p.

Conclusions

At first glance, Kodi 18.0 appears to be a cautious update without many changes compared with its predecessor. Only if you take a closer look do you notice the many changes under the hood with the InputStream add-on. DRM-encrypted streams can now be played back, opening the door to streaming services such as Netflix, Amazon, and others. The Widevine decryption routine, however, reminds one a bit of playing video DVDs on Linux with libdvdcss [14]. From a technical point of view, it works, but don't expect either official support or ease of installation and configuration.

In terms of integrating games, Kodi continues to work consistently on developing the software into a comprehensive digital entertainment platform. In practice, it is not difficult to get old retro games from C64 times to run. However, documentation of the new functions is still missing. Moreover, help in the form of a games database would be ideal, so that game classics can be installed with just a few clicks. However, with a complex legal situation and unclear copyrights, such convenience remains pretty much a utopian dream.