Linux Crumbs
Simbiotic - A Cyberpunk Thriller Novel

Installing LibreELEC 11.0.6 with MythTV PVR Client on a Raspberry Pi 2/3/3B+

Summary

This tutorial describes how to install LibreELEC 11.0.6 with MythTV PVR Client on a Raspberry Pi 2/3/3B+ computer. Also covered is changing to Confluence skin, installing a Log Viewer, installing Video Add-ons, enabling Closed Captions, and customizing keyboard and remote control actions.

Note that these instructions switch to using the Confluence skin as soon as possible. As such the menu commands will likely differ from the default Estuary skin that ships with LibreELEC.

Written: Feb 18, 2024

Updated Oct 30, 2024: Add Appendix A: Optional - Reduce Menu Clutter

Contents

Background

Ever since I got my first Raspberry Pi 2 model B in 2016 and I've been impressed with it's ability to play 1080i (interlaced) and 720p (progressive) content recorded from Over-The-Air with my MythTV PVR. Back then I used OpenELEC 6.0.3 and along the way I updated versions and switched over to LibreELEC. All worked well until the major jump to LE 10.x which involved big changes from Python 2 to Python 3, and also focused on the (then) new Raspberry Pi 4 model B.

The three main issues I encountered with various versions of LE 10.x and LE 11.x were

  • Unacceptable playback and deinterlacing of 1080i content recorded from Over-The-Air with my MythTV PVR.

  • Subtitles (parsed from OTA) shown in LE 10.0.2, but no longer work in LE 10.0.3.

  • Unacceptable playback of streams whereby buffering results in a black screen.

    More specifically if I skipped forward or back while streaming video, or if the video buffered, then sometimes this resulted in only a black screen being displayed or image stuck and the audio continuing in the background. This occurred in LE 10.0.4, 11.0.0 and 11.0.1.

I felt that the good folks working on LibreELEC and Kodi would eventually release a version that would work well for my trusty RPi2. Until then I resolved to stick with LE 9.2.7.

The first LibreELEC release that performed well for my needs was LE 11.0.4.

I finally took the plunge and upgraded to LE 11.0.6 when I encountered an issue whereby a streaming video would not play with LE 9.2.7, but would play properly with LE 11.0.6.

Following are the steps I used to install LE 11.0.6.

A. Download and Uncompress LibreELEC to MicroSD Card

Linux users can use the following instructions to download and write the LibreELEC image to the microSD card.

For other operating systems, such as Windows, or newer versions of LibreELEC see LibreELEC Downloads.

  1. Download LibreELEC disk image for RPi2/3/3B+:

    Download LibreELEC 11.0.6

  2. Insert the MicroSD card into your computer.

  3. Determine the which /dev/device it is.

    dmesg | tail

    Example output:

    $ dmesg | tail
    [  227.218363] sdhci-pci 0000:01:00.2: PCI INT A -> GSI 16 (level, low) -> IRQ 16
    [  227.218396] sdhci-pci 0000:01:00.2: Refusing to bind to secondary interface.
    [  227.218413] sdhci-pci 0000:01:00.2: PCI INT A disabled
    [  227.218884] jmb38x_ms 0000:01:00.3: enabling device (0000 -> 0002)
    [  227.218906] jmb38x_ms 0000:01:00.3: PCI INT A -> GSI 16 (level, low) -> IRQ 16
    [  227.218931] jmb38x_ms 0000:01:00.3: setting latency timer to 64
    [  227.617315] mmc1: new SDHC card at address 0001
    [  227.617720] mmcblk1: mmc1:0001 SD8GB 7.32 GiB
    [  227.621661]  mmcblk1: p1 p2
    [  228.753036] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)

    From above output the device is /dev/mmcblk1 (we ignore the partition portion p2).

    WARNING:   It is very important to identify the correct device. Use of the wrong device path can result in loss of data and/or the operating system.

  4. Ensure that the device is unmounted by checking the output from df to see if the device is in use.

    Example output:

    $ df
    Filesystem     1K-blocks    Used Available Use% Mounted on
    /dev/sda1        6734812 5612328    780368  88% /
    udev              499152       4    499148   1% /dev
    none              506428       8    506420   1% /tmp
    tmpfs             101288     844    100444   1% /run
    none                5120       0      5120   0% /run/lock
    none              506428      72    506356   1% /run/shm
    none              506428     572    505856   1% /var/log
    none              506428       0    506428   0% /var/tmp
    /dev/mmcblk0p1  15615056 1183088  14431968   8% /media/mmcard16gb
    /dev/mmcblk1p1    261868  111280    150588  43% /media/0F39-638F
    /dev/mmcblk1p2   7177771   83036   7094735   2% /media/0c0676d8-24f7-43c4-8bed-d19e6ea3a147

    If the device is in use then unmount each mount point.

    Using the example above we unmount two locations from mmcblk1:

    sudo umount /media/0F39-638F
    sudo umount /media/0c0676d8-24f7-43c4-8bed-d19e6ea3a147
  5. Write the image to the microSD Card.

    Be sure to use the correctly identified device! In this example the device path is /dev/mmcblk1.

    zcat ~/Downloads/LibreELEC-11.0.6.img.gz | sudo dd of=/dev/mmcblk1 bs=4M
    sync
  6. Remove the microSD Card.

