Saturday, October 11, 2008

Mediabuntu

To play DVDs we need to install a couple things so that we can decode DVDs. First add the mediabuntu repository then update it:

sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update

Then install libdvdcss2

sudo apt-get install libdvdcss2

your computer can now play DVDs.

lircrc for mplayer

Ok, time to beable to control mplayer with the remote control. In the mythtv users home directory add this to the .lircrc file (or create it if it doesn't exist):

#mplayer
begin
prog = mplayer
button = Back
config = quit
end

begin
prog = mplayer
button = Mute
config mute
end

begin
prog = mplayer
button = Rewind
config = seek -10
repeat = 2
end

begin
prog = mplayer
button = Forward
config = seek -10
repeat = 2
end

begin
prog = mplayer
button = Pause
config = pause
end

begin
prog = mplayer
button = Right
config = seek +100
end

begin
prog = mplayer
button = Left
config = seek -100
end

begin
prog = mplayer
button = Up
config = audio_delay 0.100
end

begin
prog = mplayer
button = Down
config = audio_delay -0.100
end

Some settings in MythTV

I'll change some settings in MythTV just to optimize the performance a bit. Most of these are optional; although the first one is definitly needed (for my system atleast).

The live TV guide operate very slowly, and that is becuase of the encoder that is used to display the live tv. In Setup-Setup-TV settings-Playback change the profile from CPU+ to Slim. This will make the guide work correctly.

I reccomend going through all of the settings and reading about them and then changing them to what suits you best. Two that I like is to allow LiveTV to change the status of recorded shos (so it can change what tuner it is going to use so it doesn't interupt your show) and for LiveTV to use the Tuner card that doesn't have anything recording on it for the longest time. This just helps to have uninterupted live tv.

Thursday, October 9, 2008

lircrc for mythtv

To use the remote for mythtv I am using this simple lircrc file to begin with. I plan to add and modify it in the future as needed, but for now it gets all of the basics. Put this in the home directory of mythtv under ~/.mythtv/lircrc Don't forget to reboot afterwards. I'll get a file for mplayer later.

begin
prog = mythtv
button = One
config = 1
end

begin
prog = mythtv
button = Two
config = 2
end

begin
prog = mythtv
button = Three
config = 3
end

begin
prog = mythtv
button = Four
config = 4
end

begin
prog = mythtv
button = Five
config = 5
end

begin
prog = mythtv
button = Six
config = 6
end

begin
prog = mythtv
button = Seven
config = 7
end

begin
prog = mythtv
button = Eight
config = 8
end

begin
prog = mythtv
button = Nine
config = 9
end

begin
prog = mythtv
button = Zero
config = 0
end

begin
prog = mythtv
button = Back
config = Esc
end

begin
prog = mythtv
button = Home
config = Enter
end

begin
prog = mythtv
button = Guide
config = M
end

begin
prog = mythtv
button = More
config = I
end

begin
prog = mythtv
button = ChanUp
repeat = 3
config = Up
end

begin
prog = mythtv
button = ChanDown
repeat = 3
config = Down
end

begin
prog = mythtv
button = Up
repeat = 3
config = Up
end

begin
prog = mythtv
button = Down
repeat = 3
config = Down
end

begin
prog = mythtv
button = Left
repeat = 3
config = Left
end

begin
prog = mythtv
button = Right
repeat = 3
config = Right
end

begin
prog = mythtv
button = Play
config = Return
end

begin
prog = mythtv
button = OK
config = Return
end

begin
prog = mythtv
button = Enter
config = Return
end

begin
prog = mythtv
button = Mute
config = |
end

begin
prog = mythtv
button = Rewind
config = <
end

begin
prog = mythtv
button = Forward
config = >
end

begin
prog = mythtv
button = Record
config = R
end

begin
prog = mythtv
button = Stop
config = O
end

begin
prog = mythtv
button = Pause
config = P
end

# Use for backwards commercial skip
begin
prog = mythtv
button = Replay
config = Q
end

# Use for forward commercial skip
begin
prog = mythtv
button = Skip
config = Z
end

begin
prog = mythtv
button = LiveTV
repeat = 3
config = ALT+L
end

# Toggle subtitles (closed captions)
begin
prog = mythtv
button = Teletext
config = T
end

Uploading videos

Videos that are in the /var/lib/mythtv/Videos directory can be watched through MythTV Media Library menu. TO get files here I want to be able to SSH in to my user on the computer and just upload them to the file; however, I need to give my user access to the files. To do this use:

chmod 777 /var/lib/mythtv

And now everyone has access to read, write and execute files in that directory.

Fixing the volume

The volume in mythtv seems to be really low, even if I turn the speakers up to max I can barly hear them. To fix the problem I did the following.

First I want to fix the volume in MythTV. First do:

alsamixer

I then put all of the volumes to 100%. Save the settings with:

sudo alsactl store

In mythtv go to Setup/General. On the third screen raise the PCM and master volumes to 100. That should do it.

Wednesday, October 8, 2008

Installing MythTV

This is the big post, installing a Mythtv master backend and a frontend on one machine. This will take some time so be sure to have some when you start.

Start by installing the Backend:

sudo apt-get install mythtv-backend-master

It will ask for a password for the root mysql user. Enter one. It will then tell you mythtv-setup needs to be ran after the install. Click yes to more than one computer using mythtv (unles that isn't the case). I would reccomend password protecting mythweb, so select yes to that and enter a username and password. Click OK to the random password that is generated for MySQL, but remember where the file is:
/etc/mythtv/mysql.txt

Now the backend is installed, lets install the frontend:

sudo apt-get install ubuntu-mythtv-frontend

sudo dpkg-reconfigure mythtv-database

select localhost and then root (unles you know it is different) Then enter the mysql password that you inserted above (not the randomly generated one). Then select more than one computer agian.

We would also need to allow outside connections to mysql if we have more than one computer, but we will worry about that when we install a second computer. (this might not be nesscerry, I am unsure at the moment).

reboot the system and then go to the TV and start the configure process for mythtv.

sudo reboot now

At the computer screen (not SSH like I have done almost everything else) mythtv will have started. It will ask you to configure mythtv before starting the frontend. Click OK.

**Note these setting differ by person and location. Don't ask me what settings you should use, figure it out for yourself like I did. These are the settings that worked for me.
Start with General:
On the second screen change the channel frequency table to us-cable. Make sure TV format is NTSC (If you are in the US). The rest of the defaults work for me.

Capture cards is next:
My TV capture card (PVR-500) has two tuners, so I need to do this twice with the only change being the video device. Select new capture card and for card type select MPEG-2 encoder card. Default input is Tuner 1. One card will use /dev/video0 and the other /dev/video1 for video device. Once that is done push esc to get back to the main menu.

Video Source:
Click new video source. Give it a name (doesn't matter) Then enter in your login name and password for the SchedulesDirect.org website (if you don't have one get one). Retrieve lineup and it should pop up with what you set on SchedulesDirect's website. Select us-cable and then hit finish. Esc to get back to the main menu.

Input Connections:
Find the /dev/video0 and /dev/video1 tuner lines and do the same for both. Give it a name (different for each card please) and then select the video source you entered above. Then scan the channels to find out what channels you get. This takes a minute. If it doesn't give you all the channels that you should have chances are you didn't select us-cable. click OK then finish on the second screen. You should be back to the input connections page. repeat for the second card.

Channel Editor:
I didn't need to edit the channels so I skipped this.

Storage:
I just used the defaults for this.

Hit esc to finish the configure. It will ask you to fill the database, click OK. This will take a little while. It is downloading the program listing from SchedualesDirect.

Once that is done you can start watching TV in mythtv, but you might notice that the volume is low. I'll fix that in the next post and also change some of the settings in mythtv. You also can't play encrypted DVDs, I'll also fix that in the next post.

ZSNES and DOSBOX

We can install a DOS emulator and a SNES emulator quickly. Other emulators will be installed later, but this will get us started for now.

sudo apt-get install dosbox
sudo apt-get install zsnes

sudo reboot now

We'll get the joystick working later for zsnes.

Static IP

I want to have my mythtv box use a static IP address instead of using DHCP to request a IP from my router every time. This makes it easier to SSH in to the box since it always has the same IP on my network, it also will be helpful in the future when I have multiple frontends talking to the same backend, if the address to the backend changes everytime it restarts then it will be a headache.

sudo vim /etc/network/interfaces

It orgianly looked like

auto lo
iface lo inet loopback

your's may be different. I added to the bottom:

auto eth0
iface eth0 inet static
address 192.168.1.198
netmask 255.255.255.0
gateway 192.168.1.1

I then got kicked out of the SSH terminal so I just restarted it from the computer and then in the future I can SSH in to it at the IP address of 192.168.1.198

Tuesday, October 7, 2008

Install LIRC

To use a remote with a mythTV setup you need to install LIRC.

sudo apt-get install lirc

The install will then ask what remote you have and give you a list of options. I have a Anyware HA-IR01SV Infrared Certified MCE VISTA Remote Control so I selected:

Windows Media Remote (new version)

It then asks about an IR transmitter, which I do not have so I selected none.

It then finishes the install. You can test LIRC by using the command irw. This will then pause the terminal. Press the buttons on your remote and if everything is working the buttons you pushed will show up on the terminal. to quit irw use crtl-c.

We will then need to configure a lircrc file to use with mythtv and other programs but that will be done later.

restart the computer (although not needed I like to do it anyways)

sudo reboot now.

Sunday, June 8, 2008

Installing Ubuntu

I am installing Ubuntu 8.04, Hardy Haron. I am just using the install CD that I downloaded from Ubuntu's website and did a generic install except for the partition of the hard drive. For the hard drive I did:
10GB EXT3 mounted to \
2GB Swap
the rest XFS mountes to \var\lib

XFS partitioning system is very useful for large files, in particular when they are always being deleted and new ones made.

Once installed I installed a couple programs real quick,
so I can log in through SSH from any computer
sudo apt-get install openssh-server

I also update my video driver to the proprietary version.

These two update the repositories list and then upgrades any out of date programs
sudo apt-get update
sudo apt-get upgrade

Reboot the system
sudo reboot now

Now my Ubuntu install should be set for MythTV

Wednesday, May 14, 2008

Putting the computer together

For this mythTV box I am making a combined front end and back end system. This way I can watch TV and record shows with only one computer. In the future when I add another TV to the system I can have a lower powered machine and just have a front end system. The parts for this setup were either given to me from friends who had extra parts or bought from www.newegg.com. Here is a list of the parts I am using:
  • Athenatech A100SC.200 Black/ Silver Steel MicroATX Desktop Computer Case 230W SFX Power Supply
  • ASUS EN6200LE/TC256/TD/64 GeForce 6200LE (has TV composite out)
  • 1.8GHz Celeron Processor
  • 500GB Western Digital hard drive
  • 1GB DDR2 667 memory
  • LITE-ON DVD +/- RW
  • MSI P6NGM-L
  • PVR-500 dual TV tuner

I chose a Micro ATX case so that it would be small and fit under my TV stand. One needs to be carful that the MicroATX case has full profile PCI slots, I don't know any TV tuners that utilize a low profile. I chose components that are known to not run how so I could minimize the fans and fan speed in my system, this will minimize the noise. The first TV this system is going to hook up to only has composite video in, so I had to find a way to hook up the computer to composite video in. I chose the graphics card that I did because it had composite out and the price was decent. The quality of the card wasn't an is sure because I will not be playing any games that require top notch graphics. This card will easily work for all the emulators I envision having on this system. If I was going to hook up to a tv that had an HDMI input I would have skipped the graphics card and got a mother board that had DVI or HDMI output and used onboard graphics. I would have also liked a mother board with 4 or 3 PCI slots which would allow more tuner cards to be added in the future, but my restriction to composite out made me chose the mother board and graphics card that I did.
I only got 1x1024MB memory card because the mo ther board doesn't support dual channel and I only needed 1GB to start my system. I chose a single core processor becuase this one does not run as hot and the price was good. Top-notch hardware is not needed in a mythTV box, so I focused on price.
Here is the case opened up before I put anything in:
It is a tight fit but after everything was in it:

Monday, April 28, 2008

Hauppauge WinTV-PVR-500 MCE Dual Tuner

I bought the TV tuner that will go in to my MythTV system today. The PVR-500 is a dual TV tuner with hardware encoding to MPEG-2. The hardware encoding is important because it will take a lot of stress off of the CPU allowing me save money on the CPU. I got the card off of ebay for about $98 after shipping which is a pretty good deal on ebay with the average at this time being about $105; although, I did see one go for a little less earlier this week. I choose the PVR-500 over the 350 so I could get two tv tuners in one, which will allow me to record two shows at once which most commercial DVRs will allow you to do. Since my initial box will only be hooked up to one TV I don't see the need to get more than two channels at a time, but in the future I have the option to add another TV tuner.