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.