Installing mythTV all starts with good hardware. The first requirement is a machine capable of running openSUSE x86 or x86-64 and that can be connected to the Internet. You will also need a decent audio card and a video card, a hard drive with as much storage space as you desire, as well as a TV tuner capable of performing hardware-level video encoding. Many people run mythTV without any problems on older hardware; however, if you are planning on doing anything with high definition video or complex transcoding jobs, you will need to have sufficient memory and processing power. Check this wiki and the mailinglist before you purchase any new hardware.

You might also find it useful to look at http://www.silentpcreview.com/ if you build a machine for your living room, in order to get advice on low power-consumption, low noise setups.

Initial system setup and considerations

Partitions and File Systems

OpenSuSE ships with a number of different file systems. Each file system has its own advantages and disadvantages that can make it more suited to a scenario. Professional high-performance setups may require a different choice of file system than a home user's setup.

FILE SYSTEM RECOMMENDATIONS

Use Ext4 as your default file system. Consider using XFS for your video data. XFS is very good at manipulating and deleting large files and performs well on high-end hardware.

OTHER RECOMMENDATIONS

Make sure you understand what hardware you have - especially if you have issues an need to Google.

Start required services

Make sure all required system services are running on startup:
As root start 'yast2 runlevel' and enabel the following services and click OK after popup dialog

ntp

mysql

Notice there is a mythbackend option, would suggest that you do not enable "mythbackend" just yet, until you have tried running in a terminal window as below. If all steps below work then enable this to run.

Tip: You can manually add things to /etc/init.d/boot.local. After initializing and processing the boot procedure the boot.local script us executed, which can execute the local commands.

Create the database (mysql)

mythTV uses MySQL to store it's settings, listings, recording schedules, and other information. So we have to make sure openSUSE starts MySQL when it boots, and we have to initialize the database with some basic information that mythTV can work with. The database is probably the most important component of mythTV because without it, absolutely none of mythTV can function.

TROUBLESHOOT/CONFIGURATION TIPS

1.) The MySQL deamon (mysql) is not started automatically by default after a reboot.
As root start 'yast2 runlevel', select mysql and make sure it's started at boot time.

2.) Create the database
If the database is not started, start mysql (as root) by typing

/etc/init.d/mysql start

Watch for errors. Set up a root password by typing

mysqladmin -u root password <yourpasswordhere>

Once MySQL is setup, install the mythTV Database. This is done by running:

mysql -u root -p < /usr/local/share/mythtv/mc.sql

(and key-in the previously entered password)
You should see no output - this is a good thing!

By default, the database is named mythconverg and contains a set of tables that interact with one-another.

Tip: make the database multi user, so you can access it from more than 1 machine; this will assign a user named "mythtv" with a password of "mythtv " to the "mythconverg" database:

mysql -u root -p mythconverg

You will then be connected directly to the database. Enter the following commands at the mysql> prompt.

Analogue Video capture card (IVTV)

A TV capture card, also called a TV tuner card, is a device that receives TV signals and converts

them into a digital format. With a minimum of one TV tuner card installed, you can watch and record TV by using your mythTV system. If you install a second TV tuner, you can record or watch TV from more than one channel at the same time.

If you have one TV tuner, for example the Hauppauge PVR-150, you can:

Record TV on one channel

Watch live TV on one channel

Watch a recorded show while you record another show

If you have two TV tuners, for example the Hauppauge PVR-500, you can:

Record TV on two different channels at the same time

Watch live TV on one channel while another show that is on a different channel is recorded

Watch a recorded show while you record two shows at the same time

mythTV supports a myriad of different video capture cards by utilizing the IVTV driver, a kernel driver for Linux and a driver for X11 for hardware based on Conexant's CX23415/CX23416 codec chip. The recommended analogue Standard Definition Cable (SDC) capture cards are the Hauppauge PVR.

openSUSE 10.3 ships with IVTV version 0.10.3 and ivtv-firmware 0.10.3, everything is auto detected on the x86 and x86-64 bit version of the OS.
Please make sure you install the ivtv-firmware from YaST from the NON-OSS openSUSE repository.

IVTV-based cards are hardware encoders, but the firmware does not exist in the card itself. Instead, you must point your hardware to an extracted version of the firmware on disk. One of the benefits of openSUSE is that it has the closed source ivtv-firmware drivers available in the NON-OSS repository.
This Firmware is licensed for use only in conjunction with Hauppauge component products. More info about the license can be found in the license agreement included in the package.

Configuration Tips

Check the IVTV console output with dmesg

dmesg | egrep -i '(ivtv|tveeprom|tuner)'

Your output should look something like this example from the Hauppauge PVR500:

If you are lost; here are some screenshots of mythtv-setup for a PVR-500 in the Netherlands.

Channels and frequencies