B. Insert MicroSD Card and Power on Raspberry Pi

At first power up the image will be resized to use the entire microSD card, and then the RPi will reboot.

  1. At Welcome to LibreELEC screen leave Language as English and choose Next.

  2. At Hostname prompt change or leave name LibreELEC and choose Next.

    I chose hostname LibreELEC-TV.

  3. At Networking screen with Wired and Wireless networks listed choose Next.

    I have a wired network.

  4. At Sharing and Remote Access screen under Configure Services enable SSH and enable Samba. Choose Next.

    Samba should be enabled to access Windows network shares, or to have the hostname easily discoverable on the network.

    Note that username is root and password is libreelec.
    When SSH Password screen popped up recommending a personal password be set, I choose Keep Existing.

  5. At Thank you screen choose Next.

C. Choose Confluence Skin

My preference is to use the Confluence skin so we change to it and use it for all the remaining steps in this tutorial.

  1. Navigate to Settings (gear icon) -> Add-ons -> Install from repository -> All repositories -> Look and feel -> Skin -> Confluence.

  2. Choose Install.

  3. Respond to the following three prompts, which may display in a different order than listed below.

    • If prompted First run help... read the message then press OK to dismiss.

    • If prompted Would you like to switch to this skin respond Yes.

    • If prompted Would you like to keep this change respond Yes.

  4. Back out (Backspace or Escape) to the main menu.

D. Disable LibreELEC Automatic Update

In the past I have occasionally experienced problems when LibreELEC automatically upgraded. To avoid the sudden appearance of these problems I prefer to disable automatic updates. That way I can manually install the updates at a time of my choosing.

  1. Navigate to System -> LibreELEC -> Updates -> Automatic Updates.

  2. Press Enter and choose manual

  3. Back out (Backspace or Escape) to the main screen.

How to Manually Update LibreELEC

  1. Download your chosen version of the LibreELEC image file from LibreELEC Downloads.

  2. Copy the file to the microSD card /storage/.update/ folder.
    For example:
    scp -p LibreELEC-RPi2.arm-11.0.7.img.gz root@192.168.1.65:/storage/.update/

  3. Reboot LibreELEC.

E. Disable Wireless Networks

If you have a wired network then the wireless networks are not needed. A good reason for disabling wireless networks is to reduce the power required by the RPi3 and RPi3B+. These options are disabled by default on a RPi2 because it does not have the hardware to support wireless networks or bluetooth.

  1. Navigate to System -> LibreELEC -> Network.

  2. Active (under Wireless Networks) highlighted press Enter to toggle status.

  3. Back out (Backspace or Escape) to the main screen.

