MythTV

From LinuxMCE
Revision as of 16:46, 21 June 2008 by Langstonius (Talk | contribs) (Troubleshooting)

Jump to: navigation, search

MythTV is a Linux application which turns a PC (with the necessary hardware) into a personal video recorder, a digital multimedia home entertainment system, and a Home Theater Personal Computer. It is used by LinuxMCE to handle viewing and recording of television.

Setting up MythTV in LinuxMCE

(If you purchased a Media Director with LinuxMCE pre-installed, you can skip steps 2, 3 and 6 below -- they will have been preconfigured.)

  • Plug in and boot your Media director.
  • If you have a PVR capture card, such as the PVR250/350 supported by IVTV, or the newer Blackbird cards (cx88), install any updated firmware available from the manufacturer. (Sometimes an Internet search for 'linuxmce' and 'firmware' will also locate firmware for your card.)
  • For each Media Director, select the 'Computing' button on either the Orbiter that appears on the media director's screen (the on-screen orbiter), or using any other Orbiter which is controlling the same room as the Media Director. Choose "MythTV Setup". Myth's setup utility will appear on the Media Director. If you launched this from an Orbiter other than the Media Director's own on-screen Orbiter, that Orbiter will display a keyboard & mouse that you can use (in addition to the media director's own). In this way you can use a webpad or PDA Orbiter as a wireless keyboard/mouse.
  • If you do not use NTSC, go to the "General"-->"Next"-->"Global Backend Setup" page. Choose your video standard (NTSC, PAL, etc.). The other default general settings should be fine. Press ESC to return to the Main Myth Setup Menu.
  • Choose "Capture Cards"-->"New Capture Card".
  • If you have an ivtv or blackbird/cx88 card, choose "MPEG-2 Encoder card (PVR-250/350)".
  • If you're using the cx88/blackbird driver, change the 'video0' to 'video1'.
  • If your card was properly identified, the video device field should be filled in for you. If not, try rebooting the Media Director and repeating. Press ESC to return to the Main Myth Setup Menu.
  • Choose "Video Sources" and select your video source. Refer to the Myth user's Manual for details. Press ESC to return to the Main Myth Setup Menu.
  • Choose "Input connections" to indicate which video source is connected to which input on the capture card.
  • Press ESC to exit Myth Setup and return to the LinuxMCE Orbiter screen.
  • At this point you will be prompted to run mythfilldatabse. Select "Yes".
Sadly, as of 0710b3, this command silently fails to run. To fix this problem:
  • Open /etc/mythtv/mysql.txt
  • Copy the value for DBpasswd from that file.
  • Open /home/linuxmce/.mythtv/mysql.txt (this file was created when you tried to run mythfilldatabse earlier)
  • Paste the value you copied earlier into the DBpasswd field
  • Save the file and run mythfilldatabase again.
  • Go get a coffee
  • You will need to do a full reboot of the whole LinuxMCE system (the Core and all Media Directors) before you can watch TV with Myth TV. You may want to setup all the Media Directors at once, therefore, and then do a complete reboot.

NOTE: Do not reboot until the Media Directors have had a chance to retrieve the channel data. You can confirm this by choosing the 'TV' button on the Orbiter main menu. This launches MythTV. Then choose "Manage Recordings", "Schedule Recordings", "Program Guide". You should see some program guide data. If you do not, wait a bit so Myth has a chance to download the guide data.

Troubleshooting

Fixing Errors in MythTV Tables

Upon sudden power loss or in some other situations, you may experience odd behavior from MythTV on restart. This includes

  • Scheduled recordings not showing in 'Upcoming Recording' in Mythweb
  • Inability to record programs from any interface, be it the on-screen orbiter or Mythweb.
  • Inconsistencies in the mythconverg table (Advanced Users)

To correct this issue, please take the following steps: Try either of these options:

  • 1st we check to see if infact there are problem tables by running this in a shell on the core:
 /etc/init.d/mythtv-backend stop
 mysqlcheck -c -uroot -p mythconverg 
    • if there are errors the run
 mysqlcheck -r -uroot -p mythconverg

occasional this does not fix the problem, then try this

 cd /var/lib/mysql/mythconverg
 /etc/init.d/mythtv-backend stop
 /etc/init.d/mysql stop
 myisamchk *.MYI -r

This should correct the issue. In my own testing (golgoj4) after a reboot everything was functioning correctly.

This fix was provided by user Rwilson131 (thanks)

Electronic Program Guide with xmltv

Programmer's Guide

We have created a DCE Device that wraps the MythTV libraries and can receive commands from other DCE devices and use them to control the TV functionality of the mythtv. Supported functionality at this moment comprises the following: Start TV, Stop TV, Tune to channel, Channel Up, Channel Down. The player uses the same mechanisms that the current (as of 0.16 version) MythTv frontend program uses. So for every mythtv installation that currently works the player should work the same way as the current frontend.

In order to be able to do this we had to change the signature of some methods in a class used by the mythfrontend application. The classes in question is the TV class defined in the libs/libmythtv/tv_play.{h,cpp} files from the mythtv repository. The changes consist in some method and field access changes (made some previously private methods to be public). This was done in order to be able to control the player programatically and avoid putting synthetic events into the playback windows event queue. The changes only affect the headers and are used to compile the player. The binary should run on any machine with a working 0.16 MythTV installation.

Since we needed to have a resizable playback window we had to make some changes in the way the mythtv playback window is created and displayed. The change is a derived class from the MainMythWindow class which knows about resize events and uses them to resize all child objects inside it. The class is available in the plutohome.com svn repository also (in the MythTV Player module).

This module does not work currently with a mythfrontend application running. The module will present itself to the server as another mythfrontend client and it will use one tuner on playback (the same way as a mythtfronted will do).