
I have create this guide based on my experience of Installing and configuring MythTV. If you're looking for a PVR project, then MythTV is perfect.
This is for a dedicated box so no desktop environment will be installed.
I have compiled this on the assumption that you are competent in Linux so it won't be much use as a beginners guide, though I may turn it into one if I get time.
Obviously this guide is specific to my hardware so please make changes where needed for your setup.
The Hardware:
Samsung Dual Layer SATA DVD-RW
Western Digital 1Tb HDD [System & Storage]
Asus P7H55M PRO Mainboard
4Gb Corsair XMS3 1333Mhz DDR3
Intel 3.2Ghz i5 650 CPU
MCE Remote v2 (Phillips
Leadtek DTV1000 DVB-T PCI x2
Once you have you base Linux system up and running it's time to start installing applications. The version currently being used at the time of writing this is:
media-tv/mythtv-0.22_p22860
media-plugins/mythgallery-0.22_p22763
media-plugins/mythgame-0.22_p22763
media-plugins/mythvideo-0.22_p22864-r1
media-plugins/mytharchive-0.22_p22763
x11-themes/mythtv-themes-0.22_p22869
media-plugins/mythmusic-0.22_p22763
x11-themes/mythtv-themes-extra-0.22_p22492
www-apps/mythweb-0.22_p22763-r1
So we now have a base Gentoo install and Mythtv. If you have used the "autostart" flag then follow the steps below:
(you may need to use ALT+F1 to get a terminal) Assuming you have installed mysql and have not yet setup the root account for mysql.. execute:
- Edit /etc/inittab and add c8:2345:respawn:/sbin/mingetty --autologin mythtv tty8 underneath the #TERMINALS section.
- Edit /usr/share/mythtv/database/mc.sql and change the username and password entries.
- Run mysql -uroot -p < /usr/share/mythtv/database/mc.sql to create the Mythtv database with the details used in previous step.
- Log into mysql as root and run GRANT ALL PRIVILEGES ON `mythconverg`.* TO 'mythtv'@'localhost'; this just gives permissions to the mythtv user for the Mythtv database.
- Run rc-update add mythbackend default to have Mythtv's brains startup on reboot.
- Edit /home/mythtv/.xinitrc
# .xinitrc
#[ -x /usr/bin/nvidia-settings ] && /usr/bin/nvidia-settings -l
/usr/bin/killall -9 mythfrontend evilwm
sleep 1
/usr/bin/xset s noblank
/usr/bin/xset s off
/usr/bin/xset -dpms
/uar/bin/xsetroot -cursor_name dot
/usr/bin/evilwm &
exec /usr/bin/mythfrontend -l /var/log/mythtv/mythfrontend.log -v important,general
#exec /usr/bin/mythtv-setup
*TIP* If you need to enter mythtv-setup for whatever reason, comment out exec /usr/bin/mythfrontend -l /var/log/mythtv/mythfrontend.log -v important,general and add exec /usr/bin/mythtv-setup to your .xinitrc. Then exit the frontend. Don't forget to change back when finished.
You can reboot now
If things are working as they should, you will now have a language selection screen.
Hit ALT+F1 and login as root and stop the mythbackend daemon. /etc/init.d/mythbackend stop
SU to mythtv. su - mythtv Execute DISPLAY=":0.0" mythtv-setup and hit ALT-F7.

Now to tell Mythtv where it's brains are. Most of the screens can be left as the default settings. If you are only have 1 box leave the IP's as 127.0.0.1, if you are planning remote frontends then change to the IP of the backend (ie this box).

Change this screen to your TV settings.

Click Next

Click Next

Click Next

Click Next

Change the CPU to HIGH and uncheck Allow Advert Detection Jobs.

Click Next

Click Finish

Capture Cards
Highlight (new capture card) and hit enter.

Change the card type for your tuner.

Select Recording options.
If you only have one card, leave the max recordings as 1.
Tick Wait for SEQ start header
Tick Open DVB card on demand
Tick Use DVB card for active EIT scan

Video Sources
Highlight (new video source) and press enter

Enter a name in the Video source name box
Change the Listings Grabber to EIT

Input Connections
Here you should see the card(s) you have just setup in the previous step.
Select your card and press enter.

Change the Video Source (there should only be the one)
Use Quick Tuning should be fine as the default Live TV Only
Click Scan for Channels (you may need to change the country)

Change the Input group 1 to DVB0 if setting up the first card.

Channel Editor (optional)
Click Icon Download

Storage Directories
Highlight default and press enter
Highlight Add New Directory and press enter
Enter the full path to where you want TV streams to be saved.

Exit mythtv-setup by pressing ESC (you may see the language screen again.. do not select anything!
Hit ALT+F1 and reboot.. you should now boot straight into Mythtv.

Mythvideo
Highlight Setup and press enter.
Highlight Video Settings and press enter.
Highlight General Settings and press enter.
Enter the full path to where you want mythtv to find other videos etc that mythtv did not record.
DVD's ripped by Mythtv will be put here.







PLAYER SETTINGS:
The defaults should be ok.

FILE TYPES:
Here you can add files types of videos that are not enabled by default.

RIP SETTINGS:


MythGallery



MythGame






MythArchive






MythWeb
You need apache2 and php5 installed and setup for mythweb to function. Apache instructions
cp /usr/share/webapps/mythweb/<version>/htdocs/mythweb.conf.apache /etc/apache2/modules.d/mythweb.conf
edit /etc/apache2/modules.d/mythweb.conf and change the directory path to eg /var/www/localhost/htdocs/mythweb
Change the setenv entries to reflect the mythtv mysql account. run
htpasswd2 -c /path/to/your/.htpasswd <username> This will prompt for a username and password.
^ this should be outside the root of mythweb. The -c option creates a new file. If you are adding a second user or more, omit the -c to apend the file.
Restart apache /etc/init.d/apache2 restart
Advanced: Setup SSL Add the following lines to .htaccess in the root of mythweb to encrypt user details.
SSLOptions +StrictRequire
SSLRequireSSL
SSLRequire %{HTTP_HOST} eq "<domain>"
ErrorDocument 403 https://domain/path/to/403.html
AuthType Basic
AuthUserFile /path/to/your/.htpasswd
AuthName "Please enter your username and password."
require valid-user
You will also need to create SSL keys and tell apache about them. You will be forced to provide a password. This will cause apache not to start if not attended.
openssl genrsa -des3 -out server.key 1024
To remove the password:
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
To create the certificate request:
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Now change the perms so only root can read them.
chmod 400 server*
Copy the generated key and crt files to somewhere that apache can read eg /etc/apache2/ssl/. Enter the following into your vhosts:
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
Restart apache
Trouble Shooting:
I've come across the occasional update where upon restarting mythbackend, the system load would max out for no reason. I found to resolve this I needed to run mythtv-setup and delete the dvb cards, readd them and rescan the channels. Upon restarting mythbackend, load would remain normal.