F. Disable Add-on Automatic Updates

I've also experienced issues with add-ons ceasing to work after being automatically updated. Hence I prefer to disable these and perform updates manually.

Disable add-on automatic updates and enable unknown sources:

  1. Navigate to System -> Settings -> System -> Add-ons.

  2. Change Updates to Notify, but don't install updates.

  3. Enable Unknown sources and answer Yes to the warning.
    This is used to install add-ons from zip files.

  4. Change - Update official add-ons from to Any repositories.

  5. Back out (Backspace or Escape) to the main screen.

How to Manually Update Add-ons

  1. Navigate to System -> Settings -> Add-ons -> Available updates.

  2. For each Add-on you wish to update:
    Choose Add-on, choose Update, choose the update version, and wait for update to install.

G. Enable MPEG-2 Hardware Video Decoding

If you plan to view MPEG-2 content such as North American Over-The-Air TV then purchase an MPEG-2 license key from the Raspberry Pi Store. Cost is ~2 British Pounds. The license key will be sent to the email address you provide (can take up to 72 hours).

Note that a VC-1 license key is also available, but it is not needed to view North American Over-The-Air content which is in MPEG-2 format.

RPi 4/5 do not need an MPEG-2 license because these use software decoding instead of hardware decoding.

  1. Lookup the IP Address in Kodi for the Raspberry Pi.

    Navigate to System -> System info.

    Make note of the IP address.

    In this example we will use 192.168.1.65.

    Back out (Backspace or Escape) to the main screen.

  2. Open a terminal window on a different GNU/Linux computer and make a secure shell connection to the IP address of your Raspberry Pi.

    Be sure to use the IP address for your RPi on your network.

    ssh root@192.168.1.65

    The default password is libreelec all lowercase.

  3. In the SSH session mount the /flash directory with read and write privileges.

    mount -o remount,rw /flash
  4. Edit the /flash/config.txt file to add the MPEG-2 license key.

    nano /flash/config.txt

    Locate the decode_MPG2 line, remove the # and space at the front, and add your MPEG-2 license key.

    decode_MPG2=0x8ff5a5c7

    If you wish to share a microSD card image with multiple RPi's then you can string together a maximum of 8 licenses. For example:

    decode_MPG2=0x8ff5a5c7,0xd4cb22af,0xe05b40bc,0xa54335b8,0x5964579b,0xafd24232,0xa0a3ecad
  5. Enable analog audio by uncommenting the following two lines [Optional]

    dtparam=audio=on
    audio_pwm_mode=1
  6. Potential fix for overscan issue [Optional]

    If the edges of the kodi display are not visible on the physical screen, then try adding or uncommenting the overscan_scale=1 config.txt parameter.

    overscan_scale=1
  7. Save and exit the editor with Ctrl+X.
    Answer Y to save modified buffer.
    Press Enter accept File Name to Write.

  8. Return the /flash directory back to read only privileges.

    mount -o remount,ro /flash
  9. Reboot the Raspberry Pi. This will close the SSH session.

    reboot

If you wish you can check if the MPEG-2 decoder is enabled via an SSH connection with the following command:

vcgencmd codec_enabled MPG2

The MPEG-2 hardware video decoder should now be enabled.

H. Enable 3.5mm Headphone Jack Audio [Optional]

To use the 3.5mm headphone jack for audio (instead of HDMI):

  1. Navigate to System -> Settings -> System -> Audio -> Audio output device and press Enter.

  2. In Audio output device window navigate to ALSA: bcm2835 Headphones, bcm2835 Headphones and press Enter.

    Previously mine was set to ALSA: vc4-hdmi(vc4hdmi), BNQ BenQ FP222WH on HDMI. My monitor was a BenQ model FP222WH.

  3. Back out (Backspace or Escape) to the main screen.

