MythTV

From SME Server
Jump to navigation Jump to search

MythTV Backend

  Warning:
As SME Server is designed as a secure system using minimal resources it does not contain a window manager like X. You should only run the backend of MythTV on your SME Server. You should watch TV on other workstations on your network.



Description

MythTV is a GPL licensed suite of programs that allow you to build the mythical home media convergence box on your own using Open Source software and operating systems.

HowTo backgrounds

A number of people have been struggling with this so I thought I would start to document what I did to get this working. It is cumbersome but do-able. I also strongly suggest you also use the sme server as a backend and don't implement the frontend on it as i have little confidence in the security of it.

I would suggest moderate and more expert users check this out first to see if I have some errors or holes. If it's close then we can update the wiki. I just didn't want to muck it up before some sanity was applied. In particular, I would like to see if there is any minimization we can do say by removing unnecessary steps or packages.

I had to draw on many sources including: Duncan's how-to (link currently dead); the contrib wiki; mythtv.org (and it's wiki); knoppmythwiki.org; and many more that I have forgotten.

Here goes and good luck.

(Thanks to Christian for this HowTo)

Please add your success/failure stories at the end of this HowTo.

Configure necessary repositories

To be able to install MythTV on SME Server you need to configure the ATrpms and the Dag repository as shown below.

ATrpms

The following command will configure the ATrpms repository on SME Server. ATrpms After adding it to the database we have to update the changes to the configuration file:

signal-event yum-modify

Dag

The following command will configure the Dag repository on SME Server. EDIT NOT COMPLETE!


To create an entry in the database for the epel repository we open put the following commands in a terminal window or in a shell window:

/sbin/e-smith/db yum_repositories set epel repository \

Name 'SME Server - epel' \
BaseURL 'http://<http://download.fedoraproject.org/pub/epel/7/$basearch' \
EnableGroups yes \
GPGCheck yes \
Visible no \
status disabled

To enable the changes:

    signal-event yum-modify

Just to be sure, give yum a fresh start:

    yum clean all

After adding it to the database we have to update the changes to the configuration file:

signal-event yum-modify

Installation