You can fill the channel table and frequencies from mythtv-setup

Since there must be more MythTV users in your area, this could be a good moment to make some new friends.
Chances are that someone already did this and exported this channel information and published it on the web.
Check the country specific information on the mythtv wiki or some local mythtv sites and with some luck you can
import a channel file to your database.

Tip: For some countries, providers, areas there are channel.sql files available that hold all channels and frequencies for your area and that can be imported directly into the mySQL database. See the XMLTV page for more details about your country specific information.

<debug>Show the channel table from the mythtv database from the commandline</debug>

Electronic Program Guide (EPG)

The most difficult part of installing/configuring MythTV is getting the data, name and frequency of all the channels in the database.
One of the reasons is; it's country and region specific information and it also depends on your type of TV signal.
Most analogue mythTV systems need to grab information from some local website and import it into the mythTV datastore. For this to work, a technology called grabbers is used. A grabber, 'grabs' EPG information from a website and transforms the data to XML format.
Most DVB-C infrastructures send EPG information in streams over the cable so other techniques are used.

The best advise we can give you, is to search for country/provider specific information because for EPG there is no 'one size fits all'.

mythfilldatabase

mythfilldatabase is nothing more that a nice wrapper around your EPG handler. Normally mythfilldatabase is run automatically by mythbackend every 24 hours. It uses your EPG handler (grabber) as defined in mythtv-setup.

XMLTV

Most grabbers use XMLTV to get the EPG data into the database. Make sure you install the XMLTV software packages.
XMLTV ships with a set of standard grabbers per country. Although these might work - again, search for country specific information - better grabbers may be around.

The program guide in mythTV is a listing of TV shows that you receive over the network.

XMLTV is a set of utilities to transfer and store EPG (Electronic Program Guide) in a XML format for various countries.

It's good to understand the following components before you begin:

XMLTV Grabber = country specific module to grab EPG (Electronic Program Guide) info from a source and translates it to XML format.

XMLTV ID = Value that exists in the XMLTV data and in the Channel table. It's the link/mapping to get the information on the correct channel.

CHANNELS = Your TV channels, with their channel number and frequencies as defined in mythtv-setup

CHANNEL_ICONS = Bitmaps that are displayed by mythfrontend as a graphical representation of the channel. (example: CNN logo)

mythfilldatabase = An mythTV application that uses the XMLTV grabber that you defined in mythtv-setup and stores the information in the MySQL database.

The most essential data in your database is the channel mapping: The mythconverg_channel table in the database links/maps the following information
channel number frequency name of the channel XMLTV number
Without this information the EPG (Electronic Program Guide) can not work.

The first thing you should do to get listings into the database is to set up your channels. In mythtv-setup, after you have set up your card, you can configure a video source based on your geographic location. The video source config page has a field for "grabber"; select your country there and mythTV will be ready to run a program called "mythfilldatabase" that will use XMLTV and tv_grab_XX, where XX is your country specific method. So, XMLTV works by running a custom grabber for your country. This grabber collects guide data from the sources appropriate to your country.

1.) Understand what grabber technology you should use and are currently trying to configure - read !

2.) Location of the grabber config file and current user. The grabber for your country may have it's settings stored in the users home directory (~./.xmltv or ~./.mythtv).
Normally your should run mythfilldatabase as user and not as root!!

3.) Check the XML-TV-ID in database and grabber

Have a quick look in the database
This will show channel numbers, xmltvid etc.

Use and configure mythTV clients (frontends)

Integrated LCD or VFD panel (LCDProc)

Mythfrontend (the integrated mythlcdserver) can control a LCD (Liquid Crystal Display) or a VFD (Vacuum Fluorescent Display) panel through the LCDproc API. LCDproc is a small piece of software that displays real-time system information from your Linux box on a LCD/VFD.

STEPS

Install LCDproc and configure your device

LCDproc is not part of the openSUSE 10.3 distribution, but a rpm is available:

Remote Control (LIRC)

The configuration of your remote control can be one of the most time consuming aspects of your mythTV setup. The remote controller itself can never be detected by the system so it requires some manual work. If your remote control device is not supported, it's required to learn the system about your device and define it's behavior.

LIRC is the package that allows you to decode and send infra-red signals of many commonly used remote controls.
openSUSE 11.1 ships with LIRC 0.8.4. To use LIRC, you need a configuration file for your remote control. A list of supported remote control is available on http://lirc.org/remotes/

If you can't find a configuration file for your remote control on the lirc page, it does not mean that your remote control is not supported but there is no configuration file for it yet. You don't have to be a developer to create a configuration file by using irxevent and mode2. More info about these LIRC programs can be found on http://lirc.org/html/programs.html

If you have created a new configuration file for a remote control, please send it to the LIRC team.

