Search:  
Gentoo Wiki

HOWTO_Use_MythTV

This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

MythTV Series

MythTV

Installation

Tips/Tweaking

Usage

  • HOWTO Use MythTV
edit

Contents

Introduction

MythTV is an open-source Personal Video Recording (PVR) system, that can be used to manage, record and playback many types of media. In short, it can act as a dedicated hardware entertainment kiosk.

This guide will attempt to show you the inner workings, details, and configuration of MythTV on a Gentoo system. What this will not cover is how to install MythTV or setup your hardware. For that, checkout this howto on the wiki: HARDWARE Setup MythTV

This HOWTO assumes you have already installed MythTV with the default settings, your hardware is working correctly, and want to know what to do next.

Now then, on with the show. The first stop is to startup and configure the backend of MythTVv.

Note: This HOWTO is still incomplete/under development, but feel free to add any changes to the existing content.
Warning: This guide was written with 0.18.1 as the installed version. 0.19 screenshots / settings will eventually be phased in.

mythbackend

If you haven't already, make sure that MySQL has started. It will need to be running before we configure anything, because unlike most programs that store their settings in dotfiles in your home directory, MythTV keeps everything in a database. So, if it's not running, changes won't be saved and it can get very frustrating very quickly.

As root, startup mysql (unless you already did):

 # /etc/init.d/mysql start

If you are having problems already, you might want to re-emerge MySQL and make sure that you follow the instructions after the ebuild finishes.

If you're going to be using MythTV on a regular basis, add mysql to the default runlevel so it starts every time on boot:

 # rc-update add mysql default

Now, start the mythbackend using the init script:

 # /etc/init.d/mythbackend start
