For those of you who always thought PCLinuxOS and MythTV would go together…you’re quite right, they do fit well together…though there are a few bumps on the road. Hopefully, this how-to will help you along the way.
First, let’s mention what this guide will not cover:
- Remote Controls
- IR Blasters
- Picture Quality Settings
Why won’t I cover those? Because there are infinite possibilities for each one…and it would be impossible for me to investigate them all…hardware not in my possession besides. So, this will cover installing mythtv and omit the items above. Mythtv has those items covered quite well in their documentation.
- HP a1520n
- ATI x300 PCIe VPU
- PVR150 and PVR350
- Sharp Aquos 37″ LCD TV
- USR MaxG PCI Card
Install PCLinuxOS…with a twist
When I installed PCLinuxOS, I created a user “mythtv” for my main desktop user on my media center pc. This is an easy way of ensuring that your user is part of the multimedia group that some how-to’s speak about. I recommend you do this also.
I created 3 partitions on my hard drive: /boot, /, and /home. I used ext3 for /boot and /, and XFS for /home…because /home will be where my video is kept. The /home partition is rather large for me since I have a 250GB Hard disk…and boot only has 100M with / having 15GB. /home gets the rest 😀
Another thing I did was connect a network cable despite having a wireless adapter. This is so I could setup ntp right away during first boot. It’s imperative that the time be correct for your timezone because the MythTV guide data is totally dependent upon it. Since part of the installation is downloading guide data, I also recommend you do this.
After PCLinuxOS Install
After installing, I created a directory inside my /home/mythtv folder. I changed the permissions on this folder with the following command:
[root@localhost~]# chmod -R a+xrw video/
This will be the directory I use to store liveTV recordings and shows that I record. I also made sure that the current user (mythtv) owns this directory by listing the directories with the -l flag (ls -l).
Open Synaptic, click the reload button, click the mark all updates button, click the apply button. This will install all updates for the distro and bring us up to current.
Getting Ready for MythTV and Multimedia
Next up we have to get PCLinuxOS ready to play any media we throw at it. If this is legal in your country, install the following:
- mysql (needed for mythtv)
- ivtv (for Hauppage Cards)
Make sure you accept all dependencies that are marked for installation by the package selection above. Texstar and the gang know what’s going on so you’re very safe with their dependency selection.
Optional Installation Candidates:
- Google Earth
- Google Desktop
Before you install the MythTV packages, we need to make sure the MySQL package we installed is up and running. Open up a Konsole and type the following:
[root@localhost~]# service mysqld status
If the mysql daemon is running, great! If not, start it with ‘service mysqld start‘. Open up the PCLinuxOS Control Center and go to System >> Services. Make sure the checkbox is toggled on mysqld so that it will start on boot.
When you installed mysql in the step above…it installed with no root password set. This is bad for security reasons…especially if you later plan on using the web plugin for MythTV where you can access program data from the web. To change this, do the following:
[root@localhost~]# mysql -u root
This logs you into the mysql console. You’ll then be able to:
[root@localhost~]# mysql> SET PASSWORD FOR root@localhost=PASSWORD('password');
Make sure you replace the word ‘password’ with a password of your choosing. This will be the new root mysql password. Keep it in a safe place away from prying eyes 😀
Now that we’ve got the mysql server running and all the prepatory packages installed, it’s time to get MythTV installed. If synaptic is not open, open synaptic and do a search for ‘MythTV’. You should see quite a good number of packages available for install. There are only 4 packages that we need to get MythTV running…so install the following:
Allow those installations to also select any dependencies they might need. Don’t worry, we can install other add-ons later. After installation of these packages, we’ll need to configure the backend of MythTV first so it can scrape program data from the web and store it in our MySQL database.
To setup mythtv’s backend, we’re going to run myth-setup (that’s the command you can run from a konsole as well). This will ‘setup’ our configuration for when we fire up the mythbackend. However, we need to give the MySQL database structure so that the data can be stored inside of it. To do this, MythTV gives you a .sql file that can be used to form the database structure.
[root@localhost~]# mysql --user=root --password=passwordSETearlier < /usr/share/doc/mythtv-0.20/database/mc.sql
Now the structure is complete. It’s time to run the setup utility. Go to the PC Menu >> Multimedia >> Video >> MythTV Setup.
Step through the setup tasks. It’s ok to leave stuff you don’t know about…you can always tweak things later. Some items you must change are your IP (from 127.0.0.1 to whatever your IP is) if you plan on connecting a remote front end to it (say, one in your bedroom to the server backend in the living room). Since I run my server as a standalone one (both frontend and backend) I will leave this to 127.0.0.1.
I won’t cover all of the screens in the setup here. There is good documenation available at the mythtv website: http://www.mythtv.org/docs/mythtv-HOWTO-9.html#ss9.1
Only step through 9.1 on that link as we’ll need to do some more with PCLinuxOS before moving onto the next step.
Make sure that you’ve previously setup the correct lineup with zap2it…and remember that this month they’ll stop allowing free service so you’ll have to pay per month for their service. The reason you need to have an account with zap2it is so that during the next few steps, we’ll be downloading channel data for the MythTV install.
Finish out the setup configuration. Now we need to start the backend which will read the configuration we just did so that when we download channel data, it connects through the backend daemon and uses it for access to MySQL (remember the IP address and user/password in the screens?). To start the backend, open a konsole and su to root.
enter your root password when prompted.
[root@localhost~]# service mythbackend start
The backend starts up and reports back that it was successful. Now it’s time to fill the database with channel data by running mythfilldatabase.
After it starts, execute:
This fills your database with channel data from your zap2it lineup. You now have MythTV ready to go with full configuration. There are numerous tweaks such as filters and encoders/decoders that I won’t go into here…mainly because I don’t know much about them. Experiment around and see what suits your cable signal and your install.
Problems I encountered with mythfilldatabase
My backend wasn’t running when I first executed the mythfilldatabase command and no amount of executing the command “service mthbackend start” could get it to work. So my mythfilldatabase kept timing out when trying to connect to the backend and fill the mysql database with channel info.
I isolated my problem to my /home/mythtv/video directory. Inside of this directory there is a file used by mythtv named nfslockfile.lock. This file had the wrong permissions set for it when I looked at it and mythtv couldn’t access it. So, I opened up a konsole, and ran
[root@localhost~]# chmod a+rwx nfslockfile.lock
[root@localhost~]# chown mythtv:mythtv nfslockfile.lock
Then, fired up the backend again with:
[root@localhost~]# service mythbackend start
and once that was accomplished, I reran mythfilldatabase and things were like greased lightening.
Continuing the Installation and Finalizing
After you channel data is finished downloading and reports it successfully saved in the database, you can start the front end. Before doing that though it is wise to check to make sure your capture cards are working (most happauge cards work quite well out of the box)
To do so, open up a konsole and type the following:
[root@localhost~]# mplayer /dev/video0
This should play channel video using mplayer. If it works, you know you capture card is functional. If you have a second card like me, test it out with:
[root@localhost~]# mplayer /dev/video1
You should have picture and sound from the default TV channel done during the lineup import (mythfilldatabase). If this doesn’t work for you, you’ll have to do some searching on mythtv and your model of capture card. This how-to won’t cover that but I’ll try to answer questions in the comments section.
So, we’ll assume that video is good for you and that the mythfilldatabase went fine and that you’re ready to watch TV. Open up the PC Menu >> Multimedia >> MythTV.
I also copied this MythTV shortcut to my desktop by click dragging it out of the PC menu to the desktop (choose copy here). Then you don’t have to access the menu each time, you can simply double click the shortcut.
Once the front end is up and running, you can immediately go to ‘watch tv’ though it may not look very good due to aspect ratio and filters not being set as well as quality not being set. You change these values by configuring the front end.
Configure the front end with the instructions here: http://www.mythtv.org/docs/mythtv-HOWTO-10.html
Now that you’ve got stuff setup the way you like it and you’re watching TV on your new MythTV box, you can add a few ‘plugins’ to supplement your experience.
I chose to install the following add ons:
You can choose others but please be advised that mytharchive currently doesn’t work as it is missing a dependency….I’ve reported the problem to the devs and it should be solved soon.
That’s about it! Pretty straight forward as long as you do things in order. I messed up 3-4 times and had to start over when creating this how-to…I installed mythtv before I installed mysql one time…I even messed up and forgot to connect the box to the internet once and banged my head at why it wouldn’t download channel data (it was the end of a long weekend and it was VERY early in the morning).
In all, don’t give up! Keep on trying and if you have questions, please ask via the comments and I’ll try to point you in the right direction.
For those of you already running MythTV…
I’m specifically interested in what combination of filters people have used for their cable TV…it seems I can’t get as good of quality with my us-cable signal that others report (I have a Sharp Aquos 37” LCD TV to display my TV on). So, if you find a good combination, please share it in the comments!
This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.