Ubuntu MythTV Epia Frontend Installation Guide
Update: this information is now out-of-date. Please follow the main guide here.
Introduction
This guide describes how to create a MythTV Frontend system based on the Ubuntu Linux distribution and Via Epia hadware. While there may be other distros specifically tailored towards Epia based systems, I've found that Ubuntu runs perfectly well, providing a great set of features and resulting in a system which can do much more than just run MythTV. It's also pretty easy to get up and running apart from a few Epia-specific caveats which are covered in this guide.
The installation requires a hard disk in the frontend box, which makes it a more expensive solution than a thin client. However, it also means that it can be used on a wireless network, as it doesn't have the restrictions of a netbooted system.
See here for details of the hardware I used.
Ubuntu Installation
I downloaded the Ubuntu Edgy Desktop CD from here. I just followed the standard installation procedure. The only things to note are:
- Don't call your default user
mythtv. He'll be added when we install the packages later. - As this is going to be a frontend only, no fancy partition or filesystem options are required; just use the default of
ext3. - Once the system is installed and booted follow the prompts to install any software updates.
Package Repositories
MythTV 0.20 is in the standard multiverse repositories, so installation is easier than ever. Just add universe and multiverse to your sources.list file.
Here's my /etc/apt/sources.list
Update the package list to include the new packages and the latest updates:
sudo apt-get update
MythTV Installation
Run the following commands to install the frontend software:
sudo apt-get install mythtv-frontend mythtv-themes
Set the password for the mythtv user:
sudo passwd mythtv
Change his default shell to bash in /etc/passwd
mythtv:x:118:118::/home/mythtv:/bin/bash
Set the mythtv user's permissions in /etc/group. Basically, add him to all the groups that your default user is in. Something like:
adm:x:4:garry,mythtv dialout:x:20:cupsys,garry,mythtv cdrom:x:24:haldaemon,garry,mythtv floppy:x:25:haldaemon,garry,mythtv audio:x:29:garry,mythtv dip:x:30:garry,mythtv video:x:44:garry,mythtv plugdev:x:46:haldaemon,garry,mythtv lpadmin:x:106:garry,mythtv scanner:x:110:cupsys,garry,mythtv admin:x:112:garry,mythtv
Log out of Gnome and log back in as your new mythtv user. We'll use him from now on.
MythTV Configuration
First of all, make sure your frontend can see your backend server. To make things easy, we'll add the backend to the /etc/hosts file. I have an entry like:
192.168.0.3 ripley
Make sure you can ping the backend:
ping ripley
The next thing to do is check that you have access to the MySQL database on your backend. Run the following command (replace ripley with the name of your backend server):
mysql mythconverg -h ripley -u mythtv -p
Note: The mythtv MySQL password would have been created automatically when your backend was installed. You can find it in the file /etc/mythtv/mysql.txt on your backend.
Copy the icons from your backend. On the frontend, run:
sudo cd /usr/share/mythtv sudo scp -r ripley:/usr/share/mythtv/icons .
Run mythfrontend for the first time:
mythfrontend
You'll get lots of errors, but should eventually be presented with a Language screen.
Go to Setup->General->Host name and enter the IP address of your backend.
Enable real-time scheduling of the frontend process:
sudo chmod a+s /usr/bin/mythfrontend /usr/bin/mythtv
Frontend Setup
XvMC
The most important thing to setup is XvMC. This offloads the processing of MPEG2 files to the Epia hardware. Without it, my Epia SP 800MHz cannot playback recordings due to lack of CPU power. Luckily, the Unichrome driver which comes with Dapper supports this out of the box.
Set the option Utilities/Setup->Setup->TV Settings->Playback->Preferred MPEG2 Decoder to VIA XvMC.
Deinterlacing
Deinterlacing is essential to prevent motion blur during playback. Bob is the only deinterlacing algorithm which works with XvMC, so that's what we'll use.
Set the option Utilities/Setup->Setup->TV Settings->Playback->Deinterlace Playback to Bob (2x framerate).
OSD Hack
Without this hack, not only does the On Screen Display show as greyscale, but it will frequently cause the system to crash and sometimes lock completely. Add the following lines to the Device section of your /etc/X11/xorg.conf file:
Option "XvmcUsesTextures" "false"
Log into your backend database and run the following command to enable the fix for your frontend:
mysql -u root mythconverg insert into settings set value='UseChromaKeyOSD',data='1',hostname='ferro';
OSD Stutters Playback
The fading of the OSD caused playback to pause temporarily. To get aroung this, I disabled fading by editing the theme and setting the fade duration to 0. I'm using the Isthmus theme, so I edited /usr/share/mythtv/themes/isthmus/osd.xml and changed the following line:
<fadeaway>0</fadeaway>
Tinny Sound
I got tinny sound when watching recording in MythTV. This was fixed by setting an option in the sound driver:
sudo -s -H echo "options snd_via82xx dxs_support=2" >> /etc/modprobe.d/sound
No Text in the OSD
The OSD was empty. To fix this, I changed the OSD font to freesans: Utilities/Setup->Setup->TV Settings->Playback->On Screen display->OSD font: FreeSans.ttf
Watch some TV
At this point, your Epia box should be working as a basic frontend. I'm now going to go on and talk about some extra configuration for my specific hardware...
ATI Remote Wonder
Although the ATI Remote Wonder isn't the trendiest remote control in the world, it works very well in Linux. Using this config, it can be used to control the gnome desktop - setting the volume etc. It even works as a mouse. Once MythTV is running, the lirc daemon takes over and maps the buttons to mythtv keys.
Install Lirc
sudo apt-get install lirc
I've mapped all of the keys on the remote and created a lircd.conf. Download the following files and copy them to their correct locations as described:
sudo cp lircd.conf /etc/lircd.conf sudo cp hardware.conf /etc/hardware.conf cp lircrc /home/mythtv/.lircrc cd /home/mythtv/.mythtv ln -s ../.lircrc lircrc
Restart lirc to pickup the changes:
sudo /etc/init.d/lirc restart