Warning: If mythbackend does not properly start, it may not display any errors. To check that it is actually running try to stop it (with # /etc/init.d/mythbackend stop). If it stops without error messages then it probably was running. If it says that mythbackend wasn't running then you have an issue to debug. A common issue is not having access rights to the storage directory (default storage directory is /mnt/store). You may have to issue the command # /etc/init.d/mythbackend zap to force the system to believe that mythbackend is not running before you can start it again. To debug, run mythbackend yourself as root. Before proceeding, be sure to start it again with the # /etc/init.d/mythbackend start

If you want mythbackend to start on bootup as well, add that to the default runlevel to make life easier as well:

# rc-update add mythbackend default

Once your backend daemon to the MythTV is running, you can jump ahead to setting up the system.


mythtv-setup

Normally we want the mythbackend server to run if we're doing anything in mythfrontend. But if you are going to run mythtv-setup, then it has to to be turned off, otherwise some settings may not be saved. So, before starting mythtv-setup, shut down mythbackend.

/etc/init.d/mythbackend stop

Once you've finished with setup, you can start it back up, since you'll need it later with mythfrontend.

Startup the mythtv-setup program. By default, it will run in fullscreen mode and assume you have a remote setup as a pointer to navigate through the menus. We'll assume you don't.

This example will shrink the window to 640x480 so you can easily switch between the setup window and this HOWTO. Use the arrow keys on your keyboard to navigate the menus. Hit Escape to exit out of menus, and eventually exit.

mythtv-setup -geometry 640x480
Note: Depending on your window manager, you may or may not be able to move the position of the window.

Each time you startup the program, MythTV will ask you two questions. The first is, Would you like to clear all capture card settings before starting configuration? If this is your first time setting up MythTV, you can choose either option (since you won't have any capture card settings to clear). So, pick either one.

The next question is, Would you like to clear all program data and channel settings before starting configuration? Again, for a first-time setup, pick either one.

Note: Those questions only appear up to version 0.18.1 of MythTV.

Once you're in the main menu, you'll have five options to choose from:

One thing to take notice of when configuring your MythTV settings, is that anytime you highlight a selection, a short description of the option will display on the bottom. Be sure to read these to familiarize yourself with MythTV's options.

Let's step through the General setup first, and look at any options that you will most likely need to alter.

General

Host Address Backend Setup

The first line should say, "IP address for <hostname>", and be set to 127.0.0.1 MythTV can run its backend and its frontend as separate parts. But in our basic setup, we'll be running both on the same box. 127.0.0.1 is the IP address of localhost, or the current box you are running on. So, don't change that.

Don't worry about the ports or master server IP address, either.

Host-specific Backend Setup

Again, for a default setup, there's nothing here that needs to be changed.

Make sure that the directories are created, though. If they aren't, the frontend will die when trying to start. Watch out for typos too.

# mkdir /mnt/store

v0.19: If you want to save the original video files after recording them, then check the box next to 'Save original files after transcoding (globally)'. There's no real reason to do this for most people, so you can just ignore it.

Global Backend Setup

You may have to change some settings based on your region. If you're not sure, leave them to the defaults for now, and move on.

Shutdown/Wakeup Options

Defaults should be fine.

WakeOnLan settings

Defaults should be fine.

Job Queue (Host-Specific)

The mythbackend daemon will take care of things like flagging your recordings for commercials, and re-encoding the video after recording live TV. Here you can set how many jobs you want it to handle at once. Unless you have a very fast, very nice machine, you probably shouldn't change this to be too much higher than 1 or 2, since video encoding takes a lot of CPU usage.

If you want to flag commercials, make sure the "Allow Commercial Detection Jobs" box is checked (arrow down to the option, arrow right to enable or disable).

Job Queue (Global)

More settings related to processing backend tasks, the defaults should be fine for most users.

Job Queue (Job Commands)

Defaults should be fine.

Capture cards

If you're going to setup your MythTV box to record live television (or video from any input source, using a tuner card), this is going to be your next stop. Select the option from the main menu, and then pick "(New capture card)".

First, choose your card type depending on your hardware. The default option, "Standard V4L capture card" would be something like a generic TV card like a WinTV PCI card. Toggle through the options using the right arrow to see what else there is, and select the one that matches your hardware. Be sure that your kernel drivers are setup already, and that your video devices are loaded. Again, see the mythtv hardware howto for instructions.

Video devices are created in the /dev/v4l directory. If you have one TV tuner, the default option of /dev/v4l/video will be fine. The kernel registers the devices starting at #0, so video0 will work too.

The VBI device is for closed-captioning and teletext. Even if your card doesn't support it, or you don't want to use it, you can leave it set to the default.

The audio device should be set to the audio device of your TV tuner card, not the audio device of your soundcard. If you are using ALSA with OSS emulation (most likely, you are), then your soundcard is using /dev/dsp, and your tv card will use the next available device -- /dev/dsp1. So, change audio device to /dev/dsp1.

Audio sampling rate limit is the kHz at which to record audio. Please note that some TV tuner cards *must* have this set to a specific setting or audio will not record properly. If unsure, leave it set to the default option of (None) for now, and you can always come back and change it later.

The do not adjust volume option would affect watching Live TV.

For default input, a lot of TV tuner cards have more than one input device to record and display video from. If you are using a coaxial cable (cable TV), then set this to "Tuner" or "Television" (whichever is available).

Save your settings when finished, and exit back to the main menu.

Video sources

The third step in setting up your MythTV box to record television is find a source to get information such as available channels, and what programs will be showing. This step is completely optional if you want to manually add the channels, but you won't have the nice program guide or TV listings.

Select video sources from the main menu. From the Video sources menu, select "(New video source)".

For the first option, enter something for video source name. This is completely cosmetic, and you can call it whatever you like as a reference. For our example, we'll be boring and call it "myth".

The rest of the video sources setup will vary depending on your region.

North America (DataDirect)

If you are living in North America, this is one of the options you can choose. Recently, Schedules Direct started providing a way for users to download the data directly, provided they create a user account with their service and pay a nominal fee (Paypal or Google Checkout required as of 12/18/2007).

So, before you fill in this section, you'll need to sign up for a DataDirect account.

Once you're done, go ahead and enter your user id and password for mythtv. Note that the password will be hidden.

Click the Retrieve Lineups button to download the possible lineups you selected on the Schedules Direct website. Most likely, you only setup one (which is fine), and it will default to the first option available.

The channel frequency table is going to depend on your local provider, but you can leave it set to default and you may well be fine.

Once you click Finish, you'll be brought back to the list of video sources. You should see your new setup in the list. Just hit Escape to exit back to the main menu. We'll download the actual listings later on.

Note: Zap2it Labs shut down their free directory service on September 1,2007. Schedules Direct is a not-for-profit organization that was formed to offer this service to MythTv users in response to this change.


Note: Editing the wiki and entering regional info would be greatly appreciated if the steps are difficult or could benefit from a little extra explanation

Input connections

Setting up the video sources is just part of getting your listings to work with MythTV. The next step is to actually tell your setup which video sources to use with which tuner card -- even as specific as which input device!

The reason for this is that most TV tuner hardware have more than one input connection. You can record on a coaxial cable connection, or through an RCA cable connection, or even through s-video.

When you first enter the input connections menu, you'll see a menu of all the input devices that your TV tuner uses. Since some TV tuner hardware devices have more than one input to record video, you'll have to select the one that you're using. Again, if you are using just a regular cable TV coaxial cable, then arrow down and select the "(Television)" or "(Tuner)" option.

Connect source to input

This setup is fairly simple. For video source, select the "myth" video source that you setup earlier. The rest of the defaults should be fine for most hardware, so hit the Finish button, and you're done!

If you're going to use other video inputs to record television, go ahead and repeat the same step, and exit back to the main menu when you're ready.

Channel Editor

If you already jumped ahead to the Channel Editor, and didn't see any channels listed, don't panic. You haven't done anything wrong. Before you can see anything listed, you'll need to download the actual listings from your video source configured above using another MythTV tool called mythfilldatabase.

mythfilldatabase

Later on in the howto, we'll look at mythfilldatabase a little bit more, but for now let's use it just to get you set up. Go ahead and run the command in a terminal session as any user. It won't matter who you use, because the data is inserted into the database using those user permissions.

 mythfilldatabase

Stretch your legs for a minute, since it will take around a minute (on a broadband connection) to download the listings.

mythfilldatabase will download about a week and a half worth of listings at a time for DataDirect. Later on, we'll cover how to have it run automatically within MythTV, so don't get worried about having to setup cron jobs. :)

If this does not work then you may need to restart the mythtvbackend rc-script.

Once your listings are downloaded, go back to the main menu of mythtv-setup, and select Channel Editor.

Channels

This time, you should see a listing of all the channels that you setup in your XMLTV configuration (either through DataDirect or manually).

By default, the list's sort mode will be by channel name, though you can change it to channel number if you like. Changing it will only affect this page, not your on-screen guide. The on-screen guide displays channels in numerical order by default.

If you select the video source menu, you'll see the "myth" video source that you setup earlier. It will probably be the only one setup in there, but if you added more they will be there as well. By default, MythTV will use all the available video sources, but you can switch to just one or the other here if you'd like.

That's about it for this page. It is mostly to display what channels are available. Congratulations! If you made it this far, you've got your MythTV backend all setup, and are ready to move on to actually watching something.

mythfrontend

Now that MythTV is all configured and ready to go on the backend (setting up hardware, channels, and MySQL connections), you're ready to jump into mythfrontend.

Again, for our walkthrough, run mythfrontend in a window so we can guide you through some of the steps.

# mythfrontend -geometry 640x480

In this case, we are running as root. However, you can run mythfrontend as any user you like (mythbackend, too), as long as they have read/write permissions to the directory to store recordings. A general recommendation would be to not run any programs as root unless you need to, so creating a user just for mythtv to run as, and owning the directories to them is a good idea.

From the main menu, you'll have five options to choose from:

Watch TV

It's pretty obvious what this menu selection will do -- drop you right into viewing the television stream coming to your tuner card. Go ahead and test this, to see if everything is working properly. If you don't hear any sound, don't panic. It could mean one of two things -- either your hardware is not setup properly, or the tuner card can't route the sound it's recording to your soundcard. If you can get a video stream though, you're probably all setup.

Media Library

You'll have different options here, depending on what mythtv plugins you have installed. With just the basic myth setup, you'll only have one: watch recordings.

Watch Recordings

The default view preference is a simple browse mode. First, it will drop you into an 'All Programs' view on the left. If you arrow over to the right, you can then select the recording shows to watch. If a program is currently recording, it's title will be in purple (for the default theme). Recorded shows will display in a white font.

To watch a program, just select it and hit Enter.

If you want to browse by TV title, scroll up and down with the menu on the left.

Manage Recordings

Information Center

Again, like the Watch Recordings section, the menu list here will vary depending on the plugins you have installed. For a default installtion, the only avaialable option will be system status.

System Status

Utilities / Setup

A default installation will only have one option: Setup.

Setup

General

Database, audio, and general settings

Appearance

Change the mythtv theme.

TV Settings

Recoriding and playback profiles and priorities.

See Also

External Links

This article is still a Stub. You can help Gentoo-Wiki by expanding it.

Retrieved from "http://www.gentoo-wiki.info/HOWTO_Use_MythTV"

Last modified: Tue, 18 Dec 2007 10:16:00 +0000 Hits: 46,739