Archive:MythTV

From Official Kodi Wiki
Revision as of 20:49, 7 March 2009 by >Dteirney (Further instructions about where to go regarding setting up MythTV.)
Jump to navigation Jump to search

XBMC Media Center includes a Source that can be used to interact with a MythTV backend to:

  • Watch Live TV
  • View the electronic program guide (EPG)
  • Play previously recorded TV shows

Once the MythTV Source has been added, when it is chosen you will be presented with 4 virtual folders as shown below:

MythTV.FolderListing.jpg

  • All Recordings - to watch TV shows that have been previously recorded
  • Live TV - to display TV that is currently being aired
  • Guide - to view the EPG for a subsequently chosen channel
  • Recordings by title - to list each series of TV shows that have been previously recorded (only available in SVN)

What is Myth TV

MythTV is a digital video recorder for watching and recording television. MythTV also contains plugins for viewing other home media, similar to what XBMC Media Center provides. MythTV is like a free open source alternative to Tivo and Windows Media Center.

Some of MythTV's features include:

  • Watch and record analog and/or digital TV, including HDTV.
  • Pause, skip, and rewind live TV shows.
  • Completely automatic commercial detection/skipping, with manual correction via an intuitive cutlist editor.
  • Intelligently schedules recordings to avoid conflicts.
  • Parental controls to keep your kids out of the good shows.
  • Schedule and administer many functions remotely via a web browser.
  • Flexible client/server architecture allows multiple frontend client machines to access content served by one or more backend servers (although the most common installation consists of a single computer running both the client and server together).

This wiki page doesn't contain any information about how to install, setup or configure MythTV. If you need further information about how best to do this, Mythbuntu would be a good place to start. Mythbuntu is an community supported add-on for Ubuntu focused upon setting up a standalone MythTV based PVR system.

Setup in XBMC

To communicate with a MythTV backend, add a new Source from the Videos section. The source should have a URL that looks like:

myth://username:[email protected]

i.p.address is the IP address of the MythTV backend server. A hostname can also be used, but it must be resolvable to an IP address on the XBMC Media Center machine.

username and password are the credentials for a user that has access to the MySQL mythconverg database on the MythTV backend.

The username and password supplied in the URL are used to obtain EPG information from the MythTV database when using the Guide. If the username and password are not supplied a default of mythtv is used for both. The username and password are not used when watching recordings.

Setup in MythTV

If XBMC Media Center and the Myth TV backend are NOT running on the same machine:

  • Check that the IP Address configured in MythTV can be accessed by the XBMC machine. The default IP Address for an installation of MythTV is 127.0.0.1 so must be changed
  1. Run mythtv-setup
  2. Select General
  3. Check that the IP Address in Local Backend section is NOT set to localhost or 127.0.0.1. The IP Address must be resolvable from the XBMC Media Center machine, e.g. 192.168.1.3.
  • Check that the MySQL database being used by MythTV has been configured to allow external connections.
    • Generally this means ensuring that the bind-address is not set to localhost or 127.0.0.1 in /etc/mysql/mysql.cnf or one of the *.cnf files in /etc/mysql/conf.d/.
  • Check that the username configured in the myth:// URL has access to the mythconverg database from external locations.

It is very important that the IP Address is set correctly using mythtv-setup. The Myth Protocol used by XBMC Media Center uses the IP Address configured in the Myth TV backend to determine where to stream the recordings from. So, even if the IP address in the myth:// URL points correctly to the MythTV backend, there can still be playback problems if the correct IP Address isn't also set correctly using mythtv-setup.

If you don't intend on using the Guide then the MySQL related configuration can be omitted. Access to the mythconverg MySQL database is only used to view the Guide (and perhaps Live TV - TBC).

Watching Live TV

After choosing Live TV a listing of channels held within MythTV will be presented along with:

  • the name of the channel
  • the currently playing TV show on that channel.

MythTV.LiveTV.jpg

Depending on the XBMC skin being used, and the available Views, the icon for the channel and the description for the currently playing TV show may be displayed.

When a channel is chosen, the currently playing TV show will be displayed.

There are future plans for a fully interactive EPG similar to that available within the MythTV frontend.

It is not possible within XBMC to move up and down the channels when playing Live TV. The currently playing channel needs to be stopped and the new channel then chosen from within the Live TV listing.

Viewing the Program Guide

After choosing Guide a listing of channels held within MythTV will be presented.

MythTV.Guide.jpg

When a channel is chosen, and listing of upcoming TV shows on that channel is displayed.

MythTV.Guide.TV3.jpg

There is a future project to be able to schedule programs to record from the EPG similar to the functionality available in the MythTV frontend.

Watching Recorded TV Shows

When choosing All Recordings a list of all recorded TV shows is presented along with:

  • The name of the TV show
  • The date that it aired

Depending on the XBMC skin being used, and the available Views, the thumbnail for the TV show, the channel name and the description may be displayed.

MythTV.AllRecordings.jpg

Standard XBMC functionality can be used to sort by date to see the most recent recordings. Or, sorted by name to get all the shows from a given series shown together.

When choosing Recordings by title a list of all the recorded TV shows grouped by title is shown. This makes it much easier to see what TV show series have been recorded.

File:MythTV.RecordingsByTitle.jpg

After choosing a title, the list of recorded TV shows in that series is shown.

MythTV.RecordingsByTitle.BestOfTopGear.jpg

Trouble Shooting

Recordings Don't Play

