Showing posts with label MythTV. Show all posts
Showing posts with label MythTV. Show all posts

Wednesday, December 28, 2011

Configuring the MythTV Frontend

There really isn't much to setting up the MythTV frontend. The main things that I want to do were to setup the remote control to work with MythTV, enable VDPAU, and setup GDM to login as the mythtv user.

To start the MythTV, you can either do it from the Applications menu on the Gnome desktop while logged in as the mythtv user, or from the command line terminal while logged into the Gnome desktop as the mythtv user. During the initial setup I like to start the frontend from the command line because I can see if there are any errors when running the frontend on the console.
[mythtv@htpc ~]# mythfrontend
Provided that mythfrontend started up without any issues, you can navigate around using the keyboard directional keys. One of the first things that I did was to change the theme because the default theme is pretty hideous. Go to Setup -> Theme Chooser and select MythCenter-wide 1.1 (provided that you have a widescreen TV). I also like to change the menu theme to something that I'm used to by going to Setup -> Appearance and selecting Default for the Menu theme.

The next step is to get the remote control working with the frontend. Exit out of the frontend by hitting the Esc key a few times and create the lircrc file in the .mythtv folder
[mythtv@htpc ~]# vi ~/.mythtv/lircrc
Rather than taking up a whole lot of space on this post for the lengthy config file, I decided to post the config for my remote on Pastebin. You can view it here. I used the MythTV key bindings as a reference. Save the file and launch the frontend again. You should now be able to navigate the menu's using the remote control.

The next thing that I wanted to enable is VDPAU, which allows the majority of video rendering to be offloaded from the CPU onto the nVidia GPU. Navigate to Utilities/Setup -> Setup -> TV Settings -> Playback and hit next a couple of times until you get to the Playback Profiles (3/8) screen. Select VDPAU High Quality for the Current Video Playback Profile. As far as I know this only works for nVidia cards. You can find a good list of video cards that support VDPAU here.

Lastly, I wanted the mythtv user to automatically log into the Gnome desktop. As root, edit /etc/gdm/custom.conf and add the following under the daemon section.
TimedLoginEnable=true
TimedLogin=mythtv
TimedLoginDelay=10
The above settings will automatically login the mythtv user into the Gnome desktop after a 10 second delay.

That's really about it. There are lots of other settings to play around with and I'll post any tweaks that I make over time. For now, sit back and try watching some live TV and play around with recording stuff.

Saturday, December 24, 2011

Installing MythTV on CentOS 6

Now that OS environment is ready and all of the drivers have been installed and working properly, it's time to install MythTV. As a recap, here's everything that was done to get to this point:


First thing is to install MySQL and start it up
[root@htpc ~]# yum install mysql mysql-server
[root@htpc ~]# chkconfig mysqld on
[root@htpc ~]# service mysqld start
Next, secure MySQL. I basically answered all the questions with a 'Y'
[root@htpc ~]# /usr/bin/mysql_secure_installation
Enter current password for root (enter for none): <enter>
Set root password? [Y/n] y
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
Install QT 4.7. Needed to remove qt-x11 because it was conflicting with QT 4.7.
[root@htpc ~]# yum remove qt-x11
[root@htpc ~]# yum install qt47 qt47-x11 qt47-webkit qt47-mysql
Install MythTV
[root@htpc ~]# yum install mythtv-backend mythtv-frontend mythtv-docs mythtv-setup 
Create the MythTV database and user in MySQL.
[root@htpc ~]# mysql -u root -p < /usr/share/doc/mythtv-docs-0.24.1/database/mc.sql
For performance reasons, it is recommended to tweak some MySQL settings. Simply edit /etc/my.cnf and add the following values:
  key_buffer = 16M
  table_cache = 128
  sort_buffer_size = 2M
  myisam_sort_buffer_size = 8M
  query_cache_size = 16M 
