Showing posts with label lirc. Show all posts
Showing posts with label lirc. 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.

Friday, December 23, 2011

The Remote Control

As I mentioned in my hardware post, I got a pretty generic Vista MCE Remote Control. By far, this was the most time consuming and frustrating piece of the install up to this point mainly because lirc is kind of a black box for me and guides for setting it up are scattered. Another problem that I ran into is that the USB IR receiver shows up as two devices. I finally got it working and minimized the process to a few basic steps, but a lot of blood and sweat went into the next set of instructions.

First off, install lirc. No additional drivers or kernel modules are necessary since I will be using /dev/input
[root@htpc ~]# yum install lirc
Next, get the generic lirc.conf for devinput from the lirc web site
[root@htpc ~]# wget http://lirc.sourceforge.net/remotes/devinput/lircd.conf.devinput -O /etc/lirc/lircd.conf
Then, because there are two devices in /dev/input, I needed a way to tie them together in lircd. I did this by editing the /etc/sysconfig file and putting in the following lines. The device names will be different depending on the remote, but these work for the one that I got.
LIRCD_OPTIONS_1="--driver=devinput --device=/dev/input/by-id/usb-05a4_9881-event-kbd  --pidfile=/var/run/lirc1.pid --listen=9988"
LIRCD_OPTIONS_2="--driver=devinput --device=/dev/input/by-id/usb-05a4_9881-event-if01 --pidfile=/var/run/lirc2.pid --connect=localhost:9988"
Finally, edit the lircd init script and modify the start function so that two lircd daemons are started up with the options from /etc/sysconfig
daemon lircd $LIRCD_OPTIONS_1
daemon lircd $LIRCD_OPTIONS_2
All that's left is to set lircd to start at boot and start the service
[root@htpc ~]# chkconfig lircd on
[root@htpc ~]# service lircd start
And of course test
[root@htpc ~]# irw 
Pressing the buttons on the remote control should show up in the output of irw.

References:
http://www.gossamer-threads.com/lists/mythtv/users/430004
http://old-de.opensuse.org/Linux_Infrared_Remote_Control