
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.sabayonlinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Setup_Mythtv&amp;feed=atom&amp;action=history</id>
		<title>HOWTO: Setup Mythtv - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Setup_Mythtv&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Setup_Mythtv&amp;action=history"/>
		<updated>2013-05-22T23:52:55Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.4</generator>

	<entry>
		<id>http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Setup_Mythtv&amp;diff=8497&amp;oldid=prev</id>
		<title>Joost at 05:34, 7 June 2010</title>
		<link rel="alternate" type="text/html" href="http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Setup_Mythtv&amp;diff=8497&amp;oldid=prev"/>
				<updated>2010-06-07T05:34:54Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Warning| '''This article uses Portage. Do not proceed if you have no idea what Portage is.'''}}&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
These instructions assume you are root, if you are not, su to root, or research the sudo package.&lt;br /&gt;
&lt;br /&gt;
As always with Gentoo, make sure portage is synced (but only if it's been more then 24 hours from the last time you synced. Please be nice to the rsync servers!):&lt;br /&gt;
 emerge --sync&lt;br /&gt;
&lt;br /&gt;
{{Warning| '''This article is outdated, Qt3 is not in Portage anymore.'''}}&lt;br /&gt;
&lt;br /&gt;
First we need to make sure QT-3 was compiled with MySQL support:&lt;br /&gt;
 emerge -pv =x11-libs/qt-3*&lt;br /&gt;
&lt;br /&gt;
If you see -mysql on the line, we need to add MySQL (and other handy flags) support to qt:&lt;br /&gt;
 echo &amp;quot;x11-libs/qt mysql opengl&amp;quot; &amp;gt;&amp;gt; /etc/portage/package.use&lt;br /&gt;
&lt;br /&gt;
emerge -1 tells it to re-emerge qt without touching the world file, so it won't change anything, just rebuild itself in place:&lt;br /&gt;
 emerge -1 =x11-libs/qt-3*&lt;br /&gt;
&lt;br /&gt;
When you just installed Qt for the first time, don't forget to update your environment, otherwise you could run into compiler errors with MythTV:&lt;br /&gt;
 env-update &amp;amp;&amp;amp; source /etc/profile&lt;br /&gt;
&lt;br /&gt;
We should now take a look at the MythTV flags:&lt;br /&gt;
 emerge -pv --nodeps mythtv&lt;br /&gt;
&lt;br /&gt;
You will likely want to add some support, I recommend&lt;br /&gt;
 echo &amp;quot;media-tv/mythtv alsa opengl vorbis dvb dvd ieee1394 lirc mmx xvmc xv&amp;quot; &amp;gt;&amp;gt; /etc/portage/package.use&lt;br /&gt;
&lt;br /&gt;
This will build myth with all of the common features.&lt;br /&gt;
&lt;br /&gt;
if you don't already have VIDEO_CARDS set in your /etc/make.conf, you might want to set that, as newer X.Org versions have moved to that style.&lt;br /&gt;
&lt;br /&gt;
We now emerge MythTV:&lt;br /&gt;
 emerge -av mythtv&lt;br /&gt;
&lt;br /&gt;
Compiling MythTV will take a fairly long time, even on a fast machine. Probably about the same time it takes for QT to compile.&lt;br /&gt;
&lt;br /&gt;
Before we emerge xmltv we have to emerge some dependencies:&lt;br /&gt;
 emerge perl-tk&lt;br /&gt;
&lt;br /&gt;
After that we need Term::ReadKey perl module:&lt;br /&gt;
 emerge TermReadKey&lt;br /&gt;
&lt;br /&gt;
You may now need to install XMLTV to retrieve TV listings over the Internet:&lt;br /&gt;
 emerge -av xmltv&lt;br /&gt;
(MythTV users from [[XMLTV|outside the US or Canada, learn how to configure XMLTV to get a localized guide]]).&lt;br /&gt;
&lt;br /&gt;
MythTV should now be installed and ready to configure.&lt;br /&gt;
&lt;br /&gt;
===Setting up the initial database===&lt;br /&gt;
&lt;br /&gt;
This step is only required on the system maintaining the database, which may or may not be one of your MythTV boxes. If the database is on a non-MythTV machine you'll need to copy the mc.sql file to it. &lt;br /&gt;
 emerge mysql&lt;br /&gt;
&lt;br /&gt;
Run the initial setup:&lt;br /&gt;
 /usr/bin/mysql_install_db &lt;br /&gt;
&lt;br /&gt;
Start the MySQL server and add mysql to the default runlevel.&lt;br /&gt;
 /etc/init.d/mysql start&lt;br /&gt;
&lt;br /&gt;
Add it to startup &lt;br /&gt;
 rc-update add mysql default&lt;br /&gt;
&lt;br /&gt;
Set a root password:&lt;br /&gt;
 /usr/bin/mysqladmin -u root -h localhost password 'new-password' -p&lt;br /&gt;
&lt;br /&gt;
Now set up the database used by MythTV.&lt;br /&gt;
&lt;br /&gt;
 mysql -u root -p &amp;lt; /usr/share/mythtv/database/mc.sql&lt;br /&gt;
&lt;br /&gt;
This command tells the MySQL server to login as root (-u root) and ask for a password (-p: only use if you have set a password as recommended). Then, the commands listed in the file are executed. You can &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; the file to see what is in it.&lt;br /&gt;
&lt;br /&gt;
Also, note that MySQL keeps logs of all database transactions in /var/lib/mysql/.  Over the course of a few years, these can really add up.  It's useful to have these deleted after a small interval by adding the following to /etc/mysql/my.cnf under the section heading &amp;quot;[mysqld]&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 expire_logs_days                        = 7&lt;br /&gt;
&lt;br /&gt;
This will delete logs older than seven days.&lt;br /&gt;
&lt;br /&gt;
===mythbackend===&lt;br /&gt;
&lt;br /&gt;
Before running mythfilldatabase below you will need to start the backend server. If you don't, you won't be able to watch TV and will get errors like &amp;quot;Unable to connect to backend server&amp;quot;.&lt;br /&gt;
 /etc/init.d/mythbackend start&lt;br /&gt;
&lt;br /&gt;
Also, set up mythbackend to start on boot.&lt;br /&gt;
 rc-update add mythbackend default&lt;br /&gt;
&lt;br /&gt;
===mythsetup===&lt;br /&gt;
&lt;br /&gt;
As a normal user, run:&lt;br /&gt;
 $ mythtv-setup&lt;br /&gt;
&lt;br /&gt;
Answer yes to both questions on the initial run.&lt;br /&gt;
&lt;br /&gt;
Sign up for a [http://labs.zap2it.com/ Zap2it Account] for the North America (DataDirect) under the Video Sources option. The certificate code is '''ZIYN-DQZO-SBUT'''&lt;br /&gt;
&lt;br /&gt;
While in setup make sure to select the proper cards and so forth.&lt;br /&gt;
(Note: mythsetup will take over the full screen and swallow the mouse cursor. Use the left/right arrow keys and the spacebar to navigate the setup screens.)&lt;br /&gt;
&lt;br /&gt;
A useful tip is to use the --geometry option when running mythsetup, this prevents mythsetup from taking over the whole screen.&lt;br /&gt;
 $ mythtv-setup --geometry 640x480&lt;br /&gt;
&lt;br /&gt;
Add any users that will be using MythTV to the video group or you will not be able to use your capture cards.&lt;br /&gt;
 # gpasswd -a &amp;lt;username&amp;gt; video&lt;br /&gt;
&lt;br /&gt;
You may need to run this if you are having trouble:&lt;br /&gt;
 # chmod 660 /dev/nvidia*&lt;br /&gt;
&lt;br /&gt;
Be sure to associate your tuner card with a tuner in step 2. In step 3 configure the channel data. In step 4, associate your tuner in step 2, with the channel data in step 3.&lt;br /&gt;
&lt;br /&gt;
If during step 3 you're finding that you're having problems receiving your channel lineup, you may want to do this:&lt;br /&gt;
 # echo &amp;quot;net-misc/wget ~x86&amp;quot; &amp;gt;&amp;gt; /etc/portage/package.keywords&lt;br /&gt;
 # echo &amp;quot;net-misc/wget ssl&amp;quot; &amp;gt;&amp;gt; /etc/portage/package.use&lt;br /&gt;
 # emerge -v wget&lt;br /&gt;
where ~x86 is your real arch. This is because MD5 is required for auth on zap2it's SOAP stuff.&lt;br /&gt;
&lt;br /&gt;
===mythfilldatabase===&lt;br /&gt;
&lt;br /&gt;
First fill the database with all the needed channel info.&lt;br /&gt;
 $ mythfilldatabase&lt;br /&gt;
&lt;br /&gt;
If you run into these sorts of errors:&lt;br /&gt;
&lt;br /&gt;
 Resolving datadirect.webservices.zap2it.com... 206.18.98.160&lt;br /&gt;
 Connecting to datadirect.webservices.zap2it.com[206.18.98.160]:80... connected.&lt;br /&gt;
 HTTP request sent, awaiting response... 401 Unauthorized&lt;br /&gt;
 Authorization failed.&lt;br /&gt;
&lt;br /&gt;
Go back and make sure you have have a Zap2It account and that you entered your information correctly during mythsetup.&lt;br /&gt;
&lt;br /&gt;
If you have MythTV set up to run mythfilldatabase automatically and use XMLTV, you may need to link your XMLTV configuration file to somewhere where the automated script can find it.&lt;br /&gt;
 # ln -s /home/mythtv/.mythtv/*.xmltv /etc/mythtv/.mythtv/&lt;br /&gt;
&lt;br /&gt;
===mythfrontend===&lt;br /&gt;
&lt;br /&gt;
The frontend can use real-time scheduling for the video output thread. To enable this you need a kernel &amp;gt;= 2.6.12 and &amp;gt;= sys-libs/pam-0.79. Add the following to &amp;lt;code&amp;gt;/etc/security/limits.conf&amp;lt;/code&amp;gt; :&lt;br /&gt;
&lt;br /&gt;
 *               -       rtprio     0&lt;br /&gt;
 *               -       nice       0&lt;br /&gt;
 @audio          -       rtprio     50&lt;br /&gt;
 @audio          -       nice       0&lt;br /&gt;
&lt;br /&gt;
Run mythfrontend and see if it works, if it does myth is installed.&lt;br /&gt;
&lt;br /&gt;
 mythfrontend&lt;br /&gt;
&lt;br /&gt;
[[Category:Multimedia|Setup Mythtv]]&lt;/div&gt;</summary>
		<author><name>Joost</name></author>	</entry>

	</feed>