REMOTE CONTROL CONFIGURATION FILES

/etc/sysconfig/lirc = Hardware config file

You must install the lirc kernel modules package that corresponds to your installed kernel.

sudo zypper in lirc-kmp-default

Tip: You can check the kernel version from the command line with 'uname'. The word 'default' in the below example means a default kernel (in most cases the only other possibility is 'bigsmp').

# uname -r
2.6.25.5-1.1-default

You must edit this file so that lirc knows which device to use. For example, if you have a PVR-150 make the following changes:

Tip: If your lirc kernel module is working and detects the card properly you will see the device /dev/lirc appear when lirc is started. If that device does not appear check /var/log/messages and dmesg for clues. Also, it has been reported that a full cold boot is sometimes required to bring the PVR150's IR back to life even going so far as to remove the card from the motherboard for a few moments. Be sure to try this before taking any other drastic steps (such as compiling lirc from source).

lircrc = Application specific mapping of the remote functions (play, poweroff etc) to the app specific functions for mythTV, mplayer and or Xine

Every application that you want to control with your remote (and has support for remote control) needs it's own lircrc configuration file.

The lircrc maps the keynames defined in lircd.conf (example: poweroff) to an application specific function (example: exit application). Make sure that the key names in lircrc should correspond with the same button names in lircd.conf.

APPS AND THEIR lircrc CONFIGURATION

mythTV = /home/user/.mythtv/lircrc

xine = /home/user/.xine/lircrc (TODO: check if this is correct)

mplayer = /home/user/lircrc

Tip: Instead of creating an individual lircrc file for each application, you can create one master file and put symbolic links to this in the appropriate places. The command for creating a lircrc file in your /home/userid/.mythtv directory, symbolically linked to lircrc in your home directory, follows:

ln -s ~/.mythtv/lircrc ~/lircrc

NOTE

The LIRC deamon (lircd) is not started automatically by default after a reboot.

As root start 'yast2 runlevel', select lircd and make sure it's started at boot time.

The lirc deamon does not start without a configuration file. Please make sure your create the configuration file before you start lircd.

TODO: howto get a sample ~/.mythtv/lircrc - google for a lircrc for your remote - try the mythtv remote control wiki pages

there can be only one, make sure you have 1 lircrc file for mythtv. Create links to it.

the ~/.mythtv directory is user specific and created in the users home directory when he starts mythfrontend for the first time and ask for an ip address of the backend. If you don't have a ~/.mythtv directory, start mythfrontend first. The directory is hidden, try ls -al.

example: /etc/lircd.conf

Play 0x00007be9

The lircrc is application specific, here your define that the 'Play' key is the same as function 'P'
(P is by default Play in mythfrontend)

Audio setup

TV Output (Proprietary Driver)

You can use several different types of connections to connect your mythTV frontend PC to a TV.
The S-Video cable works well with most standard TVs. The picture below explains the different types of connections that can be used to connect yout TV.

The type of output your PC's video card can do, and the type of inputs your TV can handle are primarily what dictates what you should use to connect them. From highest- to lowest-quality, the order of consideration is: HDMI, DVI (both of which are digital), VGA, Component, S-Video and finally Composite (all of the rest are analog).

Web frontend (mythweb)

MythWeb provides a frontend for scheduling and managing recordings on your mythTV system from a web browser located on another machine. Provided the security is set up correctly on your MythBox you can access your machine from anywhere on the internet, or even your mobile phone as long as you have a compatible browser. Of course it is just as useful to browse your myth content from your laptop while your partner is watching their favorite programme.

Make sure the following packages are installed

yast2-http-server, apache2, apache2-mod-php5

You can quickly check if the package is already installed with the following command

rpm -qa | grep apache

Activate the required server module for the Apache HTTP server

The Rewrite Server Module provides a rule-based rewriting engine to rewrite requested URLs on the fly. By default it's turned off and you need to turn it on.
The Environment Server Module modifies the environment passed to CGI scripts and SSI pages

Start YaST and goto the HTTP server menu (commandline: yast2 http-server)
follow the menu's by next,next,next,next and click the HTTP Server Expert Configuration, here you see a tab with 'Server Modules'

The Rewrite module is disabled by default - Enable this option

The Env module is disabled by default - Enable this option

Securing mythweb

If you plan to open your mythweb to the internet, you should seriously consider securing it. That and more information can be found here. Follow the section specifically for openSUSE here

Security Example for mythweb

To secure your Mythweb you can configure the access to it. For example you can set up 'limit access'. It will ask you for an username and password if you try to access the mythweb page. It's very simple:

First make a file where you store the username and password for a user.

htpasswd2 -c /etc/apache2/htpasswd <username>

Type in a password (2x)

Then just add the lines below in your http.conf or default-server.conf