And restart MySQL for the changes to take effect
[root@htpc ~]# service mysqld restart
Finally, I like to do one last system update and reboot to make sure that all the necessary services start at boot time.
[root@htpc ~]# yum update
[root@htpc ~]# reboot
And test to make sure that MySQL and lirc are working
[root@htpc ~]# mysql -p
[root@htpc ~]# irw
Next up, configuring the MythTV backend...


Friday, December 23, 2011

Hello World!

My first post, YEY!

I'm an Oracle Database Administrator that likes to tinker with home theater PC's (HTPC's) when I have some spare time. I know Linux pretty well when it comes to running Oracle databases but I've come to learn that Linux for an HTPC is a totally different beast. I created this blog so that I may share my experiences of building out a Linux HTPC with the rest of the world. My hope is that someone out there would find it useful and perhaps help them save some time and avoid some of the frustrations that I've gone through over the years with my HTPC. I may on occasion do a random Oracle related post, but I'll try to keep that to a minimum.

I built out my first and current HTPC system back in early 2006. It's running on a machine that I put together for the sole purpose of running MythTV. It has an Athlon 3200+ CPU, 1G of memory, an nVidia GeForce FX 5200 graphics card, a couple of Hauppauge analog capture cards, and a pcHDTV HD-5500 digital capture card. I don't use the analog capture cards anymore since everything is pretty much broadcast digitally nowadays, however, I do still use one of them for the remote control because it has an IR input. I use that machine for other things such as a backup server, a DNS server, and a DHCP server. Over time I've added other HTPC applications to it like Boxee, Subsonic, and Serviio, which I use to watch more demanding HD content like H.264 on my Playsation 3.

Surprisingly, the HTPC I built back in 2006 has held up pretty well over the years. It is able to play back HD MPEG recordings just fine due to the hardware acceleration of the nVidia card and I haven't really had any major issues other than a failed hard drive due to a power outage. Because it was able to play back recordings in HD, I haven't had a compelling reason to do a major overhaul of the hardware, so I just left it alone. I will admit though that the hardware has been showing its age for quite a while and it doesn't do too well with Flash (Boxee) or H.264 video (that's why I setup Serviio). The opportunity to do a hardware overhaul  presented itself when I upgraded my desktop PC, which left behind some fairly decent spare parts, so I figured now is a good time, plus it's the holidays and I have a bit more spare time than usual.

The Linux flavor that I chose for my first HTPC was Gentoo. I chose Gentoo because I found a good article on the Internet that detailed how to setup MythTV on it. I also thought that Gentoo would be a good challenge (which it was) that would allow me to learn up a thing or two about how Linux works (which it did).

At first I thought that Gentoo was really cool, and to some extent I still do, however, over the years, I just got tired of keeping up with the frequent updates, not to mention all the little details you have to pay attention to. Compiling most everything was time consuming (MythTV took about an hour), and sometimes I would have to do it twice because I was missing a use flag that was needed for a feature to work. The thing that really wore me down was the feeling that the next update, no matter how benign, had the potential to break something which would cause my delicate MythTV environment to crumble, forcing me to have to spend a lot of time researching and fixing stuff. I guess that just goes with the territory of  being on the bleeding edge of Linux updates. Eventually I got to the point where I just didn't have the interest or motivation to go through updates anymore so I stopped, which isn't good from a security perspective. After about a year, my Gentoo system was so out of date that I would probably have to rebuild it from scratch to make it current.

This time around I wanted to use a binary distribution where I didn't have to spend a lot of time compiling stuff and one that had a longer support lifetime so that I wouldn't be forced to update as frequently. Being an Oracle DBA, I feel most at home with the Red Hat distribution of Linux. I ultimately decided to go with  the latest version of CentOS, which is essentially a Red Hat clone without the Red Had branding and artwork. I considered using Scientific Linux but decided on CentOS because I was more familiar with it. With the packages from the good folks at EPEL and ATrmps the process of building up the HTPC was no where near as time consuming as doing it on Gentoo (at least not so far). I guess only time will tell.

Next up, the new(er) hardware...