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
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
|
<!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: Configuring MythTV. </TITLE>
<LINK HREF="mythtv-HOWTO-10.html" REL=next>
<LINK HREF="mythtv-HOWTO-8.html" REL=previous>
<LINK HREF="mythtv-HOWTO.html#toc9" REL=contents>
</HEAD>
<BODY>
<A HREF="mythtv-HOWTO-10.html">Next</A>
<A HREF="mythtv-HOWTO-8.html">Previous</A>
<A HREF="mythtv-HOWTO.html#toc9">Contents</A>
<HR>
<H2><A NAME="Configuring_mythtv"></A> <A NAME="s9">9.</A> <A HREF="mythtv-HOWTO.html#toc9">Configuring MythTV. </A></H2>
<P>By this point, all of the compile-time prerequisites have been installed,
<B>mysql</B> is running and has had its initial database setup. It's now
time to configure MythTV.
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: If you're running Debian unstable and you have compiled
MythTV from source, you will need to install an additional package before
you will be able to run MythTV. Execute the following to install the MySQL
driver for QT.</CAPTION>
</FIGURE>
<BLOCKQUOTE><CODE>
<PRE>
$ su -
# apt-get install libqt3c102-mt-mysql
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H2><A NAME="ss9.1">9.1</A> <A HREF="mythtv-HOWTO.html#toc9.1">Configuring the Master backend system</A>
</H2>
<P>Open a shell and decide where you will store your video files. This may
be one directory or multiple directories on the same or different
filesystems. There is no default directory used for new recordings, you
<B>must</B> create at least one storage directory and configure Myth to
use it by running <B>mythtv-setup</B>. If you do not do this, then MythTV
will be unable to record anything. The following example is specific for
<CODE>/var/video</CODE>, but the same instructions would apply for any directory
name you choose to use. See the
<A HREF="mythtv-HOWTO-24.html#advancedpartitionformatting">Advanced Partition Formatting</A> section for hints on creating a
partition for MythTV.</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ su
# mkdir /var/video
# chmod a+rwx /var/video
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P><B>NOTE</B>: The last slash "/" is not required.</P>
<P>
<A NAME="storagegrouptip"></A>
<B>TIP</B>: Try not to have your video mount point on the same partition
as your root partition, which could lead to the filling up of your root
partition with video data if the mount fails. For example:</P>
<P>If <CODE>/var/video</CODE> is created on your root partition and you then
perform a mount of another drive to this directory there won't be any
problems if everything is working the way it should. However, if the mount
fails for some reason, <CODE>/var/video</CODE> still exists, so MythTV will find
the directory and write files to it. If your <CODE>/</CODE> mount point is
space limited, <CODE>/var/video</CODE> will <B>also</B> be space limited, and
it won't take long to fill the partition. This will cause a number of
side-effects, most of them bad. Instead, create subdirectories as the
destination for the storage group.</P>
<P>Your directory structure could then look something like this:
<BLOCKQUOTE><CODE>
<PRE>
/mnt/video/drive1/video
/mnt/video/drive2/video
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Your <CODE>/etc/fstab</CODE> would look like this:
<BLOCKQUOTE><CODE>
<PRE>
/dev/hdb1 /mnt/video/drive1
/dev/hdc1 /mnt/video/drive2
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Because the Storage Group path is <CODE>/mnt/video/drive1/video</CODE>, if the
mythbackend can only find <CODE>/mnt/video/drive1</CODE> it will <EM>not</EM>
write files to that share.</P>
<P>After you create the desired directory or directories for storing your video
files, you will need to add them to the proper Storage Group using
<B>mythtv-setup</B>. This procedure is described below in the
<A HREF="#storagegroups">Storage Groups</A> section.</P>
<P>The first thing to configure is the Master backend system. If you are
running multiple backend systems, the Master backend will make all
decisions about which programs will be recorded on which tuners. If you
have only one backend, then it will be its own master.</P>
<P>The Master backend will always choose the first available tuner in the same
order as you add cards through "mythtv-setup". In other words, the second
card you add will only be used when there are two overlapping recordings,
the third when there are three, and so on.
Therefore, you will want to have
the greatest amount of disk space on the Master backend because its tuner
will always be the first choice. You will then want to add your
<A HREF="#nonmaster_backend">other backends</A> in the order of your
preference for recording.</P>
<P>
<FIGURE>
<EPS FILE="warning.eps">
<IMG SRC="warning.png">
<CAPTION><B>NOTE</B>: It is possible to <EM>not</EM> have the cards on the Master
backend be the first ones used. However, if you are new to MythTV it is
easier to configure the Master backend first before moving on to the Slaves,
at least until you become more familiar with the MythTV system. See
<A HREF="mythtv-HOWTO-23.html#advanced_backend_config">Advanced Backend Configurations</A> for
information on configuring multiple backend systems in various ways.</CAPTION>
</FIGURE>
</P>
<P>Because MythTV uses a database to store all configuration variables,
part of the bootstrap of MythTV is to indicate the location of the MySQL
database server. If the frontend, backend and MySQL database server are all
going to be running on the same box, you can continue to the next step. If
not, you'll need to change the Host Name in the "Database Configuration"
screen of the mythfrontend program.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: Users that have been running the frontend and the backend on
different machines have stated that they have been having issues with remote
access to the MySQL database. The following instructions may or may not
work. Add the following to <CODE>/etc/my.cnf</CODE> on the backend machine and
restart MySQL.</CAPTION>
</FIGURE>
<BLOCKQUOTE><CODE>
<PRE>
skip-innodb
set-variable=thread_stack=256k
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Run the setup program:
<BLOCKQUOTE><CODE>
<PRE>
$ mythtv-setup
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>The backend setup program will start and offer you a number of choices. It
is <EM>strongly</EM> recommended that you go through them in order.</P>
<P>The first question will ask if you wish to clear out your existing
configurations for your capture cards. Initially, you should say "YES" so
that there are no surprises later.</P>
<P>The next question will ask you if you wish to clear out your video source
information. You should answer "YES" to this as well.</P>
<P>Once the graphical setup starts, you'll see that there are six choices</P>
<P>
<FIGURE>
<EPS FILE="add.eps">
<IMG SRC="add.png">
<CAPTION>The Storage Directories feature is available only in the SVN version of MythTV.</CAPTION>
</FIGURE>
</P>
<P>
<OL>
<LI>General</LI>
<LI>Capture Cards</LI>
<LI>Video Sources</LI>
<LI>Input connections</LI>
<LI>Channel Editor</LI>
<LI>Storage Directories</LI>
</OL>
</P>
<P>Use the arrow keys to move around, and press the space bar to select which
option you wish to configure.</P>
<H3>General</H3>
<P>The first screen of the General configuration deals with IP addresses of the
system that you're running mythtv-setup on and any master backend you may have.
If you've only got one machine, then the default values are fine and you can
move to the next page by pressing the space bar. If you need to move around
the screen, use the arrow keys to move focus between settings, not the
mouse.</P>
<P>If you will be deploying multiple backends, or if your backend is on one
system and you're running the frontend on another machine then <EM>do
not</EM> use the "127.0.0.1" IP address.</P>
<P><B>NOTE</B>: If you modify the 127.0.0.1 address and use a "real" IP
address, you must use real IP addresses in both fields, otherwise your
frontend machines will generate "Unexpected response to MYTH_PROTO_VERSION"
errors.</P>
<P>Changing any of the port settings is very strongly discouraged.
(If you do accidentally change them, the defaults are 6543 for
the master/backend server, and 6544 for the HTTP requests)</P>
<P>Once you're satisfied with the values, move the focus down to Next and hit
the space bar.</P>
<P>The next screen details the Host-specific Backend setup. This is where you
will set the specific directory paths for this particular backend. Make
sure that you've followed the steps at the beginning of this section and
created a directory that exists and that MythTV will have write privileges
to. When you're done, press Next to continue, taking you to the Global
Backend Setup.</P>
<P>On the Global Backend Setup configure your backend with the appropriate
settings. Use the left and right arrow keys to iterate through the choices
available on each setting, and the up and down keys to move between
settings. Move to Finish when you're done and press the space bar, taking
you back to the main configuration screen.</P>
<H3>Capture Cards</H3>
<P>You should have no capture cards defined, so the highlight will be on
(New Capture Card). Press space to begin.</P>
<P>Choose the appropriate settings for your particular tuner. Use the arrow
keys to move around and to make your choices, and press RETURN when
complete. Pressing RETURN will take you back to the Capture Cards screen;
if you have additional capture cards in this machine, press the space bar
when the highlight is on the (New Capture Card) row to define another card. </P>
<P>If you have made a mistake, you can delete a card by highlighting it and
pressing the 'D' key, or you can highlight it and press the RETURN or 'E'
key to edit it.</P>
<P>Once you have no additional cards to setup, press ESC.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: If you have a dual digital/analog card, such as the pcHDTV
cards and some DViCO cards, then you should not configure this as two
separate cards. Configure the digital portion as a DVB card, then click
on the "Analog Options" button within the DVB configuration panel for
the card and configure the analog portion of the card there.</CAPTION>
</FIGURE>
</P>
<H3><A NAME="VideoSources"></A> Video Sources </H3>
<P>When you start, the highlight should be on (New Video Source). Press the
space bar to begin. The first field asks for the name of the video source.
You may choose something easy to remember, like "Antenna" or "Cable". Once
you've chosen a name, press the down arrow to move to the next field. </P>
<P>If you're in North America, change the grabber to
"SchedulesDirect.org(Internal)", then continue pressing the down arrow to
move to the next field. Fill in the username (lowercase only) and password
that you have established with Schedules Direct, then move to the "Retrieve
Listings" button and press the space bar.</P>
<P><B>NOTE</B>: You need <B>wget</B> version 1.9.1 or higher to use
Schedules Direct.</P>
<P>The mythtv-setup program will contact the Schedules Direct servers and get
your account information. Once you're done, you may click the Finish button
and skip the next few paragraphs in this document since they only apply to
users that are using the external XMLTV script to get their guide data.</P>
<P>If you wish to continue using the XMLTV grabber, then move to the Zip/postal
code field and put in the appropriate value.</P>
<P>If you're outside of North America, then some manual interaction will be
required with XMLTV. You may need to switch from the MythTV setup program
to the console it was run on to interact with XMLTV.</P>
<P>Once you have chosen your provider, press RETURN to continue. XMLTV will
now begin collecting the initial data for your location. The screen may
blank for a few seconds to several minutes, depending on the load of the
listings provider and the speed of your connection to the Internet. Be
patient!</P>
<P>You will then be returned to the Video Sources screen. If you have multiple
video sources available, such as Antenna, Cable, etc, go ahead and define
them all, even if they're not all going to be physically connected to the
master backend server. Once you're done, press ESC to return to the main
screen.</P>
<H3>Input Connections</H3>
<P>The final configuration item is Input Connections. On this screen, you
will associate the various video sources you defined earlier with a physical
input to a encoder card. It's entirely possible that you have multiple
tuners, and each tuner has a different input, so on this screen you let
MythTV know which device will connect to which input source.</P>
<P>When you start this screen, you should see a listing of the various input
connections available on each of the Capture cards you defined earlier. For
example, you may have a capture card with a tuner, a SVideo and a Composite
connection. If you wanted to associate the tuner (a.k.a., "Television")
with an "Antenna" source you defined in Video Sources, you would move to the
<CODE>/dev/videodevice (Television) -> </CODE> line and press the space bar.
Using the left and right arrow keys will show you the various choices you
have already created for video source. In our case, you would use the
left/right cursor keys until "Antenna" was shown in the Video Source field.
Press down to move to the next setting.</P>
<P>On the connection pane there is a "Scan for channels" button, if you are
configuring a digital source such as a DVB card, you need scan for channels
and you must do this before pressing the "Fetch channels from listings
source" button. You may scan for analog channels on an analog input, but
this is not needed.</P>
<P>The other button is called "Fetch channels from listings source". As long as
you have a real listings source you should fetch channels from them for
analog channels. You can do this for digital sources as well (unless the
listing source is transmitted EIT data). If you are using XMLTV, you may need
to switch from the MythTV setup program to the console it was run on to
interact with XMLTV after pressing this button. It is possible to fetch the
channels on the command line using mythfilldatabase. But if you need to do
this, you will probably need to re-enter the MythTV setup program to
configure the "Starting channel" setting for this source->input connection.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: If you have a Hauppauge PVR-500, you must think of
it has two PVR-150's on a single PCI card. For example, if you have a
single PVR-500 card, it will appear as <CODE>/dev/video0</CODE> and
<CODE>/dev/video1</CODE>. Each <CODE>/dev/video</CODE> device will have a Tuner input.</CAPTION>
</FIGURE>
Once you're done, press RETURN to go back to the Input Connections screen.
You would then finish associating the video sources to any other hardware
devices you have available.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: Don't add a video source to a hardware input if you don't
actually have anything connected there. For example, adding "Cable" to the
Tuner and to the Composite inputs without having something connected to
Composite will lead to blank recordings.</CAPTION>
</FIGURE>
</P>
<P>Press ESC to return to the main menu, and press ESC again if you have no
further items to configure, thereby returning you to the command line.</P>
<H3>Channel Editor</H3>
<P>The channel editor is used to globally alter channel information,
including items like hue, contrast, fine tuning and others. Users in North
America shouldn't run the channel editor until you've completed the initial
mythtv-setup and ran <B>mythfilldatabase</B> at least once to populate the
database.</P>
<H3><A NAME="storagegroups"></A> Storage Groups </H3>
<P>
<FIGURE>
<EPS FILE="add.eps">
<IMG SRC="add.png">
<CAPTION>New in MythTV 0.21</CAPTION>
</FIGURE>
</P>
<H3>Introduction.</H3>
<P>Storage Groups are lists of directories that are used to hold MythTV
recording files giving you a flexible way to allow you to add capacity to
your MythTV system without having to use exotic solutions such as LVM,
filesystem expansion or RAID Online Capacity Expansion. You can also use
Storage Groups to organize recordings and to put recordings of a certain
type into one subdirectory.</P>
<P>Storage Groups do not offer redundancy in case of hard drive failure, but
unlike LVM, if you lose a hard drive, you only lose the recordings that were
on that drive. With LVM, if you lose a hard drive, you will most likely
lose <B>everything</B>.</P>
<H3>How to use Storage Groups.</H3>
<P>By default, there is only one Storage Group called "Default", and it is
used for all recordings and Live TV.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: You need to add at least one directory to the Default
Storage Group or else you will not be able to record anything with MythTV.</CAPTION>
</FIGURE>
</P>
<P>For example, if you have 5 hard drives in your system, your first hard drive
could be your "boot" drive, and the remaining four could be dedicated to
media storage. You could format the drives and mount them as
<CODE>/mnt/store/d2</CODE>, <CODE>/mnt/store/d3</CODE>, <CODE>/mnt/store/d4</CODE> and
<CODE>/mnt/store/d5</CODE>.</P>
<P>Within each mount point, it's <EM>strongly</EM> recommended that you use a
sub-directory and make that the destination path for the Storage Group. See
the
<A HREF="#storagegrouptip">Tip</A> in the "Configuring the Master
backend" section for additional information.</P>
<P>You would then add the four subdirectories you created under the mount
points (<CODE>/mnt/store/d1/video</CODE>, etc) into the "Default" Storage Group.</P>
<P>At recording time, if there were four simultaneous recordings, MythTV would
put one recording onto each drive.</P>
<P>Or, say that you originally installed MythTV to a 80GB hard drive, and that
hard drive is now filling up. You could simply add a new drive to your
system, mount it and update the Storage Group to add additional space.</P>
<P>You may create additional Storage Groups to store specific recordings in
their own directories. Storage Groups are edited via the 'Storage
Directories' section of mythtv-setup. </P>
<P>You can also create multiple Storage Groups to group recordings together;
recording schedules now have an option to specify which Storage Group to
use.</P>
<P>MythTV will balance concurrent recordings across the available directories
in a Storage Group in order to spread out the file I/O load. MythTV will
prefer filesystems that are local to the backend over filesystems that are
remote until the local filesystem has 2 concurrent recordings active or
other equivalent I/O, then the next recording will go to the remote
filesystem. The balancing method is based purely on I/O, Myth does not try
to balance out disk space unless a filesystem is too low on free disk space
in which case it will not be used except as a last resort.</P>
<P>Storage Groups are global, but can be overridden on a slave backend by
creating a local Storage Group by running <B>mythtv-setup</B> on the
slave. If a problem occurs and the slave backend is unable to use the
desired Storage Group, it will fail back and try the directories defined in
the master's Storage Group.</P>
<P>There's also a special 'LiveTV' Storage Group, but the directory list starts
out empty. If you add a directory to the Storage Group, it will be used
instead of putting LiveTV recordings in the Default Storage Group. This
will allow you to put your LiveTV recordings on their own filesystem, which
is similar to the old MythTV method which used a RingBuffer for LiveTV. Of
course, you don't have to do anything, and Live TV recordings will just go
into the Default Storage Group where they'll be the first programs eligible
for expiration if the system needs free space for recordings.</P>
<P>Usage information for all Storage Group directories is visible on the
mythfrontend status screen as well as the mythbackend status webpage.
MythTV is smart enough to determine which directories are on shared
filesystems so it should not count free or used space multiple times if you
have more than one directory on the same filesystem.</P>
<H3>Migrating to Storage Groups.</H3>
<P>Migrating to Storage groups is very simple: if you have existing
recordings in a storage directory, then the system will automatically add
that directory to the Default Storage Group. If you then add additional
directories to a storage group, the system is flexible enough to check
<EM>all</EM> Storage Groups for a file before deciding that it can't be
found, which means that you can use the <B>mv</B> command from the Unix
command line to arrange files however you'd like.</P>
<H3>Advanced: Algorithm used by the Storage Group</H3>
<P>This section details the logic of the Storage Group allocation engine.</P>
<P>The current load-balancing preferences (in order) are:
<UL>
<LI>Local filesystems over remote</LI>
<LI>Less-busy (less weight) over more-busy (more weight)</LI>
<LI>More Free Space over Less Free Space</LI>
</UL>
</P>
<P>The 'business' of a filesystem is determined by weights. The following
weights are added to a filesystem if it is in use for the following things:
<UL>
<LI>recording = +10</LI>
<LI>playback = +5 (mythfrontend)</LI>
<LI>comm flagging = +5 (mythcommflag)</LI>
<LI>transcoding = +5 (mythtranscode)</LI>
</UL>
</P>
<P>If a recording is due to end within 3 minutes, it is not counted against
the weight of a filesystem. This is done to account for the pre/post-roll
and start-early/end-late settings. </P>
<H2><A NAME="ss9.2">9.2</A> <A HREF="mythtv-HOWTO.html#toc9.2">Post-configuration</A>
</H2>
<P>Run the <CODE>mythfilldatabase</CODE> program as directed. The master
backend will obtain guide data for all the video sources you defined during
setup.</P>
<P><B>NOTE</B>: If you are using Schedules Direct and watching the output messages
on the console or the log file it is normal to see a "401 Unauthorized"
error followed by a "200 OK" when the connection to Schedules Direct is being
established.
<BLOCKQUOTE><CODE>
<PRE>
From : Sun Jun 13 05:00:00 2004 To : Mon Jun 14 05:00:00 2004 (UTC)
--02:58:01--
http://datadirect.webservices.zap2it.com/tvlistings/xtvdService
=> -'
Resolving datadirect.webservices.zap2it.com... 206.18.98.160
Connecting to datadirect.webservices.zap2it.com[206.18.98.160]:80...
connected.
HTTP request sent, awaiting response... 401 Unauthorized
Connecting to datadirect.webservices.zap2it.com[206.18.98.160]:80...
connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/xml]
[ <=> ] 114,125 63.57K/s
02:58:03 (63.53 KB/s) - -' saved [114125]
Your subscription expires on 08/20/2004 12:00:00 AM
Grab complete. Actual data from Sun Jun 13 05:00:00 2004 to Mon Jun 14
00:00:00 2004 (UTC)
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Once <CODE>mythfilldatabase</CODE> has finished, start the master server before
continuing.
<BLOCKQUOTE><CODE>
<PRE>
$ mythbackend
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>mythbackend will print information about connections and what it's doing to
the console. If you'd like to see the options that are available for
mythbackend, type <CODE>mythbackend -h</CODE> for help.</P>
<P>As of MythTV v0.21, the available options are:
<BLOCKQUOTE><CODE>
<PRE>
$ mythbackend --help
Valid options are:
-h or --help List valid command line parameters
-l or --logfile filename Writes STDERR and STDOUT messages to filename
-p or --pidfile filename Write PID of mythbackend to filename
-d or --daemon Runs mythbackend as a daemon
-v or --verbose debug-level Use '-v help' for level info
--printexpire List of auto-expire programs
--printsched Upcoming scheduled programs
--testsched Test run scheduler (ignore existing schedule)
--resched Force the scheduler to update
--nosched Do not perform any scheduling
--nojobqueue Do not start the JobQueue
--noautoexpire Do not start the AutoExpire thread
--version Version information
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Running mythbackend as a daemon and using the logfile option will allow you
to have mythbackend automatically start up during boot. You can follow the
steps outlined in the section called
<A HREF="mythtv-HOWTO-23.html#mythbackend_autostart">Automatically starting mythbackend at system boot time</A> for
configuration steps.</P>
<P>If you enable the <CODE>-l</CODE> parameter, you will want to keep your logfiles
rotated (so that they don't fill up a partition). See the section called
<A HREF="mythtv-HOWTO-23.html#logrotate">Automatically rotating logs</A> for more
information.</P>
<H2><A NAME="nonmaster_backend"></A> <A NAME="ss9.3">9.3</A> <A HREF="mythtv-HOWTO.html#toc9.3">Configuring a non-master backend </A>
</H2>
<P>Ensure that you've granted access to the master MySQL database for remote
backends as discussed in the section titled
<A HREF="mythtv-HOWTO-6.html#modify_perm_mysql">Modifying access to the MySQL database for multiple systems</A> and that
you have the correct IP address for the database server in the "Database
Configuration" screen of the mythtv-setup application on this slave backend.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: Slave backends <B>must not</B> run a local MySQL
daemon. By default, they will connect to their local daemon rather than the
central database, causing unexpected behavior such as empty "Watch
Recordings" lists and a failure to locate the Video Sources defined on the
master backend. Modify the <CODE>/usr/local/share/mythtv/mysql.txt</CODE> file
on all slave backends to ensure that the <CODE>DBHostName</CODE> has the address
of the MySQL server.
Caveat: You may make a slave backend the primary MySQL server, or run a
non-MythTV database on a slave backend as long as you have edited the
<CODE>mysql.txt</CODE> file on <B>all</B> systems and made it consistent. There can be only one authoritative MySQL database in a MythTV system -
errors such as the one above ensue if backends and frontends have differing
ideas of which MySQL database they should talk to.</CAPTION>
</FIGURE>
</P>
<P>Make sure that the IP addresses on the General setup screen are accurate.
If the slave backend can't communicate with the master backend due to IP
address misconfiguration then MythTV will not function properly.</P>
<P>Configuration of a non-master backend follows the same general procedure
as that of the master backend, with the exception that you skip over the
"Video Sources" step. All possible video sources need to be defined on the
master backend system; only the master backend will query a listings
provider to obtain guide data for all the non-master backends.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: Do not run <CODE>mythfilldatabase</CODE> on a non-master backend.</CAPTION>
</FIGURE>
</P>
<H2><A NAME="ss9.4">9.4</A> <A HREF="mythtv-HOWTO.html#toc9.4">Configuring and running mythfilldatabase</A>
</H2>
<P>
<FIGURE>
<EPS FILE="warning.eps">
<IMG SRC="warning.png">
<CAPTION><B>NOTE</B>: <B>mythfilldatabase</B> might take a while to complete,
depending on any number of factors, most of which you can't control. It's
best to just let the program run to completion.</CAPTION>
</FIGURE>
<B>mythfilldatabase --help</B> will give a full listing of the options
available. </P>
<P><B>mythfilldatabase --manual</B> is another option; the manual option will
allow you to fine tune channel frequencies and specify which channels will
be added to the database. </P>
<P><B>mythfilldatabase --file</B> is an option if there isn't an XMLTV grabber
for your country, but you <B>do</B> have an XML formatted listings file
created by some other program.</P>
<P><B>mythfilldatabase --xawchannels</B> is an option if you have used
<B>xawtv</B> to fine-tune your channels and would like to import the fine
tuning offsets into MythTV.</P>
<P><B>mythfilldatabase --refresh-today</B> will only pull guide data for
today (in case of late-breaking changes to the schedule).</P>
<H3>Periodically running <B>mythfilldatabase</B></H3>
<P>In order to keep your database filled, <B>mythfilldatabase</B> should be
run once a day.</P>
<P>To use MythTV's built-in capability, you'll need to run the
<B>mythfrontend</B> Setup option. From the mythfrontend, enter the
Setup>General screen and advance to "Mythfilldatabase", the fourth screen.
Select the checkbox, then complete the options as you see fit. The
<B>mythbackend</B> program will now run <B>mythfilldatabase</B> for you.</P>
<H2><A NAME="ss9.5">9.5</A> <A HREF="mythtv-HOWTO.html#toc9.5">Grabbing channel icons for Schedules Direct users</A>
</H2>
<P>While the Schedules Direct TV listings service has several advantages, it
does not support grabbing logo icons for the stations you receive. However,
there are utilities provided with MythTV which you may use to grab your
initial set of icons and to keep them updated if your lineups change.</P>
<P>First, you need to generate or obtain an XML file with the information for
your stations.</P>
<P>If you have XMLTV software installed, there is a perl script in MythTV's
<CODE>contrib/</CODE> directory which will generate this file for you. Run the
command:
<BLOCKQUOTE><CODE>
<PRE>
$ perl mkiconmap.pl
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>You will be asked for your zip code and the service that you use. If there
are no errors, the <CODE>iconmap.xml</CODE> file that you need for the next step
will be created.</P>
<P>If you do not have XMLTV software installed and do not want to install it
for the sake of this minor task, there is a generic
<CODE>contrib/master_iconmap.xml</CODE> which you can copy and use but this may
not be as complete as using the specific information for your service.</P>
<P>Once you have an <CODE>iconmap.xml</CODE> file, add the icon information to your
database and grab any new icons with the command:
<BLOCKQUOTE><CODE>
<PRE>
$ mythfilldatabase --import-icon-map iconmap.xml --update-icon-map
</PRE>
</CODE></BLOCKQUOTE>
</P>
<HR>
<A HREF="mythtv-HOWTO-10.html">Next</A>
<A HREF="mythtv-HOWTO-8.html">Previous</A>
<A HREF="mythtv-HOWTO.html#toc9">Contents</A>
</BODY>
</HTML>
|