Difference between revisions of "Installing MythTV on Fedora"

From MythTV Official Wiki
Jump to: navigation, search
m (NVIDIA: More FC15 notes (sorry I forgot summaries on previous ones) for nvidia support)
m (Remove atrpms reference)
 
(264 intermediate revisions by 8 users not shown)
Line 1: Line 1:
This "How-To" guide is for installing MythTV on the latest release of Fedora.
+
 
 +
{{User Manual TOC}}
 +
 
 +
This "How-To" guide is for installing MythTV on {{FedoraVersion}}.
  
 
==Introduction==
 
==Introduction==
  
This guide is shamelessly based on '''Jarod Wilson's''' how to guide which no longer exists.
+
This wiki entry will detail the installation of a combined frontend and backend in {{FedoraVersion}}.  Ensure you have met the [[Hardware_Requirements|hardware requirements]].
  
Fedora provides updates for a release until two releases after that(N-2). The current release is Fedora 12, which means support for Fedora 10 was discontinued a month after it was released. Thus, it makes sense to update to the latest release at least every other version, if not every verson.  
+
Fedora provides updates for a release until two releases after that. At the time of this writing, the current release is {{FedoraVersion}}, which means support for {{FedoraVersion}} - 2 becomes discontinued a month after {{FedoraVersion}} is 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 and 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://www.fedoraproject.org/en/get-fedora Fedora Download Page].
+
 
 +
{{Download|getfedora.org/en/workstation/|Fedora download page}}
 +
 
 +
Note that the Workstation 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===
Line 17: Line 23:
  
 
==Installing Fedora==
 