I. Set Time Zone Details

  1. Navigate to System -> Settings -> Interface -> Regional -> Language.

  2. Navigate to Timezone country and press Enter.

    Set the following:

     Region default format:   # e.g., Canada
     Timezone country:        # e.g., Canada
     Timezone:                # e.g., America/Edmonton
  3. Back out (Backspace or Escape) to the main screen.

J. Add Program Add-on Log Viewer

The Program add-on named Log Viewer for Kodi can be very helpful when trouble-shooting issues with add-ons.

  1. Navigate to System -> Settings -> Add-ons -> Install from repository -> All repositories -> Program add-ons.

    If First run help... window pops up, read the message then press OK to dismiss.

  2. Navigate to Log Viewer for Kodi and press Enter.

  3. Select Install and press Enter.

  4. Back out (Backspace or Escape) to the main screen.

K. Install MythTV PVR Client

If you wish to watch recordings from a MythTV PVR then install this add-on.
See also Configuring MythTV Backend for Remote Frontends.

  1. Navigate to System -> Settings -> Add-ons -> Install from repository -> All repositories -> PVR Clients.

  2. Navigate to MythTV PVR Client and press Enter.

  3. Select Install and press Enter.
    When I did this version 20.6.1.1 was installed.

  4. On MythTV PVR Client press Enter.

  5. Navigate to Configure and press Enter.

    Using your own MythTV Backend values for IP Address, Security Pin and Ethernet Address, set the following:

     MythTV Backend Hostname or IP           192.168.1.55
     ...
     MythTV Security Pin for API services    0000
     MythTV Backend Ethernet address (WOL)   00:0b:0e:0f:00:ed
     ...
     Conflict Handling       Prefer recording and stop Live TV

    Note be sure to use the same security pin as you set in the MythTV Backend.

  6. Navigate up to General tab.

  7. Navigate right to Preferences tab.

    Set the following:

     Enable commercial skips (EDL)           Never
  8. Navigate down to OK button and press Enter.

  9. If PVR clients: MythTV PVR Client - Needs to restart is displayed then choose OK.

  10. Back out (Backspace or Escape) to the main screen.

L. Configure MythTV Style Skip Backward/Forward

In the default Kodi configuration, skip steps progressively increase in value as the arrow key is pressed, and there is a 750ms delay before performing the skip action. The default skip steps are:

-30 min, -10 min, -5 min, -3 min, -60 sec, -30 sec, -10 sec, starts here, 10 sec, 30 sec, 60 sec, 3 min, 5 min, 10 min, 30 min.

This can be disconcerting to MythTV Mythfrontend users. The Mythfrontend default is -5s back and +30s forward.

To make the skip backward/forward experience closer (-10s/+30s) to Mythfrontend the steps are:

  1. Navigate to System -> Settings -> Player -> Videos.

  2. Navigate to Skip steps and press Enter.

  3. Navigate up/down to each value that is not (-10s/+30s) and press Enter.

    The text colour should change from yellow to grey. This indicates the value will not be used in skipping.

    Check to ensure the -10 sec and 30 sec entries are yellow.

  4. Navigate to OK and press Enter.

  5. Navigate to Skip delay (on down arrow icon) and press Enter 3 times.

    This will reduce the skip delay from 750 ms to None.

  6. Back out (Backspace or Escape) to the main screen.

M. Enable Closed Captions

Here we enable the ability to parse for closed captions contained within the recorded ATSC TV shows.

  1. Navigate to System - > Settings -> Player -> Subtitles.

  2. Navigate to Enable parsing for closed captions and press Enter to toggle to active.

  3. Back out (Backspace or Escape) to the main screen.

N. Add Custom Key Mappings for Subtitle Control