If you now access the Mythweb (http://ip number/mythweb/) it will ask you for an username and password.

Tip: You can access your MythWeb remotely if you know your IP address. However, if you are a DHCP client, your IP will probably change. To resolve the issue of having an IP address that is constantly changing, you can sign up for an account with a dynamic DNS site (such as http://www.yi.org) and create a unique unchanging hostname that can be forwarded to your IP address - even if it changes.

Making it an appliance

Wakeup using the bios

Switching computers that do not need to run 24 by 7 on and off as required can cut your power consumption. There are different methods of programming a wakeup time under Linux without needing to set the time manually in the computer’s BIOS.

NVRAM wakeup uses the BIOS settings stored in non-volatile RAM (NVRAM).
The nvram kernel module allows Linux to access a maximum of 128 bytes of non-volatile memory.
To get this to work, you need to compile the nvram kernel module.
Basically nvram is directly poking into your bios.

ACPI has a (limited) standard interface to change the value in the bios.

The kernel transfers the time directly to your computer’s RTC (real time clock), but not the date. This leads to the computer
waking up at the same time every day, and not just on the given date. The problem is that there is a more-orless
standardized method of transferring the time to the RTC, but no such standard for the wakeup date.

ACPI RTC Alarm works with openSUSE 11.1 - more information on the following page

Remove KDE or GNOME

autorun mythfrontend or automatically start mythfrontend and not start the full gnome
The mythtv rpm's create an xsession configuration for you, so that you can select mythtv as your session from gdm, this way
gnome is not started (faster and saver you some memory)
You can select the session from the initial login screen (logout and select another session)

Upgrading from 10.2 with Packman

Over the weekend I managed to upgrade-in-place my existing MythTV installation from OpenSUSE 10.2 to 11. I did not nuke my root partition and just do a new install, I upgraded my / partition. It went rather well, but there were a few speed bumps. First, the speed-bumps:

The Lirc install still doesn't support the IR Blaster on a Hauppauge PVR150.

Due to the number of packages being thrown around, several reboots are needed for things to settle down.

11 sets up XGL/Compiz by default, which may have some affect on how MythTV renders video. This will have to be diddled after the install is completed, and will probably depend on hardware. This guide doesn't cover that.

And now, the process I followed.

Back up everything you need to back up. This makes recovery a lot easier if things go badly.

Boot to the installation media and perform the upgrade.

Pay attention to the packages and patterns you are installing. Go through them and verify everything you want is checked. I didn't have any troubles with this, but this is an area where things can go wrong.

During the upgrade process it will remove all packages not part of the OS, and not flagged as locked. Since the Packman MythTV packages show up as locked, they'll still be around. We'll fix this later.

Log in as Root to your console.

Run Online Update to get the latest openSUSE patches, which includes a kernel already and will require a reboot.

Log in again, launch YaST, and run Software Repositories

Select Community Repositories (at the top of the list)

Add Packman and any others you might need, like the NVidia repo.

Exit Software Repositories, and launch Software Management

Search for "myth". Note the MythTV packages you have installed, and explicitly remove them. These are the 10.2 packages and will not work with 11.0. Especially since most of their multimedia dependencies were removed as part of the OS upgrade.

Once that is completed, go back into Software Management and reinstall the MythTV packages you removed in the previous step.

It will give a big list of dependencies required by the MythTV packages; OK their install, and let it go.

Once everything is installed, reboot to settle things down.

By this point things should be in a good state. From a terminal window, launch "mythtvsetup" and see if it segfaults. If it runs correctly, MythTV as a whole should run correctly. If it does segfault, then this guide has failed you and I apologize.

If you are using a Hauppauge PVR150 and its IR Blaster, you will have to compile a "lirc_pvr150" module from source. You already had to do this with 10.2, so the process should be familiar. The update to 11.0 doesn't require any config file changes.

Go into YaST and launch System Services. Set "mythtvbackend" (and "lirc" if you use an IR remote) to run automatically, if that's what you do.

Log in as your MythTV user and make any Gnome/KDE/whatever changes you need. 11.0 includes significant updates to the desktop from 10.2. In my case I just nuked my profile and began anew. Your mileage may vary.

A final reboot to make sure everything is working as planned.

The above worked for me, and should be pretty solid for 10.2 to 11.0 while using the Packman MythTV packages.

Using Firefox as integrated Mythbrowser

In Opensuse 11 just changing the configuration setting in Mythbrowser to /usr/lib/firefox does not work any more. To make it work create a firefox.sh file in the Mythtv home directory i.e. /home/mythtv/firefox.sh

The script should contain something like:

#!/bin/sh
shift #shift down the arguments that were passed so we can access the url
shift
/usr/bin/firefox $9 --fullscreen #what was argument 11 (the url) becomes 9
echo $* #show all the passed arguments