==Installing Fedora==
Anaconda is the Fedora installer program and will launch a GUI by default.
+
The official {{FedoraVersion}} [http://docs.fedoraproject.org/en-US/Fedora/21/html/Installation_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 - Workstation'''.  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/21/Spins spins] page and installation is detailed [http://docs.fedoraproject.org/en-US/Fedora/21/html/Release_Notes/index.html 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===
 
===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 separate physical drive than 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.  
+
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.  A partition setup example is given in the Table below.
  
Previously, XFS was the recommendation for the file system to use for such a purpose, but with EXT4 now the default in Fedora and other distributions, many have migrated to using it as the partitioning scheme. Barring that, XFS is still an option, as is JFS, or even ReiserFS. An example partitioning setup can be found below.
+
===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 [http://en.wikipedia.org/wiki/Strong_password Strong Password] that is '''different than the root password.'''
  
 
<center>
 
<center>
Line 34: Line 47:
 
| /dev/sda1
 
| /dev/sda1
 
| /boot
 
| /boot
| 100-200MB
+
| 500MB
 
| ext4
 
| ext4
 
|-
 
|-
 
| /dev/sda2  
 
| /dev/sda2  
 
| swap  
 
| swap  
| same as RAM (ex: 512MB)  
+
| same as RAM (ex: 4096MB)  
 
| swap
 
| swap
 
|-
 
|-
Line 45: Line 58:
 
| /  
 
| /  
 
| 8-12GB  
 
| 8-12GB  
 +
| ext4
 +
|-
 +
| /dev/sda4
 +
| /home
 +
| 8-12GB
 
| ext4
 
| ext4
 
|-
 
|-
 
| /dev/sda5  
 
| /dev/sda5  
 
| /video  
 
| /video  
| Everything else
+
| Remainder
|
+
| 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.
 
 
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):
 
 
Note that there's really no point in using anything but ext4 on / and /boot.
 
 
===Network configuration===
 
On the Network Configuration screen, it is highly recommend setting a static IP address (could either be truly static, or a 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 wouldn't know where the master backend was anymore if the address changed.
 
 
===Package selection===
 
Note for FC14 Users: Packages marked with a * were likely installed by default.
 
====Required====
 
On the package selection screen, select (at least) these package groups:
 
*Desktop Environments
 
**[[K Desktop Environment]] (KDE) or [[GNOME Desktop Environment]]
 
 
If you enable options under the install to install from additional repositories, you'll also have alternate desktop environment and window manager options such as XFCE, fluxbox or ratpoison, which are more lightweight and thus may be better for a dedicate frontend.
 
 
*Servers
 
**[[MySQL]] Database
 
**Web Server* &mdash; if you want to use [[MythWeb]]
 
 
====Optional====
 
Some other packages that might be of interest, but are not required:
 
*Applications
 
**Graphical Internet* (includes Empathy and Firefox)
 
**Sound and Video*
 
*Development
 
**Development Tools &mdash; if you want or need to compile anything
 
*Servers
 
**Network Servers (under details, select vnc-server)
 
**Windows File Server (includes Samba)
 
  
 
==First boot==
 
==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.
+
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.
 
 
===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 headaches if you disable it completely.  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 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 mysql.
+
===GNOME terminal===
  
===SELinux===
+
Tasks in linux are performed with greater ease through the command line and are therefore required in this How-ToIn GNOME 3, the terminal is accessed by going to Activities and typing <tt>terminal</tt> in the search box.
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 set SELinux to "enforcing" such as the MythWeb pluginIf 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 Core 6 comes with the excellent [http://fedoraproject.org/wiki/SELinux/setroubleshoot '''setroubleshoot'''] tool which will notify of denials whilst permitting you to leave SELinux enabled on your system.
 
  
If you insist on running enforcing SELinux with mythweb, the following commands may be helpful:
+
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.
  $ /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
 
  
Note for FC14 users:
+
To execute commands as the root run "su -" and enter the Fedora root password.
Disabling SELinux may cause the system to have a long boot time or crash upon reboot. Use the permissive mode instead.  This can be changed by editing <tt>/etc/selinux/config</tt>.
 
 
 
===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. Making sure the system is running to the correct time is important for timely scheduling of recordings.
 
 
 
===Display===
 
The '''Setup Agent''' should have detected your video card and your monitor.  Select the screen resolution that is best for your monitor.
 
 
 
===Switch 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.'''
 
 
 
 
 
==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. In GNOME, this is under Applications > Accessories > Terminal. Under KDE, 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.
 
 
 
 
 
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'''@''machine_name'' ~]'''$''' su -
 
  ['''mythtv'''@''machine_name'' ~]'''$''' su -
Line 136: Line 94:
 
  ['''mythtv'''@''machine_name'' ~]'''$'''
 
  ['''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===
 +
Firstly get your system fully updated.  Simply run the command from terminal:
 +
<pre>
 +
# yum update
 +
</pre>
 +
 
 +
When you see the '''Transaction Summary''', you will need to press "y" to begin downloading the packages.
 +
<pre>
 +
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
 +
</pre>
  
 +
After the update has finished, reboot your computer for the effects to take place.
  
===Set $KVER variable===
+
===Network configuration===
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, and so-forth. Simply drop a file in /etc/profile.d, like so:
+
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 Mythbox (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 located if the address changes.
  
# echo "export KVER=\`uname -r\`" >> /etc/profile.d/kver.sh
+
===Firewall===
  
(Note: those are back-ticks, not single-quotes.)
+
Note that since Fedora 21 Workstation the firewall application has been removed for ease of use.  The VNC ports are open on this machine by default.  It can be installed by
 +
<pre>
 +
# yum install firewall-config
 +
</pre>
  
If you are using an nVidia graphics card, read the notes below under NVIDIA. The changes to grub.conf should be done before rebooting.
+
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.
Now you're ready to reboot into that new kernel and start installing kernel modules for your tuner card(s), remote, and so-forth.
 
  
  # reboot
+
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.
  
===Add a few important yum packages===
+
===Autologin and display timeout===
====yum-fastestmirror====
+
You can choose to have GNOME autologin in the ''mythtv'' user on boot so that the mythfrontend can automatically load.  To set this behaviour go to Activities > Users.  Unlock the user panel with the administrator password and slide the ''Automatic Login'' to the on position.
To ensure that yum always uses the fastest available mirror for a repository (if it has more than one mirror) you can install the package yum-fastestmirror. This will decrease the time for downloads in many cases.
 
yum install yum-fastestmirror
 
  
If the above command does not work you get something like this:
+
The screen timeout will also cause problems when using MythTV.  You can set the display to not turn off by going to Activities > Power and setting the ''blank screen'' option to neverBe sure not to leave the display on with this option as it can cause issues with the display panel (burn in etc).
(this was using Fedora 8)
 
yum install yum-fastestmirror
 
Existing lock /var/run/yum.pid: another copy is running as pid 21830.
 
  Another app is currently holding the yum lock; waiting for it to exit...
 
  
====Yum-Presto====
+
===Sound setup===
  
Yum-presto is another useful package to install. It downloads only the deltas (changes) between the installed and new packages, and rebuilds an installable rpm on your machine. The data required to be downloaded is cut to an amazingly small proportion of what would otherwise be required.
+
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 (e.g., HDMI) in Activities > Sound.
  
yum install yum-presto
+
===Remote desktop===
  
Note for FC14 users:  The default install should already have this enabled.
+
The remote desktop in GNOME can be enabled through Activities > System Settings > Sharing.  Turn on ''Screen Sharing'' and ''Allow Remote Control'' through the attached network device. It is '''strongly''' recommended that a secure password is set.
  
====Refresh-packagekit====
+
==Fedora setup==
 +
The next section will require you to be logged in as the mythtv user.
  
You may see this listed as one of the loaded plugins when you run yum. It is installed through 'PackageKit-yum-plugin' as part of the PackageKit group of programs. It is this package (I think!) which allows you to click on an rpm package on a web-page and install it directly.
+
===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.
  
====Yum Priorities====
+
{{Webpage|rpmfusion.org/Configuration|RPMFusion}} 
  
Optional: To prevent packages from the Fedora repositories from being overwritten by ones from secondary repositories, edit the /etc/yum.repos.d/fedora.repo and /etc/yum.repos.d/fedora-updates.repo files by adding a priority=1 line like below:
+
Note: You will need to download the packages rpmfusion-free-release and rpmfusion-nonfree-release under ''Firefox graphical installation'' and install with GNOME Software or rpm -ivh *.
  
[fedora]
+
Some 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 packagesThe '''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.
name=Fedora $releasever - $basearch
 
failovermethod=priority
 
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
 
  mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
 
enabled=1
 
gpgcheck=1
 
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
 
<b>priority=1</b>
 
  
Then, after configuring a secondary package repository (see next section), add this line to the new repo's configuration, giving it a lower (higher-numbered) value:
+
=====NVIDIA=====
priority=10
 
  
====Yumex====
+
We recommend you use a card that supports [[VDPAU]] for video acceleration.
  
yumex is a graphical version of yum.  Its advantage is that you may see the pacakges, select them, and read notes.
+
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>
yum install yumex
+
$ /sbin/lspci -nn | grep 'VGA'
 
</pre>
 
</pre>
  
===Configure package repositories===
+
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.
A very helpful guide is available here: [http://www.howtoforge.com/managing_packages_repositories_yum_yumex_fedora7 yum repositories on fedora.
 
  
Configuration of yum is needed to use ATrpms or RPMFusion package repositories. Both offer MythTV packages, but you must use either one or the other as they do not work together. ATrpms tends to be updated more frequently though. Pre-configured files can be downloaded and run from the desktop.  Follow the links below and install the RPMs for the latest version and correct architecture.
+
To install from the RPMFusion repository, run:
  
ATrpms
+
<pre>
    http://atrpms.net/install.html
+
# yum install kernel-devel akmod-nvidia
 +
</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.
  
RPMFusion
+
<pre>
  http://rpmfusion.org/Configuration
+
$ glxinfo | grep -i nvidia
 +
</pre>
  
Note: You will need to download the packages rpmfusion-free-release and rpmfusion-nonfree-release and install with rpm -ivh *.
+
Which should return an entry for the NVIDIA card.
  
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].
+
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 <tt>libdvdcss</tt> package from an alternative repository.  Please check if this is legal in your country.
  
Many MythTV installations require additional kernel modules to make all the hardware work. The ATrpms repository offers a package which downloads new kernel modules when the stock Fedora kernel is updated. You should wait a few days after the new kernel appears to update, giving the packagers time to create kernel module rpms. You can get this package with the following command
+
<pre>
 +
# yum localinstall http://rpm.livna.org/livna-release.rpm
 +
# yum install libdvdcss
 +
</pre>
  
 +
The <tt>libdvdcss</tt> package can also be installed by performing the following commands for 64 or 32 bit versions respectively:
 
<pre>
 
<pre>
# yum install yum-plugin-kmdl
+
# rpm -Uvh http://rpm.livna.org/repo/18/x86_64/libdvdcss-1.2.12-1.fc17.remi.x86_64.rpm
 +
or
 +
# rpm -Uvh http://rpm.livna.org/repo/18/i386/libdvdcss-1.2.12-1.fc17.remi.i686.rpm
 
</pre>
 
</pre>
  
''As with any other mailing list, please search their respective archives first.''
+
==Install MythTV==
 
 
====NVIDIA====
 
  
We recommend you use a card that supports VDPAU for video acceleration. See http://www.mythtv.org/wiki/VDPAU.
+
MythTV has numerous required dependencies to function correctly, which are automatically taken care of with one simple command:
 
 
You can install binary drivers from NVIDIA, but in most cases it's simpler to use yum to get and install them from ATrpms or RPM Fusion. It is essential to get the proper version of the drivers. Start by running
 
  
 
<pre>
 
<pre>
/sbin/lspci -nn | grep 'VGA\|NV'
+
# yum install mythtv
 
</pre>
 
</pre>
  
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 http://www.nvidia.com/object/IO_18897.htmlUnless 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.  
+
===SELinux===
 +
It is strongly recommended that SELinux is run in "enforcing" mode as set by defaultYou can choose the permissive mode which will only warn you of problems.
  
If you chose ATrpms as your repository, run:
+
Fedora 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 enforcing 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>
 +
$ /usr/sbin/setsebool -P httpd_can_connect_mythtv 1
 +
$ /usr/sbin/setsebool -P httpd_can_network_connect 1
 +
</pre>
 +
If you have followed the previous instructions and the MythTV recordings and videos are on a seperate drive and you wish to use MythWeb, then you will need to tell SELinux about this.  On the test machine the videos are mounted at <code>/mnt/sdb/Videos</code>.  The SELinux Troubleshooting tool gives errors that httpd wants to access these directories.  To allow httpd read permission:
 
<pre>
 
<pre>
yum install nvidia-graphics
+
$ chcon -R -t httpd_sys_content_t '/mnt/sdb/Videos*'
 +
$ semanage fcontext -a -t  httpd_sys_content_t '/mnt/sdb/Videos*'
 
</pre>
 
</pre>
  
If you need a legacy package from ATrpms look under your proper core version at http://atrpms.net/dist/.
+
===Install capture card drivers===
  
If you chose RPM Fusion as your repository, run:
+
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>
yum install kmod-nvidia
+
dmesg | grep -i dvb
 
</pre>
 
</pre>
 
+
If the firmware loading was successful you may notice a message similar to:
If you need a legacy package from RPM Fusion consult the available packages table at http://rpmfusion.org/.
 
 
 
<b>Note for FC12 Users</b>
 
 
 
Fedora 12 uses the nouveau driver by default and a copy of the driver is included in the initrd file used for booting. We have to avoid that. Before rebooting, edit (as root) /boot/grub/grub.conf to append the following to the end of the kernel line:
 
 
 
 
<pre>
 
<pre>
rdblacklist=nouveau vga=0x318
+
usb 1-6: dvb_usb_v2: 'Kworld UB499-2T T09' successfully initialized and connected
 
</pre>
 
</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>.
  
The first entry disables a driver that conflicts with nvidia, and the second allows the graphical boot screen to show.  Also run
+
An example output of this might be:
 
 
 
<pre>
 
<pre>
livna-config-display
+
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
 
</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].
  
To allow automatic switching of the X-server drivers. After installing the nvidia driver, if you run 'yum update' any new kernel installation will create its own initrd which does not contain the nouveau driver. Note that if you use nvidia's install package, you will have to re-install it on every kernel upgrade (you will see an error in Xorg.0.log saying 'No screens found')
+
===Configure remote control===
 
 
<b>Note for FC13 Users</b>
 
 
 
This thread may have useful information: http://forums.fedoraforum.org/showthread.php?t=204752  (You may need to add vmalloc=256m after the nouveau blacklist on the grub.conf kernel line.)
 
  
If X does not start, consider hitting <ctrl> <alt> <F2> to get to a login screen.
+
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.
 
 
Then use the following to see if the required components are loaded:
 
  
 
<pre>
 
<pre>
glxinfo
+
# yum install v4l-utils
 
+
</pre>
rpm -qa |grep nvidia
 
  
cat /etc/X11/xorg.conf
+
Once v4l-utils has successfully installed you can check to see what protocol and keymap that the current remote control has by runnning:
</pre>
 
  
To see if the nouveau blacklist worked try:
 
 
<pre>
 
<pre>
lsmod | grep nouveau
+
# ir-keytable
</pre>
 
To see if the nvidia driver loaded try:
 
<pre>
 
lsmod | grep nvidia
 
 
</pre>
 
</pre>
  
If glxinfo returns nothing.
+
This might give the following output (for a MCE-USB remote):
 
 
Try:
 
 
<pre>
 
<pre>
nvidia-config-display disable
+
[root@machinename]# ir-keytable
 
+
Found /sys/class/rc/rc0/ (/dev/input/event4) with:
nvidia-config-display enable
+
  Driver mceusb, table rc-rc6-mce
 +
  Supported protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC other
 +
  Enabled protocols: RC-6
 +
  ...
 
</pre>
 
</pre>
 +
In this instance the keymap being used is <tt>/lib/udev/rc_keymaps/rc6-mce</tt>.
  
Or try using nvidia settings:
+
To test the key mappings run the following command that will capture the input and button name of each keypress.
 
<pre>
 
<pre>
nvidia-settings
+
# ir-keytable -t
 
</pre>
 
</pre>
  
<b>Note for FC14 Users</b>
+
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 and re-load the keymap using:
 
 
Edit /boot/grub/grub.conf as root and add the following to the end of the kernel line before rebooting:
 
 
 
 
<pre>
 
<pre>
rdblacklist=nouveau vga=0x318 vmalloc=256M
+
# ir-keytable -c -w /lib/udev/rc_keymaps/<keymap name>
 
</pre>
 
</pre>
  
NOTE:  Depending on your hardware, you may not need to set the vmalloc amount.  However, many systems will need this, and it's easier to experiment with taking it out later if needed, ''after'' you know everything is working.  For more info see the link above in the FC13 section.
+
If your remote control does not exist in the kernel and you don't get any output in <tt>ir-keytable -t</tt> then you will have to install LIRC.
  
After rebooting with the new driver, if you're using GNOME, you may find your font size has shrunk to be almost unreadable.  To fix this, select System->Preferences->Appearance from the menus, choose the Fonts tab, click Advanced, then change the DPI to a larger value such as 96.
+
'''Note for rc6-mce''': at the top of the <tt>/lib/udev/rc_keymaps/rc6_mce</tt> keymap file the protocol is changed to RC6-MCE and this will need to be changed back to RC6 if an error regarding unsupported protocol occurs.
  
<b>Note for FC15 Users</b>
+
====Install LIRC====
  
These notes apply for kmod-nvidia. If you use FC15 and use nvidia-graphics, please update this wiki accordingly.
+
'''This LIRC instruction may well be outdated'''
  
Follow the steps above to install kmod-nvidia,  and ensure nouveau is not being used (with lsmod, above). You may need to manually run dracut as well to change your initramfs to keep nouveau from loading, more detail can be found on http://blog.bodhizazen.net/linux/how-to-install-the-nvidia-driver-on-fedora-15 and http://forums.fedoraforum.org/showthread.php?t=204752
+
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.
  
<i>Notes for Gnome 3 on FC15</i>
+
Check first if lirc is installed before proceeding below...(eg find / -name lircd)
 
 
You may find that you lose plymouth (graphical boot), and if Gnome 3 fails to properly load; you may find issues when you enter the GUI (hangs without fully loading, stops at splash, only mouse control after log in). One noted item from the fedoraforum post above tries to address a bug ( https://bugzilla.redhat.com/show_bug.cgi?id=694918 ) related to gnome-shell, it offers the advice of trying:
 
  
 
<pre>
 
<pre>
su
+
# yum install lirc
grep gnome-session-c /var/log/audit/audit.log | audit2allow -M nvidiaisbroken
 
semodule -i nvidiaisbroken.pp
 
 
</pre>
 
</pre>
  
If gnome still fails to load completely, you may attempt to force Gnome 3 fallback, discussed in the section "Is there a procedure to always use fallback mode?" @ http://fedoraproject.org/wiki/Features/Gnome3#Comments_and_Discussion
+
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.
 
 
Should the resolution settings not pass properly into the gnome display preferences, configure your video settings in an x session (e.g. gnome terminal) by running:
 
  
 +
==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 MariaDB 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.
 +
Start by enabling automatic load at boot and start the database:
 +
<pre>
 +
# systemctl enable mariadb.service
 +
# systemctl restart mariadb.service
 +
</pre>
 +
Then to setup the database:
 +
<pre>
 +
$ mysql_secure_installation
 +
</pre>
 +
Set the MariaDB root password when prompted and accept all the defaults by pressing enter.  Now we can create the MythTV database (called mythconverg) to get us started:
 
<pre>
 
<pre>
nvidia-settings
+
$ 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.
  
===Sound setup===
+
The above command gives users access to the database (see the main documentation) with the  
 
 
Fedora uses PulseAudio by default, as do many Linux distributions. MythTV does work with Pulseaudio, however, if you wish to remove it, you can run the following command to revert to using ALSA only.
 
 
 
 
<pre>
 
<pre>
yum remove alsa-plugins-pulseaudio
+
/usr/bin/mysql -u root -p mythconverg
 +
mysql> GRANT ALL ON mythconverg.* TO mythtv@"%" identified by  "mythtv";
 +
mysql> flush privileges;
 
</pre>
 
</pre>
  
'''Note for FC 13 Users'''
+
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.  
 
 
You may have sound by using the test feature found in
 
the GUI gnome-volume-control, yet none while running Mythtv.
 
Consider using the solution found in this bug report
 
 
 
http://svn.mythtv.org/trac/ticket/7645
 
 
 
  
Alternatively, if you have pulse, try
+
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>
Audio output Device ALSA:pulse  or ALSA:front
+
$ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
 
</pre>
 
</pre>
  
in "Setup" "General" in the frontend.
+
==Pre-launch 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?
===Install MythTV===
 
 
 
Now, here's why we '''really''' like yum&hellip; MythTV has numerous required dependencies to function correctly, which are automatically taken care of with one simple command, using either repository:
 
  
 
<pre>
 
<pre>
# yum install mythtv
+
$ ls /dev/dvb*
 
</pre>
 
</pre>
 
+
Which should return (or similiar if successful):
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 ATrpms and Freshrpms to fulfill all requirements.
 
 
 
 
 
Note for Fedora ...
 
 
 
ATrpms may have a dependency issue that requires removing python-imaging that was installed by default with the distro. After removing python-imaging, mythtv should install smoothly.  This does not appear to affect FC14 but may be an issue in older versions.
 
 
 
==Setting up drivers/Modules==
 
===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.
 
 
 
Note for FC14 users:  Fedora may also automatically detect and install the needed firmware for some TV cards (e.g. Hauppauge HVR-1600).  If this occurs you will see a balloon in the top-right corner shortly after login, asking you to install needed firmware for devices.  You can click the link in the balloon to complete the installation, or install the firmware manually.
 
 
 
===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.
 
 
 
Check first if lirc is installed before proceeding below...(eg find / -name lircd)
 
 
 
 
<pre>
 
<pre>
# yum install lirc
+
adapter0 adapter1
 
</pre>
 
</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 using <tt>dmesg | grep -i dvb</tt>), 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.
  
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. Some examples of the lircrc file can be found under /usr/share/doc/mythtv-$VERSION/
+
==Setup MythTV==
  
 +
To launch the MythTV setup utility search for <tt>mythtv</tt> in the Activities overview.  You should be presented with a graphical interface and you may be required to update the database schema.  Now we will move onto assigning the tuners, channels and storage directories.
  
===Update Fedora===
+
===1. General===
To get your system fully updated, simply run the command:
+
In General settings, set the local and master backend IP address to the local IP address of your machine for a combined frontend / backend.  On the test machine this was 192.168.0.2 (may be different for you).  Set your ''channel frequency table'' in the next page and continue to scroll through until you have reached '''Finished'''.
  
  '''#''' yum update
+
===2. Capture cards===
 +
In order for MythTV to record a stream, you must firstly setup the capture devices. This is under '''2. Capture Cards'''.  Select the card type (DVB-T/S/C for terrestial) and make sure the DVB device is recognised correctly and select '''Finish'''.  Do this for each available capture device.  At this stage you can also set each recording device to record multiple channels per [[Record_multiple_channels_from_one_multiplex|multiplex]] (DVB) by Recording Options > Max Recordings: and set to 3 (from a value of 2).
  
When you see the '''Transaction Summary''', you will need to press "y" to begin downloading the packages.
+
===4. Video sources===
 +
Once the capture devices have been created successfully and you have decided between SchedulesDirect or using EIT to schedule recordings, a video source is required.  Create a video source under '''4. Video sources''' and give it a name (e.g. vidSrc0) and enter in your SchedulesDirect details or use EIT under ''Listings Grabber'' and accept the remaining defaults.
  
Transaction Summary
+
===5. Input connections===
=============================================================================
 
Install      20 Package(s)
 
Update      79 Package(s)
 
Remove      0 Package(s)
 
Total download size: 902 M
 
Is this ok [y/N]: '''y'''
 
  
Since this is your first upgrade, you will also need to import the GPG key when promptedYou should only need to do this once.
+
In the next section '''5. Input Connections''' assign each capture device a display name (adapterX) and a video source.  Then select '''Scan for channels''' and ensure the country and scan type (TV or TV+Radio) is correct and select '''Next'''.  The selected capture device will now scan for available channels.  Once complete, a summary of the channels is given, select '''Insert All''' and '''Finish'''.   
  
  Retrieving GPG key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
+
In many parts of the world the program guide data is transmitted free over the air and is used by MythTV to schedule recordings and provide program information (EIT). However if you are in the US, you will may need a paid account with [http://www.schedulesdirect.org schedulesdirect]. The current pricing is $25US per year (current at November 2014). This will give you television feed data that your Mythbox uses for scheduling once you have localized your account to your zip code, chosen a content provider service and then set your channels from the web page.
Importing GPG key 0x4F2A6FD2 "Fedora Project <fedora@redhat.com>"
 
Is this ok [y/N]: '''y'''
 
Key imported successfully
 
  
===Kernel upgrades===
+
===6. Channel Editor===
*'''Note:''' Fedora is shipped with a specific kernel, over time bugs are discovered and corrected in new versions.  If possible update your kernel to the newest one.
 
  
Among the packages upgraded just a minute ago with yum should be your kernel, to the very latest errata release. 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 January 2010, ''2.6.31.12-174.2.3.fc12.i686'' is the latest released kernel. You should be using the latest released kernel available for your distribution.
+
There may be duplicate channels that can be removed safely and allows for less clutter for the backend to deal with when scheduling. In '''6. Channel Editor''' the duplicate channels can be deleted using key <tt>d</tt> and further additions to channels / transports can be done if desired. There may be icons available for you to download using <tt>Download icons</tt> option.
  
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 it is 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
+
===7. Storage directories===
  
==Setup MySQL==
+
The storage directories can be configured in '''7. Storage Directories'''.  Those using a dedicated /video partition as per the previous recommendation, you 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.  Just make sure your mythtv user has permission to read and write to whatever location you choose.
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>
+
==Mythbackend startup==
# /sbin/chkconfig mysqld on
 
# /sbin/service mysqld start
 
</pre>
 
  
Set the MySQL root password.
+
It is highly recommended that you go through the above 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] where required.
  
 +
Once you've gone through the setup, you have to populate the MythTV database with some program info. 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 and we'll set it to autostart later.  Enter the following command in a terminal:
 
<pre>
 
<pre>
mysql_secure_installation
+
$ mythbackend
 
</pre>
 
</pre>
  
Now we create the MythTV database (called mythconverg) to get us started:
+
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, in a new terminal window type:
  
 
<pre>
 
<pre>
$ mysql -u root -p < /usr/share/doc/mythtv-docs-0.22/database/mc.sql
+
$ mythfilldatabase
Enter password:
 
 
</pre>
 
</pre>
At this point, enter the password you just set above (ROOT_PWD) when prompted. Also note, "mythtv-0.22" refers to the version of MythTV you are have installed, in this case version 0.22.
 
  
Again, all subsequent database population for MythTV's add-on modules must now be done '''after''' running mythtvsetup at least one time. It's worth customizing some parameters in /etc/my.cnf for optimal performance with MythTV.  
+
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.
  
These adjustments to my.cnf under the [mysqld] section improve performance with both MythTV (especially in the GUI) and MythWeb:
+
'''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 the available options in '''mythtv-setup''', under '''1. General''' on the 10th page for further configuration.
  
<pre>
+
==Mythfrontend configuration==
key_buffer = 16M
 
table_cache = 128
 
sort_buffer_size = 2M
 
myisam_sort_buffer_size = 8M
 
query_cache_size = 16M
 
</pre>
 
  
==Does /dev/video* exist?==
+
Now start up the MythTV frontend.  It is recommended launching <tt>mythfrontend</tt> in a separate shell window, so you can distinctly see the output for the backend and frontend processes for debugging purposes. From a terminal:
Before going further it is wise to check whether things have worked so far. Has a /dev/video entry been created for an analog video source?
 
  
 
<pre>
 
<pre>
$ ls -la /dev/video*
+
$ mythfrontend
 
</pre>
 
</pre>
If not, either you have a digital tv tuner (in which case you will have some entries in /dev/dvb/, and you should be reading https://fedoraproject.org/wiki/DavidTimms/DVB), or you have an analog 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==
+
There are various options within mythfrontend that you can tweak relating to appearance, video, audio and scheduling of recordings.
Recall what your video device was set up as (likely /dev/video0 for analog video sources; if you have a digital tuner see: https://fedoraproject.org/wiki/DavidTimms/DVB). 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.
 
  
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 these are outside this document support scope and the lsitings are not as accurate or as reliable.
+
===Audio===
  
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:
+
To configure the audio go to Setup > Audio.  Choose the '''Audio output device''' that gives the current line output (e.g. HDMI). On the test computer this was <tt>ALSA:hdmi:CARD=NVidia,DEV=0</tt>.  Use the inbuilt '''Test''' function to see if MythTV is outputting sound to the correct device.  Select '''Next''' to choose the mixer properties.  If your remote control has volume buttons then MythTV can respond the volume changes when the '''Mixer device''' is set to '''software'''.
  
<pre>
+
===Video===
$ mythtv-setup
 
</pre>
 
  
I'm told that non-U.S. 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.
+
Likewise for the audio, the video can be configure under Setup > Video. If the captured streams are interlaced, then the [[Deinterlacing|choice]] of interlacer is critical to an enjoyable viewing experience. It is generally considered that nVidia with VDPAU has the most advanced deinterlacing methods (Advanced and Temporal) and these should be selected under Playback > Playback Profiles (3/8).  Here VDPAU / OpenGL / Normal settings can be tweaked along and rules set based on the source video resolution.  Advanced options are under Edit for each resolution rule.  Otherwise if your hardware is sufficient choose the YADIF filter.  Once tweaking is finished, select '''Next''' until you appear back in the menu.
  
Note: 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>
+
===Scheduling of recordings ===
  
 +
Recordings can be scheduled under Manage Recordings > Schedule Recordings > Program Guide.  A variety of rules can be set but it should be noted that recordings can conflict and the priority will determine which program will be recorded.  This can be checked in ''Upcoming recordings''.
  
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.
+
===Downloadable themes===
  
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:
+
MythTV frontend allows multiple themes to be added with ease provided you have an internet connection.  Under Setup > Theme Chooser you can select between the available themes as desired.
  
http://www.mythtv.org/docs/mythtv-HOWTO-9.html
+
==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:
  
'''Note:''' your system may appear to hang at step 3; give it time, it isn't locked up, that part just takes a while!
+
<pre>
 +
# systemctl enable mythbackend.service
 +
</pre>
  
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 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.
+
If the backend isn't already running, save yourself a reboot and issue this command:
  
 
<pre>
 
<pre>
$ mythbackend &
+
# systemctl restart mythbackend.service
 
</pre>
 
</pre>
  
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:
+
(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 (changing EN_AU to your langauge code):
 +
<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>
 
<pre>
$ mythfilldatabase
+
# mkdir -p /home/mythtv/scripts
 +
# gedit /home/mythtv/scripts/autoLaunchFrontend.sh
 
</pre>
 
</pre>
 +
And copy and paste the following text into the file.  This script will wait 10 seconds before launching the frontend.
 +
<pre>
 +
#!/bin/bash
  
If you're using a guide data source other than SchedulesDirect (i.e., anyone outside the U.S. and Canada), 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.
+
# Autolaunch script for MythTV Frontend
 
 
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)...
 
  
 +
sleep 10s
 +
mythfrontend
 +
</pre>
 +
Change the permissions to an executable with:
 
<pre>
 
<pre>
$ mythfrontend
+
# chmod +x /home/mythtv/scripts/autoLaunchFrontend.sh
 
</pre>
 
</pre>
 +
Reboot to test the autostart scripts are working.
  
There are various options within mythfrontend that you can tweak...a lot of this is covered by other parts of the wiki.
+
=MythExit=
  
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.
+
We're done!
  
==Configure startup==
+
This should be the entire guide required to get MythTV installed and operational on Fedora.  If you have any feedback or a request additonal explanations, post in the discussion panel or jump in and add it yourself!  Don't forget to checkout the troubleshooting section and the enhancements to get the best out of your Mythbox.
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>
+
=Troubleshooting=
# /sbin/chkconfig mythbackend on
 
</pre>
 
  
If the backend isn't already running, save yourself a reboot and issue this command:
+
==SELinux==
  
 +
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 allow access to the libraries with the following command:
 
<pre>
 
<pre>
# /sbin/service mythbackend start
+
# chcon -t texrel_shlib_t /usr/lib/libmyth*.so*
 
</pre>
 
</pre>
  
 +
==Tuners do not load on boot==
  
You can list which scripts are started by issuing the command:
+
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>
 
<pre>
# chkconfig --list
+
# systemctl stop mythbackend.service
 +
$ mythbackend
 
</pre>
 
</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).
It might be worthwhile to kill a number of scripts that you not used. Each script in /etc/init.d contains a short explanation of what they do. You can prevent the scripts from starting by issuing the command:
 
 
 
 
<pre>
 
<pre>
# chkconfig --del <name>
+
[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
 +
# Uncomment below if running mythweb and comment the above
 +
# Wants=httpd.service 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 599: Line 557:
 
</pre>
 
</pre>
  
 +
=Enhancements=
  
==Fedora Version Specific Tips==
+
==Space saving==
 +
Since most Mythboxes would not be used as a general workstation some packages can be removed with relative certainty.  A big ticket item is the Libreoffice suite and the removal of this should make for much smaller updates.
 +
<pre>
 +
# yum remove libreoffice*
 +
</pre>
  
===Fedora 12/13===
+
==MariaDB performance==
  
If analog sound doesn't work, try changing the audio device to ALSA:front, and change the ALSA:default mixer to control the Master control rather than PCM.
+
These adjustments to <tt>/etc/my.cnf</tt> under the [mysqld] section improve performance with both MythTV (especially in the GUI) and MythWeb:
  
 +
<pre>
 +
key_buffer = 16M
 +
table_cache = 128
 +
sort_buffer_size = 2M
 +
myisam_sort_buffer_size = 8M
 +
query_cache_size = 16M
 +
</pre>
  
 +
==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
 +
<pre>
 +
# yum install powertop tlp
 +
</pre>
 +
And start <tt>tlp</tt> with:
 +
<pre>
 +
# tlp start
 +
</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:
 +
<pre>
 +
# powertop
 +
</pre>
 +
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 in <tt>/etc/default/tlp</tt> (assuming the hardware you have is recent).
  
[[Category:Distribution_Specific_Install_Guides]]
+
 
[[Category:Fedora]]
+
[[Category:Software Installation|1200]]

Latest revision as of 16:05, 4 August 2017


This "How-To" guide is for installing MythTV on Fedora 21.

Introduction

This wiki entry will detail the installation of a combined frontend and backend in Fedora 21. Ensure you have met the hardware requirements.

Fedora provides updates for a release until two releases after that. At the time of this writing, the current release is Fedora 21, which means support for Fedora 21 - 2 becomes discontinued a month after Fedora 21 is 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

Download.png - Fedora download page

Note that the Workstation 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 21 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 - Workstation. 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. A partition setup example is given in the Table below.

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.

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

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 Mythbox (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 located if the address changes.

Firewall

Note that since Fedora 21 Workstation the firewall application has been removed for ease of use. The VNC ports are open on this machine by default. It can be installed by

# yum install firewall-config

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.

Autologin and display timeout

You can choose to have GNOME autologin in the mythtv user on boot so that the mythfrontend can automatically load. To set this behaviour go to Activities > Users. Unlock the user panel with the administrator password and slide the Automatic Login to the on position.

The screen timeout will also cause problems when using MythTV. You can set the display to not turn off by going to Activities > Power and setting the blank screen option to never. Be sure not to leave the display on with this option as it can cause issues with the display panel (burn in etc).

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 (e.g., HDMI) in Activities > Sound.

Remote desktop

The remote desktop in GNOME can be enabled through Activities > System Settings > Sharing. Turn on Screen Sharing and Allow Remote Control through the attached network device. It is strongly recommended that a secure password is set.

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.

Webpage.png - RPMFusion

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

Some 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.

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

The libdvdcss package can also be installed by performing the following commands for 64 or 32 bit versions respectively:

# rpm -Uvh http://rpm.livna.org/repo/18/x86_64/libdvdcss-1.2.12-1.fc17.remi.x86_64.rpm
or
# rpm -Uvh http://rpm.livna.org/repo/18/i386/libdvdcss-1.2.12-1.fc17.remi.i686.rpm

Install MythTV

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

# yum install mythtv

SELinux

It is strongly recommended that SELinux is run in "enforcing" mode as set by default. You can choose the permissive mode which will only warn you of problems.

Fedora comes with the excellent setroubleshoot tool which will notify of denials whilst permitting you to leave SELinux enabled on your system. Audit2allow in enforcing 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_connect_mythtv 1
 $ /usr/sbin/setsebool -P httpd_can_network_connect 1

If you have followed the previous instructions and the MythTV recordings and videos are on a seperate drive and you wish to use MythWeb, then you will need to tell SELinux about this. On the test machine the videos are mounted at /mnt/sdb/Videos. The SELinux Troubleshooting tool gives errors that httpd wants to access these directories. To allow httpd read permission:

 $ chcon -R -t httpd_sys_content_t '/mnt/sdb/Videos*'
 $ semanage fcontext -a -t  httpd_sys_content_t '/mnt/sdb/Videos*'

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.

Configure 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 check to see what protocol and keymap that the current remote control has by runnning:

# ir-keytable

This might give the following output (for a MCE-USB remote):

[root@machinename]# ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event4) with:
  Driver mceusb, table rc-rc6-mce
  Supported protocols: NEC RC-5 RC-6 JVC SONY SANYO LIRC other
  Enabled protocols: RC-6
  ...

In this instance the keymap being used is /lib/udev/rc_keymaps/rc6-mce.

To test the key mappings run the following command that will 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 and re-load the keymap using:

# ir-keytable -c -w /lib/udev/rc_keymaps/<keymap name>

If your remote control does not exist in the kernel and you don't get any output in ir-keytable -t then you will have to install LIRC.

Note for rc6-mce: at the top of the /lib/udev/rc_keymaps/rc6_mce keymap file the protocol is changed to RC6-MCE and this will need to be changed back to RC6 if an error regarding unsupported protocol occurs.

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 MariaDB 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. Start by enabling automatic load at boot and start the database:

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

Then to setup the database:

$ mysql_secure_installation

Set the MariaDB root password when prompted and accept all the defaults by pressing enter. Now we can 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

/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

Pre-launch 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*

Which should return (or similiar if successful):

adapter0 adapter1

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 using dmesg | grep -i dvb), 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

To launch the MythTV setup utility search for mythtv in the Activities overview. You should be presented with a graphical interface and you may be required to update the database schema. Now we will move onto assigning the tuners, channels and storage directories.

1. General

In General settings, set the local and master backend IP address to the local IP address of your machine for a combined frontend / backend. On the test machine this was 192.168.0.2 (may be different for you). Set your channel frequency table in the next page and continue to scroll through until you have reached Finished.

2. Capture cards

In order for MythTV to record a stream, you must firstly setup the capture devices. This is under 2. Capture Cards. Select the card type (DVB-T/S/C for terrestial) and make sure the DVB device is recognised correctly and select Finish. Do this for each available capture device. At this stage you can also set each recording device to record multiple channels per multiplex (DVB) by Recording Options > Max Recordings: and set to 3 (from a value of 2).

4. Video sources

Once the capture devices have been created successfully and you have decided between SchedulesDirect or using EIT to schedule recordings, a video source is required. Create a video source under 4. Video sources and give it a name (e.g. vidSrc0) and enter in your SchedulesDirect details or use EIT under Listings Grabber and accept the remaining defaults.

5. Input connections

In the next section 5. Input Connections assign each capture device a display name (adapterX) and a video source. Then select Scan for channels and ensure the country and scan type (TV or TV+Radio) is correct and select Next. The selected capture device will now scan for available channels. Once complete, a summary of the channels is given, select Insert All and Finish.

In many parts of the world the program guide data is transmitted free over the air and is used by MythTV to schedule recordings and provide program information (EIT). However if you are in the US, you will may need a paid account with schedulesdirect. The current pricing is $25US per year (current at November 2014). This will give you television feed data that your Mythbox uses for scheduling once you have localized your account to your zip code, chosen a content provider service and then set your channels from the web page.

6. Channel Editor

There may be duplicate channels that can be removed safely and allows for less clutter for the backend to deal with when scheduling. In 6. Channel Editor the duplicate channels can be deleted using key d and further additions to channels / transports can be done if desired. There may be icons available for you to download using Download icons option.

7. Storage directories

The storage directories can be configured in 7. Storage Directories. Those using a dedicated /video partition as per the previous recommendation, you 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. Just make sure your mythtv user has permission to read and write to whatever location you choose.

Mythbackend startup

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

Once you've gone through the setup, you have to populate the MythTV database with some program info. 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 and we'll set it to autostart later. Enter the following command in a terminal:

$ 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, in a new terminal window type:

$ 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.

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 the available options in mythtv-setup, under 1. General on the 10th page for further configuration.

Mythfrontend configuration

Now start up the MythTV frontend. It is recommended launching mythfrontend in a separate shell window, so you can distinctly see the output for the backend and frontend processes for debugging purposes. From a terminal:

$ mythfrontend

There are various options within mythfrontend that you can tweak relating to appearance, video, audio and scheduling of recordings.

Audio

To configure the audio go to Setup > Audio. Choose the Audio output device that gives the current line output (e.g. HDMI). On the test computer this was ALSA:hdmi:CARD=NVidia,DEV=0. Use the inbuilt Test function to see if MythTV is outputting sound to the correct device. Select Next to choose the mixer properties. If your remote control has volume buttons then MythTV can respond the volume changes when the Mixer device is set to software.

Video

Likewise for the audio, the video can be configure under Setup > Video. If the captured streams are interlaced, then the choice of interlacer is critical to an enjoyable viewing experience. It is generally considered that nVidia with VDPAU has the most advanced deinterlacing methods (Advanced and Temporal) and these should be selected under Playback > Playback Profiles (3/8). Here VDPAU / OpenGL / Normal settings can be tweaked along and rules set based on the source video resolution. Advanced options are under Edit for each resolution rule. Otherwise if your hardware is sufficient choose the YADIF filter. Once tweaking is finished, select Next until you appear back in the menu.

Scheduling of recordings

Recordings can be scheduled under Manage Recordings > Schedule Recordings > Program Guide. A variety of rules can be set but it should be noted that recordings can conflict and the priority will determine which program will be recorded. This can be checked in Upcoming recordings.

Downloadable themes

MythTV frontend allows multiple themes to be added with ease provided you have an internet connection. Under Setup > Theme Chooser you can select between the available themes as desired.

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 (changing EN_AU to your langauge code):

[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.

MythExit

We're done!

This should be the entire guide required to get MythTV installed and operational on Fedora. If you have any feedback or a request additonal explanations, post in the discussion panel or jump in and add it yourself! Don't forget to checkout the troubleshooting section and the enhancements to get the best out of your Mythbox.

Troubleshooting

SELinux

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 allow access to the libraries with the following command:

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

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
# Uncomment below if running mythweb and comment the above
# Wants=httpd.service 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

Space saving

Since most Mythboxes would not be used as a general workstation some packages can be removed with relative certainty. A big ticket item is the Libreoffice suite and the removal of this should make for much smaller updates.

# yum remove libreoffice*

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 in /etc/default/tlp (assuming the hardware you have is recent).