These steps should enable the Subtitle, Teletext or Closed Caption button on an MCE remote control so you can easily toggle closed captions on and off without having to go through the menu.

  1. Open a terminal window on a different GNU/Linux computer and make a secure shell connection to the IP address of your Raspberry Pi.

    Be sure to use the IP address for your RPi3 on your network.

     ssh root@192.168.1.65

    The default password is libreelec all lowercase.

  2. Change to the ~/.kodi/userdata/keymaps directory.

     cd  ~/.kodi/userdata/keymaps
  3. Create/edit keyboard.xml file.

     nano keyboard.xml
  4. Determine the key presses we wish to remap.

    Often the default keymaps for the keyboard and remote controls work well. However sometimes you may wish set up custom keymappings.

    PC Keyboard remappings

    The T key toggles subtitles.

     Keyboard Key       New Function
     ----------------   ------------
     F5                 Activate the OSD audio settings window
     Ctrl+Left          Subtitle delay minus
     Ctrl+Right         Subtitle delay plus
     Ctrl+Shift+Left    Audio delay minus
     Ctrl+Shift+Right   Audio delay plus

    VRC-1100 Vista MCE remote control

    Note that this remote is more challenging to change because it acts like a keyboard and mouse combination.

     Remote Key         Key Code       New Function
     ----------------   ------------   ------------
     Explorer (e)       KEY_WWW        -
     Power              KEY_POWER      -
     Yellow             KEY_VCR        -
     Blue               KEY_AUDIO      -
     Green              KEY_CAMERA     -
     Red                KEY_VIDEO      -
     Below Yellow       KEY_TUNER      -
     Below Blue         KEY_EPG        -
     Below Green        KEY_TV         -
     Below Red          KEY_DVD        - already ContextMenu
     Info               KEY_INFO       -
     Close              KEY_SUBTITLE   - already "Close"d Captioned
     Clear              KEY_DELETE     -
     Enter              KEY_ENTER      -

    INFRARED REMOTE CONTROLS

    To learn the infrared remote control keycodes, in a terminal window with an ssh session to the RPi start the program irw and it will echo the keycodes as you press keys on the remote control. To exit irw type Ctrl+C.

    Mediagate MG-IR02BK / Rosewill RRC-126 MCE rc6 remote control

     Remote Key         Key Code       New Function
     ----------------   ------------   ------------
     Power (moon)       KEY_SLEEP      -
     Pictures           KEY_CAMERA     -
     Music              KEY_AUDIO      -
     Videos             KEY_VIDEO      -
     Radio              KEY_RADIO      -
     Clear              KEY_DELETE     -
     DVD Menu           KEY_DVD        - already ContextMenu
     Enter              KEY_ENTER      -
     Zoom (red)         KEY_ZOOM       -
     Angle (green)      no code        -
     Audio (yellow)     KEY_LANGUAGE   -
     Subtitle (blue)    KEY_TITLE      Subtitle

    Philips 5100 Vista MCE rc6 remote control

     Remote Key         Key Code       New Function
     ----------------   ------------   ------------
     Power (moon)       KEY_SLEEP      -
     TV red dot         KEY_PVR        -
     Grid               KEY_EPG        -
     TV triangle        KEY_TUNER      -
     Rectangle slot     KEY_DVD        - already ContextMenu
     Clear              KEY_DELETE     -
     Rectangle T        KEY_SUBTITLE   -
     Enter              KEY_ENTER      -
     Red                KEY_RED        -
     Green              KEY_GREEN      -
     Yellow             KEY_YELLOW     -
     Blue               KEY_BLUE       Subtitle
  5. To remap the keys, cut and paste the following content.

    If keyboard.xml file already exists then add only the inner section of lines as only one section is needed for each of FullScreenVideo and keyboard and remote.

    <?xml version="1.0" encoding="UTF-8"?>
    <keymap>
      <FullscreenVideo>
        <keyboard>
          <!--
               PC keyboard
          -->
          <F5>ActivateWindow(osdaudiosettings)</F5>
          <left mod="ctrl">subtitledelayminus</left>
          <right mod="ctrl">subtitledelayplus</right>
          <left mod="ctrl,shift">audiodelayminus</left>
          <right mod="ctrl,shift">audiodelayplus</right>
        </keyboard>
        <remote>
          <!--
               Mediagate MG-IR02BK / Rosewill RRC-126 MCE rc6 remote control
          -->
          <title>ShowSubtitles</title>
          <!--
               Philips 5100 Vista MCE rc6 remote control
          -->
          <blue>ShowSubtitles</blue>
        </remote>
      </FullscreenVideo>
    </keymap>
  6. Save the file with Ctrl+O and exit with Ctrl+X.

