Installing Kodi Media Center as a Menu in MythTV
Summary
This tutorial describes how to install Kodi and access it from a menu on your MythTV PVR.
There are great features to both MythTV and Kodi. MythTV is an excellent PVR for recording and watching your favourite TV shows. On the other hand, Kodi shines as a media center and works well for streaming video. Rather than forcing a choice of one over the other, why not have both! This tutorial will show you how.
These steps were documented using Mythbuntu 14.04 which uses MythTV 0.27.
Contents
- Background
- A. Open a Terminal Window
- B. Fix Video Tearing on XFCE [Optional]
- C. Install Kodi Media Center
- D. Install Video Add-ons in Kodi
- E. Exit Kodi
- F. Add Kodi to MythTV Menu
- G. Close Terminal Window
- Completed Kodi Menu in MythTV
- References
- Appendix A: Revert to Confluence Skin
Background
Occasionally I like to stream a show from a TV Network's web site, or I simply wish to watch an Internet video on the living room TV. In the past I used the Firefox web browser from MythTV to stream the video. However navigating in Firefox requires a mouse or touchpad, and I really wanted something that would work with my MCE remote control. The solution I found is the Kodi media center where videos can often be easily streamed using the Video Add-ons section of Kodi.
For the curious, Kodi is the new name for what was previously called XBMC (X Box Media Center).
A. Open a Terminal Window
Many of the following steps require a terminal window to enter commands.
If you have Configured MythTV Automatic Wakeup and Shutdown on your Mythbuntu PVR, then see that tutorial section for Temporarily Using PVR as a Desktop Computer. Remember to Lock Shutdown.
Start Applications -> System -> Xfce Terminal to open a terminal window.
B. Fix Video Tearing on XFCE [Optional]
If you previously followed the tutorial for Tear Free Firefox Menu in MythTV then you can skip ahead to the next step.
Otherwise if you experience video tearing then see my other tutorial section Fix Video Tearing on XFCE to install the compton compositor.
C. Install Kodi Media Center
-
Update the system package lists.
sudo apt-get update
-
Add the Kodi (formerly XBMC) Personal Package Archive (PPA)
sudo add-apt-repository ppa:team-xbmc/ppa
-
Reload the system package lists.
sudo apt-get update
-
Install Kodi
sudo apt-get install kodi
Kodi should now be installed. You can invoke kodi from a terminal to start the media center.
kodi
When I first started kodi I saw a prompt for TheAudioDb.com for Music Videos that indicated Add-on is incompatible or has been marked broken in repository. I choose Yes to disable this add-on on my system.
D. Install Video Add-ons in Kodi
With Kodi up and running, install a few Video Add-ons to watch video sources.
-
Navigate left to Videos.
-
Navigate down to Add-ons and press Enter.
-
Navigate to Get more... and press Enter.
TIP: Is the list of video add-ons empty?
If the list of video add-ons is empty after pressing Enter on Get more... then press left arrow to access the side menu. Next navigate down to Check for updates and press enter. Press right arrow to close the side menu. -
Navigate to an entry you wish to install (for example TED Talks) and press Enter.
-
Navigate to Install and press Enter.
NOTE: Some Video Add-ons have additional requirements
Some Video Add-ons require extra setup, such as an account, or are restricted by region. To see if an add-on works we have to try it out. If we cannot configure the add-on to work then simply uninstall the add-on. -
Press Escape to back out to list of Video Add-ons.
-
Repeat steps 4 through 6 to add other video sources you like.
-
Press Escape to back out to list of installed Video Add-ons.
-
Press Escape to return to top level Kodi menu.
TIP: How to Play a Kodi Video |
E. Exit Kodi
To exit from Kodi:
-
Press Escape until the top level kodi menu is shown.
-
Navigate down to the power button icon in the lower left corner of the screen and press Enter.
-
Navigate to Exit and press Enter to exit Kodi.
F. Add Kodi to MythTV Menu
The following steps are performed in a terminal window.
-
Open an editor and create a script file to optionally invoke compton and Kodi.
sudo leafpad /usr/bin/mythtv-kodi.sh
-
Copy the following sample mythtv-kodi.sh file and paste it into the editor.
----- Begin mythtv-kodi.sh -----
#!/bin/sh # # Startup Kodi for MythTV # # If compton compositor available and not running then start compton if test "x`which compton`" != "x" ; then if test "x`ps -e | grep compton`" = "x"; then compton --backend glx --vsync opengl -b fi fi # Ensure that no other kodi processes are running killall kodi # Startup Kodi kodi
----- End mythtv-kodi.sh -----
-
Save the file and exit the editor.
-
Make the script file executable.
sudo chmod 755 /usr/bin/mythtv-kodi.sh
-
Ensure you have a override copy of the Information Center .xml file.
ls -l ~/.mythtv/info_menu.xml
If you do not have a ~/.mythtv/info_menu.xml file then copy one from MythTV.
cp -p /usr/share/mythtv/themes/defaultmenu/info_menu.xml ~/.mythtv/
-
Edit ~/.mythtv/info_menu.xml and add Kodi menu entry near bottom, but above any FireFox entries if these exist.
leafpad ~/.mythtv/info_menu.xml
Insert the Kodi button text (shown below) near the end of the file just above the </mythmenu> line.
<button> <type>KODI_MEDIA_CENTER</type> <text>Kodi Media Center</text> <description>Kodi media center - no mouse needed</description> <action>EXEC mythtv-kodi.sh</action> </button>
In my case I have Firefox menu entries so I placed the kodi menu entry above the Firefox ones.
Save the file and exit the editor.
G. Close Terminal Window
Normally I wouldn't list this step, but I needed a title for those of us folks who have Configured MythTV Automatic Wakeup and Shutdown. Remember to Unlock Shutdown. See Temporarily Using PVR as a Desktop Computer.
Completed Kodi Menu in MythTV
Following is a picture of the completed MythTV Menu with a Kodi entry.
This menu also shows entries for Firefox, both native and using wine, as per my tutorial Tear Free Firefox Menu in MythTV.
References
While researching how to install Kodi media center on Mythbuntu I found the following references useful:
Appendix A: Revert to Confluence Skin
Kodi Kryton 17 introduced a new skin called Estuary which changes the menu system for Kodi. To revert back to the prior Confluence skin, use the following steps.
-
Navigate to Settings (gear icon) and press Enter.
-
Navigate to Interface settings and press Enter.
-
Navigate to Skin.
-
Navigate right to Look and feel pane.
-
Navigate to Skin and press Enter.
-
Navigate to Get more... and press Enter.
-
Navigate to Confluence and press Enter.
The Confluence skin should download.
-
At Keep skin? - Would you like to keep this change? prompt navigate to Yes and press Enter.
-
Press Escape twice to back out to main menu.