For the myth:// protocol to play recordings, XBMC must be able to access the IP Address configured in the MythTV backend using mythtv-setup. This is necessary because of the way the Myth Protocol works. The Myth API gets the IP Address configured in the MythTV backend and uses that to stream recordings.

If a hostname was used in the IP Address configuration for the MythTV Local Backend, either the DNS server on the network needs to be able to resolve the hostname to an IP address, or a static hostname to IP address entry is needed on the XBMC machine. A static IP address mapping can be set in the /etc/hosts file in Linux or Mac OSX, or in the AdvancedSettings.xml file for the original XBox.

Double check that the Local Backend IP Address configured in the MythTV backend is not set to localhost or 127.0.0.1 if the MythTV backend is running on a different machine to XBMC Media Center.

Live TV Doesn't Play

Unconfirmed: from http://forum.xbmc.org/showthread.php?p=283190#post283190

The cmyth library used for to connect to MythTV from XBMC only enumerates the first 17 tuner devices when looking for available tuners. Trac - CMyth only enumerates 17 tuners

Depending on what was done when the MythTV backend was setup, it's possible that some Tuner ID's are > 17 in the mythconverg database (especially if tuners were added and deleted several times, or if multiplexing is being used for digital terrestrial tuners).

If this is the case, you may be able to see the Guide and all the stations displayed in XBMC, but XBMC may not be able to select a tuner for live TV playback.

This can be resolved by removing all the tuners through mythtv-setup (so they start at 0 when re-added), and then re-adding them, or reducing the number of multiplexed virtual tuners that are created for each physical digital terrestrial tuner.

Guide Doesn't Display Anything

Check that the username and password supplied in the myth:// URL are a username and password that have access to the mythconverg MySQL database. The guide information is obtained directly from the database.

If a username and password have not been supplied in the myth:// URL then the default of 'mythtv' will be used for both.

See Setup in XBMC for more information.

Audio Plays Out of Sync

If CPU utilization is close to 100% on any of the CPU cores then there could be audio sync problems.

Depending on the video card and driver being used, there could be significant CPU utilized when playing H264 video content. The <skiploopfilter> setting in advancedsettings.xml can be used to reduce the CPU utilization by reducing the quality of the output H264 video. Valid values are -16, 0, 8, 16, 32, 48. The larger the number the more h264 content gets discarded in an effort to save CPU cycles.

Try adding <skiploopfilter>48</skiploopfilter> to the advancedsettings.xml file in userdata.

Known Problems

Below is a list of known problems that may be encountered when using the XBMC integration with MythTV.

  • Need to delete a Recording twice for it to be removed from the list if using a MythTV 0.20 backend. Deleting appears to work as expected using a 0.21 Myth TV backend.
  • Seeking (fast forward, rewind skipping forwards or backwards) doesn't work with Live TV. This is related to the way the Myth API streams content. Hopefully this will be resolved in the future.
  • Seeking can take some time if the CPU usage needed to playback a recording is high (typically with H264 content).

History of MythTV support in XBMC

MythTV support in XBMC has been available since ~2004. It started life as a Python script for the original XBox that had functionality added by willing developers over the following years. Eventually the script moved to the current home at Sourceforge, and is now called xbmcmythtv. In late 2008 another script based solution arrived called MythBox.

In 2007 support for communicating with the MythTV backend was added directly to XBMC via a Source using the myth:// protocol. This project uses the cmyth library, which was built to use the network based Myth Protocol supported by MythTV.

In 2009 it is hoped that the Google Summer of Code - Unified PVR Frontend project will be available and provide added functionality to the existing myth:// protocol support. More information about the PVR project can be found in the very large MythTV frontend client built into XBMC forum thread.

xbmcmythtv Script

Support for MythTV in XBMC started with the xbmcmythtv Python script. This project communicated with the MythTV mythconverg MySQL database to get information, and played recordings via a Samba share on the MythTV backend.

The last official release of the Python script was in May 2007 and supported version 0.20 of MythTV and protocol 34. Various unofficial releases were made available by some of the developers of xbmcmythtv, but appears to no longer be supported on an ongoing basis.

Since this project was implemented as a Python script, it is not yet able to be used in the Linux version of XBMC.

myth:// Source

The myth:// source was released in early 2007. This project uses the network based Myth Protocol to communicate with the MythTV backend. It also accesses the MySQL database directly to get Guide information.

Although the myth:// source doesn't support all the functionality that the xbmcmythtv script supported, it is possible to play recordings, which is all many XBMC frontend systems need to support.

The native MythTV frontend client needs to be used to schedule recordings.

MythBox Script (Linux/Mac/Windows)

MythBox was released in late 2008 and is a Linux only XBMC script for MythTV that supports:

  • Watching recordings with commercial skipping
  • Watching Live TV
  • Scheduling recordings
  • TV Guide
  • MythTV 0.21 and 0.22 (trunk) backends

The code was forked from the initial xbmcmythtv script.

PVR frontend

The future for MythTV support in XBMC is based on the unified PVR frontend support that is envisaged for XBMC Media Center.

Much more information can be found in the Google Summer of Code - Unified PVR Frontend wiki page. MythTV is being used as the first PVR backend that will be supported, with the intention of XBMC being able to communicate with any PVR backend.

Note that the vision does not include XBMC providing native support for digital video recorder (DVR) capabilities. Rather the vision is to leverage the significant amount of existing open source effort that has been put into this area by providing a slick frontend interface.