See also Kodi Add Downloaded Subtitle to DVD Playback.

O. Optional - Limit Internet Bandwidth

If you are on a lower speed Internet then setting a maximum Internet bandwidth can help to avoid buffering while streaming.

  1. Navigate to System -> Settings -> System -> Internet Access.

  2. Select Internet connection bandwidth limitation and press Enter.

  3. Choose a value lower than your maximum Internet bandwidth.
    For example with 5 Mbps (~5000 kbps) Internet you might choose 4096 kbps.

  4. Back out (Backspace or Escape) to the main screen.

P. Optional - Install Video Add-ons

Video add-ons enable you to watch content that is streamed over the Internet. One such add-on is TED Talks which I'll show you how to install. Other add-ons can be installed in a similar fashion.

  1. Navigate to Video -> Add-ons.

  2. Navigate Left to access side-bar menu.

  3. Navigate to Get more... and press Enter.

  4. Navigate to TED Talks and press Enter.

  5. Select Install and press Enter.

  6. Navigate to TED Talks and press Enter.

  7. Choose Configure and set the following:

    Enable subtibles:                  Enabled
    Custom language codes (optional):  en
  8. Navigate to OK and press Enter.

  9. Press Backspace once to back out to the list of your video add-ons.
    At this location you can invoke a specific add-on to watch it's content.

    Note that the TED Talks video add-on did not work for me. However by using information in the Kodi forum for TED Talks I was able to get it working.

  10. Back out (Backspace or Escape) to the main screen.

Q. Optional - Create Favourites

You can create favourites for video add-ons.

  1. Select a TV Show or episode in a video add-on.

  2. On a keyboard press the letter C.

  3. Choose Add to favourites.

To remove favourites:

  1. Select a favourite.

  2. On a keyboard press the letter C.

  3. Choose Remove.

Favourites are accessed by the star icon next to the Power icon.

These favourites are stored in the /storage/.kodi/userdata/favourites.xml file.

Conclusion

Congratulations. You should now have an inexpensive way to watch your MythTV recordings and Video add-on content on a Raspberry Pi 2/3/3B+ computer.

Troubleshooting Tips

Note that Kodi includes at least two keyboard menu options that help with diagnosis that can be toggled on/off during video playback:

References

While writing this tutorial I found the following resources helpful:

Appendix A: Optional - Reduce Menu Clutter

To make menu navigation easier you might consider hiding menu items that are not used. The following steps hide menu items that are not needed to use the video and MythTV PVR add-ons.

  1. Navigate to System -> Settings -> Interface Skin -> Configure skin... -> Home window Options.

  2. Choose a default startup menu item.

    On right hand window pane under Home screen options:

    • Change Set default startup item to VIDEOS.
  3. Hide unused menu items.

    On right hand window pane under Hide main menu buttons:

    • Enable Hide - Movies (Videos - Library)

    • Enable Hide - TV Shows (Videos - Library)

    • Enable Hide - Music

    • Enable Hide - Pictures

    • Enable Hide - Weather

    • Enable Hide - Games

    • Enable Hide - Radio

    The only options that are left disabled at this point are:

    • Disabled Hide - Videos
    • Disabled Hide - Add-ons
    • Disabled Hide - TV
    • Disabled Hide - System
  4. Back out (Backspace or Escape) to the main screen.

  5. If prompt displayed to Press 'Up' to set this item as default then navigate left or right to Videos and press Up.

The Medusa Deception novel - free first in series
News   Documentation     Copyright (c) 2013-2024 Curtis Gedak

Get GParted at SourceForge.net. Fast, secure and Free
	Open Source software downloads Valid HTML 4.01! Correct CSS!