1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
<TITLE>Installing and using MythTV: Downloading and compiling. </TITLE>
<LINK HREF="mythtv-HOWTO-6.html" REL=next>
<LINK HREF="mythtv-HOWTO-4.html" REL=previous>
<LINK HREF="mythtv-HOWTO.html#toc5" REL=contents>
</HEAD>
<BODY>
<A HREF="mythtv-HOWTO-6.html">Next</A>
<A HREF="mythtv-HOWTO-4.html">Previous</A>
<A HREF="mythtv-HOWTO.html#toc5">Contents</A>
<HR>
<H2><A NAME="DownloadAndCompile"></A> <A NAME="s5">5.</A> <A HREF="mythtv-HOWTO.html#toc5">Downloading and compiling. </A></H2>
<P>Get MythTV from the
<A HREF="http://www.mythtv.org">http://www.mythtv.org</A> web site. There are two installation methods
you may choose from. The first is to download the latest release in tarball
format and compile. The tarball release of MythTV should work on a wide
variety of systems and should be the preferred method for new users. If you
wish to use the <B>subversion</B> copy of MythTV you may obtain it from
<A HREF="http://svn.mythtv.org">http://svn.mythtv.org</A></P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: If you are going to use <B>subversion</B> to
compile MythTV rather than using the distribution tarball, you <EM>must</EM>
join the
<A HREF="http://www.mythtv.org/mailman/listinfo/mythtv-commits/">http://www.mythtv.org/mailman/listinfo/mythtv-commits/</A> and
<A HREF="http://www.mythtv.org/mailman/listinfo/mythtv-dev/">http://www.mythtv.org/mailman/listinfo/mythtv-dev/</A> mailing lists to
keep up to date with the current status of the code. Code obtained from
subversion has no guarantees regarding stability, etc.</CAPTION>
</FIGURE>
</P>
<P>If you are in North America you will use the Schedules Direct grabber which is
built-in to MythTV. You <EM>do not</EM> need to install XMLTV (so you may
skip XMLTV-related instructions), but you need <B>wget</B> version 1.9.1
or higher.</P>
<P>Get XMLTV from
<A HREF="http://xmltv.sourceforge.net">http://xmltv.sourceforge.net</A>. Download the latest version (0.5.51).</P>
<P>
<HR>
<PRE>
NOTE for Mandriva users: If you have added a "PLF" mirror, you may skip the
next step and type:
# urpmi libmp3lame0 libmp3lame0-devel
After downloading, be sure to install both:
# rpm -Uvh lame*
</PRE>
<HR>
</P>
<P>Get lame from
<A HREF="http://lame.sourceforge.net/">http://lame.sourceforge.net/</A>. Download the source code to v3.96.1
by following the links from "Using" through "Download...".</P>
<H2><A NAME="ss5.1">5.1</A> <A HREF="mythtv-HOWTO.html#toc5.1">Building LAME</A>
</H2>
<P>Open a shell and switch to the directory where you saved lame.
<BLOCKQUOTE><CODE>
<PRE>
$ tar -xzf lame-3.96.1.tar.gz
$ cd lame-3.96.1
$ ./configure
$ make
$ make test
$ su
# make install
</PRE>
</CODE></BLOCKQUOTE>
Check that it worked:
<BLOCKQUOTE><CODE>
<PRE>
# ls -l /usr/local/lib
-rw-r--r-- 1 root root 381706 Nov 4 14:22 libmp3lame.a
-rwxr-xr-x 1 root root 674 Nov 4 14:22 libmp3lame.la*
lrwxrwxrwx 1 root root 19 Nov 4 14:22 libmp3lame.so ->
libmp3lame.so.0.0.0*
lrwxrwxrwx 1 root root 19 Nov 4 14:22 libmp3lame.so.0 ->
libmp3lame.so.0.0.0*
-rwxr-xr-x 1 root root 360197 Nov 4 14:22
libmp3lame.so.0.0.0*
# exit
$
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H2><A NAME="ss5.2">5.2</A> <A HREF="mythtv-HOWTO.html#toc5.2">XMLTV</A>
</H2>
<H3>Red Hat Linux and Fedora Core:</H3>
<P>RPMs for <B>XMLTV</B> and all of its dependencies can be obtained from
<A HREF="http://ATrpms.net/name/xmltv/">http://ATrpms.net/name/xmltv/</A>. The web page has a
list of all the dependent packages you must download and install.
<BLOCKQUOTE><CODE>
<PRE>
# rpm -Uvh xmltv* perl*
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>If you install from this location you may skip to
<A HREF="#manually_building_mythtv">Manually building MythTV</A>.</P>
<H3>Mandriva</H3>
<P>RPMs for <B>XMLTV</B> and all of its dependencies are located in
Mandriva's "contrib". If you have added a contrib mirror, try installing
<B>XMLTV</B>:
<BLOCKQUOTE><CODE>
<PRE>
# urpmi xmltv xmltv-grabbers
</PRE>
</CODE></BLOCKQUOTE>
If this does not work, it is possible that contrib for your Mandriva version
does not have <B>XMLTV</B>, so you may install the XMLTV prerequisites by typing:
<BLOCKQUOTE><CODE>
<PRE>
# urpmi perl-xml-twig perl-xml-writer perl-datemanip perl-libwww-perl
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>and skip straight to the XMLTV compilation step.</P>
<H3>Manual installation</H3>
<P>
<A NAME="untarring_xmltv"></A> Untar the xmltv file:
<BLOCKQUOTE><CODE>
<PRE>
$ tar -xjf xmltv-0.5.51.tar.bz2
</PRE>
</CODE></BLOCKQUOTE>
Install the xmltv prerequisites. The following prerequisites are the
minimum required; when you actually start running the xmltv setup program it
may alert you to other modules that are required.:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ su
# perl -MCPAN -e shell
cpan> install XML::Twig
cpan> install Date::Manip
Date::Manip is up to date.
cpan> install LWP
cpan> install XML::Writer
cpan> exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Change to the XMLTV directory and compile it:
<BLOCKQUOTE><CODE>
<PRE>
$ cd xmltv-0.5.51
$ perl Makefile.PL
</PRE>
</CODE></BLOCKQUOTE>
You can answer "N" to the tv_check, tv_pick_cgi questions. Say "yes" to
the grabber required for your location.</P>
<P>You may get errors about modules not being installed. You will need to
resolve any missing dependencies at this point, or your grabber may not work
correctly.
<BLOCKQUOTE><CODE>
<PRE>
$ make
$ make test
$ su
# make install
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H2><A NAME="ConfigureSD"></A> <A NAME="ss5.3">5.3</A> <A HREF="mythtv-HOWTO.html#toc5.3">Configuring the Schedules Direct service </A>
</H2>
<P>As of 2007-09-01, Tribune Media Services will no longer offer free guide
data. Schedules Direct is a non-profit organization which has licensed the
data to make it available to users of Freeware and Open Source applications.</P>
<P>If you wish to use Schedules Direct, you'll need to establish a user
account. Go to
<A HREF="http://www.schedulesdirect.org">http://www.schedulesdirect.org</A> and click on the "Membership" link. </P>
<P>Once you've read and agreed to the Subscriber Agreement, Terms of Use and
Privacy Policy proceed to the lineup choices and configure your account for
your particular location and the channels that you have. This configuration
will be imported into MythTV when you first run the <B>mythtv-setup</B>
program.</P>
<P>
<A NAME="manually_building_mythtv"></A> </P>
<H2><A NAME="ss5.4">5.4</A> <A HREF="mythtv-HOWTO.html#toc5.4">Manually building MythTV</A>
</H2>
<P>If you are going to use <B>subversion</B>, execute the following
instructions to obtain the latest version of MythTV:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ mkdir mythtv
$ svn co http://svn.mythtv.org/svn/trunk/ mythtv
$ cd mythtv
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>To use a release version, you can execute:
<BLOCKQUOTE><CODE>
<PRE>
$ mkdir mythtv-release-0.21
$ svn co http://svn.mythtv.org/svn/branches/release-0-21-fixes/ mythtv-release-0.21
$ cd mythtv-release-0.21
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P><B>NOTE</B>: Using a svn version of the code allows you to stay
up-to-date with changes. So, if there's an update to the 0.21 release and
you originally obtained it using svn, you could enter the
mythtv-release-0.21 directory and type "svn up", which will update your copy
with the fixed version from the website. You would then recompile and
install the updated 0.21 code.</P>
<P>If you are using the tarball, then unpack it:
<BLOCKQUOTE><CODE>
<PRE>
$ tar -xjf mythtv-0.21.tar.bz2
$ cd mythtv-0.21
$ ./configure
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>If you wish to change options, run <B>./configure --help</B> to
see what is available and to override and automatically detected options.
See the <CODE>config.log</CODE> file after running <B>configure</B> to see
previous runs.</P>
<P>To compile:
<BLOCKQUOTE><CODE>
<PRE>
$ make -j 2
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>The MythTV compile can take advantage of multiple CPUs, SMP and
Hyperthreading. If you want to build MythTV on a multi-CPU machine (or with
<B>distcc</B>), specify "-j numjobs", where "numjobs" is greater than 2.
In the above example, we had two concurrent jobs executing, which is
recommended for a single CPU system. Do not set the number of jobs too
high, or your compile will actually take longer to complete than it would if
you did a "normal" build.</P>
<P>If you are using <B>distcc</B>, and you had two other host machines (red, blue)
participating, you would do something like:
<BLOCKQUOTE><CODE>
<PRE>
$ export DISTCC_HOSTS='localhost red blue'
$ make -j 6 CXX=distcc
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>The actual speed-up, if any, is dependant on a number of factors, such as
number of CPUs / hosts, etc. The <B>distcc</B> documentation recommends
using a <CODE>-j</CODE> value of twice the number of CPUs available to keep all
of them busy.</P>
<P>Some timing information. The following should only be used for
illustration; your actual results may vary. The test involves a complete
<CODE>make distclean</CODE> to the final binary.
<UL>
<LI>P4 3.2Ghz HT: "standard" make: 12m 49s</LI>
<LI>P4 3.2Ghz HT: make -j 2: 11m 24s </LI>
</UL>
</P>
<P>In the above example, we see that with a single CPU, a multi-stage
<B>make</B> does not significantly decrease compile time.</P>
<P>Once the compile is done, switch to superuser:
<BLOCKQUOTE><CODE>
<PRE>
$ su
# make install
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: subsequent configuration steps assume that you are within
the MythTV directory that you <CODE>cd</CODE>'d to above.</CAPTION>
</FIGURE>
</P>
<H3>Enabling real-time scheduling of the display thread.</H3>
<P>MythTV supports real-time scheduling of the video output thread. There
are three ways to go about enabling this: You can use rlimits, you can use
the realtime security module, or on older systems you can SUID the
executable. Enabling real-time scheduling is optional, but can make the
video display smoother, especially if you are decoding HDTV.</P>
<H3>rlimits</H3>
<P>The rlimits method is the preferred method and is included in Linux
2.6.12 and above. Unfortunately, you need PAM version 0.79 or above, which
may not be supported by your distribution yet. Assuming anyone running
<B>mythfrontend</B> is in the audio group and rlimits are supported, all
you need to do is place this in your <CODE>/etc/security/limits.conf</CODE></P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
* - rtprio 0
* - nice 0
@audio - rtprio 50
@audio - nice 0
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H3>realtime module</H3>
<P>The second option is to use the Linux realtime kernel module.
This is will be phased out over time, but is currently supported
by many distributions that do not yet support rlimits. If you are
not using the distribution kernel you must configure your kernel
with:
<BLOCKQUOTE><CODE>
<PRE>
Security options : [*] Enable different security models
Security options : [M] Default Linux Capabilties
</PRE>
</CODE></BLOCKQUOTE>
You may also need to install the realtime module, using your distribution's
realtime package. Assuming the users who will be running
<B>mythfrontend</B> will be in the audio group you can get the GUID of a named
group like so:
<BLOCKQUOTE><CODE>
<PRE>
$ grep audio /etc/group
</PRE>
</CODE></BLOCKQUOTE>
If the number printed out from the grep was 18, you can now load
this module as root before starting <B>mythfrontend</B>:
<BLOCKQUOTE><CODE>
<PRE>
# modprobe realtime gid=18
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H3>run as root option (not safe)</H3>
<P>The final and least preferred option is to set the sticky bit
on the <B>mythfrontend</B> executable. This <B>opens a security hole</B>,
but is the only option on systems that do not support either
rlimits or the realtime module. This does not work on modern
distributions either, and is <B><EM>not recommended</EM></B>
on any system connected to the Internet. This may also make it
impossible to debug MythTV without running <B>gdb</B> as root. If you
would still like to do this, you just need to run this as root:
<BLOCKQUOTE><CODE>
<PRE>
# chmod a+s /usr/local/bin/mythfrontend /usr/local/bin/mythtv
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H3><A NAME="frontend-only"></A> Frontend-only configuration </H3>
<P>Since MythTV uses a client/server architecture, multiple frontend
computers can simultaneously access content on a Myth system. Live TV,
watching and scheduling recordings, etc. are all possible from multiple
frontends.</P>
<P>To get a better picture of what is needed to run a frontend, note the
following:
<LI>You do NOT need the MySQL server installed on your remote frontend</LI>
<LI>You do NOT need XMLTV installed on your remote frontend</LI>
<LI>You do NOT need to run the mythtv-setup program on
your frontend machine</LI>
</P>
<P>Other than the exclusion of the MySQL server and XMLTV, the MythTV
compilation procedure is the same as when you're setting up both a backend
and a frontend. However, you <EM>will</EM> need to install the database
access libraries.</P>
<P>Once MythTV is compiled and installed:
<LI>Run the mythtv-setup program on your Master backend. Under the "General"
menu, change the IP address of the current machine (by default, "127.0.0.1")
to the real external IP address - 127.0.0.1 is the loopback address and no
external machine can access it. Change the Master Server IP setting to the
same IP address as well.</LI>
<LI>Run the mythfrontend program on your frontend machine,
and a "Database Configuration" screen should appear.
Set the "Host name" field to point to your Master backend's IP address.</LI>
</P>
<H2><A NAME="Gentoo_build"></A> <A NAME="ss5.5">5.5</A> <A HREF="mythtv-HOWTO.html#toc5.5">Gentoo </A>
</H2>
<P>Installation of MythTV on Gentoo consists of simply emerging the desired
ebuild because all of the packages are now part of the official Portage tree.
<BLOCKQUOTE><CODE>
<PRE>
$ su -
# emerge --sync # make sure portage is up to date.
# vi /etc/make.conf
</PRE>
</CODE></BLOCKQUOTE>
Add mysql to your USE variable. i.e. <CODE>USE="mysql ...."</CODE>
<BLOCKQUOTE><CODE>
<PRE>
# emerge mythtv
</PRE>
</CODE></BLOCKQUOTE>
</P>
<HR>
<A HREF="mythtv-HOWTO-6.html">Next</A>
<A HREF="mythtv-HOWTO-4.html">Previous</A>
<A HREF="mythtv-HOWTO.html#toc5">Contents</A>
</BODY>
</HTML>
|