You will likely need the following (based on Duncan's How to). I know some are needed but have not confirmed if all are needed.I suspect some of it is only needed if you wish to load up the myth source and use their "config" tool.

Dependencies

As SME Server does not have all software installed for MythTV we need to install some dependencies:

yum install gcc-c++ qt qt-MySQL qt-devel ncurses-devel python-devel zlib-devel dialog subversion
signal-event post-upgrade; signal-event reboot

MythTV packages

  Note:
The exact kernel version used is depending on the processor(s). Multiple or HT processors will use the SMP kernel by default, otherwise the non SMP (.EL) kernel is being used.

Entering 'uname -r' on the console will tell you the exact kernel you are currently running, and using it with the yum command will make it easy to prevent typos and using the correct kernel version used by your machine. The ` sign in the below code is the one as on the ~ key, below the 'esc' key.


yum install mythweb mythtv-setup mythtv-frontend --enablerepo=atrpms --enablerepo=dag 

To you use a analogue Hauppauge PVR based card you should also install the ivtv packages so your card gets recognized and loaded:

yum install ivtv ivtv-kmdl-`uname -r` --enablerepo=atrpms

To be sure that the drivers are loaded and to not leave SME Server in a unknown state issue the following command:

signal-event post-upgrade; signal-event reboot

MySQL

You will need to set up MySQL. The required mc.sql file is located in the documentation of MythTV. The easiest way to retrieve this is by issuing this command:

yum install mythtv-docs --enablerepo=atrpms 

This should normally install the mc.sql file that holds the database layout in /usr/share/doc/mythtv-docs-$version/database/

To load the database into MySQL import the dump file into MySQL, for the 0.20.2 version this would read:

mysql < /usr/share/doc/mythtv-docs-0.20.2/database/mc.sql

Now grant access to your box and remote front ends within subnet 192.168.1 (change to suit you) to access mysql

mysql -e "grant all on mythconverg.* to mythtv@'192.168.1.%' identified by 'mythtv'"
mysql -e "flush privileges"
/sbin/e-smith/config setprop mysqld LocalNetworkingOnly no
/sbin/e-smith/expand-template /etc/my.cnf
service mysqld restart

From the shell window of your front end, verify that the access worked:

mysql -h smeserveraddress -u mythtv -pmythtv mythconverg
  Note:
The address of your SME Server in above command should be either the IP address, 'localhost' or the full qualified domain name (FQDN) of your server.


If you have no error then quit. If you do then it is likely a permission or grant error to be resolved.

X11 Forwarding

You need to set up X11 forwarding to another machine (I targeted a CentOS release running on a virtual machine (VirtualBox) on my XP Home machine.

X11 Forwarding is described in the X11 Forwarding on SME section of this wiki.

If you would like to view the X111 output of your SME Server on another linux machine (which has X running) and do:

ssh -X root@smeserveraddress /usr/bin/mythtv-setup

and follow the instructions to set up your environment for the backend.

Startup mythtv

  • modprobe ivtv (check 'dmesg' for any errors. See this example of a correctly loaded PVR-350)
  • 'mythbackend -d' on the console will start mythbackend as a deamon
  • Make it all automagically at boot time
  • Make tv listings (mythfilldatabase) automagically

Installing Mythweb in an Ibay

(taken from the forums mainly donated by Duncan)

  • Create an Ibay (e.g. tvoverview, own admin, read everyone, enable html, access localnetwork without pass) Use any Ibay name you want, just make sure you use it througout the config consistantly. Also make sure you secure access to the Ibay either by SME Server default mechanism (password) or by using htaccess passwords.
  • Create custom template
# mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
# cd /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
# pico 99mythweb 

and paste following code into the template:

<Directory /home/e-smith/files/ibays/tvoverview/html>
    php_admin_flag      allow_url_fopen on
</Directory>
  • Allow .htaccess
# /sbin/e-smith/db accounts setprop tvoverview AllowOverride All
# /sbin/e-smith/signal-event ibay-modify tvoverview 
  • edit the mythweb .htaccess file and add
Options FollowSymlinks

and adjust the below variables to the right values valid for your mysql setup:

setenv db_server        "127.0.0.1"
setenv db_name          "mythconverg"
setenv db_login         "mythtv"
setenv db_password      "mythtv"

Towards the bottom of the file where it says "RewriteEngine on". Whilst in this file uncomment the line and make it look like:

RewriteBase    /tvoverview

Now access http://yourserver/tvoverview and you should be up and running.

Known problems

When you encounter the following error: 'Client does not support authentication protocol requested by server; consider upgrading MySQL client' then you need to set the above mysql user password 'old' style. When connecting to the server with a pre-4.1 client program, use an account that still has a pre-4.1-style password. To do this, enter the following on the console:

mysql> SET PASSWORD FOR
   -> mythtv@localhost = OLD_PASSWORD('mythtv');

where user and password are the same as used with the 'grant' command. '/usr/bin/mythtv-setup' should start fine now.

MythTV Frontend

One of the easiest to install frontends for MythTV is KnoppMyth as there seems to be good support including HowTo's to link things together. For instruction on how to install Knoppmyth have a look at this HowTo.

User experience

  • Tested with SME Server 7.3 - Works

Note I had to install the ivtv-kmdl separately as the non-smp won't install if you are running in smp. I believe smp is the default for sme server.

I decided to use Knoppmyth as my front ends as there seems to be good support including HOW-To's to link things together.

Install Knoppmyth from "http://www.knoppmythwiki.org/?id=KnoppmythDownloads" onto a front end PC.

Follow this HOW TO http://www.knoppmythwiki.org/index.php?page=FrontendOnlyInstall

I would also recommend defining a common file structure for your frontends and backends. I used the SME as my common file store. In theory, the next version of myth will allow you to more easily share directories but for now you will need to follow the following HOW-TO's

However, you won't have much joy using NFS (per their suggestion) and rather than samba you may wish to consider using sshfs as described in: http://ubuntu.wordpress.com/2005/10/28/how-to-mount-a-remote-ssh-filesystem-using-sshfs/ After you make your mounts, adjust your directory structure in the myth frontend to suit your mount structure. - Christian 10:44, 2 December (MST)


old page contents

  Incomplete:
This article or section needs to be expanded. Please help to fill the gaps or discuss the issue on the talk page



MythTV is a GPL licensed suite of programs that allow you to build the mythical home media convergence box on your own using Open Source software and operating systems.

MythTV has a number of capabilities. See the MythTV website for details

http://www.mythtv.org/modules.php?name=MythFeatures
http://www.mythtv.org/docs/mythtv-HOWTO-1.html#ss1.1

A new how-to has been posted MythTV-HowTo here

Requirements

  Warning:
As SME Server is designed as a secure system using minimal resources it does not contain a window manager like X. You should only run the backend of MythTV on your SME Server, You watch TV on other workstations on your network.


Hardware requirements
http://www.mythtv.org/docs/mythtv-HOWTO-3.html


Installation

There are a list of required rpms here, http://forums.contribs.org/index.php?topic=38591.msg175160#msg175160

Here are the mythtv/ivtv packages I've got installed on my smeserver (from atrpms).

  • libmyth-0.20.2_0-0.20.2-165.el4
  • libmythavcodec-0.20.2_0-0.20.2-165.el4
  • libmythavformat-0.20.2_0-0.20.2-165.el4
  • libmythavutil-0.20.2_0-0.20.2-165.el4
  • libmythfreemheg-0.20.2_0-0.20.2-165.el4
  • libmythlivemedia-0.20.2_0-0.20.2-165.el4
  • libmythtv-0.20.2_0-0.20.2-165.el4
  • libmythui-0.20.2_0-0.20.2-165.el4
  • libmythupnp-0.20.2_0-0.20.2-165.el4
  • myththemes-0.20.2-114
  • mythtv-backend-0.20.2-165.el4
  • mythtv-frontend-0.20.2-165.el4
  • mythtv-setup-0.20.2-165.el4
  • mythtv-themes-0.20.2-165.el4
  • mythweb-0.20.2-165.el4
  • ivtv-0.4.10-114.el4
  • ivtv-firmware-20070217-13.at
  • ivtv-kmdl-2.6.9-55.0.6.EL-0.4.10-114.el4
  • ivtv-kmdl-2.6.9-55.0.6.ELsmp-0.4.10-114.el4
  • perl-Video-ivtv-0.13-8.el4.at

If I remember correctly I needed the frontend package in order to load some of the graphical libraries needed to run mythtvsetup. Beyond installing the above (plus dependencies) I enabled X11 forwarding and configured the system from one of the remote frontends.

Usage

Refer to MythTV Documentation ?
Explain a little about setting up the Frontend ?


Other SME/Mythtv resources