Difference between revisions of "Installing MythTV on Fedora"

From MythTV Official Wiki
Jump to: navigation, search
(Package Selection: - gnome works just as well)
m (Setup MythTV: Removed redundant sentence)
(306 intermediate revisions by 45 users not shown)
Line 1: Line 1:
<center><div style="text-align: center; margin: 0 10% 1em 10%;">
+
This "How-To" guide is for installing MythTV on the latest release of Fedora.
{| class="notice noprint" style="background: #69C; border: 1px solid #aaa; padding: 0.1em; margin: 0.5em auto;"
+
 
|-
+
{{Note box|This installation guide is currently undergoing an overhaul to remove outdated procedures and reduce the overall size. Addressing the helpful comments in the discussion panel}}
| style="padding: 0.1em" | '''This page is incomplete!'''<br><div style="font-size: 90%;">The text of this page is still being filled in and is currently in a transition from being based on Fedora Core 4 to Fedora Core 6.</div>
 
|}
 
</div></center>
 
  
This "How To" guide is for installing MythTV on the latest release of Fedora Core which is currently Fedora Core 6.
+
==Introduction==
== Introduction ==
 
  
This guide is shamelessly based on '''Jarod Wilson's''' how to guide which you can find [http://www.wilsonet.com/mythtv here]
+
This wiki entry will detail the installation of a combined frontend and backend in Fedora 20.  Ensure you have met the hardware requirements set out by  [http://www.mythtv.org/wiki/Hardware_Requirements MythTV].
  
With the way that opensource development is constantly changing a guide that could keep up with the changes was needed. Being that this guide is in the wiki format and capable of receiving full community attention, the guide will change along with the release of Fedora as well as all other software packages that go together with making MythTV the greatest TV time shifting product in the world.
+
Fedora provides updates for a release until two releases after that. At the time of this writing, the current release is Fedora 20, which means support for Fedora 18 was discontinued a month after Fedora 20 was released. Thus, it makes sense to update to the latest release at least every other version, if not every version.  
  
You are welcome as a MythTV user and general wiki participant to add/modify this document that will help the community the best way possible.
+
You are welcome as a MythTV user and general wiki participant, to add to, and modify this document that will help the community the best way possible.
  
 
==Getting Fedora==
 
==Getting Fedora==
===ISO Images===
+
===ISO images===
The latest version of Fedora can be downloaded from the [http://fedora.redhat.com/Download/ Fedora Core Download Page].
+
The latest version of Fedora can be downloaded from the [http://www.fedoraproject.org/en/get-fedora Fedora Download Page].  Note that the Desktop edition has the default [http://www.gnome.org/ GNOME] Desktop available whereas the DVD install has alternative desktop environments available.  For the remainder of this installation guide, the default desktop environment GNOME will be used to avoid confusion.  Other desktop environments should be similar.
  
===Physical Media===
+
===Physical media===
CD and DVD discs can be purchased from [http://fedoraproject.org/wiki/Distribution/OnlineVendors online] and [http://fedoraproject.org/wiki/Distribution/LocalVendors local] vendors.
+
CD-ROM and DVD-ROM discs can be purchased from [http://fedoraproject.org/wiki/Distribution/OnlineVendors online] and [http://fedoraproject.org/wiki/Distribution/LocalVendors local] vendors.
  
 
==Installing Fedora==
 
==Installing Fedora==
 +
The official Fedora 20 [http://docs.fedoraproject.org/en-US/Fedora/20/html/Installation_Quick_Start_Guide/index.html installation guide] is an excellent place to start when installing Fedora.  There are a few modifications on the procedure given in the official documentation; user creation and filesystem partitions.  The notes in this wiki will detail an installation from the '''Live Desktop Media'''.  It should be noted that additional desktop environments are also available if the GNOME 3 desktop is not suitable.  Some alternatives are listed in the Fedora [http://fedoraproject.org/wiki/Releases/20/Spins spins] page and installation is detailed [http://docs.fedoraproject.org/en-US/Fedora/20/html/Release_Notes/sect-Release_Notes-Welcome_to_Fedora_.html here].  Desktop environments other than GNOME 3 are outside of the scope of this wiki for brevity.
  
Anaconda is the Fedora Core installer program and will launch a GUI by default.
+
===Date/Time===
 +
During installation you should adjust the date and time of the machine to the current date and time.  To do this ensure the Network Time slider is set to on under the Localization options.  Making sure the system is running to the correct time is important for timely scheduling of recordings.
  
 
===Filesystems===
 
===Filesystems===
The 2.6 kernel series includes several journaling file systems, some of which are more suited for use with large files 'like Myth recordings' than Red Hat's default file system, ext3.
 
 
In order to use a different file system at install time when loading the Fedora Core install CD/DVD you type in: <pre>boot:linux <otherfs></pre> Where <otherfs> is for example ''reiserfs'', ''jfs'', ''xfs''.
 
  
Among the MythTV community it is highly recommend to use a custom partitioning scheme rather than auto-partitioning, with a dedicated /video (or similar) partition for storage of all your recordings.  
+
Among the MythTV community, it is highly recommend to use a custom partitioning scheme rather than auto-partitioning with a dedicated /video (or similar) partition for storage of all your recordings. If possible, for best efficiency, the video partition should be on a drive physically separate from the operating system partitions. Software RAID and LVM for your video partitions will only slow it down and should be avoided. LVM is no longer necessary for MythTV due to Storage Groups.
  
Previously, XFS was '''[http://www.wilsonet.com/mythtv Jarod Wilson's]''' recommendation for the file system to use for such a purpose, but some additional stability issues with using XFS on Fedora Core's stock kernels have been brought light. In the case where you're stacking software RAID, LVM and XFS all together, stack overflows tend to crop up. JFS is becoming the more recommended file system, so boot the installer with "linux jfs", then choose JFS for your /video partition.
+
Currently EXT4 format is the default in Fedora and other distributions. Here's a partition setup example:
  
ReiserFS is also an option, though it is believed JFS performs a bit better (XFS is even better still, at least, when its stable...). An example partitioning setup can be found below.
 
  
 
<center>
 
<center>
Line 44: Line 38:
 
| '''Format'''  
 
| '''Format'''  
 
|-
 
|-
| /dev/hda1
+
| /dev/sda1
 
| /boot
 
| /boot
| 50-100MB
+
| 500MB
| ext3
+
| ext4
 
|-
 
|-
| /dev/hda2
+
| /dev/sda2
 
| swap  
 
| swap  
| same as RAM (ex: 512MB)  
+
| same as RAM (ex: 4096MB)  
 
| swap
 
| swap
 
|-
 
|-
| /dev/hda3
+
| /dev/sda3 (for the OS)
 
| /  
 
| /  
 
| 8-12GB  
 
| 8-12GB  
| ext3
+
| ext4
 +
|-
 +
| /dev/sda4
 +
| /home
 +
| 8-12GB
 +
| ext4
 
|-
 
|-
| /dev/hda5
+
| /dev/sda5
 
| /video  
 
| /video  
| Everything else
+
| Remainder
| jfs
+
| ext4
 
|-
 
|-
 
|}
 
|}
 
</center>
 
</center>
  
At the Installation Type screen, you want to choose a Custom installation (rather than Personal Desktop, Workstation or Server), because none of the defaults give us everything we need and/or add junk we don't need.
+
===User creation===
 
 
On the Disk Partitioning Setup screen, choose to Manually partition with Disk Druid. A suitable custom partitioning setup is as follows (assuming a single IDE hard drive):
 
  
Be sure to choose JFS (or XFS or ReiserFS) as the partition format type for the /video partition, as the selection will default to ext3. Note that there's really no point in using anything but ext3 on / and /boot. Red Hat tests ext3 heavily, its the only one that is pretty well guaranteed to be problem-free for / and /boot. Those expecting to add additional hard drives to their system for more video storage might want to set the partition type for hda5 to LVM, then create a logical volume over the top of it, formatted JFS. That'll allow you to increase the size of your /video partition transparently across multiple drives. Details on how to do that can be found in the official MythTV docs, at http://mythtv.org/docs/mythtv-HOWTO-23.html#ss23.3.
+
When prompted during the installation, create a non-administrator user on the system with the username "mythtv". You can set the password for this user to anything you want. This should be a [http://en.wikipedia.org/wiki/Strong_password Strong Password] that is '''different than the root password.'''
  
===Network Configuration===
+
==First boot==
On the Network Configuration screen, it is highly recommend setting a static IP address (could either be truly static, or a staticly mapped DHCP address). It really isn't a huge deal if you only have one Myth box (though you probably don't want MythWeb to be a moving target), but it could cause major headaches once you have more than one machine, since non-primary systems wouldn't know where the master backend was anymore if the address changed.
+
At this point Anaconda will ask you to remove the installation media from the drive and reboot the system. Once your system has finished rebooting you will be prompted to do some final configurations and be given a short tour of GNOME 3.
  
===Package Selection===
+
===Gnome Terminal===
'''On the package selection screen, select (at least) these package groups'''
 
*X Window System
 
*KDE Desktop Environment and/or GNOME Desktop Environment
 
*MySQL Database (be sure mysql-server is selected under the "Details" section)
 
*Web Server (if you want to use MythWeb)
 
  
'''Some other packages that might be of interest, but are not required:'''
+
Tasks in Linux are performed with greater ease through the command line and are therefore required in this How-To.  In GNOME 3, the terminal is accessed by going to Activities and typing <tt>terminal</tt> in the search box.
*Graphical Internet
 
**Gaim
 
**Firefox (very handy for following this very guide -- think copy and paste)
 
*Sound and Video
 
*Windows File Server
 
*Network Servers
 
**vnc-server
 
*Development Tools (if you want/need to compile anything)
 
  
Either KDE or GNOME are equally suitable as an X environment for running MythTV. If you wish to switch to another desktop environment, you can fire up a terminal session, and issue the command:
+
Some commands need to be run as the mythtv user, and some commands need to be run as the root user.  The boxes below will indicate with a prompt which user should run the command. Commands with a "$" prompt should be run as the mythtv user.  If you see a command that starts with a "#", you will need to use the '''su''' command to become the root user.
  
$ switchdesk KDE
+
To execute commands as the root run "su -" and enter the Fedora root password.
  
or
+
  ['''mythtv'''@''machine_name'' ~]'''$''' su -
 
 
  $ switchdesk GNOME
 
 
 
There are also reports of it working equally as well in lesser known Desktop Environments such as XFCE and in window managers such as fluxbox or ratpoison
 
 
 
==First Boot==
 
At this point Anaconda will ask you to remove the disc from the drive and reboot the system.  Once your system has finished rebooting you will be prompted to accept the license agreement and a few more installation configuration options.
 
 
 
===Firewall===
 
A basic MythTV box should not have any problems running with the firewall turned on however you will probably save yourself a lot of headaces if you disable it completley.  This is especially recommended for new users.  If you do need to enable the firewall, you will at the very least want to enable SSH, Secure WWW (HTTPS) and WWW (HTTP) checkboxes to enable those services.
 
 
 
If you plan to run seperate front end and back end servers you will need to allow those ports through on under "Other Ports".
 
 
 
===SELinux===
 
It is strongly recommended that SELinux is disabled or run in "permissive" mode.  There are a few things that will not work properly if you have SELinux such as ResierFS and the MythWeb plugin.  If you think you might want to run in SELinux mode in the future, choose the permissive mode which will only warn you of problems.  This will enable you to turn SELinux mode on quickly and easily turned on at a later time.
 
 
 
===Date/Time===
 
Here you should adjust the date and time of the machine to the current date and time.  Once you have done this, select the "Network Time Protocol" tab and select the "Enable Network Time Protocol" checkbox.
 
 
 
===Display===
 
The '''Setup Agent''' should have detected your video card and your monitor.  Select the screen resolution that is best for your monitor.
 
 
 
:*For more information see the [http://fedora.redhat.com/docs/install-guide/fc6/en/ch-firstboot.html First  Boot - Display] secion of the Fedora Core 6 manual.
 
 
 
===System User===
 
Create a user on the system with the username "mythtv".  You can set the password for this user to anything you want.  This should be be a [http://en.wikipedia.org/wiki/Strong_password Strong Password] that is '''different than the root password.'''
 
 
 
===Sound Card===
 
From the '''Sound Card''' screen you should see your sound card and be able to play a test sound.  If you sound card is not showing up, your sound card may not be supported.  It is possible to  manually configure Fedora to use unsupported sound cards, but that is out of the scope of this document.
 
 
 
==Fedora Setup==
 
The next section will require you to be logged in as the mythtv user.  Some commands will need to be executed from the command line.  You can run commands with the "Konsole" program.  To start Konsole, right-click on your desktop and select "Konsole..." and a new Konsole window should appear.
 
 
 
In GNOME, this is under Applications > Accessories > Terminal
 
 
 
Some commands will need to be run as mythtv and some commands will need to be run as the root user.  The boxes below will indicate with a prompt which user a command should be run as.  Commands with a "$" prompt should be run as the mythtv user.  If you see a command that starts with a "#', you will need to use the '''su''' command to become the root user.
 
 
 
To execute commands as the root run "su -" and enter the root password you set when you installed Fedora.
 
 
 
['''mythtv'''@myth ~]'''$''' su -
 
 
  Password:
 
  Password:
  ['''root'''@myth ~]'''#'''
+
  ['''root'''@''machine_name'' ~]'''#'''
  
Notice the way the username changes from mythtv to root and the prompt changes from "$" to "#".  Be sure you run all of the following commands as the correct user.  If you do not, you will likley run into problems sooner or later.  To become the mythtv user again, type "exit".
+
Notice the way the username changes from mythtv to root and the prompt changes from "$" to "#".  Be sure you run all of the following commands as the correct user.  If you do not, you will likely run into problems sooner or later.  To become the mythtv user again, type "exit".
  
  [root@myth ~]'''#''' exit
+
  ['''root'''@''machine_name'' ~]'''#''' exit
 
  logout
 
  logout
  [mythtv@myth ~]'''$'''
+
  ['''mythtv'''@''machine_name'' ~]'''$'''
  
Your screen should clear, and your prompt will be a "$" sign again.  If this is not the case, keep typing "exit" until it is.
+
Your screen should clear, and your prompt should be a "$" again.  If this is not the case, keep typing "exit" until it is.  You can copy and paste text in the terminal by using 'Control-Shift-C' and 'Control-Shift-V' respectively.
  
 
===Update Fedora===
 
===Update Fedora===
To get your system fully updated, simply run the command:
+
Firstly get your system fully updated.  Simply run the command from terminal:
 
+
<pre>
'''#''' yum upgrade
+
# yum update
 +
</pre>
  
 
When you see the '''Transaction Summary''', you will need to press "y" to begin downloading the packages.
 
When you see the '''Transaction Summary''', you will need to press "y" to begin downloading the packages.
 
+
<pre>
 
  Transaction Summary
 
  Transaction Summary
 
  =============================================================================
 
  =============================================================================
  Install      1 Package(s)
+
  Install      20 Package(s)
  Update      29 Package(s)
+
  Update      79 Package(s)
 
  Remove      0 Package(s)
 
  Remove      0 Package(s)
  Total download size: 16 M
+
  Total download size: 902 M
  Is this ok [y/N]: '''y'''
+
  Is this ok [y/N]: y
 +
</pre>
 +
 
 +
After the update has finished, reboot your computer for the effects to take place.
  
Since this is your first upgrade, you will also need to import the GPG key when prompted.  You shoud only need to do this once.
+
===Network configuration===
 +
On the Network Configuration screen (Activities -> Network Connections), setting a static IP address is highly recommended (could be either a static, or statically mapped DHCP address). It really isn't a huge deal if you only have one Myth box (though you probably don't want MythWeb to be a moving target), but it could cause major headaches once you have more than one machine, since non-primary systems won't know where the master backend is, if the address changes.
  
Retrieving GPG key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
===Firewall===
Importing GPG key 0x4F2A6FD2 "Fedora Project <fedora@redhat.com>"
+
A basic MythTV box should not have any problems running with the default Public zone firewall settingsIf there are issues with service access you will at the very least want to enable SSH, Secure WWW (HTTPS) and WWW (HTTP) checkboxes to enable those services under the appropriate Firewall zone with the ''Permanent'' configuration.
  Is this ok [y/N]: '''y'''
 
Key imported successfully
 
  
===Kernel Upgrades===
+
If you plan to run separate front end and back end servers you will need to allow those ports through on under "Other Ports". Add TCP ports 6543 and 6544 to allow the MythTV protocol access through the firewall and TCP 3306 for MariaDB.
*'''Note:''' Fedora Core 6 is currently shipping with kernel, '''2.6.18-1.2798.fc6''' but should be updated with the newest one.
 
  
Among the packages upgraded just a minute ago with yum should be your kernel, to the very latest errata release, be that the single-processor one or the smp one. Additionally, your boot loader should have been automatically updated to use the new kernel, so all you need to do is reboot to start using the new kernel, which you'll want to do in just a minute. As of this writing, '''2.6.18-1.2798.fc6''' is the latest released errata kernel. You should be using at least this kernel (or kernel-smp), if not a newer one.
+
==Fedora setup==
 +
The next section will require you to be logged in as the mythtv user.
  
Generally speaking, you should always install the latest errata kernel, shortly after the release of which Axel should have all the needed kernel modules available. Kernel modules are NOT maintained for older kernels, because of two things. First, a new kernel from Red Hat usually fixes some flaw in earlier kernels (security hole or bug fix), so its good practice not to use the flawed kernel and second, building kernel modules for every kernel would take forever and a day and cause assorted other headaches for Axel. To make providing kernel modules feasible, only the very latest one or two kernels are supported.
+
===Configure package repositories===
 +
====RPMFusion====
 +
Configuration of yum is needed to use the RPMFusion package repository.  Follow the links below and install the RPMs for the latest version and correct architecture for your system. It should be noted ATrpms can also be used as an alternative to RPMFusion but they cannot be used simultaneously and ATrpms will require the priority of the repo file to be set higher as to not conflict with the official packages.
  
To make life simpler after we've rebooted and are prepared to start installing drivers for some of our hardware not supported natively by the kernel, we're going to set up a custom environment variable, KVER, that will help avoid problems from typos, user error, confusion, etc. Simply drop a file in /etc/profile.d, like so:
+
RPMFusion
 +
  http://rpmfusion.org/Configuration
  
# echo "export KVER=\`uname -r\`" >> /etc/profile.d/kver.sh
+
Note: You will need to download the packages rpmfusion-free-release and rpmfusion-nonfree-release and install with GNOME Software or rpm -ivh *.
(those are back-ticks, not single-quotes)
 
  
Now you're ready to reboot into that new kernel and start installing kernel modules for your tuner card(s), remote, etc.
+
Many MythTV installations require additional kernel modules to make all the hardware work. When installing firmware/drivers such as the proprietary nVidia graphics drivers the '''akmod''' or '''kmod''' packages can be chosen.  The '''akmod''' packages automatically check and compile the driver on boot if required.  This incurs a small penalty of having to install development packages.  The '''kmod''' packages are built against a specific kernel version and if a new kernel is installed without the corresponding kmod then errors on boot may occur.  Therefore for system safety the akmod packages are recommended.
  
# reboot
+
=====NVIDIA=====
  
===Configure package repositories===
+
We recommend you use a card that supports VDPAU for video acceleration. See http://www.mythtv.org/wiki/VDPAU.
Configuration of yum is needed to use ATrpms and FreshRPMs package repositories. This is a simple matter of adding a configuration file for each repository in /etc/yum.repos.d/. Pre-configured files can be created by cutting and pasting the following into a root shell.
 
  
Note that you may have to update atrpms.repo if the baseurl is changed.  It currently has been changed to "fc6-i386".  (This is substituted for the $releasever symbol below.)
+
You can install binary drivers from NVIDIA, but in most cases it's simpler to use yum to get and install them from RPMFusion. It is essential to get the proper version of the drivers. Start by running
  
 
<pre>
 
<pre>
cat > /etc/yum.repos.d/atrpms.repo <<EOF
+
$ /sbin/lspci -nn | grep 'VGA'
[atrpms]
+
</pre>
name=ATrpms for Fedora Core \$releasever - \$basearch
 
baseurl=http://dl.atrpms.net/fc\$releasever-\$basearch/atrpms/stable
 
enabled=1
 
gpgcheck=1
 
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
 
  
[atrpms-testing]
+
This will give you the chipset name and the PCI id (which is after the colon inside the bracket set before the rev number).  Compare these to the NVIDIA [http://www.nvidia.com/object/IO_32667.html docs].  Unless your card is in one of the legacy lists, you can install the latest drivers.  If you have one of the legacy products you will have to modify the yum package name to get the proper drivers. The newer drivers will NOT work on "legacy" cards.
name=ATrpms test packages for Fedora Core \$releasever - \$basearch
 
baseurl=http://dl.atrpms.net/fc\$releasever-\$basearch/atrpms/testing
 
enabled=0
 
gpgcheck=1
 
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
 
EOF
 
  
cat > /etc/yum.repos.d/freshrpms.repo <<EOF
+
To install from the RPMFusion repository, run:
[freshrpms]
+
 
name=Fedora Core \$releasever - \$basearch - Freshrpms
+
<pre>
baseurl=http://ayo.freshrpms.net/fedora/linux/\$releasever/\$basearch/freshrpms/
+
# yum install kernel-devel akmod-nvidia
enabled=1
 
gpgcheck=1
 
gpgkey=http://freshrpms.net/RPM-GPG-KEY-freshrpms
 
EOF
 
 
</pre>
 
</pre>
  
 +
You might encounter a message about a GPG key, accept this with ''y''.  Upon reboot the boot will be interrupted to build <tt>akmod-nvidia</tt> against the current kernel version which may take some time.  You can check that the driver installed correctly by entering the following command in the terminal.
  
Generally, any problems encountered with ATrpms and ATrpms packages should be addressed on the atrpms-users mailing list before being taken to the MythTV list. You can subscribe to the ATrpms lists [http://lists.atrpms.net/mailman/listinfo/ here].
+
<pre>
 +
$ glxinfo | grep -i nvidia
 +
</pre>
  
FreshRPMs is structured a bit different than ATrpms -- it generally only provides add-on packages, while ATrpms provides both add-on packages packages that replace/upgrade/enhance packages originally provided by Red Hat. FreshRPMs only has one channel of packages. You can subscribe to the FreshRPMs mailing list [http://lists.freshrpms.net/mailman/listinfo/freshrpms-list here].
+
Which should return an entry for the NVIDIA card.
  
You may find it easier, rather than creating the freshrpms.repo as described above, to simply install the
+
If you need a legacy package from RPM Fusion consult the available packages table at http://rpmfusion.org/.
[http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/5/freshrpms-release/freshrpms-release-1.1-1.fc.noarch.rpm freshrpms-release-1.1-1.fc.noarch.rpm] package.
 
  
''As with any other mailing list, please search their respective archives first.''
+
====DVD playback====
 +
If you require DVD playback then you will need to install the <tt>libdvdcss</tt> package from an alternative repository.  Please check if this is legal in your country.
  
==Install Video Card Drivers==
+
<pre>
 +
# yum localinstall http://rpm.livna.org/livna-release.rpm
 +
# yum install libdvdcss
 +
</pre>
  
=== NVidia ===
+
===Sound setup===
To use the binary NVidia drivers you have two options, install them from NVidia or use yum to get them from either livna or atrpms.
 
  
As of now, installing the NVidia driver from livna requires adding livna.org to yum (see livna.org for instructions) and then running ''yum install kmod-nvidia-smp'' (or just yum install kmod-nvidia if you do not use an smp kernel).
+
Fedora uses PulseAudio by default, as do many Linux distributions. MythTV works with Pulseaudio. Ensure the sound is working in the GNOME Desktop otherwise try changing the output in Activites > Sound.
  
Following this, run: ''/usr/sbin/nvidia-config-xfree86 enable'' to enable the nvidia driver in XWindows, and either restart X or reboot to pickup the new NVidia Drivers.
+
===Remote desktop===
  
==Sound Setup==
+
'''Please ensure that only local access is allowed for the VNC ports for security reasons.'''
The KDE sound server, aRts does NOT work well with MythTV in many cases, though work has been done recently to remedy that. It is still highly recommended that you disable aRts from starting up if you encounter audio problems. To do so, while logged in as mythtv user, choose "Control Center" off the Fedora (Red Hat) menu. Navigate through "Sound & Multimedia" to "Sound System" and deselect "Start aRts soundserver on KDE startup" ("Enable the sound system" on KDE 3.3 or later) and then click "Apply". On subsequent logins, aRts will not launch.
 
  
Note: outside of setting your audio mixer levels, this step is not essential. Just set your volumes with the mixer program of your choice and move on to the next step if you like. ALSA is the default sound system in the 2.6 kernel, so you've already got it, and your sound card should have been auto-configured during firstboot. If you have some flashy new card, there's a chance you might need a newer ALSA version, which ATrpms does provide. Those wanting to install the latest ALSA packages from ATrpms should do so with these commands:
+
The remote desktop in GNOME can be enabled through the GUI from Activites > System Settings > Sharing. Turn on Screen Sharing and Allow Remote Control. It is '''strongly''' recommended that a secure password is set.  After the remote desktop has been enabled the corresponding ports need to be allowed through the firewall (VNC-Server checkbox).
 +
 
 +
==Install MythTV==
 +
 
 +
MythTV has numerous required dependencies to function correctly, which are automatically taken care of with one simple command:
  
 
<pre>
 
<pre>
# yum install alsa-kmdl-$KVER
+
# yum install mythtv
# yum install alsa-driver
 
 
</pre>
 
</pre>
  
For multiple sound cards an edit of /etc/modprobe.conf file is needed for a specific card. Details for supported cards can be found [http://www.alsa-project.org/alsa-doc/ here].
+
You may run into some problems with dependencies. These can usually be resolved by removing the offending package and re-running the above command. Dependency issues can be mitigated be keeping additional (third-party) repositories to a minimum. MythTV on Fedora requires only the default repositories plus RPMFusion to fulfil all requirements.
  
Included below is a excerpt of an  /etc/modprobe.conf ALSA configuration, which is for a SoundBlaster Audigy sound card. This should be valid for SB Live! and Audigy2 cards as well.  
+
===SELinux===
 +
It is strongly recommended that SELinux is run in "permissive" mode by editing <tt>/etc/selinux/config</tt>.  There are a few things that will not work properly if you set SELinux to "enforcing" such as the MythWeb plugin. If you think you might want to run with SELinux in enforcing mode in the future, choose the permissive mode which will only warn you of problems. This will enable you to quickly and easily set SELinux to enforcing mode at a later time.
  
If your card isn't one of those, check out the [http://www.alsa-project.org/alsa-doc/ ALSA site's sound card matrix] to find information for your card. The differences are very minor for most cards, and usually only the driver name has to be changed. For example, to configure ALSA for use with the onboard audio of an nForce2 board, it should be a simple matter of replacing all instances of "emu10k1" in the following modprobe.conf and .asoundrc with "intel8x0".
+
Fedora 20 comes with the excellent [https://fedorahosted.org/setroubleshoot '''setroubleshoot'''] tool which will notify of denials whilst permitting you to leave SELinux enabled on your system. Audit2allow in permissive mode can also be used to catch SELinux denials and rules can be automatically created to allow program access in the future.
  
 +
If you prefer running enforcing SELinux with mythweb, the following commands may be helpful:
 
<pre>
 
<pre>
# Example modprobe.conf entries for my Audigy
+
$ /usr/sbin/setsebool -P httpd_can_network_connect=1
alias snd-card-0 snd-emu10k1
+
$ /usr/sbin/setsebool -P httpd_ssi_exec=1
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && /usr/sbin/alsactl restore >/dev/null 2>&1 || :
+
$ chcon -R -t httpd_sys_content_rw_t /var/www/html/mythweb/data
remove snd-emu10k1 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-emu10k1
+
$ semanage fcontext -a -t  httpd_sys_content_rw_t /var/www/html/mythweb/data
 
</pre>
 
</pre>
  
Below is a modeprobe.conf ALSA snippet example for a dual sound card system with a SoundBlaster Audigy and nForce2 onboard (i810) audio.
+
===Install capture card drivers===
  
 +
Some capture card drivers have been included by default with Fedora. The IVTV drivers required for the PVR-150/250/350 and the drivers required for the Hauppauge HD-PVR 1212 are included, for example.
 +
 +
You can check if the kernel is able to detect the attached dvb tuner by checking the kernel messages.  This is done with:
 
<pre>
 
<pre>
#Example modprobe.conf entries for Audigy and nForce2 onboard (i810) audio
+
dmesg | grep -i dvb
alias snd-card-0 snd-emu10k1
 
options snd-card-0 index=0
 
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && /usr/sbin/alsactl restore >/dev/null 2>&1 || :
 
remove snd-emu10k1 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-emu10k1
 
alias snd-card-1 snd-intel8x0
 
options snd-card-1 index=1
 
install snd-intel8x0 /sbin/modprobe --ignore-install snd-intel8x0 && /usr/sbin/alsactl restore >/dev/null 2>&1 || :
 
remove snd-intel8x0 { /usr/sbin/alsactl store >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-intel8x0
 
 
</pre>
 
</pre>
 +
If the firmware loading was successful you may notice a message similar to:
 +
<pre>
 +
usb 1-6: dvb_usb_v2: 'Kworld UB499-2T T09' successfully initialized and connected
 +
</pre>
 +
Otherwise you will need to find the chipset details of the attached tuner.  If you have a '''usb''' attached tuner use <tt>lsusb</tt> or if you have a '''pci''' tuner use <tt>lspci</tt>
  
Next, create a .asoundrc file for the mythtv user (full path of /home/mythtv/.asoundrc). Technically, this isn't necessary, but it can help out quite a bit in some cases (especially if you're outputting via an S/PDIF connection), and can't hurt. Anyhow, just make a new text file called .asoundrc like so, adjusting for your specific card, substituting for "emu10k1" where necessary:
+
An example output of this might be:
 
 
 
<pre>
 
<pre>
$ cat > ~/.asoundrc
+
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pcm.emu10k1 {
+
Bus 004 Device 002: ID 0609:0334 SMK Manufacturing, Inc. eHome Infrared Receiver
type hw
+
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
card 0
+
Bus 001 Device 003: ID 1b80:e409 Afatech IT9137FN Dual DVB-T [KWorld UB499-2T]
}
+
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 
+
Bus 003 Device 002: ID 17ef:6022 Lenovo
ctl.emu10k1 {
+
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
type hw
 
card 0
 
}
 
(Now hit Control-D to end cat input)
 
 
</pre>
 
</pre>
 +
The entry with DVB gives the model name of the tuner (KWorld UB499-2T) and chipset (IT9137FN) which can be compared with the lists at [http://www.linuxtv.org/wiki/index.php/Hardware_Device_Information linuxtv.org].
  
Start the audio controller of your choice (aumix, alsamixer, kmix or gnome-alsamixer) and adjust the volumes, inputs and outputs to your liking.
+
===Remote control===
  
A simple way to test whether or not you've got sound is to use ALSA's aplay utility, like so:
+
Many remote control drivers have been moved to the kernel but manual key mapping may still be desired.  This can be achieved by installing the <tt>v4l-utils</tt> package for the <tt>ir-keytable</tt> command.
  
 
<pre>
 
<pre>
$ /usr/bin/aplay /usr/share/sounds/KDE_Startup.wav
+
# yum install v4l-utils
 
</pre>
 
</pre>
  
==Install MythTV==
+
Once v4l-utils has successfully installed you can run the following command to capture the input and button name of each keypress.
Now, here's why we REALLY like yum... MythTV has numerous required dependencies to function correctly, which are automatically taken care of with one simple command:
 
  
 
<pre>
 
<pre>
# yum install mythtv-suite
+
# ir-keytable -t
 
</pre>
 
</pre>
  
You may run into some problems with dependencies. These can usually be resolved by removing the offending package and re-running the above command. Dependency issues can be mitigated be keeping additional (third-party) repositories to a minimum. Mythtv on Fedora Core requires only the default repositories plus ATrpms & Freshrpms to fulfill all requirements.
+
The mappings can be changed by finding your corresponding keymap in <tt>/lib/udev/rc_keymaps</tt>. Be sure to comment out the original mappings in case an error is made during the file modification.
  
==Install Capture Card Drivers==
+
If your remote control does not exist in the kernel then you will have to install LIRC.
  
Some capture card drivers have been included by default with Fedora. As an example the NOVA-T PCI card from Hauppauge has a connexant chipset which is recognised out-of-the-box.
+
====Install LIRC====
  
For analogue capture cards such as the Hauppauge PVR 150/250/350/500 you will need the ivytv drivers - Kernel modules are included in the ATrpms repository.
+
'''This LIRC instruction may well be outdated'''
  
==Install LIRC==
+
Note for Fedora 12 + users the default LIRC socket file name has changed to /var/run/lirc/lircd , so you will need to update MythTV Settings -> General from /dev/lircd ->/var/run/lirc/lircd and then restart mythfrontend.
  
==Setup MySQL==
+
Check first if lirc is installed before proceeding below...(eg find / -name lircd)
We'll need to enable MySQL to load at startup, set some passwords, and create the MythTV database, which we'll populate shortly. The population of this database is handled by mythtvsetup in the next step, and all MythTV add-on module database additions must be done AFTER running mythtvsetup at least one time.
 
  
 
<pre>
 
<pre>
# /sbin/chkconfig mysqld on
+
# yum install lirc
# /sbin/service mysqld start
 
 
</pre>
 
</pre>
  
Set the mysql root password, replacing ROOT_PWD with your chosen administrator password:
+
This will install the Linux Infra-Red Control package. This is a daemon which translates infra-red key presses into keyboard events, therefore you will need to configure your remote control accordingly.
 +
 
 +
==Setup MariaDB==
 +
In Fedora 20, mySQL has been replaced with MariaDB but backwards compatibility is maintained such that the following commands should still be applicable.  We'll need to enable MySQL to load at startup, set some passwords, and create the MythTV database, which we'll populate shortly. The population of this database is handled by <tt>mythtv-setup</tt> in the next step, and all MythTV add-on module database additions must be done '''after''' running <tt>mythtv-setup</tt> at least one time.
  
 
<pre>
 
<pre>
# mysql -u root mysql
+
# systemctl enable mariadb.service
mysql> UPDATE user SET Password=PASSWORD('ROOT_PWD') WHERE user='root';
+
# systemctl restart mariadb.service
mysql> FLUSH PRIVILEGES;
 
mysql> quit
 
 
</pre>
 
</pre>
  
Now we create the mythtv database (called mythconverg) to get us started:
+
Set the MySQL root password.
  
 
<pre>
 
<pre>
$ mysql -u root -p < /usr/share/doc/mythtv-0.20/database/mc.sql
+
mysql_secure_installation
(enter the password you just set above when prompted)
 
 
</pre>
 
</pre>
  
Again, all subsequent database population for MythTV's add-on modules must now be done AFTER running mythtvsetup at least one time. And if you get an error that looks like this...
+
Now we create the MythTV database (called mythconverg) to get us started:
  
 
<pre>
 
<pre>
ERROR 1064 at line 4: You have an error in your SQL syntax near 'TEMPORARY TABLES ON mythconverg.* TO mythtv@localhost IDENTIFIED BY "mythtv"' at line 1
+
$ mysql -u root -p < /usr/share/doc/mythtv-docs/database/mc.sql
 +
Enter password:
 
</pre>
 
</pre>
 +
At this point, enter the password you just set above (ROOT_PWD) when prompted.
  
...you are probably running MySLQ 3.x and probably aren't running Fedora Core 4 (or later), but you can safely ignore it. Everything got created just fine, that syntax is for people using MySQL 4.x, which FC4 and later use. No real discernable difference bewteen 3.x and 4.x though, until you tweak your MySQL config a bit. It's worth customizing some parameters in /etc/my.cnf for optimal performance with Myth.  
+
The above command gives users access to the database (see the main documentation) with the commands
 +
<pre>
 +
$ /usr/bin/mysql -u root -p mythconverg
 +
mysql> GRANT ALL ON mythconverg.* TO mythtv@"%" identified by  "mythtv";
 +
mysql> flush privileges;
 +
</pre>
  
These adjustments to my.cnf under the [mysqld] section improve performance with both MythTV (esp. in the GUI) and MythWeb:
+
Again, all subsequent database population for MythTV's add-on modules must now be done '''after''' running <tt>mythtv-setup</tt> at least one time. It's worth customizing some parameters in /etc/my.cnf for optimal performance with MythTV.
 +
 
 +
In the event the <tt>mythtv-setup</tt> fails (current in Fedora 20), it may be because the time zone tables are not loading. See the wiki on the time zones. This entry fixed the problem:
  
 
<pre>
 
<pre>
key_buffer = 16M
+
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
table_cache = 128
 
sort_buffer_size = 2M
 
myisam_sort_buffer_size = 8M
 
query_cache_size = 16M
 
 
</pre>
 
</pre>
  
==Setup MythTV==
+
==System checks==
 +
Before going further it is wise to check whether things have worked so far. Has a <tt>/dev/dvb/</tt> entry been created for a digital video source?
  
Recall what your video device was set up as (likely /dev/video0). Note that the actual device number is NOT what determines what order MythTV will use your cards in. What matters is the order that you enter them in mythtvsetup, so your best card doesn't have to be /dev/video0. Set up /dev/video8 first, and it'll be the first card used for recordings.
+
<pre>
 +
$ ls /dev/dvb*
 +
</pre>
 +
If not, you should be reading https://fedoraproject.org/wiki/DavidTimms/DVB), if you have an digital source yet something has gone wrong with installing it (in which case you should look at /var/log/dmesg, and check whether udev, ivtv, and so on are working, and required modules are loaded). A useful quick test for USB video sources is to unplug them then plug them in again and look at the ends of whatever /var/log files get updated.
  
You will also need your zip code and it would help to know the right listing from http://www.zap2it.com/ (for US users, other countries use different listings sources) that matches your service provider, so xmltv gets the right program listings. US folks will also have to fill out some paperwork to use zap2it's new xml data feed listings (the only way to go now). [http://mythtv.org/docs/mythtv-HOWTO-5.html#ss5.4 See this page in the MythTV docs for details.]
+
==Setup MythTV==
 +
Recall what your video device was set up as (likely /dev/dvb/adapter* for digital video sources). Note that the actual device number is '''not''' what determines what order MythTV will use your cards in. What matters is the order that you enter them in <tt>mythtv-setup</tt>.
  
 +
===Transmitted guide data===
  
 +
If you are in the US, you will need a paid account with [schedulesdirect.org]. The current pricing is $20 per year. This will give you television feed data that your myth box uses for scheduling once you have localized your acct to your zip code, chosen a content provider service and then set your channels from the webpage. There are a few other ways to get your data, but they are outside the scope of this document and the listings are not as accurate or as reliable.
  
Now on to launching the MythTV setup utility. For this part, you need to have an X session started up, as the setup utility is an X application. Fire it up like so:
+
Now on to launching the MythTV setup utility. For this part, you need to have an X running, as the setup utility is an X application. Fire it up like so:
  
 
<pre>
 
<pre>
$ mythtvsetup
+
$ mythtv-setup
 
</pre>
 
</pre>
  
I'm told that non-US folks may have issues correctly getting through the tv_grab_xx/xmltv part of the setup if "focus follows mouse" is already set (in KDE's Control Center), so keep that in mind. Just set "focus follows mouse" when everything else is already configured.
+
I'm told that non-U.S. folks may have issues getting through the tv_grab_xx/xmltv part of the setup correctly if "focus follows mouse" is already set (in KDE's Control Center), so keep that in mind. Just set "focus follows mouse" after everything else is configured.
  
If you receive an error involving permissions on a .so library, you may have SELinux installed and preventing you from accessing these libraries.  You can either turn off SELinux, or allow access to the libraries with the following command as root: <pre>chcon -t texrel_shlib_t /usr/lib/libmyth*.so*</pre>
+
Note: If you receive an error involving permissions on a .so library, you may have SELinux installed and preventing you from accessing those libraries.  You can either turn off SELinux, or allow access to the libraries with the following command as root:  
 
+
<pre>
Recent changes in the mythtvsetup and database population methodology broke the default path settings for the MythTV rpms, which should be /var/lib/mythtv/ for storage of recorded shows, and /var/cache/mythtv/ for live TV buffer. These directories are automatically created at install time, but you'll have to manually enter them in section 1 of mythtvsetup.
+
chcon -t texrel_shlib_t /usr/lib/libmyth*.so*
 +
</pre>
  
Those using a dedicated /video partition, per my example, should obviously set /video/recordings for storage of recorded shows and /video/buffer for their live TV buffer. However, you can do pretty much whatever you like here, such as recording to an NFS or samba mount, a software RAID array, or even to an LVM group so you can expand your /video partition sometime down the road (I use LVM myself, someday I'll write about it more...). Just make sure your mythtv user has permission to read and write to whatever location you choose.
+
Those using a dedicated /video partition, per my example, should obviously set /video/recordings for storage of recorded shows. However, you can do pretty much whatever you like here, such as recording to an NFS or Samba mount, a software RAID array. Just make sure your mythtv user has permission to read and write to whatever location you choose.
  
It is highly recommended that you go through the setup steps in order. Follow the on-screen instruction, with aid from the MythTV website's documentation on this page:
+
It is highly recommended that you go through the setup steps in order. Follow the on-screen instruction, with aid from the MythTV website [http://www.mythtv.org/wiki/MythTV-HOWTO#Configuring_MythTV documentation].
  
http://www.mythtv.org/docs/mythtv-HOWTO-9.html
+
Once you've gone through the setup, you have to populate the MythTV database with some program info. I spent a long time tweaking my channel lineup on schedulesdirect's site to remove all the junk channels I didn't really care to have show up. Once you have your listings to your liking, you're ready to fill your database with programming info. You must start up the backend first. We'll set it to autostart later.
NOTE: your system may appear to hang at step 3; give it time, it isn't locked up, that part just takes a while!
 
 
 
Once you've gone through the setup, you have to populate the MythTV database with some program info. I spent a good long time tweaking my channel lineup on zap2it's site to remove all the junk channels I didn't really care to have show up. Once you have your listings to your liking, you're ready to fill your database with programming info. You must start up the backend first. We'll daemonize it a bit later, but for now, just start it up like so:
 
  
 
<pre>
 
<pre>
$ mythbackend &  
+
$ mythbackend &
 
</pre>
 
</pre>
  
Line 397: Line 342:
 
</pre>
 
</pre>
  
If you're using a guide data source other than zap2it (i.e., anyone outside the US and Canada), I'm told that you may well need to add a "--manual" flag to the end of that command to get it to work. Look at the output of "mythfilldatabase --help" for more clues if you have problems.
+
If you're using a guide data source other than SchedulesDirect (i.e., anyone outside the U.S. and Canada), you may need to add a "--manual" flag to the end of that command to get it to work. Look at the output of "mythfilldatabase --help" for more clues if you have problems.
  
Also, BE PATIENT! This step can take a fairly long time, depending on your internet connection speed and how many channels your service provides... To get automatic updates of programming data daily see below for configuration in mythfrontend.  
+
Also, '''be patient!''' This step can take a fairly long time, depending on your internet connection speed and how many channels your service provides. To get automatic updates of programming data daily, see below for configuration in mythfrontend.  
  
 
Now start up the MythTV front-end (I recommend doing this in a separate shell window, so you can distinctly see the different output for the backend and frontend processes)...
 
Now start up the MythTV front-end (I recommend doing this in a separate shell window, so you can distinctly see the different output for the backend and frontend processes)...
Line 407: Line 352:
 
</pre>
 
</pre>
  
There are various options within mythfrontend that you can tweak... In the past, I've recommended enabling "De-interlace Playback", even if you're using an interlaced display (like a TV). However, I've found with the latest nvidia driver and its flicker filter, this is no longer necessary for TV output (note that the flicker filter can only be used on SVideo or composite TV-Out, it isn't an option for DVI or VGA). You're on your own for the rest of the settings. Just be sure to go through every section, and get to the point where you click a "Finish" button, otherwise some values seem to not get initialized (most notably, you may get crashes that say something about not being able to open the dsp). Another setting I'd recommend enabling, especially if you're using an nVidia video card (not sure about others) is OpenGL VSync, which recently became a toggleable option. It isn't stable for everybody, but works very well for me on several systems (and I find it to be a must for optimal HDTV playback). If everything appears to be working, once you've gone through all the configuration steps, you can set your system up to automatically load everything at startup. And congrats, you've done the bulk of the work. You can stop here if you want, but if you're like me, you'll want everything to load automatically when the system boots.
+
There are various options within mythfrontend that you can tweak...a lot of this is covered by other parts of the wiki.  
  
It is recommended to use the built in features of MythTV to have mythfilldatabase updated automatically. After starting up mythfrontend, enter the Setup>General screen and advance to "Mythfilldatabase", the fourth screen. Select the checkbox, then complete the options as you see fit. If using Zap2It for programming data, selecting the option to allow the scheduler to recommend the next mythfilldatabase option and changing the allowed update time to be from 0 to 24 is best as it allows Zap2It to balance the load on their servers. After setup the mythbackend program will now run mythfilldatabase for you.
+
It is recommended to use the built in features of MythTV to have mythfilldatabase updated automatically. After starting up mythfrontend, enter the Setup > General screen and advance to "Mythfilldatabase", the fourth screen. Select the checkbox, then complete the options as you see fit. If using SchedulesDirect for programming data, selecting the option to allow the scheduler to recommend the next mythfilldatabase option and changing the allowed update time to be from 0 to 24 is best, as it allows SchedulesDirect to balance the load on their servers. After setup the mythbackend program will now run mythfilldatabase for you.
  
==Configure Startup==
+
==Configure automatic startup==
 
The necessary init script for the MythTV backend to automatically start at system boot is already in place for you, just simply turn it on:
 
The necessary init script for the MythTV backend to automatically start at system boot is already in place for you, just simply turn it on:
  
 
<pre>
 
<pre>
# /sbin/chkconfig mythbackend on
+
# systemctl enable mythbackend.service
 
</pre>
 
</pre>
  
Line 421: Line 366:
  
 
<pre>
 
<pre>
# /sbin/service mythbackend start
+
# systemctl restart mythbackend.service
 +
</pre>
 +
 
 +
(If the backend fails at boot see: [[Systemd_mythbackend_Configuration|Systemd mythbackend Configuration]] (Works for Fedora 20))
 +
 
 +
It is possible to have <tt>mythfrontend</tt> start when the mythtv user logs in.  This can be done by adding a <tt>.desktop</tt> file to the mythtv user home directory.  Open a command line and enter:
 +
<pre>
 +
# gedit /home/mythtv/.config/autostart/autoLaunchFrontend.desktop
 +
</pre>
 +
Copy and paste the following text into the newly created file
 +
<pre>
 +
[Desktop Entry]
 +
Type=Application
 +
Exec=/home/mythtv/scripts/autoLaunchFrontend.sh
 +
Hidden=false
 +
NoDisplay=false
 +
X-GNOME-Autostart-enabled=true
 +
Name[en_AU]=autoLaunchFrontend
 +
Name=launchFrontend
 +
Comment[en_AU]=
 +
Comment=
 +
</pre>
 +
Save and exit.  Create a file in the <tt>Exec=</tt> path as such:
 +
<pre>
 +
# mkdir -p /home/mythtv/scripts
 +
# gedit /home/mythtv/scripts/autoLaunchFrontend.sh
 +
</pre>
 +
And copy and paste the following text into the file.  This script will wait 10 seconds before launching the frontend.
 +
<pre>
 +
#!/bin/bash
 +
 
 +
# Autolaunch script for MythTV Frontend
 +
 
 +
sleep 10s
 +
mythfrontend
 +
</pre>
 +
Change the permissions to an executable with:
 +
<pre>
 +
# chmod +x /home/mythtv/scripts/autoLaunchFrontend.sh
 +
</pre>
 +
Reboot to test the autostart scripts are working.
 +
 
 +
==Troubleshooting==
 +
===Tuners do not load on boot===
 +
 
 +
If the DVB tuners do not load on boot when systemd loads <tt>mythbackend.service</tt> but can be accessed through mythfrontend after the following commands are issued:
 +
<pre>
 +
# systemctl stop mythbackend.service
 +
$ mythbackend
 +
</pre>
 +
Then this could mean that the tuners not ready when systemd starts the <tt>mythbackend.service</tt>.  This can be fixed by following the instructions given in <tt>/etc/systemd/system/multi-user.target.wants/mythbackend.service</tt> and adding the tuners as a requirement on boot.  Simply find the required device in <tt>/dev/dvb/adapter0</tt> as a general guide (might not be specific to your tuner).
 +
<pre>
 +
[Unit]
 +
Description=MythTV backend service
 +
After=network.target mariadb.service mysqld.service time-sync.target dev-dvb-adapter0-frontend0.device
 +
# Uncomment the following line if you will be using the mythweb plugin on the
 +
# same system as mythbackend.
 +
Wants=dev-dvb-adapter0-frontend0.device
 
</pre>
 
</pre>
  
Now, because I have a few things that don't seem to want to play nice anymore (i.e., nvidia-settings don't load like they should, alsa volume levels aren't restored), I decided to create a quick little shell script in ~/.kde/Autostart/myth-load.sh to handle loading up all the extra goodies I need/want to auto-start, as well as force stubborn things to work. This script loads my nvidia settings, restores alsa volumes, launches irexec for my little power button script (on the Tips 'n' Tricks page), then launches mythfrontend, all in one fell swoop. Just copy and past all this into ~/.kde/Autostart/myth-load.sh (adjust accordingly for different desktop environments):
+
[[Category:Distribution_Specific_Install_Guides]]
 +
[[Category:Fedora]]
 +
 
 +
===Auto-load scripts===
 +
I have a few things that don't seem to want to play nice anymore (i.e., nvidia-settings don't load like they should, alsa volume levels aren't restored), I decided to create a quick little shell script in ~/.kde/Autostart/myth-load.sh to handle loading up all the extra goodies I need/want to auto-start, as well as force stubborn things to work. This script loads my nvidia settings, restores alsa volumes, launches irexec for my little power button script (on the Tips 'n' Tricks page), then launches mythfrontend, all in one fell swoop. Just copy and paste all this into ~/.kde/Autostart/myth-load.sh (adjust accordingly for different desktop environments):
  
 
<pre>
 
<pre>
Line 454: Line 460:
 
$ chmod +x ~/.kde/Autostart/myth-load.sh  
 
$ chmod +x ~/.kde/Autostart/myth-load.sh  
 
</pre>
 
</pre>
While logged in to an X session, you'll also have to run gdmsetup, to set autologin for your mythtv user. You'll have to get a root terminal open (if you aren't logged into your X session as root already, which is a no-no), then:
+
You'll also have to set autologin for your mythtv user. You'll have to get a root terminal open then:
 +
 
 +
Add the following lines to /etc/gdm/custom.conf
  
 
<pre>
 
<pre>
# gdmsetup
+
[daemon]
 +
AutomaticLoginEnable=true
 +
AutomaticLogin=mythtv (or whatever user you want)
 
</pre>
 
</pre>
  
In GDM Setup, on the first tab ('General'), you should see a section "Automatic login". Check the box for "Login a user automatically on first bootup" and select your mythtv user from the popup menu. Alternatively, if you are not very comfortable with Linux just yet, and you suspect there may be occasions where you've mucked something up to the point that an auto-login will lock up the computer, you might not want to use Automatic Login. Instead, you might opt to use the "Timed Login" option, to log the mythtv user in a few seconds after the login screen first appears. This way, you can circumvent the mythtv user logging in, and log in as root to hopefully correct whatever you've broken.
+
If you want a timed login, try:
 
 
NOTE: if you installed the packages from kde-redhat, they probably supplanted gdm as your display manager and put kdm in its place. I like the look of Red Hat's gdm much better than kdm, so I changed it back by editing /etc/sysconfig/desktop and setting "DISPLAYMANAGER=GNOME". Not that you should be seeing the login screen often, my box is always sitting there logged in with the Myth UI up. Maybe I'll add some kdm info in a bit...
 
 
 
Anyhow, I recommend setting the Kicker (the panel at the bottom of the screen) to auto-hide, so it doesn't end up on-screen during video playback, disabling the screen saver, and disabling any monitor-related dynamic power management, or you may not be able to wake your system up if you don't have a mouse and keyboard connected. You can use the KDE Control Center to disable your screen saver, and edit your xorg.conf file to disable dpms (or at least the screen blanking parts). Note that the above myth-load.sh script actually issues a pair of commands at login time that should also disable dpms and the screen saver, but you can turn it off everywhere you can to be sure...
 
 
 
And finally, to turn on auto-hiding of the Kicker, right-click on the Kicker, choose 'Configure Panel...', then select the 'Hiding' tab, and select the radio button for 'Hide automatically'.
 
 
 
==Configure MythTV add-ons==
 
 
 
==Upgrading Your System==
 
Upgrading your MythTV installation to a new release is fairly straight-forward. As of MythTV 0.13, all database changes are handled automagically, so you merely have to upgrade your mythtv rpms when they become available. Occasionally, driver updates are also required (such was the case with the ivtv driver when upgrading to MythTV 0.13, and PVR-350 output in 0.14+ required ivtv 0.1.9+). The basic upgrade process should be as simple as:
 
  
 
<pre>
 
<pre>
# yum install mythtv-suite
+
[daemon]
 +
TimedLoginEnable=true
 +
TimedLogin=mythtv
 +
TimedLoginDelay=1 (Or however long you want to wait)
 
</pre>
 
</pre>
 +
==Enhancements==
  
Note that this will NOT suffice to upgrade all sub-packages in the event of an updated build from ATrpms of the same major version. In other words, say 0.18.1-115 packages are released with some bugfix not in 0.18.1-114 (-114 and -115 are ATrpms build numbers), but mythtv-suite is already satisfied w/0.18.1-114 (mythtv-suite only needs 0.18.1 packages of any build number), so you'll have to specify all components manually (rpm -qa | grep myth for a list of 'em). If a driver update is required, you may need to:
+
===MariaDB performance===
 +
 
 +
These adjustments to <tt>/etc/my.cnf</tt> under the [mysqld] section improve performance with both MythTV (especially in the GUI) and MythWeb:
  
 
<pre>
 
<pre>
# yum install <somedriver>-kmdl-$KVER <somedriver>
+
key_buffer = 16M
(<somedriver> could be ivtv, lirc, nvidia-graphics, etc.)
+
table_cache = 128
 +
sort_buffer_size = 2M
 +
myisam_sort_buffer_size = 8M
 +
query_cache_size = 16M
 
</pre>
 
</pre>
  
A general note about upgrading and installing rpm packages: you should NEVER use --nodeps to install or remove a package. If you can't get around using --nodeps, there is likely a packaging problem, which you should report upstream, to have it fixed. A tanked rpm database can do Very Bad Things™ to your system, and recovery is sometimes impossible. Try 'yum check' to verity its integrity, should you happen to have committed the --nodeps sin in the past.
+
===Power saving===
 
+
Since the frontend/backend is likely to be powered on around the clock, some power saving enhancements will allow the device to run cooler, quieter and reduce the impact on the electricity bill. Firstly install <tt>powertop</tt> and <tt>tlp</tt> using
Upgrading your kernel is a little bit more involved than upgrading only MythTV, because all custom kernel modules, both rpm-installed and source-installed, will have to be updated also. Kernel modules carry two different versions, one for the kernel they are for (the 'kernel version') and one for the actual module itself (the 'module version'). Everything but kernels and their matching kernel modules get upgraded automatically by 'yum upgrade'. However, note that cases where the kernel version on a kernel module remains the same, but the module version is incremented, an 'yum upgrade' will upgrade that kernel module. Essentially, you really only need to take extra measures when upgrading your kernel, as everything else gets handled automatically.
 
 
 
When you do come to a point where you need to upgrade your kernel, one of the nice features of installing from packages, rather than source, shows itself. For all the ATrpms kernel modules, you can simply type in the command...
 
 
 
 
<pre>
 
<pre>
# rpm -qa {alsa,ivtv,nvidia-graphics,lirc}*
+
# yum install powertop tlp
 
</pre>
 
</pre>
 
+
And start <tt>tlp</tt> with:
...to get a full list of all the kernel modules you have installed on your system. With that list in hand, you can now install your new kernel, along with all the corresponding updated kernel modules. For example:
 
 
 
 
<pre>
 
<pre>
# yum install kernel#2.6.15-1.1831_FC4
+
# tlp start
# yum install {alsa,ivtv,lirc,nvidia-graphics7676}-kmdl-2.6.15-1.1831_FC4
 
 
</pre>
 
</pre>
 
+
And this should return the power on status (<tt>TLP Started in AC Mode</tt>).  You can modify the defaults in <tt>/etc/default/tlp</tt> to allow power saving modes while in ac mode.  Apply the changes with the tlp start command.  You can check if the power saving features are enabled by using <tt>powertop</tt> under the tunables tab by using:
You can also uninstall an older kernel and its kernel modules with a single command:
 
 
 
 
<pre>
 
<pre>
# yum remove kernel-<oldversion>
+
# powertop
 
</pre>
 
</pre>
 
+
And using 'tab' to access the other pages in the terminal interfaceThe status ''good'' should be reported next to each itemIf not try using turning on the experimental PCI-E support (assuming the hardware you have is recent).
==Troubleshooting==
 
First and foremost, ''''' READ THE OFFICIAL DOCUMENTATION!!! '''''  Specifically, read the page on Troubleshooting, at http://mythtv.org/docs/mythtv-HOWTO-22.htmlSecond, search the MythTV users '''and''' developers mailing lists to see if this isn't already a known problem that might be fixed in Subversion or have a work-around. Again, you can search the archives online at Gossamer ThreadsThird, check out the wiki over at http://wiki.mythtv.org/, which also contains quite a bit of valuable information. Fourth, take a look at ATrpms Bugzilla and the Fedora Myth(TV)ology Wiki and Bug-tracker.
 
 
 
When troubleshooting, I suggest exiting the frontend, stopping the backend and opening a pair of terminal windows.  From one, start up the backend (as root, just type "mythbackend").  In the other, launch the frontend with verbose output (just type "mythfrontend -v all").  There should be a fair amount of output spit to the terminal windows that should give you (and the developers) a better idea of what is going wrong with your system.  Please include that output when asking for help. Additionally, if you're getting a segmentation fault, your best bet for getting help determining the cause of the problem is to download the MythTV source code and compile it yourself in debug mode, then run it with gdb, the GNU debugger (how to do that is detailed at the above link). Only with a backtrace can the developers really help you if your setup is causing Myth to segfault.
 
 
 
[[Category:HOWTO]]
 

Revision as of 10:05, 21 September 2014

This "How-To" guide is for installing MythTV on the latest release of Fedora.


Important.png Note: This installation guide is currently undergoing an overhaul to remove outdated procedures and reduce the overall size. Addressing the helpful comments in the discussion panel

Introduction

This wiki entry will detail the installation of a combined frontend and backend in Fedora 20. Ensure you have met the hardware requirements set out by MythTV.

Fedora provides updates for a release until two releases after that. At the time of this writing, the current release is Fedora 20, which means support for Fedora 18 was discontinued a month after Fedora 20 was released. Thus, it makes sense to update to the latest release at least every other version, if not every version.

You are welcome as a MythTV user and general wiki participant, to add to, and modify this document that will help the community the best way possible.

Getting Fedora

ISO images

The latest version of Fedora can be downloaded from the Fedora Download Page. Note that the Desktop edition has the default GNOME Desktop available whereas the DVD install has alternative desktop environments available. For the remainder of this installation guide, the default desktop environment GNOME will be used to avoid confusion. Other desktop environments should be similar.

Physical media

CD-ROM and DVD-ROM discs can be purchased from online and local vendors.

Installing Fedora

The official Fedora 20 installation guide is an excellent place to start when installing Fedora. There are a few modifications on the procedure given in the official documentation; user creation and filesystem partitions. The notes in this wiki will detail an installation from the Live Desktop Media. It should be noted that additional desktop environments are also available if the GNOME 3 desktop is not suitable. Some alternatives are listed in the Fedora spins page and installation is detailed here. Desktop environments other than GNOME 3 are outside of the scope of this wiki for brevity.

Date/Time

During installation you should adjust the date and time of the machine to the current date and time. To do this ensure the Network Time slider is set to on under the Localization options. Making sure the system is running to the correct time is important for timely scheduling of recordings.

Filesystems

Among the MythTV community, it is highly recommend to use a custom partitioning scheme rather than auto-partitioning with a dedicated /video (or similar) partition for storage of all your recordings. If possible, for best efficiency, the video partition should be on a drive physically separate from the operating system partitions. Software RAID and LVM for your video partitions will only slow it down and should be avoided. LVM is no longer necessary for MythTV due to Storage Groups.

Currently EXT4 format is the default in Fedora and other distributions. Here's a partition setup example:


Partition Mount Point Size Format
/dev/sda1 /boot 500MB ext4
/dev/sda2 swap same as RAM (ex: 4096MB) swap
/dev/sda3 (for the OS) / 8-12GB ext4
/dev/sda4 /home 8-12GB ext4
/dev/sda5 /video Remainder ext4

User creation

When prompted during the installation, create a non-administrator user on the system with the username "mythtv". You can set the password for this user to anything you want. This should be a Strong Password that is different than the root password.

First boot

At this point Anaconda will ask you to remove the installation media from the drive and reboot the system. Once your system has finished rebooting you will be prompted to do some final configurations and be given a short tour of GNOME 3.

Gnome Terminal

Tasks in Linux are performed with greater ease through the command line and are therefore required in this How-To. In GNOME 3, the terminal is accessed by going to Activities and typing terminal in the search box.

Some commands need to be run as the mythtv user, and some commands need to be run as the root user. The boxes below will indicate with a prompt which user should run the command. Commands with a "$" prompt should be run as the mythtv user. If you see a command that starts with a "#", you will need to use the su command to become the root user.

To execute commands as the root run "su -" and enter the Fedora root password.

[mythtv@machine_name ~]$ su -
Password:
[root@machine_name ~]#

Notice the way the username changes from mythtv to root and the prompt changes from "$" to "#". Be sure you run all of the following commands as the correct user. If you do not, you will likely run into problems sooner or later. To become the mythtv user again, type "exit".

[root@machine_name ~]# exit
logout
[mythtv@machine_name ~]$

Your screen should clear, and your prompt should be a "$" again. If this is not the case, keep typing "exit" until it is. You can copy and paste text in the terminal by using 'Control-Shift-C' and 'Control-Shift-V' respectively.

Update Fedora

Firstly get your system fully updated. Simply run the command from terminal:

# yum update

When you see the Transaction Summary, you will need to press "y" to begin downloading the packages.

 Transaction Summary
 =============================================================================
 Install      20 Package(s)
 Update      79 Package(s)
 Remove       0 Package(s)
 Total download size: 902 M
 Is this ok [y/N]: y

After the update has finished, reboot your computer for the effects to take place.

Network configuration

On the Network Configuration screen (Activities -> Network Connections), setting a static IP address is highly recommended (could be either a static, or statically mapped DHCP address). It really isn't a huge deal if you only have one Myth box (though you probably don't want MythWeb to be a moving target), but it could cause major headaches once you have more than one machine, since non-primary systems won't know where the master backend is, if the address changes.

Firewall

A basic MythTV box should not have any problems running with the default Public zone firewall settings. If there are issues with service access you will at the very least want to enable SSH, Secure WWW (HTTPS) and WWW (HTTP) checkboxes to enable those services under the appropriate Firewall zone with the Permanent configuration.

If you plan to run separate front end and back end servers you will need to allow those ports through on under "Other Ports". Add TCP ports 6543 and 6544 to allow the MythTV protocol access through the firewall and TCP 3306 for MariaDB.

Fedora setup

The next section will require you to be logged in as the mythtv user.

Configure package repositories

RPMFusion

Configuration of yum is needed to use the RPMFusion package repository. Follow the links below and install the RPMs for the latest version and correct architecture for your system. It should be noted ATrpms can also be used as an alternative to RPMFusion but they cannot be used simultaneously and ATrpms will require the priority of the repo file to be set higher as to not conflict with the official packages.

RPMFusion

 http://rpmfusion.org/Configuration

Note: You will need to download the packages rpmfusion-free-release and rpmfusion-nonfree-release and install with GNOME Software or rpm -ivh *.

Many MythTV installations require additional kernel modules to make all the hardware work. When installing firmware/drivers such as the proprietary nVidia graphics drivers the akmod or kmod packages can be chosen. The akmod packages automatically check and compile the driver on boot if required. This incurs a small penalty of having to install development packages. The kmod packages are built against a specific kernel version and if a new kernel is installed without the corresponding kmod then errors on boot may occur. Therefore for system safety the akmod packages are recommended.

NVIDIA

We recommend you use a card that supports VDPAU for video acceleration. See http://www.mythtv.org/wiki/VDPAU.

You can install binary drivers from NVIDIA, but in most cases it's simpler to use yum to get and install them from RPMFusion. It is essential to get the proper version of the drivers. Start by running

$ /sbin/lspci -nn | grep 'VGA'

This will give you the chipset name and the PCI id (which is after the colon inside the bracket set before the rev number). Compare these to the NVIDIA docs. Unless your card is in one of the legacy lists, you can install the latest drivers. If you have one of the legacy products you will have to modify the yum package name to get the proper drivers. The newer drivers will NOT work on "legacy" cards.

To install from the RPMFusion repository, run:

# yum install kernel-devel akmod-nvidia

You might encounter a message about a GPG key, accept this with y. Upon reboot the boot will be interrupted to build akmod-nvidia against the current kernel version which may take some time. You can check that the driver installed correctly by entering the following command in the terminal.

$ glxinfo | grep -i nvidia

Which should return an entry for the NVIDIA card.

If you need a legacy package from RPM Fusion consult the available packages table at http://rpmfusion.org/.

DVD playback

If you require DVD playback then you will need to install the libdvdcss package from an alternative repository. Please check if this is legal in your country.

# yum localinstall http://rpm.livna.org/livna-release.rpm
# yum install libdvdcss

Sound setup

Fedora uses PulseAudio by default, as do many Linux distributions. MythTV works with Pulseaudio. Ensure the sound is working in the GNOME Desktop otherwise try changing the output in Activites > Sound.

Remote desktop

Please ensure that only local access is allowed for the VNC ports for security reasons.

The remote desktop in GNOME can be enabled through the GUI from Activites > System Settings > Sharing. Turn on Screen Sharing and Allow Remote Control. It is strongly recommended that a secure password is set. After the remote desktop has been enabled the corresponding ports need to be allowed through the firewall (VNC-Server checkbox).

Install MythTV

MythTV has numerous required dependencies to function correctly, which are automatically taken care of with one simple command:

# yum install mythtv

You may run into some problems with dependencies. These can usually be resolved by removing the offending package and re-running the above command. Dependency issues can be mitigated be keeping additional (third-party) repositories to a minimum. MythTV on Fedora requires only the default repositories plus RPMFusion to fulfil all requirements.

SELinux

It is strongly recommended that SELinux is run in "permissive" mode by editing /etc/selinux/config. There are a few things that will not work properly if you set SELinux to "enforcing" such as the MythWeb plugin. If you think you might want to run with SELinux in enforcing mode in the future, choose the permissive mode which will only warn you of problems. This will enable you to quickly and easily set SELinux to enforcing mode at a later time.

Fedora 20 comes with the excellent setroubleshoot tool which will notify of denials whilst permitting you to leave SELinux enabled on your system. Audit2allow in permissive mode can also be used to catch SELinux denials and rules can be automatically created to allow program access in the future.

If you prefer running enforcing SELinux with mythweb, the following commands may be helpful:

 $ /usr/sbin/setsebool -P httpd_can_network_connect=1
 $ /usr/sbin/setsebool -P httpd_ssi_exec=1
 $ chcon -R -t httpd_sys_content_rw_t /var/www/html/mythweb/data
 $ semanage fcontext -a -t  httpd_sys_content_rw_t /var/www/html/mythweb/data

Install capture card drivers

Some capture card drivers have been included by default with Fedora. The IVTV drivers required for the PVR-150/250/350 and the drivers required for the Hauppauge HD-PVR 1212 are included, for example.

You can check if the kernel is able to detect the attached dvb tuner by checking the kernel messages. This is done with:

dmesg | grep -i dvb

If the firmware loading was successful you may notice a message similar to:

usb 1-6: dvb_usb_v2: 'Kworld UB499-2T T09' successfully initialized and connected

Otherwise you will need to find the chipset details of the attached tuner. If you have a usb attached tuner use lsusb or if you have a pci tuner use lspci

An example output of this might be:

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 0609:0334 SMK Manufacturing, Inc. eHome Infrared Receiver
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 003: ID 1b80:e409 Afatech IT9137FN Dual DVB-T [KWorld UB499-2T]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 17ef:6022 Lenovo 
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

The entry with DVB gives the model name of the tuner (KWorld UB499-2T) and chipset (IT9137FN) which can be compared with the lists at linuxtv.org.

Remote control

Many remote control drivers have been moved to the kernel but manual key mapping may still be desired. This can be achieved by installing the v4l-utils package for the ir-keytable command.

# yum install v4l-utils

Once v4l-utils has successfully installed you can run the following command to capture the input and button name of each keypress.

# ir-keytable -t

The mappings can be changed by finding your corresponding keymap in /lib/udev/rc_keymaps. Be sure to comment out the original mappings in case an error is made during the file modification.

If your remote control does not exist in the kernel then you will have to install LIRC.

Install LIRC

This LIRC instruction may well be outdated

Note for Fedora 12 + users the default LIRC socket file name has changed to /var/run/lirc/lircd , so you will need to update MythTV Settings -> General from /dev/lircd ->/var/run/lirc/lircd and then restart mythfrontend.

Check first if lirc is installed before proceeding below...(eg find / -name lircd)

# yum install lirc

This will install the Linux Infra-Red Control package. This is a daemon which translates infra-red key presses into keyboard events, therefore you will need to configure your remote control accordingly.

Setup MariaDB

In Fedora 20, mySQL has been replaced with MariaDB but backwards compatibility is maintained such that the following commands should still be applicable. We'll need to enable MySQL to load at startup, set some passwords, and create the MythTV database, which we'll populate shortly. The population of this database is handled by mythtv-setup in the next step, and all MythTV add-on module database additions must be done after running mythtv-setup at least one time.

# systemctl enable mariadb.service
# systemctl restart mariadb.service

Set the MySQL root password.

mysql_secure_installation

Now we create the MythTV database (called mythconverg) to get us started:

$ mysql -u root -p < /usr/share/doc/mythtv-docs/database/mc.sql
Enter password:

At this point, enter the password you just set above (ROOT_PWD) when prompted.

The above command gives users access to the database (see the main documentation) with the commands

$ /usr/bin/mysql -u root -p mythconverg
mysql> GRANT ALL ON mythconverg.* TO mythtv@"%" identified by  "mythtv";
mysql> flush privileges;

Again, all subsequent database population for MythTV's add-on modules must now be done after running mythtv-setup at least one time. It's worth customizing some parameters in /etc/my.cnf for optimal performance with MythTV.

In the event the mythtv-setup fails (current in Fedora 20), it may be because the time zone tables are not loading. See the wiki on the time zones. This entry fixed the problem:

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

System checks

Before going further it is wise to check whether things have worked so far. Has a /dev/dvb/ entry been created for a digital video source?

$ ls /dev/dvb*

If not, you should be reading https://fedoraproject.org/wiki/DavidTimms/DVB), if you have an digital source yet something has gone wrong with installing it (in which case you should look at /var/log/dmesg, and check whether udev, ivtv, and so on are working, and required modules are loaded). A useful quick test for USB video sources is to unplug them then plug them in again and look at the ends of whatever /var/log files get updated.

Setup MythTV

Recall what your video device was set up as (likely /dev/dvb/adapter* for digital video sources). Note that the actual device number is not what determines what order MythTV will use your cards in. What matters is the order that you enter them in mythtv-setup.

Transmitted guide data

If you are in the US, you will need a paid account with [schedulesdirect.org]. The current pricing is $20 per year. This will give you television feed data that your myth box uses for scheduling once you have localized your acct to your zip code, chosen a content provider service and then set your channels from the webpage. There are a few other ways to get your data, but they are outside the scope of this document and the listings are not as accurate or as reliable.

Now on to launching the MythTV setup utility. For this part, you need to have an X running, as the setup utility is an X application. Fire it up like so:

$ mythtv-setup

I'm told that non-U.S. folks may have issues getting through the tv_grab_xx/xmltv part of the setup correctly if "focus follows mouse" is already set (in KDE's Control Center), so keep that in mind. Just set "focus follows mouse" after everything else is configured.

Note: If you receive an error involving permissions on a .so library, you may have SELinux installed and preventing you from accessing those libraries. You can either turn off SELinux, or allow access to the libraries with the following command as root:

chcon -t texrel_shlib_t /usr/lib/libmyth*.so*

Those using a dedicated /video partition, per my example, should obviously set /video/recordings for storage of recorded shows. However, you can do pretty much whatever you like here, such as recording to an NFS or Samba mount, a software RAID array. Just make sure your mythtv user has permission to read and write to whatever location you choose.

It is highly recommended that you go through the setup steps in order. Follow the on-screen instruction, with aid from the MythTV website documentation.

Once you've gone through the setup, you have to populate the MythTV database with some program info. I spent a long time tweaking my channel lineup on schedulesdirect's site to remove all the junk channels I didn't really care to have show up. Once you have your listings to your liking, you're ready to fill your database with programming info. You must start up the backend first. We'll set it to autostart later.

$ mythbackend &

Assuming all goes well and the process doesn't exit on you (if it does, check out the troubleshooting section below), lets get some guide data:

$ mythfilldatabase 

If you're using a guide data source other than SchedulesDirect (i.e., anyone outside the U.S. and Canada), you may need to add a "--manual" flag to the end of that command to get it to work. Look at the output of "mythfilldatabase --help" for more clues if you have problems.

Also, be patient! This step can take a fairly long time, depending on your internet connection speed and how many channels your service provides. To get automatic updates of programming data daily, see below for configuration in mythfrontend.

Now start up the MythTV front-end (I recommend doing this in a separate shell window, so you can distinctly see the different output for the backend and frontend processes)...

$ mythfrontend 

There are various options within mythfrontend that you can tweak...a lot of this is covered by other parts of the wiki.

It is recommended to use the built in features of MythTV to have mythfilldatabase updated automatically. After starting up mythfrontend, enter the Setup > General screen and advance to "Mythfilldatabase", the fourth screen. Select the checkbox, then complete the options as you see fit. If using SchedulesDirect for programming data, selecting the option to allow the scheduler to recommend the next mythfilldatabase option and changing the allowed update time to be from 0 to 24 is best, as it allows SchedulesDirect to balance the load on their servers. After setup the mythbackend program will now run mythfilldatabase for you.

Configure automatic startup

The necessary init script for the MythTV backend to automatically start at system boot is already in place for you, just simply turn it on:

# systemctl enable mythbackend.service

If the backend isn't already running, save yourself a reboot and issue this command:

# systemctl restart mythbackend.service

(If the backend fails at boot see: Systemd mythbackend Configuration (Works for Fedora 20))

It is possible to have mythfrontend start when the mythtv user logs in. This can be done by adding a .desktop file to the mythtv user home directory. Open a command line and enter:

# gedit /home/mythtv/.config/autostart/autoLaunchFrontend.desktop

Copy and paste the following text into the newly created file

[Desktop Entry]
Type=Application
Exec=/home/mythtv/scripts/autoLaunchFrontend.sh
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_AU]=autoLaunchFrontend
Name=launchFrontend
Comment[en_AU]=
Comment=

Save and exit. Create a file in the Exec= path as such:

# mkdir -p /home/mythtv/scripts
# gedit /home/mythtv/scripts/autoLaunchFrontend.sh

And copy and paste the following text into the file. This script will wait 10 seconds before launching the frontend.

#!/bin/bash

# Autolaunch script for MythTV Frontend

sleep 10s
mythfrontend

Change the permissions to an executable with:

# chmod +x /home/mythtv/scripts/autoLaunchFrontend.sh

Reboot to test the autostart scripts are working.

Troubleshooting

Tuners do not load on boot

If the DVB tuners do not load on boot when systemd loads mythbackend.service but can be accessed through mythfrontend after the following commands are issued:

# systemctl stop mythbackend.service
$ mythbackend

Then this could mean that the tuners not ready when systemd starts the mythbackend.service. This can be fixed by following the instructions given in /etc/systemd/system/multi-user.target.wants/mythbackend.service and adding the tuners as a requirement on boot. Simply find the required device in /dev/dvb/adapter0 as a general guide (might not be specific to your tuner).

[Unit]
Description=MythTV backend service
After=network.target mariadb.service mysqld.service time-sync.target dev-dvb-adapter0-frontend0.device
# Uncomment the following line if you will be using the mythweb plugin on the
# same system as mythbackend.
Wants=dev-dvb-adapter0-frontend0.device

Auto-load scripts

I have a few things that don't seem to want to play nice anymore (i.e., nvidia-settings don't load like they should, alsa volume levels aren't restored), I decided to create a quick little shell script in ~/.kde/Autostart/myth-load.sh to handle loading up all the extra goodies I need/want to auto-start, as well as force stubborn things to work. This script loads my nvidia settings, restores alsa volumes, launches irexec for my little power button script (on the Tips 'n' Tricks page), then launches mythfrontend, all in one fell swoop. Just copy and paste all this into ~/.kde/Autostart/myth-load.sh (adjust accordingly for different desktop environments):

#!/bin/bash

# Only do this stuff if we're on the main display
# (i.e., don't do this in a vnc session)
if [ `echo $DISPLAY | grep -c ":0"` -ge 1 ]
then
    # Load nVidia driver custom settings
    nvidia-settings --load-config-only &
    # Restore audio settings
    /usr/sbin/alsactl restore
    # Launch irexec for myth power button stop/start
    irexec &
    # Launch myth welcome 
    mythwelcome &
    # Disable dynamic power management (screen blanking)
    /usr/bin/xset -dpms
    # Disable screen saver
    /usr/bin/xset s off
fi
exit 

Don't forget to make it executable:

$ chmod +x ~/.kde/Autostart/myth-load.sh 

You'll also have to set autologin for your mythtv user. You'll have to get a root terminal open then:

Add the following lines to /etc/gdm/custom.conf

[daemon]
AutomaticLoginEnable=true
AutomaticLogin=mythtv (or whatever user you want)

If you want a timed login, try:

[daemon]
TimedLoginEnable=true
TimedLogin=mythtv
TimedLoginDelay=1 (Or however long you want to wait)

Enhancements

MariaDB performance

These adjustments to /etc/my.cnf under the [mysqld] section improve performance with both MythTV (especially in the GUI) and MythWeb:

key_buffer = 16M
table_cache = 128
sort_buffer_size = 2M
myisam_sort_buffer_size = 8M
query_cache_size = 16M 

Power saving

Since the frontend/backend is likely to be powered on around the clock, some power saving enhancements will allow the device to run cooler, quieter and reduce the impact on the electricity bill. Firstly install powertop and tlp using

# yum install powertop tlp

And start tlp with:

# tlp start

And this should return the power on status (TLP Started in AC Mode). You can modify the defaults in /etc/default/tlp to allow power saving modes while in ac mode. Apply the changes with the tlp start command. You can check if the power saving features are enabled by using powertop under the tunables tab by using:

# powertop

And using 'tab' to access the other pages in the terminal interface. The status good should be reported next to each item. If not try using turning on the experimental PCI-E support (assuming the hardware you have is recent).