Archive:MythTV

From Official Kodi Wiki
Revision as of 21:20, 27 January 2009 by >Dteirney (Added known issue for Guide not working. Usually caused by incorrect username and password.)
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 program guide
  • Play previously recorded TV shows

TODO: Screenshots based on New Zealand Freeview|HD content with the MediaStream skin.

Setup

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]

username and password are the credentials for a user that has access to the MySQL mythconverg database on the MythTV backend. This is used to obtain EPG information from the database when using the Guide. If and username and password are not supplied a default of mythtv is used for both. Remember to check that the MySQL database has been configured to allow external connections if XBMC is running on a different machine.

i.p.address is the IP address of the MythTV backend server. A hostname can also be used. Be sure that the hostname resolves to an IP address on the XBMC machine.

For the myth:// protocol to work, XBMC must be able to resolve the hostname of the MythTV backend to an IP address. This is necessary because of the way the Myth Protocol works. Either the DNS server on the network needs to be able to resolve the hostname, or a static hostname entry is needed on the XBMC machine. This can be done in the /etc/hosts file in Linux or Mac OSX, or in the AdvancedSettings.xml file for the original XBox.

Relating to the DNS resolution issues, the MythTV backend must also be configured with a hostname that will resolve to an IP. The hostname in the MythTV configuration must not be set to localhost or 127.0.0.1 if XBMC Media Center is running on a separate machine.

Once the MythTV Source has been added, when it is chosen you will be presented with 3 virtual folders.

  • Live TV - to display TV that is currently being aired
  • Guide - to view the EPG for a subsequently chosen channel
  • Recordings - to watch TV shows that have been previously recorded

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.

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.

TODO: Screenshot showing listing in MediaStream.

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

TBC: Exactly when LiveTV stops recording once the channel is no longer being viewed.

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 LiveTV. The new channel needs to be chosen from within the Live TV listing.

Viewing the Program Guide

After choosing Guide a listing of channels held within MythTV will be presented. When a channel is chosen, and listing of upcoming TV shows on that channel is displayed.

TODO: Screenshot of a channel around prime time.

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 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 and the description may be displayed.

TODO: Screenshot

Using standard XBMC functionality, the recordings can be sorted by name to get all the shows from a given series shown together, or sorted by date to see the most recent recordings.

The subversion (SVN) release of XBMC also provides a Recordings By Title virtual folder. When choosing this, 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, and then see a list of recorded TV shows in a series sorted by date.

Skin Support

MediaStream - Episode View

Current Projects

Unified PVR

Trouble Shooting

XBox - SD only Linux - HD Always turn on debugging and review the XBMC log file.

Recordings Don't Play

Check the DNS entry. The Myth API gets the hostname of the MythTV backend and uses that to play recordings. XBMC needs to be able to resolve the hostname to an IP address for playback to work. On the XBox, hostname resolution is best handled by adding a using Hosts entry in AdvancedSettings.xml file. On Linux, use the /etc/hosts file.

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 for more information.

High CPU Usage with H264 Encoded Video

Depending on the video card and driver being used, there could be significant CPU utilised when playing H264 content.

There is an advanced setting which can be used to reduce the number of CPU cycles used to decode H264 encoded video.

The <skiploopfilter> setting in advancedsettings.xml can be used to reduce the CPU utilization by reducing the quality of the output 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.

Audio Plays Out of Sync

Check CPU utilization. I was having audio sync problems with 1080i content with LATM AAC audio. AAC is quite CPU intensive (or so I'm told) and my AMD X2 6000+ CPU wasn't quite cutting the mustard combined with the also CPU intensive H264 video content. So, unless you've got a rocketship CPU that's faster than 3.0Ghz 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 Myth TV 0.20 backend. Deleting appears to work as expected using a 0.21 Myth TV backend.
  • Seeking 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.

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 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 Python 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 able to be used in the Linux version of XBMC.

myth:// protocol

The myth:// protocol was released as a supported Source 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:// protocol doesn't support all the functionality that the xbmcmythtv Python 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.

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 PVR 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.