summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/local-website/htdocs/mythtv-doc/mythtv-HOWTO-singlehtml.html
blob: b5b82a2d02a5604256535e22b31a10b651e0b8bd (plain)
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
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
<!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</TITLE>
</HEAD>
<BODY>
<H1>Installing and using MythTV</H1>

<H2>Robert Kulagowski, 
<A HREF="mailto:rkulagow@rocketmail.com">mailto:rkulagow@rocketmail.com</A></H2>2008-06-04, v0.21.02
<HR>
<EM>Initially, installation of MythTV seems like a huge task.  There are lots
of dependencies, and various distributions seem to do the same thing
different ways.  This document will attempt to give general installation
instructions, as well as including distribution-specific instructions where
necessary.</EM>
<HR>
<P>
<H2><A NAME="toc1">1.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s1">First things first.</A></H2>

<UL>
<LI><A NAME="toc1.1">1.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss1.1">What is MythTV?</A>
<LI><A NAME="toc1.2">1.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss1.2">QuickStart</A>
<LI><A NAME="toc1.3">1.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss1.3">Upgrading from previous versions</A>
<LI><A NAME="toc1.4">1.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss1.4">How to obtain this document / PDF versions of this document </A>
<LI><A NAME="toc1.5">1.5</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss1.5">Books about MythTV</A>
<LI><A NAME="toc1.6">1.6</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss1.6">Document conventions</A>
<LI><A NAME="toc1.7">1.7</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss1.7">Mailing lists / getting help</A>
<LI><A NAME="toc1.8">1.8</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss1.8">IRC</A>
<LI><A NAME="toc1.9">1.9</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss1.9">Bug database</A>
<LI><A NAME="toc1.10">1.10</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss1.10">Contributing to this document</A>
</UL>
<P>
<H2><A NAME="toc2">2.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s2">Introduction.</A></H2>

<P>
<H2><A NAME="toc3">3.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s3">Checking prerequisites. </A></H2>

<UL>
<LI><A NAME="toc3.1">3.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss3.1">Hardware</A>
<LI><A NAME="toc3.2">3.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss3.2">Software</A>
</UL>
<P>
<H2><A NAME="toc4">4.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s4">System Configuration Requirements for Compiling MythTV. </A></H2>

<UL>
<LI><A NAME="toc4.1">4.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss4.1">Software requirements for compiling MythTV</A>
<LI><A NAME="toc4.2">4.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss4.2">Shared-Library requirements for MythTV </A>
<LI><A NAME="toc4.3">4.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss4.3">Environment variable requirements for MythTV</A>
</UL>
<P>
<H2><A NAME="toc5">5.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s5">Downloading and compiling. </A></H2>

<UL>
<LI><A NAME="toc5.1">5.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss5.1">Building LAME</A>
<LI><A NAME="toc5.2">5.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss5.2">XMLTV</A>
<LI><A NAME="toc5.3">5.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss5.3">Configuring the Schedules Direct service </A>
<LI><A NAME="toc5.4">5.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss5.4">Manually building MythTV</A>
<LI><A NAME="toc5.5">5.5</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss5.5">Gentoo </A>
</UL>
<P>
<H2><A NAME="toc6">6.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s6">MySQL.</A></H2>

<UL>
<LI><A NAME="toc6.1">6.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss6.1">Distribution-specific information</A>
<LI><A NAME="toc6.2">6.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss6.2">Setting up the initial database</A>
</UL>
<P>
<H2><A NAME="toc7">7.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s7">Configuring Sound.</A></H2>

<UL>
<LI><A NAME="toc7.1">7.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss7.1">Graphically setting up the mixer</A>
<LI><A NAME="toc7.2">7.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss7.2">Setting the mixer from the command line</A>
</UL>
<P>
<H2><A NAME="toc8">8.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s8">Setting up a remote control.</A></H2>

<UL>
<LI><A NAME="toc8.1">8.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss8.1">Gentoo</A>
<LI><A NAME="toc8.2">8.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss8.2">Obtaining and compiling lirc</A>
<LI><A NAME="toc8.3">8.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss8.3">Completing the lirc install </A>
<LI><A NAME="toc8.4">8.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss8.4">Additional information for lirc</A>
<LI><A NAME="toc8.5">8.5</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss8.5">Configuring lirc for use with an IR blaster</A>
</UL>
<P>
<H2><A NAME="toc9">9.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s9">Configuring MythTV. </A></H2>

<UL>
<LI><A NAME="toc9.1">9.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss9.1">Configuring the Master backend system</A>
<LI><A NAME="toc9.2">9.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss9.2">Post-configuration</A>
<LI><A NAME="toc9.3">9.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss9.3">Configuring a non-master backend </A>
<LI><A NAME="toc9.4">9.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss9.4">Configuring and running mythfilldatabase</A>
<LI><A NAME="toc9.5">9.5</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss9.5">Grabbing channel icons for Schedules Direct users</A>
</UL>
<P>
<H2><A NAME="toc10">10.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s10">Configuring mythfrontend.</A></H2>

<UL>
<LI><A NAME="toc10.1">10.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss10.1">General</A>
<LI><A NAME="toc10.2">10.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss10.2">Appearance</A>
<LI><A NAME="toc10.3">10.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss10.3">Program Guide</A>
<LI><A NAME="toc10.4">10.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss10.4">Playback </A>
<LI><A NAME="toc10.5">10.5</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss10.5">Recording </A>
<LI><A NAME="toc10.6">10.6</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss10.6">Xbox Frontends</A>
</UL>
<P>
<H2><A NAME="toc11">11.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s11">Using MythTV.</A></H2>

<UL>
<LI><A NAME="toc11.1">11.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss11.1">Keyboard commands</A>
<LI><A NAME="toc11.2">11.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss11.2">Using themes with MythTV</A>
<LI><A NAME="toc11.3">11.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss11.3">Adding DishTV information to the database</A>
<LI><A NAME="toc11.4">11.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss11.4">Adding support for an external tuner</A>
<LI><A NAME="toc11.5">11.5</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss11.5">Using Shutdown/Wakeup</A>
<LI><A NAME="toc11.6">11.6</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss11.6">Controlling the mythfrontend via telnet</A>
</UL>
<P>
<H2><A NAME="toc12">12.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s12">Scheduling Recordings.</A></H2>

<UL>
<LI><A NAME="toc12.1">12.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss12.1">Record Types</A>
<LI><A NAME="toc12.2">12.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss12.2">Scheduling Options</A>
<LI><A NAME="toc12.3">12.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss12.3">Storage Options</A>
<LI><A NAME="toc12.4">12.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss12.4">Post Recording Processing</A>
<LI><A NAME="toc12.5">12.5</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss12.5">Advanced Recording Options</A>
<LI><A NAME="toc12.6">12.6</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss12.6">Scheduling with more than one Input</A>
</UL>
<P>
<H2><A NAME="toc13">13.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s13">MythPlugins. </A></H2>

<P>
<H2><A NAME="toc14">14.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s14">MythWeb.</A></H2>

<UL>
<LI><A NAME="toc14.1">14.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss14.1">Installation and prerequisites</A>
<LI><A NAME="toc14.2">14.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss14.2">Completing the installation</A>
<LI><A NAME="toc14.3">14.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss14.3">Resetting the key binding table</A>
<LI><A NAME="toc14.4">14.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss14.4">Resetting the theme.</A>
</UL>
<P>
<H2><A NAME="toc15">15.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s15">MythGallery.</A></H2>

<UL>
<LI><A NAME="toc15.1">15.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss15.1">Installation and prerequisites</A>
<LI><A NAME="toc15.2">15.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss15.2">Using MythGallery</A>
<LI><A NAME="toc15.3">15.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss15.3">Importing Pictures</A>
</UL>
<P>
<H2><A NAME="toc16">16.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s16">MythGame.</A></H2>

<UL>
<LI><A NAME="toc16.1">16.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss16.1">Setup Directory Structure</A>
<LI><A NAME="toc16.2">16.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss16.2">Download and Install xmame</A>
<LI><A NAME="toc16.3">16.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss16.3">Download extra files</A>
<LI><A NAME="toc16.4">16.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss16.4">Download and Install MythGame.</A>
<LI><A NAME="toc16.5">16.5</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss16.5">Setup xmame in MythGame</A>
<LI><A NAME="toc16.6">16.6</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss16.6">Hints:</A>
</UL>
<P>
<H2><A NAME="toc17">17.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s17">MythMusic. </A></H2>

<UL>
<LI><A NAME="toc17.1">17.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss17.1">Manual installation of prerequisites</A>
<LI><A NAME="toc17.2">17.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss17.2">Mandriva</A>
<LI><A NAME="toc17.3">17.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss17.3">Red Hat Linux 9</A>
<LI><A NAME="toc17.4">17.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss17.4">Compiling MythMusic</A>
<LI><A NAME="toc17.5">17.5</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss17.5">Configuring MythMusic</A>
<LI><A NAME="toc17.6">17.6</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss17.6">Using MythMusic</A>
<LI><A NAME="toc17.7">17.7</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss17.7">Troubleshooting MythMusic</A>
</UL>
<P>
<H2><A NAME="toc18">18.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s18">MythWeather.</A></H2>

<P>
<H2><A NAME="toc19">19.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s19">MythVideo.</A></H2>

<P>
<H2><A NAME="toc20">20.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s20">MythDVD.</A></H2>

<UL>
<LI><A NAME="toc20.1">20.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss20.1">Manual Compilation of Prerequisites</A>
<LI><A NAME="toc20.2">20.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss20.2">Pre-compiled binaries</A>
<LI><A NAME="toc20.3">20.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss20.3">Running the Myth Transcoding Daemon</A>
</UL>
<P>
<H2><A NAME="toc21">21.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s21">MythNews.</A></H2>

<P>
<H2><A NAME="toc22">22.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s22">Troubleshooting.</A></H2>

<UL>
<LI><A NAME="toc22.1">22.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss22.1">Compiling</A>
<LI><A NAME="toc22.2">22.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss22.2">Debugging </A>
<LI><A NAME="toc22.3">22.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss22.3">Installing</A>
<LI><A NAME="toc22.4">22.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss22.4">Using</A>
<LI><A NAME="toc22.5">22.5</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss22.5">Miscellaneous</A>
</UL>
<P>
<H2><A NAME="toc23">23.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s23">Miscellaneous. </A></H2>

<UL>
<LI><A NAME="toc23.1">23.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.1">I'd like to watch the files without using MythTV / I'd like to convert the files to some other format</A>
<LI><A NAME="toc23.2">23.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.2">Using a different window manager</A>
<LI><A NAME="toc23.3">23.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.3">What capture resolution should I use?  How does video work? </A>
<LI><A NAME="toc23.4">23.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.4">MythTV GUI and X Display Sizes</A>
<LI><A NAME="toc23.5">23.5</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.5">Saving or restoring the database </A>
<LI><A NAME="toc23.6">23.6</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.6">Deleting the MySQL database</A>
<LI><A NAME="toc23.7">23.7</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.7">Moving your data to new hardware</A>
<LI><A NAME="toc23.8">23.8</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.8">btaudio </A>
<LI><A NAME="toc23.9">23.9</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.9">Removing unwanted channels</A>
<LI><A NAME="toc23.10">23.10</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.10">NFS</A>
<LI><A NAME="toc23.11">23.11</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.11">Automatically starting mythfrontend at system boot time</A>
<LI><A NAME="toc23.12">23.12</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.12">Automatically starting mythbackend at system boot time</A>
<LI><A NAME="toc23.13">23.13</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.13">Advanced Backend Configurations </A>
<LI><A NAME="toc23.14">23.14</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.14">Using the transcoder</A>
<LI><A NAME="toc23.15">23.15</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.15">Changing your hostname</A>
<LI><A NAME="toc23.16">23.16</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.16">Can I run MythTV on my TiVo?</A>
<LI><A NAME="toc23.17">23.17</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.17">Can I run MythTV on my ReplayTV?</A>
<LI><A NAME="toc23.18">23.18</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.18">Can a wireless connection be used between the frontend and the backend?</A>
<LI><A NAME="toc23.19">23.19</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.19">How can I burn shows that I have recorded to a DVD?</A>
<LI><A NAME="toc23.20">23.20</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.20">Using the DBoxII within MythTV</A>
<LI><A NAME="toc23.21">23.21</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.21">What do the icons on the Watch Recordings screen mean?</A>
<LI><A NAME="toc23.22">23.22</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.22">What do the letters mean when I change channels?</A>
<LI><A NAME="toc23.23">23.23</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.23">What is the difference between the various Hauppauge PVR models?</A>
<LI><A NAME="toc23.24">23.24</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.24">Changing channels on an external Set Top Box</A>
<LI><A NAME="toc23.25">23.25</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss23.25">Configuring one machine to flag all commercials</A>
</UL>
<P>
<H2><A NAME="toc24">24.</A> <A HREF="mythtv-HOWTO-singlehtml.html#s24">Example Configurations.</A></H2>

<UL>
<LI><A NAME="toc24.1">24.1</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss24.1">Logical Volume Manager (LVM) </A>
<LI><A NAME="toc24.2">24.2</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss24.2">Advanced Partition Formatting </A>
<LI><A NAME="toc24.3">24.3</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss24.3">Migrating from DataDirect Labs to Schedules Direct</A>
<LI><A NAME="toc24.4">24.4</A> <A HREF="mythtv-HOWTO-singlehtml.html#ss24.4">Caching support for Schedules Direct</A>
</UL>

<HR>
<H2><A NAME="s1">1.</A> <A HREF="#toc1">First things first.</A></H2>

<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: Please note that I, Robert Kulagowski, am <EM>NOT</EM> the
author/programmer of the MythTV application!  I can not give you
personalized installation support.  If you are having issues installing
MythTV you should examine the archives, or post your question to the
MythTV-users mailing list.  If you send me "Does MythTV work with 'X'"?
messages - I will simply instruct you to ask your question on the
mythtv-users mailing list.</CAPTION>
</FIGURE>
</P>
<H2><A NAME="ss1.1">1.1</A> <A HREF="#toc1.1">What is MythTV?</A>
</H2>

<P>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 is known to work on Linux and Mac OS X
(PowerPC and Intel).  It does not run on Windows.</P>
<P>MythTV has a number of capabilities.  The television portion allows you to
do the following:
<UL>
<LI>You may pause, fast-forward and rewind live Television.</LI>
<LI>You may install multiple video capture cards to record more than one
program at a time.</LI>
<LI>You can have multiple servers (called "backends"), each with multiple
capture cards in them.  All scheduling is performed by the Master backend,
which arbitrates which recording will be performed by each device.  All
recording requests are managed by the Master backend, so you can schedule a
recording from any client.</LI>
<LI>You can have multiple clients (called "frontends" in MythTV parlance),
each with a common view of all available programs.  Any client can watch any
program that was recorded by any of the servers, assuming that they have the
hardware capabilities to view the content; a low-powered frontend will not
be able to watch HDTV, for example.  Clients can be diskless and controlled
entirely by a remote control.</LI>
<LI>You may use any combination of standard analog capture card, MPEG-2,
MJPEG, DVB, HDTV, USB and firewire capture devices.  With appropriate
hardware, MythTV can control set top boxes, often found in digital cable and
satellite TV systems.</LI>
<LI>Program Guide Data in North America is downloaded from
schedulesdirect.org, a non-profit organization which has licensed data from
Tribune Media Services.  This service provides almost two weeks of
scheduling information. Program Guide Data in other countries is obtained
using XMLTV.  MythTV uses this information to create a schedule that
maximizes the number of programs that can be recorded if you don't have
enough tuners.</LI>
<LI>MythTV implements a UPNP server, so a UPNP client should automatically
see content from your MythTV system.</LI>
</UL>
 
Other modules in MythTV include:
<UL>
<LI>MythArchive, a tool to create DVDs</LI>
<LI>MythBrowser, a web browser</LI>
<LI>MythControls, an application to configure your remote control</LI>
<LI>MythFlix, a Netflix module</LI>
<LI>MythGallery, a picture-viewing application</LI>
<LI>MythGame</LI>
<LI>MythMusic, a music playing / ripping application which supports MP3
and FLAC</LI>
<LI>MythNews, a RSS news grabber</LI>
<LI>MythPhone, phone and videophone using SIP.</LI>
<LI>MythVideo, DVD ripper and a media-viewer for content not created within MythTV</LI>
<LI>MythWeather</LI>
<LI>MythWeb, which allows you to control your MythTV system using a web
browser.  With MythWeb, you can schedule and delete recordings, change
keybindings and more.  With proper security, you may even schedule a program
over the Internet and have it immediately acted on by the Master backend.</LI>
</UL>
</P>
<H2><A NAME="ss1.2">1.2</A> <A HREF="#toc1.2">QuickStart</A>
</H2>

<P>Custom mini-distributions are available to make it easier to install
MythTV.  A mini-distribution removes many of the "general purpose"
workstation / server software packages that may be installed by default if
you use one of the big-name OS packages.</P>
<P>See 
<A HREF="http://mysettopbox.tv">http://mysettopbox.tv</A> if you'd
like to install a custom version of Knoppix optimized for MythTV.</P>
<P>See 
<A HREF="http://www.minimyth.org">http://www.minimyth.org</A> if you'd like
to install MythTV onto a diskless system.</P>
<P>See 
<A HREF="http://bit.blkbk.com">http://bit.blkbk.com</A> if you'd
like to install MythTV on a Xbox.
<B>NOTE</B>:  Site appears unmaintained.</P>
<P>See 
<A HREF="http://wilsonet.com/mythtv/">http://wilsonet.com/mythtv/</A> for instructions tailored to RedHat's
Fedora Core distribution.</P>
<P>See 
<A HREF="http://www.mythbuntu.org">http://www.mythbuntu.org</A> if
you'd like to install a customized version of Ubuntu optimized for MythTV.</P>
<P>There is a MythTV wiki at 
<A HREF="http://wiki.mythtv.org">http://wiki.mythtv.org</A>.</P>
<P>If you are installing this version for Schedules Direct support, please see
the 
<A HREF="#migratingtoSD">Migrating from DataDirect Labs to Schedules Direct</A> section for additional information.</P>

<H2><A NAME="ss1.3">1.3</A> <A HREF="#toc1.3">Upgrading from previous versions</A>
</H2>

<P>The upgrade from previous versions should be transparent.  Any changes to
the database structure should be applied automatically.</P>
<P>It is <EM>strongly</EM> recommended that you back up your database before
installing a new version of MythTV.</P>
<P>See 
<A HREF="#backupdb">Saving or Restoring the database</A> for instructions.</P>

<H2><A NAME="how_to_obtain"></A> <A NAME="ss1.4">1.4</A> <A HREF="#toc1.4">How to obtain this document / PDF versions of this document </A>
</H2>

<P>This HOWTO document is maintained at the primary MythTV website: 
<A HREF="http://www.mythtv.org">http://www.mythtv.org</A> by Robert
Kulagowski 
<A HREF="mailto:rkulagow@rocketmail.com">mailto:rkulagow@rocketmail.com</A>.</P>
<P>This document is available as a single-page HTML document at 
<A HREF="http://www.mythtv.org/docs/mythtv-HOWTO-singlehtml.html">http://www.mythtv.org/docs/mythtv-HOWTO-singlehtml.html</A> or as a PDF
at 
<A HREF="http://www.mythtv.org/docs/mythtv-HOWTO.pdf">http://www.mythtv.org/docs/mythtv-HOWTO.pdf</A>.</P>
<P>This HOWTO is for MythTV v0.21</P>
<P>Release notes for this version may be found in the MythTV Wiki at 
<A HREF="http://www.mythtv.org/wiki/index.php/Release_Notes_-_0.21">http://www.mythtv.org/wiki/index.php/Release_Notes_-_0.21</A></P>

<H2><A NAME="ss1.5">1.5</A> <A HREF="#toc1.5">Books about MythTV</A>
</H2>

<P>If you would like to purchase a book specifically about MythTV:</P>
<P>
<UL>
<LI>Hacking MythTV, ISBN 978-0470037874 by Wilson, Tittel, Wright and Korelc</LI>
<LI>Practical MythTV: Building a PVR and Media Center PC, ISBN 978-1590597798 by Smith and Still</LI>
</UL>
</P>

<H2><A NAME="ss1.6">1.6</A> <A HREF="#toc1.6">Document conventions</A>
</H2>

<P>The following conventions are used throughout this document.<BR>
<B>boldface</B> - used for program names.<BR>
<CODE>typewriter</CODE> - used for program paths.<BR>
<EM>emphasis</EM> - Pay attention here.<BR></P>
<P>
<FIGURE>
<EPS FILE="warning.eps">
<IMG SRC="warning.png">
<CAPTION>Pay more attention.</CAPTION>
</FIGURE>
</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION>Ignore at your own peril.</CAPTION>
</FIGURE>
</P>
<P>
<FIGURE>
<EPS FILE="add.eps">
<IMG SRC="add.png">
<CAPTION>Feature that has been added to SVN (subversion, a revision control system)
but is not available in the current release.</CAPTION>
</FIGURE>
</P>

<H2><A NAME="ss1.7">1.7</A> <A HREF="#toc1.7">Mailing lists / getting help</A>
</H2>

<P>It's recommended that you join the user list at 
<A HREF="http://www.mythtv.org/mailman/listinfo/mythtv-users">http://www.mythtv.org/mailman/listinfo/mythtv-users</A>.  The developer
list is at 
<A HREF="http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev">http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev</A>.  Please keep
the developer list strictly for development-related issues.</P>
<P>Searchable archives for the lists are available at 
<A HREF="http://www.gossamer-threads.com/lists/mythtv/">http://www.gossamer-threads.com/lists/mythtv/</A>.</P>

<H2><A NAME="ss1.8">1.8</A> <A HREF="#toc1.8">IRC</A>
</H2>

<P>There are two IRC channels dedicated to MythTV which can be found on
irc.freenode.net
<UL>
<LI>mythtv</LI>
<LI>mythtv-users</LI>
</UL>
</P>
<P>The <CODE>mythtv</CODE> channel is where the developers discuss code.  It is
<EM>not</EM> a user-support channel.  Please don't ask non-development
related questions there.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION>Really.  Even if there's no one in the mythtv-users IRC group or everyone
seems to be ignoring you.</CAPTION>
</FIGURE>
</P>

<H2><A NAME="ss1.9">1.9</A> <A HREF="#toc1.9">Bug database</A>
</H2>

<P>If you feel you need to contribute to a bug database, use the MythTV bug
ticketing system at 
<A HREF="http://svn.mythtv.org/trac">http://svn.mythtv.org/trac</A>.</P>
<P>Good entries will contain the following:
<OL>
<LI>Qt version</LI>
<LI>Linux distribution</LI>
<LI>gcc version</LI>
<LI>the last entry in config.log to detail how you compiled</LI>
<LI>MythTV version numbers (<EM>e.g.</EM>from mythfrontend --version)</LI>
<LI>Hardware</LI>
<LI>How you are able to reproduce the bug</LI>
</OL>
</P>
<P>See the instructions on how to debug in 
<A HREF="#debugging">Section 22</A>.</P>
<P>The bug database is not a chat room, so restrict your entries to what is
relevant.  It's also not a repository of feature requests; a feature request
without an accompanying patch file to implement that feature will be quickly
closed.  There is a feature wishlist on the wiki at 
<A HREF="http://www.mythtv.org/wiki/index.php/Feature_Wishlist">http://www.mythtv.org/wiki/index.php/Feature_Wishlist</A>.  There is no
guarantee that anything on the wishlist will ever get code written to
implement it.</P>
<P>If a developer closes out your bug, it's likely you didn't provide enough
information.  Don't re-open a bug without providing additional information.</P>

<H2><A NAME="ss1.10">1.10</A> <A HREF="#toc1.10">Contributing to this document</A>
</H2>

<P>Contributions to the HOWTO are welcome, especially if you find a
grammatical or spelling error, or if the wording of something is just plain
confusing.</P>
<P>If you'd like to make a new contribution, create a ticket at 
<A HREF="http://svn.mythtv.org/trac">http://svn.mythtv.org/trac</A> and
click "New Ticket".  The type should be set to "patch" and the owner set to
"rkulagow" to ensure that I see your contribution.</P>
<P>Please send it as either SGML or as plain text. <EM>NO HTML</EM>.  The
source used to create the HOWTO is in SGML / Linuxdoc.  Do not be afraid of
SGML!  A quick look at the source of this HOWTO will show that it is not
difficult, because there aren't that many tags to worry about, so at least
<EM>try</EM> to submit as SGML. See the Linuxdoc HOWTO at 
<A HREF="http://www.tldp.org/HOWTO/Howtos-with-LinuxDoc.html">http://www.tldp.org/HOWTO/Howtos-with-LinuxDoc.html</A> for information
on the linuxdoc format itself, or look at the <CODE>mythtv-HOWTO.sgml</CODE>
file as an example.</P>
<P>To create the actual patch, run <B>diff -u origfilename newfile >
doc.patch</B> and attach your contribution to the trac ticket.</P>

<H2><A NAME="s2">2.</A> <A HREF="#toc2">Introduction.</A></H2>

<P>This HOWTO document will focus on manually building MythTV in a North
American environment. If you have installation instructions for a different
region or Linux distribution, please send them to the author so that it can
be included in other versions of this document.</P>

<H2><A NAME="s3">3.</A> <A HREF="#toc3">Checking prerequisites. </A></H2>

<P>You must ensure that any firewalls (either hardware, or a software
firewall installed by your distribution) will not block access to the ports
that will be used by the MythTV clients and servers on the "inside" LAN. 
The ports for MySQL (TCP port 3306) and mythbackend (TCP ports 6543 and
6544) must be open.  It is <EM>strongly</EM> recommended that you do
<EM>not</EM> expose the MythTV and MySQL ports to the Internet or your
"Outside" LAN.</P>

<H2><A NAME="ss3.1">3.1</A> <A HREF="#toc3.1">Hardware</A>
</H2>

<P>Hardware selection is a complex topic, one this HOWTO will only discuss
briefly and in general terms. The following subsections offer some general 
guidance but stop short of offering specific recommendations.</P>
<P>For a good MythTV experience, you must understand that MythTV exercises your
hardware more than a typical desktop. Encoder cards generate DMA across the
PCI bus.  The CPU is busy encoding / decoding video. Hard drives are
constantly reading and writing data. Building a MythTV system on older /
"spare" hardware may be an exercise in frustration and can waste many hours
of valuable time.</P>
<P>For more detail about actual configurations that others have used, Mark
Cooper has setup a hardware database at 
<A HREF="http://pvrhw.goldfish.org/">http://pvrhw.goldfish.org/</A>. The
website will let you browse what other users have reported as their hardware
configuration, and how happy they are with the results.</P>
<P>If you have specific questions about the suitability of specific hardware
choices, you can consult the archives of the mythtv-users mailing list at
<A HREF="http://www.gossamer-threads.com/lists/mythtv/">http://www.gossamer-threads.com/lists/mythtv/</A> or
post a question to the list.</P>
<H3>CPU Type and Speed</H3>

<P>Selection of CPU type and speed is one of the trickiest elements of
hardware selection, mainly because there are so many tradeoffs which can be
made.  For example, if you have plenty of CPU, you can use higher bitrates
or capture sizes, etc.</P>
<P>MythTV has two modes of operation.  First, it can function as a software
video encoder, which means that it uses a fairly generic "dumb" video
capture card to get frames of video, encodes them using the CPU on your
motherboard and writes them to disk.  High-end video capture cards and
devices like the TiVo and ReplayTV have dedicated encoder chips which use
specialized hardware to convert the video stream to the MPEG-2 format
without using the motherboard CPU.  The main CPU has the responsibility of
running the Operating System and reading and writing the encoded frames to
the disk.  These tasks have fairly low CPU requirements compared to encoding
video, which is why a device like a Series 1 TiVo can run with only 16MB of
RAM and a 54MHz CPU.</P>
<P>There are many variables that go into the question: "How fast a CPU do I
need to run MythTV"?  Obviously, the faster your CPU, the better your
experience will be with MythTV.  If you are using the software MPEG-4
encoder and performing the "Watch TV" function, where the CPU is both
encoding and decoding video simultaneously to allow Pause, Fast Forward and
Rewind functions for live TV requires more CPU then just encoding or
decoding.  MythTV also supports multiple encoder cards in a single PC,
thereby increasing the CPU requirements if you plan on simultaneously
encoding multiple programs.  As a general guideline, plan on 1GHz per
encoder if you are doing software-based encoding, less if you are using a
hardware-based encoder.</P>
<P>Here are a few data points:
<UL>
<LI>A PIII/733MHz system can encode one video stream using the MPEG-4
codec using 480x480 capture resolution.  This does not allow for live TV
watching, but does allow for encoding video and then watching it later.</LI>
<LI>A developer states that his AMD1800+ system can <B>almost</B>
encode two MPEG-4 video streams and watch one program simultaneously.</LI>
<LI>A PIII/800MHz system with 512MB RAM can encode one video
stream using the RTjpeg codec with 480x480 capture resolution and play it back
simultaneously, thereby allowing live TV watching.</LI>
<LI>A dual Celeron/450MHz is able to view a 480x480 MPEG-4/3300kbps file
created on a different system with 30% CPU usage.</LI>
<LI>A P4 2.4GHz machine can encode two 3300Kbps 480x480 MPEG-4 files and
simultaneously serve content to a remote frontend.</LI>
</UL>
</P>
<P>The second mode of operation is where MythTV is paired with a hardware-based
video encoder, such as a Matrox G200 or a Hauppauge
WinTV-PVR-150/250/350/500.  In this mode, because the video encoding is
being done by a dedicated video processor, the host CPU requirements are
quite low.  See the 
<A HREF="#video_capture_device">Video Capture Device</A> section for details.</P>
<P>The price differential between a frame grabber and a card that implements
hardware MPEG-2 encoding, such as the Hauppauge PVR-x50 series, is now less
than $30 US.  Primary development in MythTV has transitioned to supporting
MPEG-2 capture devices and HDTV, so if given the option, go with the
hardware MPEG-2 encoder.</P>
<P>If you have a Via M10000 series or a Hauppauge PVR-350, MythTV can use the
hardware-based video decoder for playback, which further reduces CPU
requirements.</P>

<H3>Memory</H3>

<P>A MythTV host that is both a backend and a frontend and using software
encoding with a single capture card should run adequately in 256MB of RAM.
Additional RAM above 256MB will not necessarily increase performance, but
may be useful if you are running multiple encoders.</P>

<H3>Hard Disk(s)</H3>

<P>Encoded video takes up a lot of hard disk space. The exact amount depends
on the encoding scheme, the size of the raw images and the frames per
second, but typical values for MythTV range from 700 megabytes/hour for
MPEG-4, 2 GB/hour for MPEG-2 and RTjpeg and 7 GB/hour for ATSC HDTV.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  You <EM>must</EM> use DMA for hard drive access to prevent
choppy or jittery video.  Not all distributions enable DMA at boot time. See the Troubleshooting Section for 
<A HREF="#Setting_DMA">instructions</A> on how to do this.</CAPTION>
</FIGURE>
</P>
<P>Writing video to disk is sensitive to timing issues; RTjpeg requires less
CPU with the tradeoff being larger files and needing to write to the disk
faster.  MPEG-4 requires more CPU, but the files are smaller.  At the
default resolution, MPEG-2 creates the largest files of all with almost no
CPU impact.</P>
<P>See the Troubleshooting 
<A HREF="#Setting_DMA">section</A> for more
information.</P>

<H3>Filesystems</H3>

<P>MythTV creates large files, many in excess of 4GB.  You <EM>must</EM> 
use a 64 or 128 bit filesystem. These will allow you to create large files.
Filesystems known to have problems with large files are FAT (all versions),
and ReiserFS (versions 3 and 4). </P>
<P>Because MythTV creates very large files, a filesystem that does well at
deleting large files is important.  Numerous benchmarks show that XFS and
JFS do very well at this task.  You are <EM>strongly</EM> encouraged to
consider one of these for your MythTV filesystem.  JFS is the absolute best
at deletion, so you may want to try it if XFS gives you problems.  MythTV
.21 incorporates a "slow delete" feature, which progressively shrinks
the file rather than attempting to delete it all at once, so if you're more
comfortable with a filesystem such as ext3 (whose delete performance for
large files isn't that good) you may use it rather than one of the
known-good high-performance file systems.  There are other ramifications to
using XFS and JFS - neither offer the opportunity to shrink a filesystem;
they may only be expanded.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  You <EM>must not</EM> use ReiserFS v3 for
your recordings. You will get corrupted recordings if you do.</CAPTION>
</FIGURE>
</P>
<P>Because of the size of the MythTV files, it may be useful to plan for future
expansion right from the beginning.  If your case and power supply have the
capacity for additional hard drives, read through the 
<A HREF="#LVM">LVM</A> and 
<A HREF="#advancedpartitionformatting">Advanced Partition Formatting</A> sections for some pointers.</P>
<P>
<A NAME="video_capture_device"></A> </P>
<H3>Video Capture Device </H3>

<P>In order to capture video, MythTV will need one or more video capture
devices with Linux drivers.  There are a number of classes of hardware
available for capturing video.  </P>
<H3>Frame Grabbers.</H3>

<P>This class of card is the simplest and is usually the cheapest.  There is no
on-board encoding of the analog video; hardware known as a Digital-Analog
Converter (DAC) takes the video and presents it to the computer in an
essentially raw digital form.</P>
<P>For a list of video capture cards known to work with Linux, please see
<CODE>/usr/src/linux/Documentation/video4linux/bttv</CODE> for a partial
listing; even if your specific card is not listed, it may be that the vendor
is actually using a standard reference design and placing their own name on
it.  See the video4linux mailing list (
<A HREF="https://listman.redhat.com/mailman/listinfo/video4linux-list">https://listman.redhat.com/mailman/listinfo/video4linux-list</A>) for
more information and for specific hardware questions.</P>
<P>The most common inexpensive cards available use the Bt848, Bt878 or CX2388x
series of video capture chips; examples are the "Hauppauge WinTV Go" card and
the "AverTV Desktop PVR" card, both of which use the bttv kernel module.</P>
<P>
<HR>
<PRE>
NOTE:  The ATI TV Wonder series and the ATI All-in-Wonder series of cards
are not the same.  The All-in-Wonder cards will not work with MythTV.
</PRE>
<HR>
</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
</FIGURE>

<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: The ATI All-in-Wonder cards (which are not the same
as the ATI TV Wonder, TV Wonder VE or TV Wonder Pro) <EM>will not</EM> work
as a MythTV capture device because the GATOS 
<A HREF="http://gatos.sourceforge.net">http://gatos.sourceforge.net</A>
drivers that are available provide only a limited subset of the V4L API. The TV Wonder series of cards are supported by the Bt8x8 Video4Linux driver.</CAPTION>
</FIGURE>
</P>
<P>After you have installed a suitable capture device, you can check that 
the kernel sees it with <CODE>lspci</CODE>. Look for an entry labeled "Multimedia 
video controller". To get more detailed information about the card, use 
<CODE>lspci -v</CODE> or <CODE>lspci -vv</CODE>.  Ensure that your system is loading
the bttv modules by typing:
<BLOCKQUOTE><CODE>
<PRE>
# lsmod |grep bttv
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>You want to see the <CODE>bttv</CODE> module listed.</P>
<H3>Hardware MPEG-2 encoders.</H3>

<P>While inexpensive video-capture cards simply capture raw frames, leaving
encoding to software, some higher-end cards incorporate hardware-based
encoding. Using either a G200 MJPEG encoder card, or a MPEG-2 encoder card
supported by the IvyTV project 
<A HREF="http://ivtvdriver.org/">http://ivtvdriver.org</A> such as the Hauppauge
PVR-150/250/350/500, Avermedia M179, Hauppauge "Freestyle" or Yuan M600
cards will allow you to use dedicated hardware encoders rather than your
CPU. (The PVR-350 can simultaneously be used as an output device.) Using the
on-board MPEG-2 encoder greatly reduces the CPU requirements for
encoding.</P>
<P>The ivtv driver was incorporated into the Linux kernel starting at v2.6.22.</P>
<P>There is a Beta driver for the HVR-1600 card at 
<A HREF="http://www.ivtvdriver.org/index.php/Cx18">http://www.ivtvdriver.org/index.php/Cx18</A></P>
<P><B>NOTE</B>:  Motherboards with the Via chipset are notoriously bad with
DMA and have caused numerous issues with ivtv, including hard locks.  See
the ivtv website 
<A HREF="http://ivtvdriver.org">http://ivtvdriver.org</A>
for the latest information on what works and what doesn't.</P>
<P>Here are some data points for encoding:
<UL>
<LI>A Celeron 450 uses 2% CPU for encoding a 480x480 16Mbps MPEG-2 stream.</LI>
</UL>
</P>
<P>Here are some data points for decoding:</P>
<P>
<UL>
<LI>An Athlon 1800XP can decode a 720x480 8Mbps MPEG-2 file using 10% CPU</LI>
<LI>An Athlon 1GHz can decode a 720x480 16Mbps MPEG-2 file using 30-50%
CPU, can decode a 480x480 16Mbps MPEG-2 using 30% CPU and approximately 30%
for Live TV at 416x480.</LI>
<LI>A P3-550 can decode a 480x480 16Mbps MPEG-2 file with 55% CPU.</LI>
<LI>A Celeron 450 (no SSE) can decode a 480x480 16Mbps MPEG-2 file with
80% CPU.</LI>
</UL>
</P>

<H3>DVB capture cards.</H3>

<P>DVB is a video standard primarily found in Europe (where it comes in
DVB-C, DVB-T and DVB-S varieties for Cable, Terrestrial and Satellite) and
is also used as the programming interface for HDTV capture cards in Linux. 
To see if your DVB card is supported, see the list of cards in the
"Supported Hardware" section of the DVB Wiki at 
<A HREF="http://www.linuxtv.org/wiki/index.php/Main_Page">http://www.linuxtv.org/wiki/index.php/Main_Page</A> for more
information.</P>
<P>In the United States, you may use a card such as the TwinHan to obtain
unencrypted Free-To-Air satellite channels.  See 
<A HREF="http://www.lyngsat.com/">http://www.lyngsat.com/</A> for the types
of content which is available.</P>

<H3>HDTV.</H3>

<P>There are a number of HDTV cards with Linux drivers which are known to
operate in the United States; a complete list of cards with DVB drivers can
be found at 
<A HREF="http://www.linuxtv.org/wiki/index.php/ATSC_Devices">http://www.linuxtv.org/wiki/index.php/ATSC_Devices</A> Some cards
support capture of unencrypted digital cable TV (utilizing QAM256), others
will only work with Over The Air (aka "OTA") signals captured with an
antenna (with 8VSB).</P>
<P>Cards that have been reported to work include:
<UL>
<LI>pcHDTV HD-2000, Air2PC PCI rev 1-3 (8VSB only)</LI>
<LI>SiliconDust HDHomeRun           (8VSB, QAM256)</LI>
<LI>pcHDTV HD-3000/5500             (8VSB, QAM256)</LI>
<LI>Air2PC HD-5000                  (8VSB, QAM256)</LI>
<LI>DViCO Fusion HDTV Lite/Gold 5   (8VSB, QAM256)</LI>
</UL>
</P>
<P><B>NOTE</B>: There are no known consumer-level capture devices which will
allow you to capture the HDTV output (DVI, HDMI, VGA, YPbPr / Component)
from a set-top box commonly found with digital cable systems or satellite
systems. <EM>None</EM> of the capture devices listed above
perform any encoding; they merely allow your computer to save a copy of a
HDTV stream which has already been converted to MPEG-2 at the broadcast
facility.</P>
<P><B>NOTE:</B>: All of the cards listed above (except for the HD-2000 and
HDHomeRun) should be configured as DVB cards. The HD-2000 can be configured
as a pcHDTV card if you use the V4L drivers from 
<A HREF="http://www.pchdtv.com">http://www.pchdtv.com</A> and use Linux
kernel 2.6.9 or earlier.  With kernel 2.6.10 and higher it must be
configured as a DVB card, but you lose access to the second antenna input in
ATSC mode. The HDHomeRun should be configured as two HDHomeRun cards, one
for each tuner.</P>
<P>To playback HDTV content, plan on a powerful CPU.  "How powerful?" depends
on a number of factors, such as the capture resolution, whether the video is
progressive or interlaced, and whether your display card has hardware-assist
support for Linux.</P>
<P>The Simple Answer: Once you are in the 3.2 Ghz P4-class of CPU you should have
no issues with viewing HDTV.</P>
<P>The Complicated Answer:</P>
<P>For 720p content (1280x720), a 2.4GHz P4 should be sufficient.</P>
<P>For 1920x1080i->1920x1080p with the better deinterlacing methods
done in real time a 2.4GHz CPU is taxed, but should work if you use "Bob and
Weave" deinterlacing, or if you have an NVIDIA card with MPEG-2 hardware
acceleration.  If you enable the hardware acceleration, you may be able to
use a 1.8GHz processor.</P>

<H3>Firewire.</H3>

<P>You may use the Firewire output of the Motorola DCT6200 or the SA3250. 
If your provider uses 5C encryption on a particular channel, you won't be
able to get any content.</P>

<H3>DBoxII or other devices running Neutrino</H3>

<P>You may use the Ethernet port of an DBoxII or a similar device to capture 
MPEG2. Your set top box has to be running the Neutrino GUI. </P>

<H3>USB Capture Devices.</H3>

<P>The Plextor ConvertX PVR devices are supported through Linux drivers
available from 
<A HREF="http://www.plextor.com/english/support/LinuxSDK.htm">http://www.plextor.com/english/support/LinuxSDK.htm</A>. MythTV uses the
Plextor to capture hardware encoded MPEG-4, so the host CPU requirements are low.</P>
<P>Hauppauge WinTV-PVR-USB2 (driver available at 
<A HREF="http://www.isely.net/pvrusb2/">http://www.isely.net/pvrusb2/</A>)
emulates a PVR-x50 card.</P>

<H3>IP Recorder (RTSP, RTS, UDP)</H3>

<P>MPEG-2, MPEG-4 and H.264 internet TS stream recording is supported using
the IPTV recorder in MythTV. This recorder expects the channels to be supplied
as a m3u playlist. If your DSL/Fiber provider supplies television service,
but does not provide a m3u playlist for the channels, you can construct one
for your own use. You do not need to download it from the same server as the
streams themselves, and can also read it from a file if this is more convenient.</P>
<P><B>NOTE</B>: Some DSL providers only allow you to use one recorder at a
time, so you may need to limit yourself to one recorder in MythTV and turn
off any set top box the cable provider sold or rented to you with your
service. This limitation is independent of the bandwidth you have purchased.</P>

<H3>Hardware known NOT to work and other issues</H3>

<P>
<UL>
<LI>Hauppauge WinTV-D or -HD (no driver)</LI>
<LI>Hauppauge WinTV-USB series</LI>
<LI>Hauppauge WinTV-PVR-usb (model 602), or WinTV-PVR-PCI (model 880) cards (no driver - this is not the PVR-250/350
series of cards supported by the IvyTV driver)</LI>
<LI>ATI All-in-Wonder series</LI>
</UL>
</P>

<H3>Sound card</H3>

<P>The system needs a sound card or an on-board equivalent on the motherboard
to play back and in most cases, to record sound. Any sound card that can be
operated by the ALSA (Advanced Linux Sound Architecture) kernel modules will
work with MythTV.  However, some cards and drivers will provide better
quality or compatibility than others.  In particular, many audio
devices included on motherboards can be problematic.</P>
<P>The usual practice for capturing the audio associated with the video is to
run a cable from an audio output on the video capture card to the Line input
on a sound card. However, some video capture cards provide on-board audio
capabilities that work with the kernel <CODE>btaudio</CODE> module instead,
thereby eliminating the need for a cable.  This is useful if you will be
using multiple capture cards in a single chassis, since each capture card
will not need its own sound card.  Note that a separate sound card is still
required for playback when using <CODE>btaudio</CODE>, and that often the audio
recorded in this way will be mono only.  See the 
<A HREF="#btaudio">btaudio</A> section for more information.</P>
<P>
<FIGURE>
<EPS FILE="warning">
<IMG SRC="warning.png">
<CAPTION><B>NOTE</B>:  Analog video capture cards are the only ones which
require a soundcard for capturing audio.  DVB, HDTV, and other hardware
encoder cards all provide a combined audio / video stream.</CAPTION>
</FIGURE>
</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  Plugging a Line-level device into the Mic input is
not recommended.  Line-level devices have higher voltages and can damage the
sound card.  In addition, even if it doesn't break your card, you will be
getting Mono sound.  See the Linux MP3 HOWTO at 
<A HREF="http://www.tldp.org/HOWTO/MP3-HOWTO.html">http://www.tldp.org/HOWTO/MP3-HOWTO.html</A> for additional information.</CAPTION>
</FIGURE>
</P>

<H3>Video Display Card</H3>

<P>MythTV will work with just about any video card.  However, it is highly
recommended that you use a card which supports XVideo (XV) extensions. If
your card does not support XV, color conversion and scaling will be
performed by your CPU rather than the video card.  This is very CPU
and memory intensive and will often result in dropped frames and a
corresponding degradation of quality.  Check the X documentation
for details if you are uncertain about your preferred card.  You may
also run <CODE>xvinfo</CODE>; look for your video card to be listed as one
of the adapters.</P>

<P>If you want to use MythTV with a standard television, you will need a
physical connection from your video card to your TV set, which can either be
a TV-out port on the card itself or an external adapter that converts the
VGA signal to an appropriate video signal. "Appropriate" depends on a number
of factors, such as video standard (NTSC vs. PAL), the type of input
connection (Composite vs. SVideo), etc.</P>
<P>Note that with some video cards and X drivers, XVideo extensions are
only supported on the VGA output, and not on the TV output.</P>

<H3>Cards with TV-out</H3>

<P>The next section deals with a number of cards that are known to have
TV-out ports.  The list is unlikely to be complete, so if you know of
others, please post a message to the mythtv-users mailing list so the
information can be included in future versions of the HOWTO. The list is
organized by manufacturer.</P>
<P>Reports here are based on what users of the cards have posted on the
mythtv-users mailing list, so if you need configuration details, please
search the archives at 
<A HREF="http://www.gossamer-threads.com/lists/mythtv/">http://www.gossamer-threads.com/lists/mythtv/</A> using
the card name in your search string.</P>

<H3>ATI</H3>

<P>ATI makes many cards with TV-out capability, but only offers Linux
drivers for Radeon 8500 and above cards.  See the Drivers and Software
section of 
<A HREF="http://www.ati.com/">http://www.ati.com</A> for the
driver and additional information.</P>
<P>The enhanced ati.2 X driver created by the GATOS 
<A HREF="http://gatos.sourceforge.net">http://gatos.sourceforge.net</A>
project offers some support for TV-out on other ATI cards, but only in its
"experimental" version, available through CVS. There have been reports from
people who say they have made this driver work with one or another ATI card.
For example, Bruce Markey 
<A HREF="mailto:bjm@lvcm.com">mailto:bjm@lvcm.com</A> writes (on the
mythtv-users mailing list): "I got this to work. You can quote me on that.
I've used TV-out on several models of ATI cards both All-In-Wonder and
regular cards with TV-out." See the "Adventurous Setup" section of 
<A HREF="http://gatos.sourceforge.net/watching_tv.php">http://gatos.sourceforge.net/watching_tv.php</A> for details. Also see
<A HREF="http://www.retinalburn.net/linux/tvout.html">http://www.retinalburn.net/linux/tvout.html</A> for more information.</P>

<H3>NVIDIA</H3>

<P>Some NVIDIA cards with TV-out can be run using the standard nv driver in 
X, combined with the userspace application <B>nvtv</B> to control the TV-out 
port. See 
<A HREF="http://sourceforge.net/projects/nv-tv-out/">http://sourceforge.net/projects/nv-tv-out/</A> for details.  Recent
versions of the NVIDIA driver have better support for overscan and other
features useful with TV-Out, so the <B>nvtv</B> application may not be
required.</P>
<P>Some NVIDIA cards can be run with a proprietary NVIDIA X driver made
available by NVIDIA. See 
<A HREF="http://www.nvidia.com/object/unix.html">http://www.nvidia.com/object/unix.html</A> for more information.</P>
<P><B>NOTE</B>:  It's strongly recommended that you use the proprietary
NVIDIA drivers; they have excellent support for XvMC and ship with a good
configuration utility.  XvMC provides MPEG-2 hardware acceleration, which is
important if you want to display HDTV.</P>

<H3><A NAME="PVR-350"></A> Hauppauge PVR-350 </H3>

<P>MythTV supports the TV-out and MPEG-2 decoder functions in the IvyTV
driver.</P>
<P>The PVR-350 is unique amongst the Hauppauge PVR-x50 cards in that it also
supports audio output, but you need to connect that audio output to
something.  There are two courses of action you may take:
<OL>
<LI>Take the audio output from the PVR-350 and plug it into an input on a
sound card on your machine.  You may then use MythTV's internal audio
controls.</LI>
<LI>Take the audio output from the PVR-350 and connect it directly to your
television / audio system.  You must indicate that you are using external
audio control on the PVR-350 setup page.</LI>
</OL>
</P>

<H3>Other Options</H3>

<P>Some devices with on-board TV-out capability, such as Xboxes converted to 
Linux and some laptops can be used as MythTV frontends to display on a 
television screen. Please consult the mythtv-users mailing list for messages 
that report the details of these special arrangements.</P>

<H3>External Adapters</H3>

<P>External adapters convert standard VGA output to a form suitable for 
display on a television. The output format varies by region, since 
different countries have different TV standards. People on the mythtv-users 
list have mentioned these adapters:</P>
<P>
<UL>
<LI>AITech Web Cable Plus, powered by external transformer or takes power
from PS/2 keyboard connector, support resolutions up to 1024x768, outputs
composite and SVideo, provides position adjustment.</LI>
<LI>Averkey lite, powered by a USB port, has Composite, SVideo, YPbPr
outputs; pan, brightness, overscan/underscan controls; supports up to
1024x768 outputs; and supports PAL and NTSC.</LI>
<LI>ADS TV Elite XGA</LI>
<LI>AverKey iMicro (comments are generally favorable)</LI>
<LI>AITech Web Cable (comments are generally unfavorable, different than
the "Plus" version above)</LI>
<LI>TVIEW Gold (mentioned once, favorably)</LI>
</UL>
</P>

<H2><A NAME="ss3.2">3.2</A> <A HREF="#toc3.2">Software</A>
</H2>

<P>There are a few ways of installing programs on Linux systems; you can
either use a pre-compiled package, or install from a tarball after
satisfying any prerequisites.</P>
<P>
<FIGURE>
<EPS FILE="warning.eps">
<IMG SRC="warning.png">
<CAPTION><B>NOTE</B>: you must have the MySQL database software installed on a
system to store the master database.  This does not necessarily mean that
MySQL must run on one of the MythTV boxes.  The minimum MySQL version is 5.0.</CAPTION>
</FIGURE>
</P>

<H3><A NAME="precompiled"></A> Pre-compiled packages </H3>

<P>A number of people have created pre-compiled packages for MythTV that may
make your installation easier.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>BIG FAT WARNING</B>:  This HOWTO assumes that you have <EM>not</EM>
installed MythTV from a package.  All example command lines and file
locations are based on the MythTV tarball defaults.  Some packagers have
modified the filenames, binaries and file locations to match what is
commonly found in that distribution.  Any issues with MythTV installed via a
pre-compiled package <B>MUST</B> be raised with the packager.</CAPTION>
</FIGURE>
</P>
<P>If you use any of the pre-compiled packages you may not need to perform any
additional configuration steps in this HOWTO.  The next logical step is 
<A HREF="#mysql">configuring MySQL</A>, which you may or may not have to
perform.  See your package documentation.</P>

<H3><A NAME="atrpms"></A> Red Hat Linux / Fedora Core </H3>

<P>The definitive documentation on installing MythTV on Red Hat Linux /
Fedora Core can be found in Jarod Wilson's (
<A HREF="mailto:jcw@wilsonet.com">mailto:jcw@wilsonet.com</A>) HOWTO at 
<A HREF="http://wilsonet.com/mythtv/">http://wilsonet.com/mythtv/</A> Just
like 3rd-party packages, any 3rd-party documentation problems should be
brought up with the 3rd-parties (maintainer, lists, bugzillas etc.).  The
installation instructions which follow should be used as a guide only; refer
to Jarod's guide.</P>
<P>Red Hat Linux and Fedora Core packages for MythTV and all of its add-on
modules and some themes have been packaged by 
<A HREF="mailto:Axel.Thimm@ATrpms.net">mailto:Axel.Thimm@ATrpms.net</A> and
are available at 
<A HREF="http://ATrpms.net/topic/multimedia/">http://ATrpms.net/topic/multimedia/</A>. All of the prerequisites for
MythTV (such as XMLTV) are available as RPM packages. If you have problems
with the RPMs, please contact the ATrpms lists at 
<A HREF="http://lists.ATrpms.net/">http://lists.ATrpms.net/</A> or file a
bug against 
<A HREF="http://bugzilla.ATrpms.net/">http://bugzilla.ATrpms.net/</A>.</P>
<P>Given the large number of dependent RPMs you are advised to use tools like
apt or yum for automatic retrieval and installation of the required RPMs.
(
<A HREF="http://ATrpms.net/install.html">http://ATrpms.net/install.html</A>) In this case a
special meta-package called mythtv-suite will allow you to install all of
MythTV and its add-ons, plus all dependencies.</P>
<P>If you don't have <B>apt</B> or <B>yum</B> on your machine, download and
install the atrpms-kickstart package from 
<A HREF="http://ATrpms.net/name/atrpms-kickstart/">http://ATrpms.net/name/atrpms-kickstart/</A>.
Install the package with:
<BLOCKQUOTE><CODE>
<PRE>
# rpm -Uvh atrpms-kickstart*
</PRE>
</CODE></BLOCKQUOTE>

Then run:
<BLOCKQUOTE><CODE>
<PRE>
# apt-get update
# apt-get dist-upgrade
# apt-get update
</PRE>
</CODE></BLOCKQUOTE>

And finally:
<BLOCKQUOTE><CODE>
<PRE>
# apt-get install mythtv-suite
</PRE>
</CODE></BLOCKQUOTE>
        
These steps however, do NOT perform the installation of any drivers required
for <B>ALSA</B>, capture cards, <B>lirc kernel modules</B>, etc., nor do
they set up your MythTV database. Check 
<A HREF="http://ATrpms.net/topic/multimedia/">http://ATrpms.net/topic/multimedia/</A> for the drivers you
need.</P>

<H3>Mandriva</H3>

<P>Thac has created RPMs for MythTV for Mandriva which may
be obtained from 
<A HREF="http://rpm.nyvalls.se/">http://rpm.nyvalls.se/</A> If you have problems with the RPMs, please
send him email directly at 
<A HREF="thac@nyvalls.se">thac@nyvalls.se</A>.</P>
<H3>Debian</H3>

<P>Debian packages for MythTV and most of its add-on modules are maintained
by Christian Marillat 
<A HREF="mailto:marillat@free.fr">mailto:marillat@free.fr</A> and are available at 
<A HREF="http://www.debian-multimedia.org/">http://www.debian-multimedia.org/</A>. 
Installation instructions can be found on those pages as well. All of the
prerequisites for MythTV are available as Debian packages, most of them from
the official Debian archive.</P>
<P>If you have followed the instructions on the above page you should have added
<BLOCKQUOTE><CODE>
<PRE>
deb-src http://www.debian-multimedia.org sid main
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>to your <CODE>/etc/apt/sources.list</CODE> file.  Running <B>apt-get update</B> and then
executing <B>apt-get build-dep mythtv</B> should install all the
pre-requisites required to compile MythTV.</P>
<P>
<FIGURE>
<EPS FILE="warning.eps">
<IMG SRC="warning.png">
<CAPTION><B>NOTE</B>:  Due to the requirement for Qt 3.3+, there are no packages for
Debian woody/stable.</CAPTION>
</FIGURE>
</P>

<P>The Debian packages are configured such that MythTV programs should be
run as the <CODE>mythtv</CODE> user, which is automatically created during
installation.  This user has access to write new recordings to disk in the
default directory, read and write the database, access the audio and video
devices, and everything else that MythTV needs to do.</P>

<P>See <CODE>/usr/share/doc/<I>packagename</I>/README.Debian</CODE> for more
information, including copies of the MythTV documentation.  The
<CODE>mythtv-doc</CODE> package contains a copy of this HOWTO in
<CODE>/usr/share/doc/mythtv-doc</CODE>.</P>
<H3>Manual installation</H3>

<P>You may use the graphical tools that come with your distribution, or you
can use command-line utilities.  Either system will get the job done, and it
all depends on your comfort level with Linux.</P>
<P>In order to compile MythTV, we need to make sure that the software it needs
is installed.  This list includes <B>mysql</B>, <B>gcc</B>,
<B>freetype2-devel</B>, <B>xorg-xserver-devel</B>, <B>qt-devel</B> and
<B>lame</B>.  If you're going to use a remote control with MythTV, you're
going to need the <B>cdialog</B> package in order to compile
<B>lircd</B> if your distribution doesn't have a pre-packaged
<B>lirc</B>.  If you are using <B>XMLTV</B> as a grabber, you will need
<B>perl</B>.</P>
<P>
<HR>
<PRE>
NOTE:  Qt v3.3 or higher is required.

NOTE:  MythTV DOES NOT WORK with Qt4.

NOTE:  If you are going to be using RPMs to install various
components, you should be aware that not all packages include the necessary
headers for compiling.  If you're having trouble compiling, ensure
that you've installed the -devel version of a prerequisite.
</PRE>
<HR>
</P>

<H3><A NAME="CLIinstalltools_"></A> Command-line installation </H3>

<P> This section details the various methods for installing prerequisites
from the command line.</P>

<H3>Mandriva</H3>

<P><B>NOTE</B>:  The following instructions should be considered out of
date as of 2006-09-10.  If updated instructions are not submitted by the
release of v0.21 of MythTV they will be removed.</P>
<P><B>urpmi</B> is the simplest tool for installation of packages from the
command line, but properly configuring it can be difficult.  The
following website 
<A HREF="http://easyurpmi.zarb.org/">http://easyurpmi.zarb.org/</A> will allow you to choose
a mirror site and then present the command-line configuration text for that
mirror.  You will most likely need to add a "Contrib" mirror to your setup. 
If you add a site from the "Penguin Liberation Front", you will be able to
load the <CODE>lame</CODE> library without compiling from source.</P>
<P>Open a shell, and execute the following. You may get
asked a number of questions regarding dependencies.  It's best to answer
"YES".
<BLOCKQUOTE><CODE>
<PRE>
$ su
# urpmi mysql gcc gcc-c++ freetype2-devel cdialog alsa-utils
# urpmi XFree86-devel perl
# urpmi libqt3-devel libMesaGLU1-devel
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>
<HR>
<PRE>
NOTE for Mandriva 9.1+ users: execute the following command.

# urpmi libqt3-mysql
</PRE>
<HR>

However, you might get this when you execute the commands above:
<BLOCKQUOTE><CODE>
<PRE>
everything already installed
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>In that case, you're ready to move to the next 
<A HREF="#Setting_up_paths">section</A>.  Once you have completed installing the pre-requisites,
exit out of the shell and start a new one to ensure that any environment
variables setup by the installation have a chance to take effect.</P>

<H3>Gentoo. </H3>

<P><B>NOTE</B>:  MythTV does <EM>not</EM> run on Qt4.
If Qt has not been installed on your system: Edit
<CODE>/etc/make.conf</CODE> and locate the "USE" variable. If the line is
commented out, remove the comment. The line should have at least:
<BLOCKQUOTE><CODE>
<PRE>
USE="mysql alsa"
</PRE>
</CODE></BLOCKQUOTE>

Next you need to build Qt. If you don't plan on using the ebuilds as 
described in the Gentoo section then you also need to install lame.
<BLOCKQUOTE><CODE>
<PRE>
# emerge lame mysql qt
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>If you have already installed Qt: you will need to rebuild because the
default installation doesn't include MySQL support, a requirement for MythTV.  
To enable SQL support, add "mysql" to your USE variable in 
<CODE>/etc/make.conf</CODE> and rebuild Qt by running
<BLOCKQUOTE><CODE>
<PRE>
# emerge qt
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>All the necessary files will be downloaded and built. Even on a fast machine
this may take a lot of time if you need to do a full Qt build.</P>

<H3>Debian.</H3>

<P>Build-dependencies for MythTV can be satisfied by adding the following to
your <CODE>/etc/apt/sources.list</CODE>
<BLOCKQUOTE><CODE>
<PRE>
# Christian Marillat's packages (mplayer, lame)
deb http://www.debian-multimedia.org sid main
deb-src http://www.debian-multimedia.org sid main
</PRE>
</CODE></BLOCKQUOTE>

and executing:
<BLOCKQUOTE><CODE>
<PRE>
# apt-get build-dep mythtv
# apt-get source mythtv --compile
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="Setting_up_paths"></A> <A NAME="s4">4.</A> <A HREF="#toc4">System Configuration Requirements for Compiling MythTV. </A></H2>

<P>Before you compile MythTV from the current source tarball or from
<B>subversion</B>, you may need to modify your system configuration in a
few ways.</P>
<P>In general, if you install MythTV from pre-packaged binaries for your Linux
distribution/version, you don't need to be too concerned about the issues in
this section of the HOWTO - the install script for the packages should take
care of them. However, this section is still recommended reading which may
help if the packager skipped a step in their packaging.</P>

<H2><A NAME="ss4.1">4.1</A> <A HREF="#toc4.1">Software requirements for compiling MythTV</A>
</H2>

<H3>General requirements</H3>

<P>MythTV is written in C++ and requires a fairly complete, but standard, 
compilation environment, including a recent g++ compiler, <CODE>make</CODE>, and 
appropriate header files for shared libraries. Any standard Linux 
distribution should be able to install a suitable compilation environment 
from its packaging system. Section 3.2 of this HOWTO provides some details 
of how to install the required environment for many distributions.</P>
<P>Subsequent sections of this chapter address the few oddities that you may 
have to adjust by hand before you compile MythTV.</P>
<P>The reference compilation system for MythTV is Ubuntu.</P>

<H2><A NAME="ss4.2">4.2</A> <A HREF="#toc4.2">Shared-Library requirements for MythTV </A>
</H2>

<H3><A NAME="modifying_ld.so.conf"></A> Modifying /etc/ld.so.conf </H3>

<P>The runtime manager for shared libraries, <B>/lib/ld.so</B>, gets
information about the locations and contents of shared libraries from
<CODE>/etc/ld.so.cache</CODE>, a file created by <B>ldconfig</B> from
information in <CODE>/etc/ld.so.conf</CODE>.  Because MythTV installs some
shared libraries in <CODE>/usr/local/lib</CODE>, that directory needs to be
added to the list of directories for <B>ld.so</B> to search when doing
runtime linking of programs, if it is not already there.
You do this, as root, by editing <CODE>/etc/ld.so.conf</CODE>, then
running <B>ldconfig</B>. There are many ways to do this; one that
works is to enter this series of commands:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ su -
# echo /usr/local/lib >> /etc/ld.so.conf
# /sbin/ldconfig
# exit
$
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H2><A NAME="ss4.3">4.3</A> <A HREF="#toc4.3">Environment variable requirements for MythTV</A>
</H2>

<H3>General requirements</H3>

<H3>QT libraries and binaries</H3>

<P>The compiler needs to be able to locate QT binaries and libraries in
order to compile MythTV. QTDIR needs to be set and the directory holding the
QT binaries needs to be added to your PATH.  Your distribution may already
be making these changes as a part of the installation of the software
prerequisites detailed earlier.</P>
<P>One way to do this is as follows: 
<A NAME="Checking_that_it_worked"></A> </P>
<P>Open a shell and execute the following:
<BLOCKQUOTE><CODE>
<PRE>
$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/games:/usr/lib/qt3/bin:/home/mythtv/bin:/usr/lib/qt3/bin
$ echo $QTDIR
/usr/lib/qt3
$ which qmake
/usr/lib/qt3/bin/qmake
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>For Mandriva, you should see a value like <CODE>/usr/lib/qt3</CODE> for
<CODE>QTDIR</CODE> and <CODE>/usr/lib/qt3/bin</CODE> should be in $PATH.</P>
<P>For Gentoo, you should see a value like <CODE>/usr/qt/3</CODE> for <CODE>QTDIR</CODE> 
and <CODE>/usr/qt/3/bin</CODE> should be in $PATH.</P>
<P>If you don't, do not proceed past this step until you have resolved this
error. You may need to manually specify the QTDIR and PATH at the shell
prompt before compiling.</P>
<P>Also, check that there has been a link created in
<CODE>/usr/lib/qt3/mkspecs</CODE> (<CODE>/usr/share/qt3/mkspecs</CODE> for Debian)
called <CODE>default</CODE>. If not, you'll get errors during the compile. See
the Troubleshooting Section for more information.</P>
<H3>Distribution-Specific Notes</H3>

<H3>Mandriva</H3>

<P>The following instructions work for Mandriva using
<B>bash</B> as the shell, and may be applicable for a distribution which
uses <CODE>/etc/profile.d</CODE>.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  Mandriva 10 installs a <CODE>/etc/profile.d/qtdir3.sh</CODE>
file, but it doesn't include the addition of the PATH variable.  If you're
running Mandriva 10, don't create a <CODE>mythtv.sh</CODE> file as detailed
below; edit the <CODE>qtdir3.sh</CODE> file and add the PATH statement within
the if / fi block.</CAPTION>
</FIGURE>

As root, create the following file in <CODE>/etc/profile.d</CODE> The example
filename is "mythtv.sh". Use what you feel is appropriate.</P>
<P>Open a shell, and switch to superuser mode. </P>
<P>
<FIGURE>
<EPS FILE="warning.eps">
<IMG SRC="warning.png">
<CAPTION><B>NOTE</B>: ^D means press CTRL and d at the same time.</CAPTION>
</FIGURE>

<BLOCKQUOTE><CODE>
<PRE>
$ su
# cd /etc/profile.d
cat > mythtv.sh
export QTDIR=/usr/lib/qt3
export PATH=$PATH:/usr/lib/qt3/bin
^D

# chmod a+x mythtv.sh
# exit
$ exit
</PRE>
</CODE></BLOCKQUOTE>

The last two commands are to exit out of the shell. This way, when you next 
open a shell your new commands
will take effect.</P>

<H3><A NAME="devperms"></A> Device Permissions </H3>

<P>MythTV will need access to the video4linux devices on your system.  By
default, your distribution may restrict access to these devices to the
logged-in user, so if you will be automatically starting
<B>mythbackend</B> from a script rather than an interactive terminal
session you will need to make some adjustments.</P>
<P><B>NOTE</B>: The following instructions are accurate for Mandriva.</P>
<P>Check for a file called <CODE>/etc/security/console.perms</CODE>.  Open the file
in your favorite text editor and look for a line that has:
<BLOCKQUOTE><CODE>
<PRE>
&lt;console>  0600 &lt;v4l>        0600 root.video
</PRE>
</CODE></BLOCKQUOTE>

and replace it with
<BLOCKQUOTE><CODE>
<PRE>
&lt;console>  0666 &lt;v4l>        0666 root.video
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>What we're doing is allowing read and write access to the files in the
video4linux directory.</P>
<H2><A NAME="DownloadAndCompile"></A> <A NAME="s5">5.</A> <A HREF="#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="#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="#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="#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="#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="#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>
<H2><A NAME="mysql"></A> <A NAME="s6">6.</A> <A HREF="#toc6">MySQL.</A></H2>

<P>When you install MySQL 5.x you will also want to comment
out "log-bin" in your <CODE>my.cnf</CODE> configuration file. This option will
quickly fill your "/var" disk partition with many gigabytes of data,
unless you are doing database replication and deleting these files regularly.</P>
<H2><A NAME="ss6.1">6.1</A> <A HREF="#toc6.1">Distribution-specific information</A>
</H2>

<H3>Mandriva</H3>

<P>If this is the system maintaining the database, make sure that MySQL is
running and started at boot.  Click on Mandriva Control
Center->System->Services, find MySQL and click the "On Boot" button and the
"Start" button if the MySQL status shows that it isn't running yet.</P>
<P>
<FIGURE>
<EPS FILE="warning.eps">
<IMG SRC="warning.png">
<CAPTION><B>NOTE</B>:  There have been reports that MySQL isn't starting at boot.
If this is happening to you, try running the following commands.</CAPTION>
</FIGURE>

<BLOCKQUOTE><CODE>
<PRE>
$ su
# chkconfig --level 35 mysql on
# /etc/rc.d/init.d/mysql start
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H3>Red Hat Linux and Fedora Core</H3>

<P>If this is the system maintaining the database, make sure that MySQL is
running and started at boot. Click on Redhat menu>Server Settings>Services
and enter the root password when asked. Check "mysqld" and then click Start.
Click Save, then close the window.</P>
<P>This can be done from the command line by typing:
<BLOCKQUOTE><CODE>
<PRE>
# /sbin/chkconfig mysqld on
# /sbin/service mysqld start
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H3>Gentoo</H3>

<P>After installing MySQL you need to initialize the database by running
<B>mysql_install_db</B> as root. </P>
<H2><A NAME="ss6.2">6.2</A> <A HREF="#toc6.2">Setting up the initial database</A>
</H2>

<P>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 <CODE>database/mc.sql</CODE> file to it.</P>
<P>To setup the initial MySQL databases:
<BLOCKQUOTE><CODE>
<PRE>
$ cd database
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H3>Mandriva and Red Hat Linux/Fedora Core</H3>

<P>
<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u root &lt; mc.sql
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H3>Debian 3.0</H3>

<P>
<BLOCKQUOTE><CODE>
<PRE>
$ mysql &lt; mc.sql
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H3>Gentoo</H3>

<P>
<BLOCKQUOTE><CODE>
<PRE>
$ su
# mysql &lt; /usr/share/mythtv/database/mc.sql
</PRE>
</CODE></BLOCKQUOTE>

<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: It is good practice to set a root password for MySQL. Instructions for doing so can be found on MySQL's web site at 
<A HREF="http://www.mysql.com/doc/en/Security.html">http://www.mysql.com/doc/en/Security.html</A>.</CAPTION>
</FIGURE>
</P>
<H3><A NAME="modify_perm_mysql"></A> Modifying access to the MySQL database for multiple systems </H3>

<P>If you're going to have multiple systems accessing a master database,
you must grant access to the database from remote systems.  By default, the
<CODE>mc.sql</CODE> script is only granting access to the local host.</P>
<P>To allow other hosts access to your master database, you can either set it
up for no security at all, or with more granularity.  Note that the "%" is
the wildcard character in MySQL.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  The "no security" option is <EM>very</EM> dangerous unless
you're in a controlled environment.</CAPTION>
</FIGURE>

This example has no security at all, and allows access from any host.
<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u root mythconverg
mysql> grant all on mythconverg.* to mythtv@"%" identified by "mythtv";
mysql> flush privileges;
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>For a more secure setup, you can restrict which machines or subnets have
access. If you have a complete DNS system operational, you could do the
following:
<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u root mythconverg
mysql> grant all on mythconverg.* to mythtv@"%.mydomain.com" identified by "mythtv";
mysql> flush privileges;
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Finally, if you just want to restrict by IP subnet (in this example, the
192.168.1. network):
<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u root mythconverg
mysql> grant all on mythconverg.* to mythtv@"192.168.1.%" identified by "mythtv";
mysql> flush privileges;
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>You'll also need to check that the "networking" feature of MySQL is turned
on. Check that <CODE>/etc/mysql/my.cnf</CODE> <EM>does not</EM> contain
<CODE>skip-networking</CODE>.  If it does, remove it.  Also verify that
<CODE>bind-address</CODE> is set to your IP address instead of
<CODE>127.0.0.1</CODE>.  If you change either of these items, restart
<B>MySQL</B>.</P>
<P><B>NOTE</B>:  Your distribution may have a customized MySQL configuration
file; in Mandriva, check <CODE>/etc/sysconfig/mysqld</CODE> for additional
configuration.</P>

<H2><A NAME="s7">7.</A> <A HREF="#toc7">Configuring Sound.</A></H2>

<P>If your video doesn't appear to be in-sync with your audio and you're
using an analog video capture card and a soundcard to capture audio, it
could be because you are listening to the real-time audio from your video
card rather than after it's been processed and synchronized to the video by
MythTV.  Because MythTV is a personal video recorder, "Live TV" isn't really
live - to let you pause live TV, MythTV is actually encoding the video,
saving to disk, and then playing it back.  This procedure puts your MythTV
"live" TV about 2 seconds behind real-time, so it's important that you're
not listening to the live audio.  However, if you're having an issue where
the audio and video aren't synchronized by small but varying amount, it's
most likely because the sound driver that you're using doesn't have the
DSP_CAP_REALTIME capability.  This was the case with ALSA (0.5), but not
with newer versions.  See the 
<A HREF="#Troubleshooting_Audio">Troubleshooting Audio</A> section for more information if you're having
issues with sound.  Also, ensure that no other programs are grabbing the
audio output, like <B>arts</B> or <B>esd</B>.</P>
<P>What you need to do is to mute the "line-in" of your sound card and also
set it as the recording source.</P>
<P>There are two ways to do this.  Graphically, and from the command line.</P>

<H2><A NAME="ss7.1">7.1</A> <A HREF="#toc7.1">Graphically setting up the mixer</A>
</H2>

<H3>Mandriva and Red Hat Linux/Fedora Core</H3>

<P>Open Kmix by clicking K->Multimedia->Sound->Kmix for Mandriva, or
<PRE>
RedHat Menu>Sound &amp; Video>Volume Control
</PRE>
 on Red Hat/Fedora.</P>
<P>Click on Settings->Configure  Make sure that "Tick Marks" and "Show
labels" have "X"'s in them.  This will make it easier to find the correct
audio source.  Click OK.</P>
<P>On the mixer page, look for Line-In on your sound card.  You should see
two LED's - a green one at the top, and a red one at the bottom.  The green
one at the top is for muting; you want to make sure that the green LED is a
dark green, meaning that it's "off".  You also want to click on the red LED
so that it turns bright red, indicating that it's "ON"; this insures that
the Line-in is used as the source.  Click OK, and make sure that you save
the settings so that this is your default.</P>

<H3>Using ALSA.</H3>

<P>To use ALSA, you'll need to correctly setup your
<CODE>asoundrc</CODE> file. Configuring this file is beyond the scope of this
HOWTO.  Once ALSA is working correctly, change the output sound device in
mythfrontend->setup->Audio from <CODE>/dev/dsp</CODE> to <CODE>ALSA:default</CODE>.
This field may be edited to suit your ALSA requirements.</P>

<H2><A NAME="ss7.2">7.2</A> <A HREF="#toc7.2">Setting the mixer from the command line</A>
</H2>

<P>If you have installed the alsa-utils package, then the <B>amixer</B>
program can be used to setup the mixer.  The "Master" volume setting is only
required on a frontend machine to ensure that the sound channels are unmuted
and configured for outputting sound.  The "Line" and "Capture" controls are
required for your sound card to actually capture audio from the external
Line-in if it's connected to an analog frame grabber.  Not all sound cards
have a "Capture" control, but if yours does and you don't set it then MythTV
will not capture audio.</P>
<P>
<HR>
<PRE>
Note the spelling in the following commands.
</PRE>
<HR>

<BLOCKQUOTE><CODE>
<PRE>
$ amixer set Master,0 100%,100% unmute
$ amixer set PCM,0 100%,100% unmute
$ amixer set Line,0 75%,75% mute captur
$ amixer set Capture,0 100%,100% captur
$ su
# alsactl store
# exit
$ 
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>If you have multiple sound cards, then use the <CODE>-c</CODE> parameter to
specify which card to adjust.  Note that the first card will be "0", the
second will be "1", etc.</P>
<P>That takes care of setting the volume correctly, and the ALSA startup script
will restore the volume after a reboot.  If you find that your sound is
distorted, it's possible that the levels in the above examples are too high
for your particular hardware combination.  Try reducing the percentages by
5-10% and checking again.  Once you're satisfied, re-run the <CODE>alsactl
store</CODE> command.</P>
<P>You may also use the <B>alsamixer</B> program to set the volume. If you
are using an ALSA version after 1.0.6, use <B>alsamixer -V all</B> First,
start <B>alsamixer</B> from the command line.  You should start out on the
"Master" volume control slider.  Use the up and down cursor to set the
master volume to around 75%.  Next, use the left and right cursor keys to
move around on the screen until you find the "Line" slider.  Press SPACE to
set it as the capture source, set the level to around 50-75% and press "M"
to mute it.  You can now press ESC to exit out of the <B>alsamixer</B>
program.  You can also have MythTV manage all volume and mute settings, but
this will only affect the "Master" or PCM volume, not the capture volume.  See
the mythfrontend setup page for options.</P>
<P>Finally, if you've performed all of the above steps, and you still don't seem to have any sound, it's possible that your video capture device is muting the audio output.
<BLOCKQUOTE><CODE>
<PRE>
$ v4lctl -c /dev/video0 setattr mute off
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="s8">8.</A> <A HREF="#toc8">Setting up a remote control.</A></H2>

<P>MythTV does not have native remote control receiver and decoder software
built-in.  Instead, remote control functions are implemented by cooperating
with <B>lirc</B>, the Linux Infrared Remote Control program.  <B>lirc</B>
handles the IR hardware and passes keystrokes to MythTV, which then acts as
if the user had pressed the keys on the keyboard.  The file
<CODE>keys.txt</CODE> describes the keys used to control MythTV.</P>
<P>
<FIGURE>
<EPS FILE="warning.eps">
<IMG SRC="warning.png">
<CAPTION><B>NOTE</B>: If you are running Mandriva, you may install
<B>lirc</B> by executing: <CODE># urpmi lirc lirc-remotes</CODE> and bypass
the manual compilation steps described below by jumping to the 
<A HREF="#completing_lirc_install">Completing the lirc install</A> section. See the contrib/mandrake91.etc.sysconfig.lircd file for an example of how to
configure lircd.</CAPTION>
</FIGURE>
</P>
<P>Some IR devices require a kernel recompile, and some don't. However, all at
least require having the kernel source available as a resource for the lirc
build process. </P>

<H2><A NAME="ss8.1">8.1</A> <A HREF="#toc8.1">Gentoo</A>
</H2>

<P>To install lirc on Gentoo, all you need to do is:
<BLOCKQUOTE><CODE>
<PRE>
# emerge lirc
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="ss8.2">8.2</A> <A HREF="#toc8.2">Obtaining and compiling lirc</A>
</H2>

<P>You're going to need to download and compile <B>lircd</B>.  Go to 
<A HREF="http://www.lirc.org">http://www.lirc.org</A> and download lirc; as
of 2006-01-21, the version available is 0.8.0.  Grab the remotes.tar.bz2 file as
well. 
<BLOCKQUOTE><CODE>
<PRE>
$ tar -xjf lirc-0.8.0.tar.bz2
$ cd lirc-0.8.0
$ ./setup.sh
</PRE>
</CODE></BLOCKQUOTE>

You're going to need to know what sort of receiver you have and where it's
connected.  In the case of the Pinnacle Studio TV card, with the IR receiver
connected to COM1 (/dev/ttys0), once the configuration menu comes up,
perform the configuration by going to Driver Configuration->Other Serial
Port Devices->Pinnacle Systems Receiver->OK and on the next page select
COM1->OK.</P>
<P>Each remote is different; some remote receivers connect directly to your
capture card and not to a serial port, so make sure that you've got the
correct one.</P>
<P>You then click "Save Configuration and run configure" to continue.</P>
<P>Make sure you read the last text generated by the configure step. It will
tell you if you require a kernel recompile, and what the name of your kernel
module will be (if necessary). For instance a home-built receiver may
require a kernel recompile, so you would be notified that you will have to
load the lirc_serial module. If you did not get any such messages skip the
kernel recompile steps below and go directly to making and installing the
lirc driver.</P>
<P>Once the configuration step is complete:
<BLOCKQUOTE><CODE>
<PRE>
$ make
$ su
# make install
# chmod 666 /dev/lircd
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>At this point, if you're using a serial receiver, check that there's a
<CODE>lirc</CODE> device in <CODE>/dev</CODE>:
<BLOCKQUOTE><CODE>
<PRE>
$ ls -l /dev/li*
lr-xr-xr-x    1 root     root            5 Jan 27 09:00 /dev/lirc -> ttyS0
srw-rw-rw-    1 root     root            0 Jan 27 15:01 /dev/lircd=
prw-r--r--    1 root     root            0 Jan 27 09:00 /dev/lircm|
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>As you can see, there's a link from /dev/lirc to ttyS0, a.k.a. "COM1", which is
appropriate for the Pinnacle Systems PCTV Pro.  However, you may notice
something like this:
<BLOCKQUOTE><CODE>
<PRE>
crw-------    1 root     root      61,   0 Dec 31  1969 lirc
</PRE>
</CODE></BLOCKQUOTE>

Some IR receivers (including some homebrew units) use a character device as
their data interface as opposed to a link to a serial port.  If the <CODE>make
install</CODE> step has created a character device for you, don't replace it
with a link to a COM port.</P>
<P>So, if the link or character device was not created (but should have been),
ensure that you ran the <CODE>make install</CODE> step as root.  If it still
doesn't work, then there are three options.  The first option is to re-read
the <B>lirc</B> documentation to determine whether your IR receiver is a
character device or should be a link to a serial port and to create the
link/character device manually.  In this example, the IR device is connected
to ttyS0.  If it were connected to "COM2", then use ttyS1, etc.
<BLOCKQUOTE><CODE>
<PRE>
$ su
# cd /dev
# ln -sf ttyS0 lirc
# exit
$
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  The above example assumes that your receiver uses the
standard serial driver.  Some receivers do not, including receivers that
plug into a TV capture card.  Check the lirc documentation, but it may be
necessary to replace the link created above with a character pipe:</CAPTION>
</FIGURE>

<BLOCKQUOTE><CODE>
<PRE>
# mknod /dev/lirc c 61 0
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>See the lirc documentation for additional information.  The lirc
installation <EM>should</EM> create this for you, so manually creating it
indicates that your lirc installation may have other issues.</P>
<P>The second option is to post your issue to the <EM>lirc</EM> list, not the
mythtv-users list.  The lirc programmers will be the ones that can assist
you best.</P>
<P>The third option is to dispense with lirc altogether by purchasing an IR
keyboard (various options exist, although Chicony appears to work for some
people) and a learning remote control.  The IR keyboard receiver plugs into
the PS/2 keyboard port on your PC and you would train your learning remote
to emulate the various keystrokes from <CODE>keys.txt</CODE> of your IR
keyboard.  Using this method removes lirc entirely from the picture - your
remote will be sending keypresses that your PC "sees" on the keyboard port.</P>

<H2><A NAME="completing_lirc_install"></A> <A NAME="ss8.3">8.3</A> <A HREF="#toc8.3">Completing the lirc install </A>
</H2>

<P>
<FIGURE>
<EPS FILE="warning.eps">
<IMG SRC="warning.png">
<CAPTION><B>NOTE to Mandriva 9.1 users</B>: skip to the manual start paragraph
below.</CAPTION>
</FIGURE>
</P>
<P>If the lirc configure program / compile did not mention anything about a
kernel module, then you are finished. If it did mention a kernel module, you
must edit the <CODE>/etc/modules.conf</CODE> file. Add this line as the first
thing in the file.  It must come first, or it may not work.
<BLOCKQUOTE><CODE>
<PRE>
alias char-major-61 XXX
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>replace XXX with the name which you determined earlier, which in this
example was "lirc_serial"
<BLOCKQUOTE><CODE>
<PRE>
$ su
# modprobe lirc_serial
# /sbin/ldconfig
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Next, we're going to manually start lircd the first time.  Mandriva 9.1
users, type: <CODE># /etc/rc.d/init.d/lircd start</CODE> instead of:
<BLOCKQUOTE><CODE>
<PRE>
# /usr/local/sbin/lircd
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P><B>NOTE</B>:  Read this next section if you're not familiar with how lirc works!</P>
<P>There are two separate files used by lirc, and both are required for your
remote control to do anything useful. First is the <CODE>lircd.conf</CODE> file. 
<CODE>lircd.conf</CODE> tells the lirc daemon how to interpret the IR pulses
that it receives from a remote control and what name to assign to each
sequence of pulses.  Without getting too involved, a particular series of
pulses may correlate to "Channel Up".  The <CODE>lircd.conf</CODE> file will
then contain a line that looks something like this:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
          ChannelUp                0x0000000000001020
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>The <CODE>lircd.conf</CODE> file can have multiple remote controls defined.</P>
<P>The second file is <CODE>lircrc</CODE>, which takes the name of the button which
was pressed ("ChannelUp") in the above example, and correlates that to an
action to be performed by a program using the remote control.  So in MythTV,
ChannelUp means one thing, while in <B>mplayer</B> it means something
different.  <CODE>lircrc</CODE> gives you the flexibility of taking the name of
the button and having it perform different actions depending on which
program you're using at the time.</P>
<P><B>NOTE</B>:  The definitions in <CODE>lircd.conf</CODE> come from the user
community, and there is no standard for the common button names.  One
<CODE>lircd.conf</CODE> file may contain a definition for a button called
"ChannelUp", while another may contain a definition for "Chan+".  Your
<CODE>lircrc</CODE> file must therefore be configured appropriately, or it won't
work.</P>
<P>If this fails, complaining of a missing <CODE>lircd.conf</CODE> file, then you
must find or make one. First look for a pre-made configuration file at 
<A HREF="http://lirc.sourceforge.net/remotes/">http://lirc.sourceforge.net/remotes/</A>.  Mandriva 9.1 users, look in
<CODE>/usr/share/lirc-remotes</CODE>. If you find one your remotes either on the
website or in <CODE>/usr/share</CODE>, download or copy the file, name it
<CODE>lircd.conf</CODE> and put it in your <CODE>/etc</CODE> directory. If you
couldn't find your remote, you must make your own <CODE>lircd.conf</CODE> file.</P>
<P>To make your own <CODE>lircd.conf</CODE> file
<BLOCKQUOTE><CODE>
<PRE>
$ irrecord myremote
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Follow the on-screen directions to train your remote and define keys. If  
your remote ends up working well, you should consider submitting your  
<CODE>lircd.conf</CODE> file back to the lirc developers. Once finished:
<BLOCKQUOTE><CODE>
<PRE>
$ su
# cp myremote /etc/lircd.conf
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>now try to start lircd again:
<BLOCKQUOTE><CODE>
<PRE>
# /usr/local/sbin/lircd
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Now, we're going to add the commands necessary for lircd to run each time we
boot. Mandriva 9.1 users, you can execute:
<BLOCKQUOTE><CODE>
<PRE>
$ su
# chkconfig --level 35 lircd on
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>All other distributions:
<BLOCKQUOTE><CODE>
<PRE>
# cd /etc/rc.d
# cat >> rc.local
echo "Starting lircd"
/usr/local/sbin/lircd
^D
# exit
$ 
</PRE>
</CODE></BLOCKQUOTE>
 </P>
<P>This takes care of the lircd portion, which "listens" for the IR signals. If
everything went well, the install script for lircd put an appropriate
configuration file for your remote into <CODE>/etc/lircd.conf</CODE> This file
maps the buttons on the remote control to the IR pulses coming from the
receiver.</P>
<P>The next step is to convert those signals into something that can be used
to control MythTV.  MythTV now includes native support for lirc and can
interact directly with </P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ cd ~/mythtv-0.21/contrib/configfiles
$ cp lircrc.example ~/.lircrc
</PRE>
</CODE></BLOCKQUOTE>
 
or
<BLOCKQUOTE><CODE>
<PRE>
$ cp lircrc.example.pinnaclestudiopctv ~/.lircrc
</PRE>
</CODE></BLOCKQUOTE>

if you've got a Pinnacle Studio PCTV remote.
<BLOCKQUOTE><CODE>
<PRE>
$ irw
</PRE>
</CODE></BLOCKQUOTE>

Start pressing the keys on your remote; <B>irw</B> will
print the name of the button as it is defined in your
<CODE>/etc/lircd.conf</CODE>. If you don't see anything at this point, you need
to troubleshoot further by going back to the lirc home page and investigating
from there.</P>
<P>If it is working, then press <B>CTRL-C</B> to abort the program.  Once you
know that your remote is working, you can either recompile MythTV with
native lirc support by enabling it in <B>configure</B> or you
need to run the <B>irxevent</B> program, which takes the key presses and
sends them to MythTV.  If you use native lirc support, you don't need to run
<B>irxevent</B>.  If you are going to use irxevent, then you need to run
it like this:
<BLOCKQUOTE><CODE>
<PRE>
$ irxevent &amp;
</PRE>
</CODE></BLOCKQUOTE>

If <B>irxevent</B> isn't running, then MythTV will not respond to your remote
control unless you're using native lirc support.</P>

<H2><A NAME="ss8.4">8.4</A> <A HREF="#toc8.4">Additional information for lirc</A>
</H2>

<P>Take a look at the lircrc.example files in the <CODE>contrib/configfiles/</CODE>
directory.  In my case, (Pinnacle Studio card) the channel up and down functions
weren't working, due to the fact that the button names were different than
the default <CODE>lircrc.example</CODE> file that came with MythTV.</P>
<P>The <CODE>lircrc.example</CODE> file has this:
<BLOCKQUOTE><CODE>
<PRE>
begin
    prog = irxevent
    button = ChannelUp
    config = Key Up CurrentWindow
end

begin
    prog = irxevent
    button = ChannelDown
    config = Key Down CurrentWindow
end
</PRE>
</CODE></BLOCKQUOTE>

but the <CODE>/etc/lircd.conf</CODE> that comes in the lircd package 
defines the buttons for the Pinnacle Studio PCTV as:
<BLOCKQUOTE><CODE>
<PRE>
          channel+                 0x0000000000000017
          channel-                 0x000000000000001C
</PRE>
</CODE></BLOCKQUOTE>

rather than "ChannelUp" and "ChannelDown".  I added the 
following to my /home/[yourusername]/.lircrc file:
<BLOCKQUOTE><CODE>
<PRE>
begin
    prog = irxevent
    button = channel+
    repeat = 3
    config = Key Up CurrentWindow
end

begin
    prog = irxevent
    button = channel-
    repeat = 3
    config = Key Down CurrentWindow
end
</PRE>
</CODE></BLOCKQUOTE>

which took care of basic functionality.  Because the PCTV Studio remote
has additional buttons, look at the
<CODE>contrib/configfiles/lircrc.example.pinnaclestudiopctv</CODE> for an example of how
to define additional buttons, and how to debug potential button name
conflicts between the <CODE>lircrc.example</CODE> file and how <B>your</B>
remote defines the button names.</P>
<P>By examining the button names defined in <CODE>/etc/lircd.conf</CODE> and using
the <B>irw</B> program to make sure that your remote is working, you can
create the appropriate mappings in <CODE>.lircrc</CODE> to get excellent remote
functionality with MythTV.</P>
<P>Note the <B>repeat =</B> parameter.  This informs the <CODE>irxevent</CODE>
program to pass through every third keypress.  By default, <CODE>lirc</CODE>
will only send one keypress to the application, even if you're holding down
the key.  The actual <B>repeat =</B> number will vary from system to
system, so experiment and see which value works best for you.</P>

<H2><A NAME="ss8.5">8.5</A> <A HREF="#toc8.5">Configuring lirc for use with an IR blaster</A>
</H2>

<P>Lirc has support for various IR transmitters. A popular model is the Actisys
IR-200L 
<A HREF="http://store.snapstreamstore.com/accessories.html">http://store.snapstreamstore.com/accessories.html</A>. It was
originally designed for IRDA communication, but can be used to transmit A/V remote
control codes. By using the lirc SIR driver, this device can easily be
integrated with MythTV. I have tested this device with an AT&amp;T DCT2000
digital cable box but the instructions can be used to configure other IRDA
devices and A/V remotes.</P>
<P>Follow the steps in the previous section.  When you run setup.sh, select
option 1, driver configuration. From here select option 6, IrDA hardware.
Select your appropriate device and the corresponding serial port, then Save
configuration &amp; run configure from the main menu. Once configure is done
type:
<BLOCKQUOTE><CODE>
<PRE>
$ make
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Please note: unlike the Pinnacle receiver above you will be compiling lircd
in addition to a kernel module for the SIR transmitter. Depending on whether
you have your serial port driver configured as a kernel module you might see
the following message during make:
<BLOCKQUOTE><CODE>
<PRE>
lirc_sir.c:56:2: warning: #warning
"******************************************"

lirc_sir.c:57:2: warning: #warning "Your serial port driver is compiled into "

lirc_sir.c:58:2: warning: #warning "the kernel. You will have to release the "

lirc_sir.c:59:2: warning: #warning "port you want to use for LIRC with:"

lirc_sir.c:60:2: warning: #warning "setserial /dev/ttySx uart none"

lirc_sir.c:61:2: warning: #warning
"******************************************"
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>If you do receive this statement make sure to run the <B>setserial</B> command
before you load the lirc_sir module. Follow this with the install:
<BLOCKQUOTE><CODE>
<PRE>
$ su
# make install
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>You will notice that lirc installs the kernel module in
<CODE>/lib/modules/uname -a/misc</CODE>. </P>
<P>The configuration for starting <B>lircd</B> differs if you're going to be
sending and receiving IR versus just receiving.
<BLOCKQUOTE><CODE>
<PRE>
 
# cd /etc/rc.d
# cat >> rc.local
echo "Starting lircd"
setserial /dev/ttySx uart none        # (if required)
modprobe lirc_sir
/usr/local/sbin/lircd
^D
# exit
$ 
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>At this point you have to populate the <CODE>/etc/lircd.conf</CODE> file with the proper
codes for your A/V remote. You should be able to find your remote within the
lirc remote tar file located at 
<A HREF="http://www.lirc.org/remotes.tar.bz2">http://www.lirc.org/remotes.tar.bz2</A>. In my case I
extracted the file from remotes/motorola/DCT2000 (gi-motorola-dct2000)</P>
<P>To test the lirc_sir module you can run <B>irw</B> to verify the codes are being
received. If everything is configured correctly
you should see something similar to the following:
<BLOCKQUOTE><CODE>
<PRE>
$ irw
0000000000007ff0 00 1 gi-motorola-dct2000
000000000000bff8 00 2 gi-motorola-dct2000
000000000000f7f0 00 ENTER gi-motorola-dct2000
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Once you've verified lirc is working you can press <B>CTRL-C</B> to exit
<B>irw</B> and configure the channel changing script.</P>
<P>The path to the channel changing script will need to be entered on the
mythtv-setup screen for Input Connections.</P>
<P>This csh script will be called each time MythTV needs to change the channel.
Below is a copy of the script followed by the corresponding perl script.
Make sure both are in your path. Also make sure you leave the #!/bin/csh
setting and not change it to Bourne or bash. This will create a frustrating
symptom to diagnose where MythTV cannot open /dev/device. Unlike Bourne or
bash, csh scripts automatically close parent file descriptors before they
start.
<BLOCKQUOTE><CODE>
<PRE>
$ cd /usr/local/bin
# su
# cat > change_channel.csh
#!/bin/csh
echo "changing to $1"
/usr/local/bin/channel.pl $1 &amp;
^D
# chmod a+x change_channel.csh
# exit
$ exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>See <CODE>contrib/channel.pl</CODE> for the actual file.  Copy it to
<CODE>/usr/local/bin/</CODE></P>
<P>The last statement within the perl script is the lirc rc command. This is
the command that transmits the code to your cable/DSS box. Make sure to have
the IRDA device within a few feet of the box.</P>

<H2><A NAME="Configuring_mythtv"></A> <A NAME="s9">9.</A> <A HREF="#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="#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="#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="#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="#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]

    [    &lt;=>                              ] 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="#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="#logrotate">Automatically rotating logs</A> for more
information.</P>

<H2><A NAME="nonmaster_backend"></A> <A NAME="ss9.3">9.3</A> <A HREF="#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="#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="#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="#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>

<H2><A NAME="s10">10.</A> <A HREF="#toc10">Configuring mythfrontend.</A></H2>

<P>Once you have completed configuration of your backend systems, the next
step is to configure the frontend client.  </P>
<P>When you start mythfrontend for the first time, it will attempt to connect
to a configuration database on the local machine.  If there is none, a
"Database Configuration" screen will appear, and you will need to fill in
some details.  The "Host name" field needs the backend or database server's
IP address or DNS name, and the User or password fields may need to be set
to match your database user accounts.  After editing those fields, press
Enter twice to write these configurations on your local machine, and attempt
to connect to the database.  If you make any mistakes, the screens will pop
up again.</P>
<P>Now that mythfrontend has started up, you should have a number of
buttons/choices.  Before doing anything, go to TV, then to Setup and
configure the frontend client.
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  You should go through the various setup screens in
mythfrontend before using any other modules to ensure that the the database
is correctly initialized.</CAPTION>
</FIGURE>
</P>
<H2><A NAME="ss10.1">10.1</A> <A HREF="#toc10.1">General</A>
</H2>

<P>The General screen has configuration items that don't really fit anywhere
else.  The first few configuration items ask you to indicate the number of
seconds to record before or after a program, which is useful if the
broadcast network or your system clock are out of sync and will help prevent
you missing the beginning or end of a program.  </P>
<P>To change the value, use the left and right arrow keys to increment and
decrement the number of seconds.  When you're satisfied with the result, use
the down arrow to put the input focus on the Next button or press RETURN to
continue to the next page.</P>
<P>The next page has a number of options to do with how channels are displayed
on your system.  The help text will give you more information.  Move the
focus to Next and press the space bar to continue.</P>
<P>The last General page sets up some final configuration items.  See the help
text for more information.</P>

<H2><A NAME="ss10.2">10.2</A> <A HREF="#toc10.2">Appearance</A>
</H2>

<P>This set of screens is mostly concerned with how MythTV will look on your
system.  From here, you can choose different themes and set the resolution
of your system.</P>

<H2><A NAME="ss10.3">10.3</A> <A HREF="#toc10.3">Program Guide</A>
</H2>

<P>Fairly self explanatory.  Note that the alternate program guide does not
use the same font settings as defined in Appearance, so if the EPG is
unreadable this is where you make the adjustments to fonts, number of
elements displayed, etc.</P>

<H2><A NAME="deinterlace_"></A> <A NAME="ss10.4">10.4</A> <A HREF="#toc10.4">Playback </A>
 </H2>

<P>The one configuration item which may cause problems on your system is the
"Deinterlace playback" setting.  MythTV uses a linear blend algorithm for
deinterlacing, which will improve how the image looks on your screen. 
Deinterlacing requires that your processor support SSE. (Streaming SIMD
Extensions, aka "MMX2").  Early Intel Celeron (those that don't use the
Coppermine 0.18um core and are usually &lt;600MHz), Pentium Pro and Pentium II
CPUs do not have SSE, so make sure you haven't enabled deinterlacing if
your processor doesn't support it. If you enable it, and your processor
doesn't support SSE, you will get "Illegal Instruction" errors.</P>
<P>To determine if you've got SSE on an Intel processor, you can:
<BLOCKQUOTE><CODE>
<PRE>
$ cat /proc/cpuinfo
[snip]
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 mmx fxsr sse
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Notice the <B>sse</B> at the end of the line - this tells you that this
processor will be able to deinterlace correctly.</P>
<P>On an AMD processor, look for "3dnow" in the cpuinfo line; "3dnow" is AMD's
implementation of SSE instructions, so if your processor has 3dnow you
shouldn't have any issues with deinterlacing.</P>
<H3>Video Filters</H3>

<P>MythTV provides a means of employing video filters while recording and
during playback. These filters can be used to improve or modify the video
image, including hiding the effects of an interlaced image or reducing the
impact of noise in a poor video signal. The following is a brief
introduction to introduce you to the filters that are available in MythTV
version 0.20 and higher.</P>
<H3>Applying filters</H3>

<P>One or more filters can be included in a "filter chain". The filters to
be used are identified in a "filter string". A filter string is a group of
filter names and parameters separated by commas.  To include parameters, the
filter name is followed by "=" and the parameter information. There should
be no spaces in the filter string. Here is an example filter string:</P>
<P>With parameters: <CODE>kerneldeint=10:1,denoise3d=12</CODE></P>
<P>Without: <CODE>kerneldeint,denoise3d</CODE></P>
<P>Recording filters are set for each individual channel. These may be used
when encoding in software (MPEG-4, RTjpeg) but do not apply when using a
capture card with hardware encoding such as those supported by the ivtv
driver, DVB, HDTV or MJPEG cards. You can run MythTV's "setup" program and
select the "Channel Editor". On the first page for each channel, you can
enter a filter string in the box titled "Video filters". If you are running
"mythweb" on your web server, you can click on "Settings" then "Channels"
and enter filter strings in the "videofilters" column.</P>
<P>Playback filters are per-host and apply to any recording you watch from the
frontend where filters have been applied. Playback filtering can only
work with software decoding so the viaslice, xvmc, and ivtv outputs ignore
filters entirely. From "mythfrontend" go to Setup->TV Settings->Playback.
Enter your filter string in the box titled "Custom Filters".</P>

<H3>Currently Available Filters</H3>

<P>"Deinterlace Playback" checkbox.</P>
<P>This implements special behavior needed for the "bobdeint" filter but can
also be used to choose any of the deinterlace filters. If you prefer, you
may leave this unchecked and include any of the deinterlace filters, other
than "bobdeint", in your custom filter chain.</P>
<P>o The "invert" filter</P>
<P>Invert ignores any parameters and inverts the pixel values of the video
frames.  In other words, a negative image. This would rarely be useful but
may be a good example to verify that your filter strings take effect.</P>
<P>o The "linearblend" filter</P>
<P>It is a simple deinterlacing filter that ignores parameters and works by
blending adjacent lines.  It replaces combing in interlaced video with a
less distracting "ghost" image.</P>
<P>o The "bobdeint" filter</P>
<P>This filter splits the interlaced image into two separate fields that
can be line doubled then displayed at twice the frame rate. If the
display is at the same refresh rate as the recording (59.92Hz NTSC or
50Hz PAL) this will cause each refresh to show objects in motion in
a new position with no jagged edges. However, if the display is not
synchronous, it will cause flickering or the appearance of the picture
moving up and down by one line.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: This filter requires the frame rate to be doubled
and therefore can only be used with the "Deinterlace Playback" checkbox.
Do not include this in your filter chain.</CAPTION>
</FIGURE>
</P>
<P>o The "kerneldeint" filter</P>
<P>Kerneldeint is a more complex deinterlacing filter which applies a filter
kernel using input from several lines.  It generally removes combing without
a "ghost" image, sometimes leaving a faint outline of the image from the
other field. It is considered to be less distracting to watch than
linearblend or no filter at all. It accepts one or two integer parameters
separated by a colon.</P>
<P>The first parameter is the filter threshold and defaults to 12. Adjacent
lines differing by more than the threshold value are filtered. The second
option defaults to 0.  If set to a non-zero value, it will cause the filter
to skip chroma, and filter only the luminance.  It may be useful on some
capture cards which do not capture the chroma fields of interlaced video
correctly.</P>
<P>o The "onefield" filter</P>
<P>This is a simple one-field deinterlacing filter that uses only one field of
the interlaced video.  By default it keeps the top field, though passing the
parameter "bottom" will cause it to keep the bottom field instead.</P>
<P>This filter is primarily useful for those who display 1080i HDTV signals
with a video mode that has 540 pixels vertically.  The advantage over other
deinterlacing filters is that scenes with motion never show combing or
ghosting.</P>
<P>o The "adjust" filter</P>
<P>This filter adjusts the digital values for luma and chroma to ensure that
they will fall within the ranges specified in the ITU-R601 standard. By
default, this corrects a known problem for the luma range used by bt8x8
chips which causes video to look washed out. If parameters are passed, there
need to be exactly six. However, passing a single parameter of "-1" will
disable the filter.</P>
<P>1: luma minimum input value (int)
2: luma maximum input value (int)
3: luma gamma correction (float)
4: chroma minimum input value (int)
5: chroma maximum input value (int)
6: chroma gamma correction (float)</P>
<P>The default bt8x8 correction values are equivalent to
"16:253:1.0:2:253:1.0".  Output ranges are fixed at ITU-R601 values (16-235
luma, 16-240 chroma).</P>
<P><B>NOTE</B>: If it is not already specified in the filter chain, this
filter will be automatically applied when recording with the "bttv" driver.</P>
<P>o The "quickdnr" filter</P>
<P>A fast temporal denoiser. This can take 1, 2 or 4 parameters, each being a
value from "0" for the least filtering to "255" for the greatest filtering.
With one parameter, the filter will compute the values it should use for all
of its variables. Two parameters will set the filter strength for luma and
chroma independently. If you are interested in how the algorithm works, you
may examine the source code to see how four parameter are used.</P>
<P>o The "denoise3d" filter</P>
<P>A slower denoiser that applies a spatial and temporal low-pass filter. The
spatial filter can remove some noise that quickdnr can't, but a more
powerful CPU is needed.  This filter accepts 3 float parameters:</P>
<P>
<UL>
<LI>luma spatial filter strength</LI>
<LI>chroma spatial filter strength</LI>
<LI>luma temporal filter strength</LI>
</UL>
</P>
<P>Reasonable defaults will be selected for omitted parameters.  The chroma
temporal filter strength is calculated from the other filter strengths.</P>
<P>o The "crop" filter</P>
<P>Covers edges of video with black bars.  This helps improve video quality
when the edges of the frame are distorted. By default, this removes 16
pixels from each edge. This can optionally take four parameters representing
top:left:bottom:right. The number times 16 is the number of pixels to remove
so, for example, the default is "=1:1:1:1".</P>
<P>o The "forceyv12" and "forceyuv422p" filters</P>
<P>These force the filter manager to use the given format.  You can use one of
these at the head of a filter chain to change the capture format. The most
likely use would be forceyuv422p to use YUV422P capture on cards with known
chroma interlacing problems with YV12.</P>
<P>There are some filters included in the MythTV source code that should 
not be used:</P>
<P>o The "forcergb24" and "forceargb32" filters</P>
<P>The two RGB formats should not be used because there is no conversion filter
for them yet.</P>
<P>o The "convert" filter</P>
<P>It exists but don't use it.  The filter manager uses this filter
automatically when it is unable to match the input/output formats of two
adjacent filters.</P>
<P>o The "postprocess" filter</P>
<P>While this exists in MythTV source code, it is currently not recommended for
use.</P>

<H3>Usage Considerations</H3>

<P>There are trade-offs to consider when deciding if it would be wise to use
a filter. Any processing will modify the original image so you should assess
if the filter has made a noticeable improvement to the picture in order to
justify the impact of the processing.  Adding any filter will inherently
increase CPU usage. The impact can vary dramatically depending on your CPU
type and speed, the resolution of the recording, which filters you are using
and other factors. You can only determine what is right for you through
experimentation. However, as a starting point, here are some filter strings
that you may find useful:</P>
<P>For typical broadcast stations:      "kerneldeint,quickdnr"</P>
<P>For stations with poor signal quality: "linearblend,denoise3d=12"</P>
<P>For synchronous TV-out: check Deinterlace with "Bob (2x framerate)"</P>

<H2><A NAME="Recording"></A> <A NAME="ss10.5">10.5</A> <A HREF="#toc10.5">Recording </A>
</H2>

<P>Depending on your capture card, MythTV offers different video encoders. 
The following types of hardware encoding cards are supported:
<UL>
<LI>MJPEG - Zoran-based cards; see 
<A HREF="http://mjpeg.sourceforge.net">http://mjpeg.sourceforge.net</A></LI>
<LI>MPEG-2 - iTVC15/16 based cards (Hauppauge PVR-250/PVR-350); see 
<A HREF="http://ivtvdriver.org">http://ivtvdriver.org</A> </LI>
<LI>HDTV - pcHDTV cards; see 
<A HREF="http://pchdtv.com">http://pchdtv.com</A> and
the Air2PC-ATSC-PCI see 
<A HREF="http://www.cyberestore.com/product_info.php?cPath=28&amp;products_id=103">http://www.cyberestore.com/product_info.php?cPath=28&amp;products_id=103</A></LI>
<LI>DVB - cards supporting DVB; see 
<A HREF="http://linuxtv.org">http://linuxtv.org</A></LI>
</UL>

For cards without hardware encoding capabilities (all cards supported by
V4L not listed above), Myth includes two methods for software encoding:
RTjpeg and MPEG-4.  RTjpeg has significantly fewer CPU demands than MPEG-4,
but it generates larger files than MPEG-4 for a given recording.</P>
<P>For DVB and HDTV cards, no further configuration is required after
setting up the card using the 'mythtv-setup' program.
For all other cards, configuration is done through MythFrontend. 
Selecting 'Recording Profiles' from the 'TV Settings' screen will list
the profiles currently available for the cards in your system. 
Depending on what types of cards you have installed you may see:
<BLOCKQUOTE><CODE>
<PRE>
(Create new profile group)
Software Encoders
Hardware MPEG Encoders
Hardware MJPEG Encoders
Transcoders
</PRE>
</CODE></BLOCKQUOTE>

The '(Create new profile group)' option will allow you to create custom
profiles in case you have multiple backends.  Note that custom profiles
are per backend and card type.  If you have 2 MPEG-2 encoders in a given
backend system, creating a custom profile will affect both of them.  This
option should not be needed otherwise.</P>
<P>The 'Transcoders' group is a little different from the others.  Selecting
this group will result in a menu with the following options: 'RTjpeg/MPEG-4'
and 'MPEG-2'.  These types indicate what transcoder options will be used for
a given input type (i.e. the 'MPEG-2' settings would be used to transcode
MPEG-2 files into MPEG-4.  The source of the MPEG-2 stream (DVB, HDTV, or
PVR-x50) does not matter. Configuration of the options is the same as below
(although any resolution settings will be ignored).</P>
<P>Selecting any of the other options will show a new screen with a list of
four profiles:
<UL>
<LI>Default</LI>
<LI>Live TV</LI>
<LI>Low Quality</LI>
<LI>High Quality</LI>
</UL>
</P>
<P>The Default profile will be used for any recording which does not otherwise
have a specific profile assigned. The 'Live TV' profile will be used when
watching TV.  The remaining two profiles are available for customizing to
allow for more precise control over what quality is used for a given
program.</P>
<P>Selecting a profile will allow you to adjust the relevant options for that
card.  The most significant setting is the recording resolution, but you can
also choose encoding format, audio format, and tweak other encoder specific
properties.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: although the width and height can be changed to almost
anything, if you start MythTV and don't see video or you get "segmentation
fault" errors, it is likely that the video4linux (v4l) subsystem did not
like the height and width parameters specified.  It's best to leave the
default as-is until you're sure that MythTV is operational.</CAPTION>
</FIGURE>
</P>
<P>See the 
<A HREF="#capture_resolution_">What capture resolution should I use? How does video work?</A> section for more information.</P>

<H2><A NAME="ss10.6">10.6</A> <A HREF="#toc10.6">Xbox Frontends</A>
</H2>

<P>MythTV is able to control the LED on the Xbox to indicate backend
recording status.  </P>
<P>To control the LED, you will need the <B>blink</B> program from the
xbox-linux project, which is installed as <CODE>/bin/led</CODE> on GentooX.  On
Xebian (the new Ed's Debian) you must install it yourself.  On other
distributions it may or may not be installed as a program called
<B>blink</B> and should be located in your path.  (Type <CODE>which
blink</CODE> to see if the program is available.) If you do not have
<B>blink</B>, you may obtain it from the Xbox-Linux project site at 
<A HREF="http://xbox-linux.sf.net/">http://xbox-linux.sf.net/</A>. The
program you need is part of the <CODE>eds_i2c_staff</CODE> module in CVS.  Note
the spelling.</P>
<P>Once you have installed <B>blink</B> you will need to set permissions. 
<B>blink</B> needs write permission to the i2c device to function
properly.  There are three methods to accomplish this.  First, you could run
<CODE>mythfrontend</CODE> as root, which is the simplest method, but could
potentially be a security risk.  Next, you may make the <B>blink</B>
binary setuid root, which allows non-privileged users to run a program with
root capability.  This is done by typing the command:
<BLOCKQUOTE><CODE>
<PRE>
$ su
# chmod u+s /path/to/blink
</PRE>
</CODE></BLOCKQUOTE>

The final technique would be to set the <CODE>/dev/i2c/0</CODE> device read/write
for all users, but this is the least preferred method.</P>
<P>Now it's time to setup MythTV for Xbox hardware.  Enter Setup -> General. 
On the second page check the 'Enable Xbox Hardware' option.  Upon reentering
the settings, you should have a new option named 'Xbox'.  Within this option
you may select the distribution, LED colors for recording and the update
interval.  If you select GentooX as the distribution <B>led</B> will be
used as the <B>blink</B> binary name, otherwise, <B>blink</B> is used. 
Colors should be self explanatory.  The update interval determines how often
the frontend should poll the backend to determine if the status has changed.</P>

<H2><A NAME="s11">11.</A> <A HREF="#toc11">Using MythTV.</A></H2>

<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE to Red Hat/Fedora 4 users</B>: Red Hat Linux and Fedora Core ship
with Gnome as the default desktop environment.  However, Gnome seems to have
issues with window focus and window switching which sometimes cause
mythfrontend to obscure the video. KDE does not seem to have any such
issues. Therefore you will need to switch to KDE by selecting
RedHatMenu>Extras>System Settings>Desktop Switching Tool and choose "KDE".
<B>NOTE to Fedora Core 5 and 6 users</B>:  Fedora 5 and 6 no longer have
this tool in the Menu. Use "switchdesk KDE" from a command line. Read "man
switchdesk" for further information about changing to other desktop
environments.</CAPTION>
</FIGURE>
</P>
<H2><A NAME="ss11.1">11.1</A> <A HREF="#toc11.1">Keyboard commands</A>
</H2>

<P>The <CODE>keys.txt</CODE> file describes what the various keyboard commands are.
If you have loaded mythweb, you may change the default keys to your liking.</P>
<H3>mythfrontend</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
Arrow keys </TD><TD> used to move the highlight point around </TD></TR><TR><TD>
ALT-F4 </TD><TD> exit out of the application </TD></TR><TR><TD>
Space/Enter     </TD><TD> take action on the item under the highlight point </TD></TR><TR><TD>
P </TD><TD> play in both "Watch a Recording" and "Delete a Recording"   </TD></TR><TR><TD>
D </TD><TD> delete in both "Watch a Recording" and "Delete a Recording" </TD></TR><TR><TD>
U </TD><TD> to view details for the currently selected show on the Watch&nbsp;or Delete screens, EPG, "Program Finder", "Fix Scheduling&nbsp;Conflicts" and search results screens </TD></TR><TR><TD>
O </TD><TD> to list the upcoming episodes for the currently selected show&nbsp;on the EPG, "Program Finder", "Program Recording Priorities",&nbsp;"Fix Scheduling Conflicts" or search results screens </TD></TR><TR><TD>
I </TD><TD> edit recording options from the EPG, "Program Finder",&nbsp;"Program Recording Priorities", or "Fix Scheduling Conflicts"&nbsp;screens. From the Playback and Delete screens, 'I' presents&nbsp;options for recorded shows such as Auto Expire or Stop Recording.&nbsp;Pressing 'I' while on the Recording Options screen will take you&nbsp;to the Advanced Recording Options screen.
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>Watching TV or a recording</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
Up or down      </TD><TD> keys change the channel </TD></TR><TR><TD>
num pad </TD><TD> Type a number to enter a channel number or jump amount (HHMM format) </TD></TR><TR><TD>
P </TD><TD> pause / play. You may also add an explicit keybinding for 'Play' through&nbsp;MythWeb, returning you to normal speed if you are in slow motion, rewind&nbsp;fast forward or pause mode. </TD></TR><TR><TD>
C </TD><TD> change inputs on TV Tuner card </TD></TR><TR><TD>
ESC </TD><TD> quits </TD></TR><TR><TD>
I </TD><TD> puts the On-screen Display up again. During playback, 'I' toggles&nbsp;between position and show description info. If a jump amount is&nbsp;entered, jump to that position. </TD></TR><TR><TD>
M </TD><TD> brings up the electronic program guide (Grid) -- see the EPG section </TD></TR><TR><TD>
Page Up </TD><TD> jump back the configured number of minutes (default is 10) </TD></TR><TR><TD>
Page Down       </TD><TD> jump ahead the configured number of minutes (default is 10) </TD></TR><TR><TD>
End or Z        </TD><TD> skip to next commercial break marker </TD></TR><TR><TD>
Home or Q       </TD><TD> skip back to previous commercial break marker </TD></TR><TR><TD>
T </TD><TD> toggle close caption support&nbsp;Pressing 0-9 (preferably 3 times) + T changes teletext page and turns on teletext. </TD></TR><TR><TD>
F </TD><TD> rotate between the various Picture Adjustments (Colour, Hue, etc.)&nbsp;While Picture Adjustment is on-screen, use Left and Right arrows to&nbsp;adjust. These settings adjust the look of the video playback, and are&nbsp;independent of the G-key settings used at record-time. </TD></TR><TR><TD>
[ or F10        </TD><TD> decrease volume </TD></TR><TR><TD>
] or F11        </TD><TD> increase volume </TD></TR><TR><TD>
| or F9 </TD><TD> toggle mute </TD></TR><TR><TD>
/ </TD><TD> jump to the next "favorite" channel </TD></TR><TR><TD>
? </TD><TD> mark/unmark the current channel as a "favorite" </TD></TR><TR><TD>
U </TD><TD> increase the play speed </TD></TR><TR><TD>
J </TD><TD> decrease the play speed </TD></TR><TR><TD>
A </TD><TD> Adjust time stretch (speed up or slow down normal play of audio and video </TD></TR><TR><TD>
W </TD><TD> cycle through zoom and fill modes: 4:3 aspect ratio, 16:9, 4:3 Zoom &nbsp;(like Pan and Scan), 16:9 Zoom, and 16:9 Stretch (eliminates black &nbsp;sidebars in TV signal) </TD></TR><TR><TD>
F8 </TD><TD> toggle the sleep timer 30m->1hr->1hr30m->2hr->Off </TD></TR><TR><TD>
CTRL-B </TD><TD> Jump to the beginning of the recording / ringbuffer </TD></TR><TR><TD>
+ </TD><TD> Switch between audio streams </TD></TR><TR><TD>
Left </TD><TD> (if a jump amount is entered) to jump back that amount </TD></TR><TR><TD>
Right </TD><TD> (if a jump amount is entered) to jump ahead that amount </TD></TR><TR><TD>
</TD><TD> </TD></TR><TR><TD>
</TD><TD> </TD></TR><TR><TD>
</TD><TD> <B>Without the stickykeys option selected</B> </TD></TR><TR><TD>
Left </TD><TD> rewind the configured number of seconds (default is 5) </TD></TR><TR><TD>
Right </TD><TD> fast forward the configured number of seconds (default is 30) </TD></TR><TR><TD>
&lt; </TD><TD> starts rewind mode as if stickykeys are selected </TD></TR><TR><TD>
> </TD><TD> starts fast forward mode as if stickykeys are selected </TD></TR><TR><TD>
</TD><TD> </TD></TR><TR><TD>
</TD><TD> </TD></TR><TR><TD>
</TD><TD> <B>With Stickykeys option selected</B> </TD></TR><TR><TD>
Right </TD><TD> starts fast forward mode </TD></TR><TR><TD>
Left </TD><TD> starts rewind mode </TD></TR><TR><TD>
</TD><TD> </TD></TR><TR><TD>
</TD><TD> </TD></TR><TR><TD>
</TD><TD> <B>In fast forward or rewind mode:</B> </TD></TR><TR><TD>
Left/Right      </TD><TD> increases the ff/rew speed </TD></TR><TR><TD>
0 </TD><TD> plays at normal speed, but leaves the time indicator on screen </TD></TR><TR><TD>
1 or 2 </TD><TD> plays back more slowly than normal ff/rew speed (1 is slowest) </TD></TR><TR><TD>
3 </TD><TD> plays back at normal ff/rew speed </TD></TR><TR><TD>
4-9 </TD><TD> plays back faster than normal ff/rew speed (9 is fastest) </TD></TR><TR><TD>
Space </TD><TD> exits fast forward or rewind mode </TD></TR><TR><TD>
</TD><TD> </TD></TR><TR><TD>
</TD><TD> </TD></TR><TR><TD>
</TD><TD> <B>While video is paused:</B> </TD></TR><TR><TD>
Left </TD><TD> rewind 1 frame </TD></TR><TR><TD>
&lt; </TD><TD> rewind 1 second </TD></TR><TR><TD>
Right </TD><TD> advance 1 frame </TD></TR><TR><TD>
&gt; </TD><TD> advance 1 second
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>Watching TV only</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
G       </TD><TD> rotate between the various Picture Adjustments (Colour, Hue, etc.)&nbsp;for recording. These values affect the look of the resulting .nuv&nbsp;file, and are independent of the playback picture settings. While&nbsp;Picture Adjustment is on-screen, use Left and Right arrows to adjust. </TD></TR><TR><TD>
H       </TD><TD> Channel history. Each repeat steps back through the previous channels. </TD></TR><TR><TD>
O       </TD><TD> Turns on 'Browse' mode, allowing user to browse channels and program&nbsp;info while watching current show FullScreen. </TD></TR><TR><TD>
Y       </TD><TD> switch between multiple capture cards.&nbsp; <B>NOTE</B>:&nbsp;you will lose your LiveTV buffer on your current card. Useful&nbsp;for different-sourced cards (such as Dish Network on one, HDTV over-the-air on another card.) </TD></TR><TR><TD>
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>LiveTV Browse Mode</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
Left </TD><TD> browse program prior to current listed program </TD></TR><TR><TD>
Right </TD><TD> browse program following current listed program </TD></TR><TR><TD>
Up </TD><TD> browse program on channel above current listed channel/program </TD></TR><TR><TD>
Down </TD><TD> browse program on channel below current listed channel/program </TD></TR><TR><TD>
/ </TD><TD> browse program on next favorite channel </TD></TR><TR><TD>
0-9 </TD><TD> enter a channel number to browse </TD></TR><TR><TD>
Space/Enter     </TD><TD> change channel to channel of current listed program </TD></TR><TR><TD>
R/r </TD><TD> Toggle recording of current program (cycles through types) </TD></TR><TR><TD>
ESC/O </TD><TD> Exit Browse mode
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>Playback Recording Zoom Mode</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
Left </TD><TD> Move video to Left </TD></TR><TR><TD>
Right </TD><TD> Move video to Right </TD></TR><TR><TD>
Up </TD><TD> Move video Up </TD></TR><TR><TD>
Down </TD><TD> Move video Down </TD></TR><TR><TD>
PageUp </TD><TD> Zoom In </TD></TR><TR><TD>
PageDown        </TD><TD> Zoom Out </TD></TR><TR><TD>
Space/Enter     </TD><TD> Exit Zoom mode leaving picture at current size and position </TD></TR><TR><TD>
ESC </TD><TD> Exit Zoom mode and return to original size
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>If you have two or more tuner cards</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
V       </TD><TD> toggle Picture-in-picture on or off </TD></TR><TR><TD>
B       </TD><TD> toggles the window focus (lets you change channels on the PiP window) </TD></TR><TR><TD>
N       </TD><TD> swaps the two channels by changing channels on both cards
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>Watching a recording only</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
Space/Enter </TD><TD> set a bookmark at that point. Next time you start the&nbsp;recording, you will automatically jump forward to this point&nbsp;and clear the bookmark. </TD></TR><TR><TD>
X </TD><TD> queues the current recording for transcoding </TD></TR><TR><TD>
O </TD><TD> brings up menu to allow toggling settings such as Commercial&nbsp;Auto-Skip, Auto-Expire, etc. </TD></TR><TR><TD>
D </TD><TD> exits the current recording and displays the Delete menu </TD></TR><TR><TD>
E or M </TD><TD> enters/exits edit mode. </TD></TR><TR><TD>
</TD><TD> </TD></TR><TR><TD>
</TD><TD> </TD></TR><TR><TD>
</TD><TD> <B>In edit mode</B> </TD></TR><TR><TD>
Left/Right      </TD><TD> move forward and backward </TD></TR><TR><TD>
Up/Down </TD><TD> alter the amount of time you jump forward and backward.&nbsp;Increments are: nearest cutpoint, nearest video keyframe, 1&nbsp;frame, 0.5 seconds, 1 second, 20 seconds, 1 minute, 5 minutes,&nbsp;and 10 minutes. </TD></TR><TR><TD>
PageUp/PageDown </TD><TD> move forward and backward to the nearest cut point </TD></TR><TR><TD>
&lt; or > </TD><TD> move forward or backward by 10 times the normal jump amount </TD></TR><TR><TD>
Space/Enter     </TD><TD> allows you to set or delete a cut point </TD></TR><TR><TD>
Z </TD><TD> loads the commercial skip list (if one exists) into the cutlist </TD></TR><TR><TD>
C or Q </TD><TD> clear all cut points in the cutlist </TD></TR><TR><TD>
I </TD><TD> Inverts the cutlist
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>EPG</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
Arrows </TD><TD> are used to move the highlighted program point around </TD></TR><TR><TD>
A, D, S, W </TD><TD> perform the same as left, right, down and up </TD></TR><TR><TD>
PageUp/PageDown </TD><TD> move the channel list up or down a page </TD></TR><TR><TD>
Home/End </TD><TD> move the highlight left or right by one day </TD></TR><TR><TD>
Ctrl+Left or &lt; </TD><TD> move the highlight left by one page </TD></TR><TR><TD>
Ctrl+Right or &gt; </TD><TD> move the highlight right by one page </TD></TR><TR><TD>
9, 3, 7, 1 </TD><TD> (like a numeric keypad) perform the same as PageUp, PageDown,&nbsp;Home and End </TD></TR><TR><TD>
I </TD><TD> bring up more information about a show, and allow you to&nbsp;schedule a recording. If you select "Record this showing"&nbsp;while watching Live TV you can "Instant Record" a program. </TD></TR><TR><TD>
Space/Enter </TD><TD> allow you resolve conflicts or change overrides. If the&nbsp;program is not already scheduled to record, it will instead act like&nbsp;pressing 'I'. </TD></TR><TR><TD>
M </TD><TD> when on a channel will change to that channel </TD></TR><TR><TD>
ESC or C </TD><TD> exits without changing the channel </TD></TR><TR><TD>
R </TD><TD> change the current item from Recording/Not-Recording.&nbsp;Successive keypresses cycle through the scheduled recording&nbsp;type list. </TD></TR><TR><TD>
X </TD><TD> change the channel to the currently selected channel without&nbsp;leaving the EPG (Most useful in the alternate EPG) </TD></TR><TR><TD>
? </TD><TD> mark/unmark the current channel as a "favorite" </TD></TR><TR><TD>
/ or 4 </TD><TD> toggle the guide listing between all channels and filtered&nbsp;"favorites"
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>Setting Program or Channel Recording Priorities</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
Right </TD><TD> increases priority value        </TD></TR><TR><TD>
Left </TD><TD> decreases priority value </TD></TR><TR><TD>
1 </TD><TD> sorts by title </TD></TR><TR><TD>
2 </TD><TD> sorts by priority </TD></TR><TR><TD>
Home/End        </TD><TD> toggle sort priority </TD></TR><TR><TD>
I </TD><TD> edit recording options      </TD></TR><TR><TD>
ESC </TD><TD> commits changes and exits
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>Viewing Scheduled Recordings/Resolving Conflicts</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
1 </TD><TD> show all recordings </TD></TR><TR><TD>
2 </TD><TD> show only important recordings </TD></TR><TR><TD>
Home/End        </TD><TD> toggle show showing all/important </TD></TR><TR><TD>
I </TD><TD> edit recording options </TD></TR><TR><TD>
Space/Enter     </TD><TD> resolve conflict or override
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>Viewing Search Listings</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
Home    </TD><TD> change to the previous view if applicable     </TD></TR><TR><TD>
End     </TD><TD> change to the next view if applicable </TD></TR><TR><TD>
M       </TD><TD> select another view if applicable. In the&nbsp;title and description search popup, press&nbsp;M again to edit or delete the selected view.
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>Recording Profiles Setup Screen</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
D       </TD><TD> on a custom profile group displays a popup to delete the group</TD></TR><TR><TD>
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>Recording Groups</H3>

<P>In the Watch Recordings screen, Recording Groups allow you to separate
programs into user-defined categories, such as "Kids", "Alice", "Bob", etc. 
This can be used to reduce clutter, or to segregate content if you use the
PIN function.
<BR><CENTER>
<TABLE BORDER><TR><TD>
M       </TD><TD> change the view or to set a group password </TD></TR><TR><TD>
I       </TD><TD> move a program from one Recording Group to another
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>Watch Recordings Screen</H3>

<P>
<BR><CENTER>
<TABLE BORDER><TR><TD>
1 or F1 </TD><TD> Meaning of the icons </TD></TR><TR><TD>
/ </TD><TD> Tags a recording. Tagged recordings can be played&nbsp;either in order or shuffled and deleted as a group.&nbsp;You can also change the recording group for several&nbsp;recordings at once by tagging them and using the &nbsp;Menu (m) button, selecting "Playlist options", &nbsp;then "Change Recording Group". </TD></TR><TR><TD>
? </TD><TD> Clear the tagged list.
</TD></TR></TABLE>
</CENTER><BR>
</P>
<H3>Remote Controls</H3>

<P>If you are using MythTV with just a remote control then it is suggested that you
map the remote control keys as described below.  Your remote control may not
have the same set of keys as those named below, the names are only a suggestion
that roughly correspond to the function.</P>
<P>If you are adding new key bindings to the program then consideration of this
suggested list will help users with remote controls.</P>
<P>This list assumes a minimal remote control that only has 20 keys, nearly all
features can be used with this configuration.  If you have more keys then you
can access all of the features.  With only 16 keys most features are usable.
<BR><CENTER>
<TABLE BORDER><TR><TD>
REMOTE CONTROL </TD><TD> LIRC KEYSTROKE </TD><TD> FUNCTION </TD></TR><TR><TD>
0 - 9 </TD><TD> 0 - 9 </TD><TD> channel selection, EPG navigation, ff/rew speed setting (with stickykeys)       </TD></TR><TR><TD>
Left Arrow </TD><TD> Left </TD><TD> scroll left, rewind </TD></TR><TR><TD>
Right Arrow </TD><TD> Right </TD><TD> scroll right, fast forward </TD></TR><TR><TD>
Up Arrow </TD><TD> Up </TD><TD> scroll up, channel change up </TD></TR><TR><TD>
Down Arrow </TD><TD> Down </TD><TD> scroll down, channel change down </TD></TR><TR><TD>
Select / OK / Play </TD><TD> Space </TD><TD> Select item, play (with stickykeys) set bookmark </TD></TR><TR><TD>
Cancel </TD><TD> Escape </TD><TD> Cancel, quit playback </TD></TR><TR><TD>
Menu </TD><TD> m </TD><TD> EPG (from watching TV) edit (from playback). </TD></TR><TR><TD>
Pause </TD><TD> p </TD><TD> Pause </TD></TR><TR><TD>
Other key 1 </TD><TD> i </TD><TD> Information </TD></TR><TR><TD>
Other key 2 </TD><TD> c </TD><TD> Change tuner card input
</TD></TR></TABLE>
</CENTER><BR>
</P>

<H2><A NAME="ss11.2">11.2</A> <A HREF="#toc11.2">Using themes with MythTV</A>
</H2>

<P>MythTV is "themeable", meaning that the visual appearance of the program
can be modified by the user without re-compiling or altering the program
functionality.  Download the MythThemes tarball from the website and untar it:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ tar -xjf myththemes-0.21.tar.bz2
$ cd ~/myththemes-0.21
$ qmake myththemes.pro
$ su -
# make install
# exit
$
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>The theme will now be available in the mythfrontend Appearance section.</P>

<H2><A NAME="ss11.3">11.3</A> <A HREF="#toc11.3">Adding DishTV information to the database</A>
</H2>

<P>A script for adding Pay Per View information into the MythTV database for
DishTV subscribers is available at 
<A HREF="http://www.mythppv.com/">http://www.mythppv.com/</A>.</P>

<H2><A NAME="ss11.4">11.4</A> <A HREF="#toc11.4">Adding support for an external tuner</A>
</H2>

<P>MythTV supports changing the channel on an external tuner.  If you have
an external tuner, such as a DirecTV or digital cable set top box, you
should add <CODE>/usr/local/bin/changechannel</CODE> to your Input Connections in the
mythbackend configuration GUI.</P>
<P>However, there is not <B>changechannel</B> program per-se, because this is
going to be dependent on what sort of external tuner you have.  Look in the
<CODE>contrib/channel_changers</CODE> directory for a number of programs and
scripts which may be used to change channels.  Once you find one which
works, copy it to <CODE>/usr/local/bin/changechannel</CODE>.</P>
<P>Feel free to browse some of what sort of hardware is available at 
<A HREF="http://store.snapstream.com/accessories.html">http://store.snapstream.com/accessories.html</A>, or if you wish to
assemble your own, rather than purchase, the following may be helpful: 
<A HREF="http://www.dtvcontrol.com/">http://www.dtvcontrol.com/</A> for
cable pinouts.</P>

<H2><A NAME="ss11.5">11.5</A> <A HREF="#toc11.5">Using Shutdown/Wakeup</A>
</H2>

<P>What does the MythTV Shutdown/Wakeup function do? The scheduler on the
Master backend (MBE) keeps track of the idle status of the entire MythTV
system, including the Slave backends (SBE). If it considers the system to be
idle, and thus ready to shutdown, it sets the wakeuptime to the time of the
next recording and then proceeds to shut down all Slave backends and then
itself. Once it is time to begin recording, the Master backend and the Slave
Backends are automatically woken up.  This system allows MythTV to record
like a normal VCR, thereby conserving power when not in active use.</P>
<P>In order to use the Shutdown/Wakeup function there must be some method of
waking up the Master backend.  There are any number of solutions, but we
will discuss in detail two possibilities:</P>
<P>
<UL>
<LI>Use another server that runs 24/7 and have it send a WakeOnLAN (WOL)
packet to wake the Master backend.  This assumes that you have the WOL tools
installed, and that your Master backend motherboard supports WOL.</LI>
<LI>Use your motherboard's BIOS wakeup capability.  You'll need a motherboard
that supports BIOS wakeup, and some tools.  Two that work are: 
<A HREF="http://sourceforge.net/projects/nvram-wakeup">http://sourceforge.net/projects/nvram-wakeup</A> and 
<A HREF="http://www.malloc.de/tools/wakeup_clock.html">http://www.malloc.de/tools/wakeup_clock.html</A></LI>
</UL>
</P>

<H3>A deeper look into the operation</H3>

<P>The scheduler keeps track of the idle status of the MythTV system. To
determine whether or not the MythTV system is idle, the following conditions
must be met for a period of time defined in the "Idle timeout (secs)"
parameter.
<UL>
<LI>no client is connected to the server</LI>
<LI>no recording (neither LiveTV nor a regular recording) is currently taking place</LI>
<LI>no recording starts within a definable amount of time ("Max. wait for recording (min)")</LI>
<LI>the "pre Shutdown check-command" returns 0 </LI>
</UL>
</P>
<P>If we get to this idle state the Master backend will set the wakeuptime using the "Set
wakeuptime command", which is the same for WOL and BIOS wakeup. The Master backend will
then shut down the Slave backends and itself using the "Server halt command".</P>
<P>One caveat is that the scheduler tries to guess if the Master backend was started by a
wakeup call or by the user. If it thinks it was woken up by a user, it
blocks shutdown until a client connects to the Master backend, after which it will
behave as described above. To disable this feature, unset "Block shutdown
before client connected" in the mythfrontend Setup->Setup->General screen.</P>
<P>Once it is time to startup the system, the Master backend is woken up first and will
wakeup the Slave backends using the "Wake command for slaves". At this time, there is
no support for starting only the required Slave backend, so all Slave backends will startup.</P>

<H3>Setting up the MythTV side of this extension.</H3>

<P>There are a number of options that are used to control the Shutdown /
Wakeup feature.</P>
<P>Shutdown/Wakeup Options:
<UL>
<LI>"Idle timeout (secs)" is the time the server waits while idle until a
shutdown occurs.</LI>
<LI>"Max. wait for recording (min)" is the time the Master backend waits for a recording
without shutting down. For example, this would be used to prevent a 10
minute system shutdown if a recording is set to start 15 minutes from now.</LI>
<LI>"Startup before rec. (secs)" Sets how long before a programmed
recording the MythTV system will be woken up.  This should be roughly be the
time your systems need to bootup, and if you have Slave backends, you'll
need to ensure this value is long enough for all your machines to perform
their bootup cycle.</LI>
<LI>"Wakeup time format" is the format of the wakeup time that is given in
the "Set wakeuptime command" as a parameter "$time". You need to set this
according to your wakeup mechanism. If you need seconds since the epoch
(1970-01-01) set the "Wakeup time format" to "time_t".</LI>
<LI>"Set wakeuptime command" is the command executed to set the new wakeuptime. </LI>
<LI>"Server Halt Command" is the command executed to shutdown the Master
backend and the Slave backends.</LI>
<LI>"pre Shutdown check-command" is used to give a
"Go/NO-GO" decision from a non-MythTV source.  This command is executed
immediately before the shutdown would occur. The return value is use to make
the following choices:
<UL>
<LI>If it returns a "0" the shutdown will occur as scheduled.</LI>
<LI>If it returns a "1" the "idle timeout" will be reset and the system
waits again for the timeout.</LI>
<LI>If it returns a "2" the entire shutdown sequence is reset.  This means
that a new client connect is needed before a shutdown occurs, unless you have
the "Wait for client connect" setting disabled, in which case this is the same as
returning "1".  An example of a use for this return value is to prevent the shutdown
if a user is currently logged in, or if a specific program (i.e. transcode,
automatic updates, etc.) is currently running. If you don't need it, leave
the field blank.</LI>
</UL>
</LI>
</UL>
</P>
<P>The "WakeOnLan settings":
These settings have nothing to do with using BIOS or WOL wakeup, they are
the same for both.
<UL>
<LI>"Master backend" This setting defines timings for the frontends to
wakeup the Master backend using WOL. Useful if your frontend can emit a WOL
packet so you don't need to physically go to the Master backend if you're
trying to watch TV.</LI>
<LI>"Reconnect wait time (secs)" is the time the frontend waits after
executing the "Wake command" before attempting to retry the connection. This
should be roughly the amount of time your Master backend needs for bootup.
Set to "0" to disable. The frontends will retry to connect for "Count of
reconnect tries" times before giving up.</LI>
<LI>"Wake command for slaves" is the <EM>one</EM> command executed to wake
your Slave backends. This should be a script that contains the calls to
wakeup all Slave backend systems.</LI>
</UL>
</P>

<H3>Using WOL to wake your Master backend. </H3>

<P>To use WOL to wake your Master backend you will need a WOL capable Master
backend, a machine that runs 24/7 which can execute an at-job and nc (netcat)
on the Master backend. I use some little bash scripts to make my DSL router
wakeup my mythbox if required.</P>
<P>Replace $SERVER and $PORT with your own settings!
On my Master backend I have a script that gets called as 'setwakeuptime command' which
looks like the following:
<BLOCKQUOTE><CODE>
<PRE>
#! /bin/sh
echo $@ | nc $SERVER $PORT
</PRE>
</CODE></BLOCKQUOTE>

This simply cats the parameters (that is $time) to my 24/7 server. On my
$SERVER I have (x)inetd listening on $PORT starting a little script which
cares about setting the at-job. The following additions are necessary on the
$SERVER:</P>
<P>If you use <B>inetd</B>:</P>
<P>In <CODE>/etc/inetd.conf</CODE> add:
<BLOCKQUOTE><CODE>
<PRE>
mythwake stream tcp nowait mythtv /usr/sbin/tcpd /usr/local/bin/mythwake
</PRE>
</CODE></BLOCKQUOTE>

If you use <B>xinetd</B>, save the following as <B>mythwake</B> in your
<CODE>/etc/xinet.d/</CODE> directory:
<BLOCKQUOTE><CODE>
<PRE>
service mythwake
  {    
        socket_type     = stream
        wait            = no
        user            = mythtv        
        protocol        = tcp
        id              = mythwake
        server          = /usr/local/bin/mythwake
  }
</PRE>
</CODE></BLOCKQUOTE>

and add the following to <CODE>/etc/services</CODE>:
<BLOCKQUOTE><CODE>
<PRE>
mythwake        $PORT/tcp
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Finally, <CODE>/usr/local/bin/mythwake</CODE> looks like:
<BLOCKQUOTE><CODE>
<PRE>
#! /bin/bash
#this should be a command to wake your server
WAKECMD="#!/bin/sh\n /usr/local/bin/wakeMBE"
#first we need to delete all wake jobs in queue
for JOB in atq | cut -f 1 ; do
    atrm $JOB;
done
#now we read the date from 'nc'
read date;
#now set the atjob
echo -e "$WAKECMD" | at $date ;
</PRE>
</CODE></BLOCKQUOTE>

<B>SECURITY WARNING</B>:
Be sure to secure $SERVER:$PORT from untrusted networks, because this
allows 3rd parties to run arbitrary code on your server!</P>

<H3>Using BIOS wakeup to wake your Master backend.</H3>

<P>Since I don't use this, I cannot say much about this. If your motherboard
supports any wakeup tool you have to call that tool as "Set wakeuptime
command" with the "Wakeup time format" suitable for that tool.</P>
<H3>Wakeup the MySQL server using WOL</H3>

<P>If your MySQL server and your Master backend are not on the same machine,
you can have the Master backend wake your MySQL server using WOL. You will
find the settings for this in the second page of the mythtv-setup program,
or at the end of <CODE>mysql.txt</CODE>.  The meanings are the same as
discussed in "The WakeOnLan settings" above.</P>

<H3>Tips/Tricks:</H3>

<P>If, for example, one of the Slave backends is also your desktop computer,
you could simply use a little script as 'server halt command' which first
calls <CODE>/sbin/shutdown -t TIMEOUT</CODE> where TIMEOUT is a value sufficient
for you to react.  You could then popup a window using *dialog, asking for
permission to shutdown. If you cancel the shutdown, simply call
<CODE>/sbin/shutdown -c</CODE>.</P>
<P>If you get "nvram-wakeup: /dev/rtc: Device or resource busy" your
set-wakeuptime-script should stop the program that uses <CODE>/dev/rtc</CODE> before
setting the wakeuptime.</P>
<H2><A NAME="ss11.6">11.6</A> <A HREF="#toc11.6">Controlling the mythfrontend via telnet</A>
</H2>

<P>To use this feature you must first enable it in Settings>General>General</P>
<P>The network control listens on port 6546, as demonstrated below:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ telnet basement 6546
Connected to basement.
Escape character is '^]'.
MythFrontend Network Control
Type 'help' for usage information
---------------------------------
# help
Valid Commands:
---------------
jump               - Jump to a specified location in Myth
key                - Send a keypress to the program
play               - Playback related commands
query              - Queries
exit               - Exit Network Control

Type 'help COMMANDNAME' for help on any specific command.

# help jump
Usage: jump JUMPPOINT

Where JUMPPOINT is one of the following:
channelpriorities    - Channel Recording Priorities
channelrecpriority   - Channel Recording Priorities
deletebox            - TV Recording Deletion
deleterecordings     - TV Recording Deletion
guidegrid            - Program Guide
livetv               - Live TV
livetvinguide        - Live TV In Guide
mainmenu             - Main Menu
...snip...
# exit
$
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Please note that this feature only allows one connection at a time, so any
new connections will automatically terminate prior ones.</P>

<H2><A NAME="s12">12.</A> <A HREF="#toc12">Scheduling Recordings.</A></H2>

<P>The MythTV master backend is responsible for managing the schedule for
all TV tuner cards on the master and any slave. Its job is to search the TV
listing for the shows you have requested and assign recordings to the TV
tuner cards. If none of the shows that you've chosen overlap, it simply
records all of them. However, if there are shows where the beginning
and end times overlap, the scheduler follows rules that you've specified or
makes logical decisions about what would be best if you haven't expressed your
preference. Further, the "Upcoming Recordings" page allows you make specific
decisions about what you really do and don't want to record.</P>

<H2><A NAME="ss12.1">12.1</A> <A HREF="#toc12.1">Record Types</A>
</H2>

<P>When you choose a show that you would like to record from the
Options Page, there are eight different types of rules to help the
scheduler find which showings you would like to record.</P>
<P>
<UL>
<LI>Single Record -- record only this title at this specific time and
this station. This is the best way to be sure that a certain showing will
be recorded. However, if the TV listings change and the show is not broadcast
at that time, the show will not be recorded but will be marked as Not Listed
to let you know that you should investigate.
</LI>
<LI>Find One -- this will record a title once from any of the times
that appear in the TV listings. This is useful for recording a movie
or special that has multiple showings because it allows the scheduler
to choose one that doesn't conflict. It is not a good choice for
recording a single episode of a series because it records the first
available showing of the title without regard to the episode
information.
</LI>
<LI>Record Weekly -- this records a show whenever the title is listed
on the same channel, weekday and time. Note that if the TV station
changes the schedule for a special episode, it would not be
recorded. However, you can add a Single record for the special
episode. If there are no matching showings in the TV listings,
a Not Listed item will be added to your schedule for the next
time slot to let you know that you should investigate.
</LI>
<LI>Find Weekly -- this will record a title once per week from any
of the times that appear in the TV listings beginning from the time of
the showing that was selected when the rule was set. This is useful
for news, current events or other programs where the same episode is
shown several times each week but the listings may not include
descriptive information. This may not be a good choice if there are
different episodes shown during the week.
</LI>
<LI>Record Daily -- this records a show whenever the title is listed
for the time and station on any day of the week. Here again, a show
will not be recorded if the time was altered by the station. If there
are no matching showings in the TV listings, a Not Listed item will be
added to your schedule for the next time slot to let you know that you
should investigate.
</LI>
<LI>Find Daily -- this will record a title once per day from any
of the times that appear in the TV listings beginning from the time of
the showing that was selected when the rule was set. This is useful
for news, current events or other programs where the same episode is
shown several times each day but the listings may not include
descriptive information. This may not be a good choice if there are
different episodes shown during the day.
</LI>
<LI>Channel Record -- records one showing of each unique episode from
any of the times the title is listed on this station.  This is perhaps
the most common rule to use for most shows.
</LI>
<LI>Record All -- records one showing of each unique episode from
any of the times this title is listed on any channel. This can be
useful if a station has sister stations where shows are rebroadcast
allowing the scheduler to record rebroadcasts on the other station
when the original airing cannot be recorded.</LI>
</UL>
</P>

<H2><A NAME="ss12.2">12.2</A> <A HREF="#toc12.2">Scheduling Options</A>
</H2>

<H3>Priority</H3>

<P>By default, all shows you select have equal value to the
scheduler.  There are a set of rules to make good choices when
two or more shows are in conflict. However, priority values let the
scheduler know what you prefer so that it can set the schedule based
on your preferences.</P>
<P>Initially, recording rule priority values are set to zero. You may choose
to leave everything at "0" and let the scheduler follow rules to guess
what you might prefer when there are conflicts. However, if you have
one or two favorite shows, you may want to increase the priority
value so the scheduler will know that you would prefer recording
these over other shows. You might use certain values to rate shows
so that all favorites are 2. good shows are 1 and extra 'filler'
shows are all -1 for example. You could sort each title on the "Set
Priorities" page to have a unique value so the scheduler can know
which show you'd prefer versus any other show. The choice and style
are entirely up to you. However, the more information you give to
the scheduler, the more likely it will make the choices you would
prefer in the first place.</P>
<P>The scheduler choices are based on the total priority for a showing by
adding up all priority factors that match the showing. By default, most
of these factors are "0" but you may use any combination to express your
likes and needs.</P>
<P>
<UL>
<LI>Per record rule -- this is the "priority" selection in the "Scheduling
Options" section of the options page and this value is included for any
showings that match the recording rule.  You may choose to only use these
values and not use the other factors for the sake of simplicity and clarity.</LI>
<LI>Per record type -- Setup->TV Settings->Recording Priorities->General allows
you to add to the priority based on the type. It may make sense to increase
the value for "Single" so that by default they have an extra advantage over
other shows. The default is +1. You may want to decrease the value for Find
rules so that they will be less likely to interfere with regularly scheduled
shows and will be more likely to record in a non-conflicting time instead.
The default is -1.</LI>
<LI>Per channel -- Setup->TV Settings->Recording Priorities->Channel Priorities
can be useful if you believe that you prefer any of the shows on certain
channels. This would give all shows on a channel an advantage by default.</LI>
<LI>Input priority -- in the "mythtv-setup" program, the "Input Connections"
section allows you to add additional priority in the "Input priority".
This is simply another priority factor but has an interesting effect. If a
card input has a higher value than the other cards, the scheduler will see
that you would rather record showings of episodes on this input rather than a
showing on other inputs. If you have multiple cards of different quality,
you may want to set input priority to encourage the scheduler to record
shows on your best card(s) whenever possible. This can also be useful if you
have multiple video sources which include the same stations. For example,
with digital and analog cable you could increase the digital cable input
preference by 1 to tell the scheduler that you want to record from the
digital channel whenever possible but the channel on the analog input could
still be used when the digital input is busy.</LI>
<LI>Custom Priority -- this allows you to add any specialized factors you
would like in order to influence scheduling decisions. See the 
<A HREF="#Custom Priority">Custom Priority</A> section below.</LI>
</UL>

For any single showing of any show you've chosen to record, these factors
are added together to find the "total priority". This is the priority that
the scheduler uses to decide which showings are given the first choice when
filling in the schedule.</P>
<P>The scheduling priority of a show may also be used to determine
auto-expiration of recordings when disk space gets full (see 
<A HREF="#Auto-Expire">Auto-Expire</A>, below).</P>

<H3>Duplicates</H3>

<P>Singles will record without regard to duplicate matching.</P>

<P>The standard recurring methods of All, Channel, Weekly and Daily use the
descriptive information in the TV listings to try to record only one showing
of each unique episode. However, This goal is sometimes complicated by the
fact that the stations may not include a description for a specific episode
but use a generic description for the series instead. When there is a
generic description, the default behavior is to assume that it may be an
episode that you have not seen and to record it for you.  One of the
duplicate matching options is "Record new episodes only".  If this is
selected, listing that have an original air date of more than 14 days
earlier are considered repeats and are not eligible to record. Generally,
generic episodes will be marked as repeats also.</P>

<P>Because of generic episodes and other situations, MythTV offers an
alternative approach where shows may be recorded by choosing from multiple
showings even when the descriptive information is not reliable. All of the
"Find" record types look for matching titles in the listings. If there is a
showing with specific episode information and that episode has recorded
before, that showing is marked as previously or currently recorded. The
scheduler will then choose to record the earliest non-conflicting showing
from any of other remaining showings regardless of the descriptive
information. Generally, Find One is most useful for movies or specials and
the Find Daily and Find Weekly rules are best for news or current events
shows that are repeated. However, these may be useful in other situations
where the standard recording rules may not work correctly.</P>

<H3>Conflicts</H3>

<P>As you add more shows that you would like to record, the scheduler
will eventually encounter conflicts. If there are two shows at the
same time and you have two or more TV tuner cards, both shows will
record. However, if there are more shows than cards, the scheduler
will have to decide what it thinks it should not record based on the
information you have given. If you see an unexpected situation you
are not "stuck" with the scheduler's choice. You can still tell the
scheduler exactly which shows you do want to record and/or don't
want to record in any situation.</P>

<H3>Scheduling decisions</H3>

<P>Here are the actual decisions made by the scheduler as it fills in the
schedule.</P>
<P>
<UL>
<LI>Currently recording beats not currently recording -- A recording
in progress can not be moved to another input or time so it "wins"
its current timeslot.
</LI>
<LI>Single, Daily, or Weekly rules with no match are marked Not Listed -- 
If these or Overrides do not match the current listings because the
listings have changed, they are added to the schedule and marked to
indicate that they will not record.
</LI>
<LI>Rules that could record beat rules that can not record a showing --
If two rules match the same showing of a program, a rule marked as inactive
or a showing marked as a repeat, for example, yield to the other rule.
</LI>
<LI>More specific record type is used in place of less specific -- If
two rules match the same showing of a program, preference is given to
Don't Record then Override, Single, Find One, Record Weekly, Find Weekly,
Record Daily, Find Daily, Channel and finally All.
</LI>
<LI>Higher total priority beats lower total priority -- This is the
core of the scheduling process. Episodes of the highest priority show
are placed on the first available input followed by the next highest
priority show and so on.
</LI>
<LI>Future start time beats past start time -- If there is an
episode in progress and also a later showing of the same episode, it
is better to record the complete episode. If there isn't another
showing, it will start recording immediately to record the remaining
portion. This should only happen if you add a new rule while the show
is in progress or if the master backend is started after the start time
of a scheduled show.
</LI>
<LI>More specific record type beats less specific record type -- If
two shows are on at the same time and have the same total priority but
different types they will be sorted by Single then Find One, Record
Weekly, Find Weekly, Record Daily, Find Daily, Channel and finally
All. This only applies if the priorities are the same.
</LI>
<LI>If both start times have passed, later start time beats earlier start
time -- This attempts to miss the least amount of time.
</LI>
<LI>If neither start time has passed, earlier start time beats later
start time -- This helps assure that the earliest showing of an episode
has the advantage.
</LI>
<LI>Lower input id beats higher input id -- The scheduler fills in
open time slots on the first available input for the video source. The
next input is used when there is another show already placed for the
card of the first input.
</LI>
<LI>Older record rule beats newer record rule -- If two shows are still
equal after all of these other checks, the show whose record rule was added
first is preferred over a more recent addition.
</LI>
<LI>Postpone showings to resolve conflicts -- If Reschedule Higher
Priorities is set or if a conflict has the same priority as a show
that was scheduled at the same time, the scheduler will check to see
if a scheduled show can be moved to another input or later matching
showing without creating a new conflict so that the conflicting show
can be scheduled to record.
</LI>
</UL>
</P>

<H3>Reschedule Higher Priorities</H3>

<P>Setup->TV Settings->Recording Priorities->General has a checkbox for
"Reschedule Higher Priorities" which tells the scheduler to try to be a
little smarter in certain situations. If this is checked, the scheduler will
look for situations where a show cannot record because all inputs for the
channel are used for higher priority shows. It will check to see if any of
the other shows could be recorded at another time so that the conflicting
show can be recorded in its place.</P>
<P>Generally, this is a good strategy but there are tradeoffs. If a higher
priority show is postponed, you will not get to watch it until it is
recorded in the later timeslot. There is also a risk that the TV listings
may change and the later showing may go away. In this rare case the higher
priority show may never record. On the other hand, if you do not use this
option you will miss recording some lower priority shows unnecessarily
unless you manually make similar changes.</P>
<P>By using Reschedule Higher Priorities, the scheduler will do a better job of
recording as many of your shows as possible when left unattended. It will
also be easy to see that shows have been marked to record at a later time.
You can then decide for yourself when you would prefer to record the first
showing by clicking "Record anyway".</P>

<H3>Controlling Your Schedule</H3>

<P>The Manage Recordings->Upcoming Recordings page is your control center
for the MythTV scheduler. Unlike other DVR systems, this one page gives you
all of the information and tools you need to see all of your alternatives
and make whatever adjustments you desire.</P>
<P>The upper half of the screen has a scrollable box listing items that match
your record rules sorted by time. The lower half shows the details for the
highlighted item. There are two 'views' available. Press "1" to include all
of the items that match record rules even if they do not need to be
recorded. Press "2" to focus on just the things that will record and items
that may need your attention. The message in the upper right-hand corner
will remind you when there are conflicts that would prevent one or more
shows from being recorded.</P>
<P>The items in the list are colored in the record color for things that
will record, white for things that may need attention, gray for those
that do not need to record and yellow when there is a time conflict.
Items at the top of the list may also be highlighted indicating that the 
recording is in progress.</P>
<P>Along with the channels, start times and titles, the right-hand column has
a status code. Numbers indicate which card number has been assigned to
record the show. Letters are used to indicate the reason that something
will not be recorded. Just below the box is a short status message for the
highlighted item that indicates the type of record rule that was matched,
the "total priority" for this showing and a one or two word explanation of
the status code. If you press SELECT, you will see more information about
the status.</P>
<P>There are a few status codes that may require your attention. "C" indicates
that there are more overlapping shows to record than there are TV tuners to
record them. "L" indicates that the scheduler found that it may be better to
record a later showing of this episode. These states happen as a result of
your choices and should normally reflect your preferences. However, you may
notice situations where you would like to modify the scheduler's initial
choices.</P>
<P>The first thing you can do is to highlight an item and press INFO to
see the recording options page. From this page you can change the
record rule type, the duplicate matching rules, or raise or lower the
priority to resolve whatever problem you noticed.</P>
<P>Additionally, you can treat any individual showing as an exception that you
do want to record or don't want to record. To use these "override" features,
highlight the item and press SELECT. You will see a message explaining the
current status and at least an "OK" button to exit without making changes.</P>
<P>For items scheduled to record, there will be a button for "Don't record"
which will prevent recording this showing but will still allow the same
episode to record in the future. If there is episode description
information, you may also see a button for "Never record".  This prevents
recording this showing and tells MythTV to remember that this is an episode
that you've seen or don't need to see if it is ever in the TV listings
again.</P>
<P>For items that are not scheduled to record, the message will describe the
reason and in the case of "C" or "L" it will include a list of the shows
that are scheduled to record instead. For any item that could potentially be
recorded there will be buttons for "Edit Options" and "Add Override". "Edit
Options" will allow you to change the options for the existing record rule
such as raising the priority so that the show will record. These changes
would apply to this and all future showings that match this record rule.
"Add Override" will allow you to set options that apply to the specific
showing without affecting the recurring record rule.</P>
<P>If you return to an override page after an override has already been set,
you will also see a "Clear Override" to undo your changes. This option makes
it very easy to try out some "what if" attempts when deciding on your best
strategy in a difficult situation.</P>
<P>For a recording in progress, there will be a "Change Ending Time" button.
This will take you to the options page for a Single or Override or create
an Override if it is a recurring rule. Here you can go to the Recording
Options section to change the program end time offset. If you extend the
end time so that it overlaps upcoming recordings, the schedule will change
to accommodate the new end time. This may cause a conflict or later showing
even for a show with higher priority. Therefore, it is a good idea to
check your schedule after changing the end time of a recording in
progress.</P>

<H2><A NAME="ss12.3">12.3</A> <A HREF="#toc12.3">Storage Options</A>
</H2>

<H3>Recording Profile</H3>

<P>Each recording rule can be configured with a different recording
profile.  For example, colorful cinematography can be configured with a
"High Quality" profile, while 'talking heads' interviews shows can be
configured with a "Low Quality" profile. These recording profiles need to
be configured before using them (see 
<A HREF="#Recording">Recording</A>,
above).</P>

<H3><A NAME="Recording Group"></A> Recording Group </H3>

<P>For organization of the "Watch Recordings" screen and the MythWeb
interface, recordings can be assigned into "recording groups".</P>

<H3><A HREF="#storagegroups">Storage Groups</A></H3>

<P>This allows you to select any special "Storage Groups" you may have
created to determine where recordings from this rule should be stored
on your disks. The "Default" storage group is always available.</P>

<H3><A NAME="Playback Group"></A> Playback Group </H3>

<P>This selects a set of pre-configured playback parameters which can be
created and edited in Setup->TV Settings->Playback Groups.  When the
recording is played, the values from this playback group will be
used. This allows you to choose a default time stretch value, skip and
jump amounts appropriate for this type of television program.</P>

<H3><A NAME="Auto-Expire"></A> Auto-Expire </H3>

<P>MythTV will "autoexpire" old recordings to make room for new recordings
when disk space gets filled up. This option can be set to "Don't allow
auto expire" to prevent these recordings from being automatically deleted
when disk space fills up.</P>

<P>The default setting is for all scheduled recordings to be eligible
for auto-expiration; this can be changed in the Settings->TV
Settings->General page by manipulating the "Auto Expire Default"
checkbox.</P>

<P>The default auto-expire policy is "Oldest Show First"; the oldest
recordings are deleted first. The "Lowest Priority First" method
chooses to expire the lowest-priority recordings first.</P>

<H3>Episode Limit</H3>

<P>An episode limit can also be configured to limit the maximum number
of episodes recorded of a single series, to restrict that series' disk
usage. If this is set, you can further decide what to do when this
limit is reached; either stop recording that series, or to delete the
oldest episodes in favor of the new ones.</P>

<H2><A NAME="ss12.4">12.4</A> <A HREF="#toc12.4">Post Recording Processing</A>
</H2>

<H3>Commercial Flagging</H3>

<P>Select whether or not to automatically flag commercials for these
recordings. Commercial Flagging parameters can be set in
Setup->TV Settings->General.</P>

<H3>Transcoding</H3>

<P>Select whether or not to automatically transcode recordings to save
disk space. Before using this, you must first enable auto-transcode in
the recording profile and configure the transcoding parameters; see
<A HREF="#Recording">Recording</A>, above.</P>

<H3>User Jobs</H3>

<P>User Jobs allow you to configure up to 4 custom commands to run on
recordings. They can be configured in mythtv-setup. The following
tokens have special meaning when used in the User Job commands:</P>
<P>
<UL>
<LI>%DIR% - the directory component of the recording's filename</LI>
<LI>%FILE% - the filename component of the recording's filename</LI>
<LI>%TITLE% - the title of the recording (e.g., name of the series)</LI>
<LI>%SUBTITLE% - the subtitle of the recording (e.g., name of the
episode)</LI>
<LI>%DESCRIPTION% - description text for the recording (from guide
data)</LI>
<LI>%HOSTNAME% - the backend making the recording</LI>
<LI>%CATEGORY% - the category of the recording (from guide data)</LI>
<LI>%RECGROUP% - the 
<A HREF="#Recording Group">recording group</A></LI>
<LI>%CHANID% - the MythTV channel ID making the recording</LI>
<LI>%STARTTIME% - the recording start time (YYYYMMDDhhmmss)</LI>
<LI>%ENDTIME% - the recording end time (YYYYMMDDhhmmss)</LI>
<LI>%STARTTIMEISO% - the recording start time in ISO 8601 format
(YYYY-MM-DDTHH:MM:SS)</LI>
<LI>%ENDTIMEISO% - the recording end time in ISO 8601 format</LI>
<LI>%PROGSTART% - the recording's start time (from guide data;
YYYYMMDDhhmmss)</LI>
<LI>%PROGEND% - the recording's end time (from guide data)</LI>
<LI>%PROGSTARTISO%, %PROGENDISO% - the recording's start and end
time in ISO 8601 format.</LI>
</UL>
</P>

<H2><A NAME="ss12.5">12.5</A> <A HREF="#toc12.5">Advanced Recording Options</A>
</H2>

<H3>Creating Power Search rules with Custom Record</H3>

<P>MythTV's "Custom Record" feature gives you unlimited control for creating
specialized search recording rules to meet your needs. It allows you to
choose your criteria to search for matching shows based on any of the
information in the program listings, channel information, time functions and
more. This goes beyond the capabilities of any other DVR system and it is
unlikely that this level of scheduling customization will ever be available
in any commercial DVR system.</P>

<H3>Getting Started</H3>

<P>Go to Schedule Recordings->Custom Record. This page, helps you build a
database search one clause at a time. Each added clause further limits
which showings will be matched in the TV listings. You can test the
search at any time and when you are done, you can save your search as a
recording rule.</P>
<P>To familiarize yourself with how you can create custom rules, create a
simple rule to record "Nova" only in primetime.</P>
<P>The first item at the top of the page allows you to edit an existing rule
or create a new rule. Leave it on "&lt;New rule&gt;". Arrow down to the
third item which says "Match an exact title". Right and left arrows would
allow you to select any of several prefabricated pieces or full examples
but leave it on the default for now. Arrow down to "Add this example
clause" and press SELECT (Enter or Space on a keyboard). The large text
box should now show:
<BLOCKQUOTE><CODE>
<PRE>
     program.title = 'Nova'
</PRE>
</CODE></BLOCKQUOTE>

As you have probably guessed, this says that we want to search for all
programs with the title "Nova" regardless of the time, day, channel, etc.</P>
<P>If you do not receive a PBS station that carries "Nova" or would like to use
another title, edit the title by pressing the down arrow to highlight the
text box and right arrow over the the word "Nova". If you are using a
keyboard you can simply delete the four letters and type a different title
between the quotes. With a remote control, you can do 'cell phone' style
text entry with the number pad. The delete key is the "X" in the grouping
for "1", zero is grouped with "9" and "0" acts as the "Caps Lock" key. You
can press ENTER in the text box to popup a virtual keyboard.</P>
<P>Note: the text box honors many familiar Emacs control keys. It is also
possible to cut and paste text into the text box so you can edit with a
favorite editor or insert a rule sent in email or from other sources.</P>
<P>In any case, choose a title that is shown both in primetime and late night
or daytime. Next, click the "Test" button. You should see a list of the
upcoming episodes for "Nova" just as if you had clicked the Upcoming
button for "Nova" elsewhere in MythTV.</P>
<P>Press ESC to go back to the Custom Record page. Move to the example
selector then press the right or left arrows until you find "Only in
primetime". Click "Add this example clause". You should now see:
<BLOCKQUOTE><CODE>
<PRE>
            program.title = 'Nova'
            AND HOUR(program.starttime) >= 19
            AND HOUR(program.starttime) &lt; 23
</PRE>
</CODE></BLOCKQUOTE>

Click "Test". You should now see a shorter list with only the showings that
begin between 7PM and 11PM. To create a rule for this, press ESC to go back
to the custom page and move to "Rule Name:" then type "Nova" or anything
else you would like. This is only a label and will not affect the search
results. Once a name has been entered, the "Record" button will light up.
Click this to enter the recording options page. If you named it "Nova" the
title will say "Nova (Power Search)". Set whatever options you would like
then click "Save these settings". You now have a special rule to record
"Nova" but only when it is shown in primetime.</P>
<P>You can make further modifications to this rule by returning to the Custom
Record page then press the right or left arrow keys on "Edit Rule:" until
you find "Nova". You can experiment and test but the saved rule will not
be updated until you click "Record" then "Save these settings".</P>
<P>To remove this, or any other rule, you can go to the "Recording Priorities"
page, arrow down to the title, press Enter and change the the recording type
to "Do not record this program" then "Save these settings".</P>

<H3>How it Works</H3>

<P>MythTV stores TV program information in a database and uses the Structured
Query Language (SQL) to access the data. Information about each TV program
is stored in the 'program' table and information about each TV station you
receive is stored in 'channel'. These two tables are used in the scheduler
queries and their columns are available to be used in your rules. The rules
you create are stored in 'record'.</P>
<P>Normal rules in MythTV simply match the title in the rule with the titles
in the 'program' table. MythTV also has search rules for "Titles",
"Keywords" and "People". These store the key phrase in the description
column of the rule and includes them in specialized SQL replacements for
the normal title check. There is also a type called "Power Search" which
takes the raw SQL in the description as the replacement for title
matching.</P>
<P>Custom Record is a tool to help you build valid SQL for Power Search rules.
You do not need to be a SQL expert to use Custom Record because the
examples are known to work correctly and are usually self-explanatory so you
can choose the pieces you need then modify them.  Many powerful solutions to
unique problems are possible by combining the examples. With some creativity
and some knowledge of SQL, the possibilities are limitless.</P>

<H3>Common Tricks and Tips</H3>

<P>The example clauses marked "complete example" are actual rules that have
been used to address specific problems. You may find that some of these
are useful for you as-is or with slight modifications. These show off how
powerful custom rules can be but there are also several simple idioms that
you may find useful for many of the shows you would like to record.</P>
<P>Wait for a known title -- If there is a movie that you anticipate will be
televised in the coming months but is not yet in the listings, you can
select "Match an exact title", edit the movie title, click "Record" then
choose "Record one showing of this title". The rule will wait weeks, months
or years until this title shows up in your listings then it will record one
showing. These rules have no impact on the scheduler throughout the day and
only take a tiny fraction of a second when the master backend starts or when
the listings are updated.</P>
<P>Silence series out of season -- "Celebrity Poker Showdown", for example,
will have new episodes for a while then long periods where reruns are shown
dozens of times per week. By checking the previously shown flag you can
create a rule that will only match new episodes.  Therefore, your schedule
won't be polluted with dozens of entries marked as "Repeat" or "Previously
Recorded".
<BLOCKQUOTE><CODE>
<PRE>
       program.title = "Celebrity Poker Showdown"
       AND program.previouslyshown = 0
</PRE>
</CODE></BLOCKQUOTE>

This allows you to keep rules for your favorite shows that are dormant while
out of season but will spring back to life when new episodes appear.</P>
<P>Choose showings on certain days -- Several cable stations will show their
highest rated shows a dozen on more times per week. However, the scheduler
only needs two or three choices to do a good job of making a flexible
choice.
<BLOCKQUOTE><CODE>
<PRE>
       program.title LIKE "Celebrity Fit Club%"
       AND DAYNAME(program.starttime) = "Sunday"
</PRE>
</CODE></BLOCKQUOTE>

This says to choose any showing of an episode that hasn't been recorded
when it appears on Sunday. This prevents all the other showings during the
week from being listed in the schedule.</P>
<P>Notice the word "LIKE" and the "%" at the end. This does wildcard matching
so that this would match even if the title ended with "2".  "III" or
":Revenge of the Snapple Lady". This can be useful where the title may
change from one season to the next like "Survivor: %", "Big Brother%" or
"The Amazing Race%".</P>

<H3>Working with SQL</H3>

<P>As you experiment, it is possible that you may misplace a quote or mistype a
word. If there is a mistake when you press "Test" or "Record" you will see
an error message returned from the database. This will usually give you a
good idea about what needs to be fixed. However, for more subtle MySQL
syntax errors, you can find more information in the documentation at 
<A HREF="http://dev.mysql.com/doc/mysql/en/">http://dev.mysql.com/doc/mysql/en/</A>. This contains a lot of
information that can be useful for Power Search rules such as the "Date and
Time Functions". There are many other good resources for SQL on the Web.</P>
<P>While the example clauses demonstrate how to use many of the data columns,
you can get a more complete list of all the columns that are available by
using a MySQL client program:
<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u mythtv -pmythtv mythconverg
mysql> describe program;
mysql> describe channel;
</PRE>
</CODE></BLOCKQUOTE>

This will show the names of all of the columns along with their type and
default value. Most are easy to understand but a few need some explanation
in order to use them effectively with Power Search.
<UL>
<LI>"program.category_type" holds one of these exact four strings: "movie",
"series", "sports" or "tvshow".
</LI>
<LI>"program.airdate" is a string representing the year of release for
movies and may have no meaning for other types of shows.
</LI>
<LI>"program.stars" is a floating point number from 0.0 to 1.0. On a
four star scale, 1.0 would be four stars, 0.75 would be three stars and so
on.
</LI>
<LI>"program.originalairdate" if provided is the date when a show
was, or will be, first televised. This may be useful for finding
episodes before or after a certain date such as finding just the
original series of "Battlestar Galactica".
</LI>
<LI>"program.previouslyshown" is a column created by MythTV to try to
determine if a showing is more than 14 days after its original air date or
if the show was marked as a repeat and did not have a date for the first
airing. If this is "0" it usually means that this is a brand new show or a
rebroadcast within the first two weeks.
</LI>
<LI>"program.generic" is a column created by MythTV to try mark
showings for a series where the specific episode information is not
included. When these generic showings appear, it is impossible for the
system to determine if they are repeats of the same episode(s) or if
they are all different episodes.
</LI>
<LI>"program.first" is a column created by MythTV to mark the first
showing in the current listings for each episode, movie or special.
Choosing to match only the "first" showing can be useful for sports
that are brodcast live then repeated.
</LI>
<LI>"program.last" is a column created by MythTV to mark the last
showing in the current listings for each episode, movie or special.
If a showing is marked both "first" and "last" then it is the only
showing of that program in the current TV listings.
</LI>
<LI>"program.programid" is the Tribune Media Service database record
identifier for each program description. In general, these start with a two
letter prefix, MV, EP, SP or SH that correspond to the
"program.category_type".  For most, the last four digits are "0000" except
EP where the last four digits are the episode number in the series. Note
that these are generated by TMS and not the show's producers but they are
usually in the same order as the original air dates for the episodes.
</LI>
<LI>"program.videoprop" also "audioprop" and "subtitletypes".
These columns contain bit flags for a variety of attributes that
may be associated with a program. These are filled with information
offered by the TV listings provider. However, your listings source
will not have information for all of the available flags. Therefore,
some of these may not be useful for your search rules. This information 
is organized in "sets" and the MySQL function FIND_IN_SET() can be used
to test for any of these flags. For example:
<BLOCKQUOTE><CODE>
<PRE>
FIND_IN_SET('SURROUND', program.audioprop) > 0
</PRE>
</CODE></BLOCKQUOTE>

would be true for the programs where the surround sound bit is present.
To see all of the available attribute names:
<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u mythtv -pmythtv mythconverg
mysql> SHOW COLUMNS FROM program LIKE '%prop'\G
mysql> SHOW COLUMNS FROM program LIKE 'subtitletypes'\G
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>

Finally, if you are doing something very experimental and a column is not
giving you the results you had anticipated, you can always check the MythTV
source code to see exactly how a column is used. The open source for MythTV
is available from 
<A HREF="http://www.mythtv.org/">http://www.mythtv.org/</A> .</P>

<H2><A NAME="ss12.6">12.6</A> <A HREF="#toc12.6">Scheduling with more than one Input</A>
</H2>


<P>MythTV is designed to allow recording television programs from one or more
service providers, or video source, on one or more video input from each
provider. Some inputs may not be allowed to record at the same time as
each other while others may record simultaneously.</P>
<P>A television station may be broadcast on more than one channel from one
provider or may be available on channels from two or more providers. If a TV
station is available from more than one source, the video quality or type of
broadcast may differ. Therefore, MythTV allows you to control how you would
like the scheduler to select the best channel and input for a show which is
available on more than one input or more than one channel.</P>

<H3>Mutually Exclusive Inputs</H3>

<P>A single TV capture card may have video connections to more than
one of its inputs and each input may be from a different service.  The card
may only be allowed to record from one of these inputs at one time because
there is only one encoder on the card that actually captures the content.</P>
<P>
<FIGURE>
<EPS FILE="BlockDiagramofavideocapturedevice.eps">
<IMG SRC="BlockDiagramofavideocapturedevice.png">
<CAPTION></CAPTION>
</FIGURE>
</P>
<P>These are mutually exclusive meaning that only one input or the other
may record at a given time but not both.</P>
<P>Usually, inputs on different cards can record at the same time
but two or more inputs on the same card cannot. However, there are cases
where inputs on different cards should not be allowed to record at the
same time, for example, a firewire card and s-video analog card connected
to the same set top cable box.</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
|
|   coax +--------------+ firewire    ------------------+
|     .-=|Cable Provider|=------------=| Card 1 input 1 | HDTV
|     |  |HD/Cable STB  |=--.          +-----||||||||||||
|     |  +--------------+   | s-video ------------------+
|     |                     `---------=|        input 2 | Digital
|wall |               coax             | Card 2         |
|=---=^=------------------------------=|        input 3 | Cable
|                                      +-----|||||||||||| 
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Input 1 and input 2 receive content from the same set top box and the
channels can not be tuned independently. Therefore only one of these two
inputs should be used at any given time. The solution is to create an "Input
Group" with <B>mythtv-setup</B> in "Input connections". Including these
two inputs in the same Input Group will tell the scheduler that these are
mutually exclusive and may not record at the same time. Inputs 2 and 3 are
automatically mutually exclusive because they are on the same card so there
is no need to create an Input Group for these inputs.</P>
<P>Cards such as the Hauppauge PVR-500 are able to record as two cards
simultaneously because it has two MPEG-2 encoders and each encoder appears
as a separate device. DVB cards may be allowed to capture content from more
than one channel at a time if the channels are in the same MUX.</P>

<H3>Stations, Channels and Video Sources</H3>

<P>Although we may be accustomed to thinking of a broadcast station and its
channel number as being synonymous, stations and channels are very different
things. A "station" is in a building with wires and employees. A "channel"
is a carrier frequency or digital ID that carries a broadcast stream. The
same TV station may be broadcast over different frequencies in different
cities or by different providers in the same city. The same frequency will
carry different stations in different cities.  In the digital realm of DVB
and ATSC (HDTV), it is even possible for a single frequency to carry
multiple program streams but each of these streams of content are actually
different channels that the receiving devices can 'tune' to independently.</P>
<P>
<UL>
<LI>Station: building</LI>
<LI>Channel: frequency</LI>
</UL>
</P>
<P>In MythTV, a "video source" is a set of channels from a provider, or over
the air, that can be received by an input. The set defines the channels and
the broadcasters primarily associated with each of those channels.  If you
have more than one device or cable from the same provider connected to more
than one card and input, you only need to create one video source in
mythtv-setup then associate that one source with each of these connected
inputs. This will let your MythTV system know that the same channels and
their TV listings are available to be recorded from any of these inputs.</P>
<P>For example. A MythTV system may have two capture cards. Both have a cable
connected to the coaxial connectors. These cables carry the local cable TV
service. In mythtv-setup, the user should create one "Video source" called
"Cable", for example. Under "Input connections", "Cable" should be
associated with each of the two tuner inputs. The scheduler will then know
that any program on one of the channels from the "Cable" source could be
recorded by either card from the card's tuner input.</P>
<P>You need to create a different video source for each provider or service
that has a different set of channels. Each input with a connection to that
service should be associated with the video source for that service so the
system will know which set of channels are available for each of your active
inputs.</P>
<P>Let's say that this user also has one digital cable set top box. The digital
cable service carries channels that are not available over basic cable. The
user would create another source called "Digital". This set top box is
connected to the second card by S-Video so under "Input connections",
"Digital" is associated with the S-Video input of card 2. The system would
then know that programs on channels from the Digital source can only be
recorded from this input. Further, the scheduler understands that it can
only record one show at a time from card 2 so it can assign Cable or Digital
shows to the card but not both at the same time.</P>
<P>Some TV stations may be broadcast over a channel from the Cable source and
also broadcast over a channel from the Digital source. Note that two
channels carrying the same primary station may not have the same TV listings
due to carrying the primary station part time, including local programming
exclusive to one of the channels, the channels may be in different
timezones, etc. Listings information must be associated with each channel
even if two or more channels report that they carry the same station.</P>

<H3>Order of Inputs</H3>

<P>By default the scheduler chooses the first (lowest numbered) input which has
a showing of the scheduled program as it fills the schedule. If a lower
priority show is on at the same time as a higher priority show that has been
assigned to input 1, then input 2 will be used next and so on. Therefore,
configure your best card and input first and next best card and input
second.  There may be differences in the type or brand of capture card,
signal quality from the cable, system resources such as disk space, CPU,
etc. By configuring your best input first, more recordings, and your highest
priority recordings, will use that input.</P>
<P>A common situation is that a newer and better card is added last. For
example, you may initially setup your system with two analog cable cards and
then add a HDTV card. If NBC is on a cable channel and "The Apprentice" is
shown in HDTV on an NBC HD channel, the scheduler would still prefer analog
inputs 1 and 2 over the new HD input 3.</P>
<P>So, if you'd like the scheduler to prefer a new source, the simplest thing
is to run <B>mythtv-setup</B> and "Delete all capture cards" then enter
your cards and inputs in your preferred order. This will not remove your
sources and channels - you want to keep those and only renumber your cards
and inputs. In this example, once the changes have been made and the Master
Backend is restarted, the scheduler would then choose "The Apprentice" in HD
on the new input 1 and only use the analog inputs (now numbered 2 and 3)
when the HDTV input was occupied with another show.</P>

<H3>Matching Callsigns</H3>

<P>If a recording rule is a type that can record from any channel, "The
Apprentice" would match for any channel that shows episodes which may
include CNBC or BRAVO. However, for Single, Timeslot, Weekslot or Channel
rules, "The Apprentice" would only match showings on the selected station as
identified by the "callsign". For example, KVBC is an NBC affiliate on
channel 3. Channel 733 is KVBCDT which is HDTV over cable from the same
station. If a Single record rule was set for "The Apprentice" on KVBC
channel 3, it could not record this showing from KVBCDT on 733. If 733 was
chosen when the rule was saved, channel 3 could not be used to record.</P>
<P>However, the "Channel Editor" in mythtv-setup can be used to change the
Callsign for channel 733 to "KVBC". MythTV would then understand that both
of these channels are from the same broadcast station. Assuming the HDTV
input was input number "1", "The Apprentice" would record on 733. If,
however, this HDTV input already had a higher priority show assigned to it
in that time slot, "The Apprentice" would be assigned to KVBC channel 3 on
input 2.</P>
<P>Having two channels with the same callsign may affect how program
information is shown in mythfrontend. If two sources have the same callsign
and channel number, the program guide and program lists will only show one
instance of the channel number and callsign. If the same callsign is on two
different channel numbers, both will be shown and if two sources have
different callsigns with the same channel number, both of those will be
shown.</P>
<P>Continuing with the example above, the Electronic Program Guide would
include rows for both "3 KVBC" and "733 KVBC". If channel 3 KVBC was also
included in the Digital cable source, the EPG would still include just one
line for "3 KVBC" even though there are two different channels, Cable and
Digital, with this identification. Regardless of how these are displayed and
which "KVBC" channel you select to add a rule to record "The Apprentice",
the scheduler will pick the best channel, source and input to record "The
Apprentice" on "KVBC".</P>

<H3>Using Priorities to Prefer an Input</H3>

<P>The fundamental concept to keep in mind is that the MythTV scheduler will
choose the lowest numbered input available when showings have the same
priority. If there are factors that cause two showings of the same show to
have different priorities then the higher priority showing will be
considered before the showings with lower priority.</P>

<H3>Input Priority</H3>

<P>"Input Connections" in mythtv-setup includes a box to set "Input priority"
which defaults to "0". If a value is set, that amount will be added to the
"total priority" for showings on that input. This can be used to influence
using favored cards or not using less favored cards unless necessary.</P>
<P>Let's say the "The Apprentice" is on at 8:00pm with a priority of 3. "Who
Cares" is -2 and an episode is shown at 8:00pm then repeated at 11:00pm. The
scheduler would assign "The Apprentice" to card 1 and "Who Cares" to card 2
at 8:00pm. If the input priority for the input on card 2 was changed to -1,
"Who Cares" would have a total priority of -2 for showings on card 1 and -3
for showings on card 2. The scheduler would assign "The Apprentice" to card
1 at 8:00pm and "Who Cares" to card 1 at 11:00pm when the better card is
available. If there was another higher priority show at 11pm, the next best
choice for "Who Cares" would be card 2 at 8pm with the priority -3.</P>
<P>Card 1 and 2 have input priority "0":</P>
<P>
<FIGURE>
<EPS FILE="Card1 Pri 0 Card2 Pri 0.eps">
<IMG SRC="Card1 Pri 0 Card2 Pri 0.png">
<CAPTION></CAPTION>
</FIGURE>
</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
 Time  Title     Priority  Card  Status
 8:00  The Apprentice  +3  1     Will Record
 8:00  Who Cares       -2  2     Will Record
11:00  Who Cares       -2  1     Earlier Showing
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Card 2 with input priority "-1":</P>
<P>
<FIGURE>
<EPS FILE="Card1 Pri 0 Card2 Pri -1.eps">
<IMG SRC="Card1 Pri 0 Card2 Pri -1.png">
<CAPTION></CAPTION>
</FIGURE>
</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
 Time  Title     Priority  Card  Status
 8:00  The Apprentice  +3  1     Will Record
 8:00  Who Cares       -3  2     Later Showing
11:00  Who Cares       -2  1     Will Record
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Card 2 at "-1" but higher priority shows at both 8 P.M. and 11 P.M.:</P>
<P>
<FIGURE>
<EPS FILE="Card1 Pri 0 Card2 Pri -1-TDS.eps">
<IMG SRC="Card1 Pri 0 Card2 Pri -1-TDS.png">
<CAPTION></CAPTION>
</FIGURE>
</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
 Time  Title     Priority  Card  Status
 8:00  The Apprentice  +3  1     Will Record
 8:00  Who Cares       -3  2     Will Record
11:00  The Daily Show  +1  1     Will Record
11:00  Who Cares       -3  2     Earlier Showing
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Note the two different effects, each of which may be what you desire
depending on circumstance. If input priorities are equal, shows will record
at the earliest time if any input is available. If input priorities differ,
shows may be postponed to a later time in order to record on the best input.</P>

<H3>Channel Priority</H3>

<P>Priority can be added for individual channels (remember, frequencies from a
video source, not stations). This can be used to tell the system that you
generally prefer the content of the station on a channel over the formats of
other stations. You may want to raise the priority for ESPN, SciFi, Comedy
Central or lower the priority for CSPAN, CourtTV, etc. If the same station
is on two different channels, you can use channel priority to have the same
effect for these channels as input priority would have for whole inputs.</P>
<P>For example, say CNN is on analog channel 20 and there is an HD CNN on 750.
You may not want to tie up the HD input for news originating in standard
definition. Under TV Settings->Recording Priorities->Channel Priorities you
could set channel 750 to -1. The scheduler would then prefer to record CNN
shows on any analog channel 20 before considering using 750 only when there
are no analog inputs available.</P>

<H3>Preferred Input</H3>

<P>For an even finer grain of control, there is a per rule option to specify
which input should be preferred for showings that match the rule. By
default, this adds +2 to the priority for showings on the specified input.</P>
<P>For illustration, let's say there will be a Space Shuttle launch on CNN that
will be broadcast in high definition. Adding a rule to record the launch
with priority "0" should default to channel 20 on input 2. Channel 750 would
have this at -1 due to the channel priority set in the previous example. If
on the recording options page for this rule, the "Scheduling Options" had
the input set to prefer the HD input on card 1, then the showing on channel
750 for this input would be increased in value by +2 for a total of +1 and
would be the best choice for this launch coverage.  While this one rule
would prefer the HD input with channel 750, all other rules that match shows
on CNN would still prefer channel 20.</P>
<P>Note that this will not work properly if the preferred input priority does
not out weigh differences in input and channel priorities.  The value of the
priority boost when this option is chosen defaults to +2 but can be modified
in TV Settings->Recording Priorities->Set Recording Priorities.</P>

<H3>HDTV Priority</H3>

<P>In the preceeding fictious example, the Space Shuttle launch is broadcast in
high definition and a preferred input is selected to give preference to the
HD input. However, TV listings from zap2it.com through the DataDirect
service may allow this to work without having to use this per rule option.</P>
<P>In Settings->Recording Priorities->Set Recording Priorities there is an
option for "HDTV Recording Priority". This value will be added automatically
if the listings for the show have the "hdtv" flag set. DataDirect will set
this flag for shows known to be broadcast in HDTV on HD channels. However,
the flag is not set for standard definition channels. This is another
example of the listings being different for the same station on a different
channel. If the HDTV priority is set to "+2", the shuttle launch would
automatically have a total priority of +1 so that channel 750 would be
preferred over channel 20 for this HDTV broadcast.</P>
<P>Channel "750 CNN" at priority "-1" and HDTV broadcast priority at "+2":</P>
<P>
<FIGURE>
<EPS FILE="Card1 HDTV Card2 Cable.eps">
<IMG SRC="Card1 HDTV Card2 Cable.png">
<CAPTION></CAPTION>
</FIGURE>
</P>

<H3><A NAME="Custom Priority"></A> Custom Priority </H3>

<P>
<FIGURE>
<EPS FILE="add.eps">
<IMG SRC="add.png">
<CAPTION>New for MythTV 0.21</CAPTION>
</FIGURE>
</P>
<P>While Input, Channel, and HDTV Priority can be used for indicating a
preference for certain programs and inputs, there may be circumstances that
cannot be resolved easily with these standard features. MythTV version 0.21
includes a feature for "power priority". The Custom Priority editor in
mythfrontend's "TV Settings" screen is similar to Custom Record, however,
Custom Priority allows you to create specialized power priority factors to
influence scheduling decisions.</P>
<P>For example, the 'program.closecaptioned' flag can be used in a
similar way as the 'program.hdtv' flag.</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
Priority Rule Name: Closed Captioned priority
Priority Value: 2
program.closecaptioned > 0
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>This will raise the priority of shows marked with "CC" over those that are
not by applying the "Priority Value" whenever the SQL fragment evaluates to
true. If the expression evaluates to false for a showing, the "Priority
Value" is not applied.</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
Priority Rule Name: Priority when shown once
Priority Value: 1
program.first > 0 AND program.last > 0
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>The "first" and "last" flags for an episode will only be set for the
same showing when there is only one showing of that episode in the
current TV listings. This rule would raise the priority in these cases
so that these shows would have an advantage to record in their only
available time slot.</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
Priority Rule Name: Input 1 signal quality
Priority Value: -1
cardinput.cardinputid = 1 AND
channel.channum IN (3, 5, 39, 66)
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>A common issue with two or more analog capture cards is that one of
the cards may have more interference on some channels than the same
channels on other cards. This example gives a disadvantage to the
channels in this list but only for the first input. Therefore, a show
on channel 39 would choose input 2 or 3 if possible but for channels
not in this list, input 1 is still the first choice.</P>
<P>The Custom Priority editor includes many example fragments and complete
examples that can be used or you can create your own to suit your needs.</P>

<H2><A NAME="mythplugins_"></A> <A NAME="s13">13.</A> <A HREF="#toc13">MythPlugins. </A></H2>

<P>MythTV has a rich set of plugins available.  Once you have downloaded
the tarball, untar it and run the <B>configure</B> script:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ tar -xjf mythplugins-0.21.tar.bz2
$ cd mythplugins-0.21
$ ./configure --help

Usage:   configure [options]
Options: [defaults in brackets after descriptions]
NB:      all --enable-* options can be reversed with --disable-*

Generic options:
  --help                   print this message
  --enable-all             Enable all options
  --enable-opengl          enable OpenGL (Music and Gallery) [default=no]

MythBrowser related options:
  --enable-mythbrowser     build the mythbrowser plugin [default=yes]

MythDVD related options:
  --enable-mythdvd         build the mythdvd plugin [default=yes]
  --enable-transcode       enable DVD ripping and transcoding [default=no]
  --enable-vcd             enable VCD playing [default=no]

MythGallery related options:
  --enable-mythgallery     build the mythgallery plugin [default=yes]
  --enable-exif            enable reading of EXIF headers [default=no]

MythGame related options:
  --enable-mythgame        build the mythgame plugin [default=yes]

MythMusic related options:
  --enable-mythmusic       build the mythmusic plugin [default=yes]
  --enable-fftw            enable fftw visualizers [default=no]
  --enable-sdl             use SDL for the synaesthesia output [default=no]
  --enable-aac             enable AAC/MP4 audio file decompression [default=no]

MythNews related options:
  --enable-mythnews        build the mythnews plugin [default=yes]

MythPhone related options:
  --enable-mythphone       build the mythphone plugin [default=yes]
  --enable-festival        enable festival TTS Engine [default=no]

MythVideo related options:
  --enable-mythvideo       build the mythvideo plugin [default=yes]

MythWeather related options:
  --enable-mythweather     build the mythweather plugin [default=yes]
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>The sections detailing configuration of the plugins assume that you are
already in the <CODE>~/mythplugins-0.21/</CODE> directory.</P>
<P>Note that a single <B>configure</B> script now does configuration for all
modules.  By default, it will compile all modules.  If you do not wish to
compile a module, either because it is of no use to you, or you do not have
the prerequisites, the simplest course of action is to go through the
various sections below, satisfying the prerequisites, and then compile all
modules at once.</P>
<P>For example, you would only like to compile and install MythGallery and
MythMusic.  For MythGallery, you would like to use the EXIF data in the .JPG
file to present additional information onscreen.  For MythMusic, you would
like to enable support for the opengl and FFT visualizations.  The command
line would look like:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ cd ~/mythplugins-0.21 
$ ./configure --disable-all --enable-opengl --enable-mythgallery --enable-exif --enable-mythmusic --enable-fft
$ qmake mythplugins.pro
$ make
$ su -
# make install
# exit
$
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>For simplicity, the examples below will disable compilation of all other
modules other than the one being discussed.</P>

<H2><A NAME="s14">14.</A> <A HREF="#toc14">MythWeb.</A></H2>

<P>MythWeb allows you to use a web page to control various aspects of your
MythTV system.  MythWeb is a separate application, but it's dependent on
MythTV being installed and operational.</P>

<H2><A NAME="ss14.1">14.1</A> <A HREF="#toc14.1">Installation and prerequisites</A>
</H2>

<P>Mythweb is a part of the <B>mythplugins</B> package.  See 
<A HREF="#mythplugins_">MythPlugins</A> for instructions on downloading the
tarball. The next step depends on whether your distribution has a web server
and if you have PHP support.</P>

<H3>Mandriva</H3>

<P>Mandriva has <B>apache</B> and <B>PHP</B> pre-packaged, so
installation is quite simple.  </P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: Mandriva 9.1 users, perform the following:</CAPTION>
</FIGURE>

<BLOCKQUOTE><CODE>
<PRE>
# urpmi apache2 apache2-mod_php php-mysql
# chkconfig --level 345 httpd on
# /etc/rc.d/init.d/httpd restart
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="ss14.2">14.2</A> <A HREF="#toc14.2">Completing the installation</A>
</H2>

<P>
<BLOCKQUOTE><CODE>
<PRE>
$ cd ~/mythplugins-0.21/mythweb
$ su
# mkdir /var/www/html/mythweb
# cp -r . /var/www/html/mythweb
# exit
$ 
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>By default, MythWeb uses an Apache <CODE>.htaccess</CODE> file to restrict
access to the website and to configure some variables.</P>
<P>To create the password file for Apache (if your system doesn't already have
one), you could do something like this:
<BLOCKQUOTE><CODE>
<PRE>
# cd /var/www
# htpasswd -c htpasswd mythtv
New password:
Re-type new password:
Adding password for user mythtv
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>See the man page for <B>htpasswd</B> for more examples.</P>
<P>To access the web page, open a web browser and use <B>http://[name or ip
address]/mythweb/</B></P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: Make sure that you have a trailing slash on the URL,
otherwise you will get a <CODE>404 Page not Found</CODE> error.</CAPTION>
</FIGURE>
</P>
<H2><A NAME="ss14.3">14.3</A> <A HREF="#toc14.3">Resetting the key binding table</A>
</H2>

<P>MythWeb allows you to configure which keys are bound to which actions
within MythTV.  If you'd like to reset this back to the default, execute the
following command:
<BLOCKQUOTE><CODE>
<PRE>
$ echo "delete from keybindings ;" | mysql -u mythtv -pmythtv mythconverg
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H2><A NAME="ss14.4">14.4</A> <A HREF="#toc14.4">Resetting the theme.</A>
</H2>

<P>If you find yourself wedged into a theme that isn't working, open your
web browser and go to site:
<CODE>http://mythweb_name_or_ip_address/mythweb/settings.php?RESET_THEME=yes</CODE></P>
<H2><A NAME="s15">15.</A> <A HREF="#toc15">MythGallery.</A></H2>

<P>MythGallery is a photo and slideshow application.  MythGallery is a
separate application, but it's dependent on MythTV being installed and
operational.</P>
<H2><A NAME="ss15.1">15.1</A> <A HREF="#toc15.1">Installation and prerequisites</A>
</H2>

<P>MythGallery is a part of the <B>mythplugins</B> package.  See 
<A HREF="#mythplugins_">MythPlugins</A> for instructions on downloading the
tarball.</P>
<P>There are a number of transitions available, some requiring OpenGL
support.  You will also need to install a TIFF library.  Under Mandriva, you 
would perform the following command:
<BLOCKQUOTE><CODE>
<PRE>
# urpmi libtiff3-devel
</PRE>
</CODE></BLOCKQUOTE>

Once you have satisfied the prerequisites for your distribution, install the application:
<BLOCKQUOTE><CODE>
<PRE>
$ cd ~/mythplugins-0.21
$ ./configure --disable-all --enable-opengl --enable-mythgallery
$ qmake mythplugins.pro
$ make
# su
# make install
# exit
$ 
</PRE>
</CODE></BLOCKQUOTE>

The configuration for MythGallery is accessed through the main Setup option
in mythfrontend.  Make sure you set your pictures directory to wherever
you're storing your photos.</P>
<P>The controls for MythGallery can be found in the README that comes with the
application.</P>
<H2><A NAME="ss15.2">15.2</A> <A HREF="#toc15.2">Using MythGallery</A>
</H2>

<P>When you first start MythGallery, you will see a thumbnail view of any
folders and pictures in the Gallery Directory you specified in setup.  If
this is the first time you have accessed this directory, the thumbnails will
be generated on the fly.  If the Gallery Dir is writable, these thumbnails
will be cached thus speeding up future access.  On the left is a greyed-out
menu of options.</P>
<P>Use the arrow keys to select a folder or picture to open/view with the
Select key, or use the Menu key to toggle access the menu on the left.  The
menu options are as follows:
<UL>
<LI> Slideshow - Will cycle through all the pictures in the current folder. 
The currently selected item must be a picture (not a folder) for this to
work.  It does not currently traverse subfolders.</LI>
<LI> Rotate CW - Rotate the current image 90 degrees in the clockwise
direction.  This change persists if the current directory is writable.</LI>
<LI> Rotate CCW - As above except the direction of rotation is counter(anti)
clockwise.</LI>
<LI> Import - Import pictures into your Gallery Dir.  This option is
described in the next section.</LI>
<LI> Settings - Access the MythGallery settings screen.</LI>
</UL>
</P>
<H2><A NAME="ss15.3">15.3</A> <A HREF="#toc15.3">Importing Pictures</A>
</H2>

<P>The import path in the setup dialog is a colon separated list of
directories and/or executable files.  When the import key is pressed, a new
directory (the destination directory) under the current directory will be
created and the import path will be searched.  If the item in the import
path is a directory (the source directory), the contents of that directory
will be copied to the destination directory. If you would like the source
directory to be that of a removable device, it might be a good idea to use
autofs.  See the automount howto at 
<A HREF="www.linuxdoc.org">www.linuxdoc.org</A> for info on how to get it working.</P>
<P>If the item in the import path is an executable file, MythGallery will
attempt to execute it with the destination directory as its sole argument.
Be careful when using executable scripts that the script runs unattended
(doesn't need user intervention) and returns properly, otherwise it could
create the appearance of MythGallery hanging (e.g. running
<B>smbclient</B> and prompting for password).  Also be sure that scripts
have executable permissions set.</P>
<P>Here is an example script that a user may want to run
on import: 
<BLOCKQUOTE><CODE>
<PRE>
#!/bin/csh

if ($#argv == 0) then 
        echo "Usage: $0 dest_dir" 
        exit 
endif 

cd $argv[1]

# get stuff over the network
wget http://www.somesite.dom/dir/file1.jpg 
wget http://www.somesite.dom/dir/file2.jpg
wget http://www.somesite.dom/dir/file3.jpg

# stuff that requires manual module loading and/or fs mounting
modprobe camera_module
mount /dev/camera /mnt/camera
cp /mnt/camera/* $argv[1]
umount /mnt/camera
rmmod camera_module

# perform some processing
foreach pname (`ls *.jpg`)
        jpegtran -flip vertical $pname > $pname.new
        mv $pname.new $pname
end
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="s16">16.</A> <A HREF="#toc16">MythGame.</A></H2>

<P>MythGame can used as a frontend to start any emulator that your host OS
runs. This is an example of how to set up xmame on Linux.
<A HREF="http://www.mameworld.net/">http://www.mameworld.net/</A> is
an excellent resource for all things mame.</P>
<P>Installation overview:
<OL>
<LI>Setup directory structure</LI>
<LI>Download and install xmame</LI>
<LI>Download and place extra files (artwork/catver.ini/etc..)</LI>
<LI>Download and install MythGame plugin</LI>
<LI>Setup xmame in MythGame</LI>
<LI>Hints</LI>
</OL>
</P>
<H2><A NAME="ss16.1">16.1</A> <A HREF="#toc16.1">Setup Directory Structure</A>
</H2>

<P>To keep things organized, create the following directories for <B>xmame</B> to use
in <CODE>/usr/local/share/xmame</CODE>: hiscore, roms, and snaps.</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ mkdir -p /usr/local/share/xmame/{highscore,roms,snaps}
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="ss16.2">16.2</A> <A HREF="#toc16.2">Download and Install xmame</A>
</H2>

<P><B>NOTE</B>:  There may be pre-packaged versions of <B>xmame</B>
available for your distribution.  Check 
<A HREF="http://x.mame.net/download.html">http://x.mame.net/download.html</A> for the latest version.</P>
<P>Download the source to <B>xmame</B> from 
<A HREF="http://x.mame.net/download/xmame-0.103.tar.bz2">http://x.mame.net/download/xmame-0.103.tar.bz2</A></P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ wget http://x.mame.net/download/xmame-0.103.tar.bz2
$ tar -xjf xmame-0.103.tar.bz2
$ cd xmame-0.103
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Edit the Makefile with your favorite editor.  Adjust the options as required for your system.
<BLOCKQUOTE><CODE>
<PRE>
$ joe Makefile
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Then make and install xmame
<BLOCKQUOTE><CODE>
<PRE>
$ make
$ su
(enter password)
# make install
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>After <B>mame</B> has been installed, we need to create some defaults.
<BLOCKQUOTE><CODE>
<PRE>
$ mkdir ~/.xmame
$ cp docs/xmamerc.dist ~/.xmame/xmamerc
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Because some ROMS work better with different display toolkits, or possibly
even older versions of xmame, it's convenient to keep all of your
<B>xmame</B> binaries and to rename them to include the version number. 
MythGame allows you to match individual roms to preferred binaries.</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ su
(enter password)
# mv /usr/local/bin/xmame.x11 /usr/local/bin/xmame-0.103.x11
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P><B>NOTE</B>: Depending on how you compiled <B>xmame</B>, you may have
<B>xmame.X11</B>, <B>xmame.SDL</B> or <B>xmame.xgl</B> based on what
display toolkit you used. Also, you may need to remove and recreate
<CODE>xmamerc</CODE> after upgrading since some of the default options may have
changed.</P>
<P>Edit <CODE>~/.xmame/xmamerc</CODE> to include your paths.
<BLOCKQUOTE><CODE>
<PRE>
### Fileio Related ###
rompath                         /usr/local/share/xmame/roms
snapshot_directory              /usr/local/share/xmame/snaps
cheat_file                      /usr/local/share/xmame/cheat.dat
hiscore_file                    /usr/local/share/xmame/hiscore.dat
hiscore_directory               /usr/local/share/xmame/hiscore
history_file                    /usr/local/share/xmame/history.dat
mameinfo_file                   /usr/local/share/xmame/mameinfo.dat
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Confirm that <B>xmame</B> works before running it inside MythTV. Place
your ROM in the <CODE>/usr/local/share/xmame/roms</CODE> directory you created
earlier.</P>
<P><B>NOTE</B>: There are three public domain ROM sets available at
<A HREF="http://www.mame.net/downmisc.html">http://www.mame.net/downmisc.html</A></P>
<P>Launch <B>xmame</B> with your game of choice.  In this example, we are using Gauntlet.
<BLOCKQUOTE><CODE>
<PRE>
$ xmame gauntlet
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Some basic <B>mame</B> keyboard commands:
<BLOCKQUOTE><CODE>
<PRE>
5 = Insert coin
1 = Player 1 start
arrow keys = movement
left control = button 1
left alt = button 2
SPACE = button 3
ESC = exit
TAB - menu
~ to adjust Volume
     &lt; and >
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="ss16.3">16.3</A> <A HREF="#toc16.3">Download extra files</A>
</H2>

<P>The following files allow you to add extra functionality.  Place them
into <CODE>/usr/local/share/xmame</CODE></P>
<P>- <CODE>catver.ini</CODE> is a catalog of categories and versions of popular mame ROMs.</P>
<P>Useful for keeping large libraries of ROMs organized.</P>
<P>It may be downloaded from 
<A HREF="http://www.catver.com">http://www.catver.com</A> or 
<A HREF="http://www.mameworld.net/catlist">http://www.mameworld.net/catlist</A></P>
<P>- Screenshots aka "snaps"</P>
<P>These may be downloaded from 
<A HREF="http://www.classicgaming.com/mame32qa/">http://www.classicgaming.com/mame32qa/</A></P>
<P>Screenshots are displayed when you are browsing your ROMS in <B>mythgame</B>.
Unzip and place them in <CODE>/usr/local/share/xmame/snaps</CODE></P>
<P>- <CODE>history.dat</CODE></P>
<P>Download from 
<A HREF="http://www.arcade-history.com/">http://www.arcade-history.com/</A>
This file fills in a bit of background about each ROM.</P>
<P>- <CODE>hiscore.dat</CODE></P>
<P>Download from 
<A HREF="http://www.mameworld.net/highscore/">http://www.mameworld.net/highscore/</A></P>
<P>- Cheats</P>
<P>Download from 
<A HREF="http://cheat.retrogames.com/">http://cheat.retrogames.com/</A></P>

<H2><A NAME="ss16.4">16.4</A> <A HREF="#toc16.4">Download and Install MythGame.</A>
</H2>

<P><B>MythGame</B> is part of the mythplugins package.  See the instructions
in the 
<A HREF="#DownloadAndCompile">Downloading and Compiling</A>
section to obtain mythplugins.</P>
<P>Switch to the mythplugins directory:
<BLOCKQUOTE><CODE>
<PRE>
$ cd ~/mythplugins-0.21
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Compile and install mythgame:
<BLOCKQUOTE><CODE>
<PRE>
$ ./configure --disable-all --enable-mythgame
$ qmake mythplugins.pro
$ make
$ su
(enter password)
# make install
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="ss16.5">16.5</A> <A HREF="#toc16.5">Setup xmame in MythGame</A>
</H2>

<P>Start <B>mythfrontend</B> and navigate to Utilities/Setup > Setup > Media
Settings > Game Settings > Game Players. Select <CODE>(New Game Player)</CODE>.</P>
<P>To set up a new player for xmame enter the following:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
Player Name:    xmame-0.103.x11                  (Name by which you want your emulator or game called)
Type:           xmame                           (This is used for display purposes only and does not affect the function of your system)
Command:        xmame-0.103.x11 -vidmod 1 -fullscreen     (Path and name of binary + any optional parameters)
Rom Path:       /usr/local/share/xmame/roms     (This tells MythGame what directories to scan for roms to be used with this emulator)
ScreenShots:    /usr/local/share/xmame/snaps    (This tells MythGame what directories to scan for snapshots to be used with these roms)
Working Directory:                              (Directory to change to before launching game or emulator. Blank in our case ignores this setting)
File Extensions:                                (List of all file extension to be used for this emulator. Blank menas any file under the Rom Path)
[] Allow games to span multiple roms/disks      (will treat game.1.rom game.2.rom game.3.rom as one game)
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="ss16.6">16.6</A> <A HREF="#toc16.6">Hints:</A>
</H2>

<P>
<UL>
<LI>Rom name before options: %s can be used as a standin for rom names on the command line.</LI>
<LI>Multiple disk/rom games: %d1 %d2 etc can be used as standins for multiple disc games on the command line.</LI>
<LI>Associating a rom with an emulator: Browse to the desired rom and press 'M' to enter the settings page for that rom.</LI>
<LI>Assign a Game Favorite Status: Browse to the desired game and press "/".</LI>
</UL>
</P>

<H2><A NAME="s17">17.</A> <A HREF="#toc17">MythMusic. </A></H2>

<P>MythMusic has a number of prerequisites that must be satisfied before it
is operational.  Depending on your distribution, some of these prerequisites can
be satisfied through the various package managers.  If your distribution doesn't
offer pre-compiled versions of the software below, then follow the generic
instructions for manually compiling and installing the software.</P>
<P>The prerequisites for MythMusic are:
<UL>
<LI>MAD</LI>
<LI>taglib</LI>
<LI>libogg and libvorbis</LI>
<LI>FLAC</LI>
<LI>libcdaudio</LI>
<LI>CDParanoia</LI>
</UL>
</P>

<H2><A NAME="ss17.1">17.1</A> <A HREF="#toc17.1">Manual installation of prerequisites</A>
</H2>

<P>These instructions are for distributions which don't have pre-compiled
versions of the software necessary to run MythTV.</P>
<P>Download MAD from 
<A HREF="http://www.underbit.com/products/mad">http://www.underbit.com/products/mad</A> and install:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ tar -xzf mad-0.15.1b.tar.gz
$ cd mad-0.15.1b
$ ./configure
$ make
$ su
# make install
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Download TagLib from 
<A HREF="http://developer.kde.org/~wheeler/taglib.html">http://developer.kde.org/~wheeler/taglib.html</A> and install:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ tar -xzf taglib-1.4.tar.gz
$ cd taglib-1.4
$ ./configure
$ make
$ su
# make install
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Download libogg and libvorbis from 
<A HREF="http://www.xiph.org/downloads">http://www.xiph.org/downloads</A> and install in a similar manner
to the above packages.</P>
<P>Download FLAC from 
<A HREF="http://flac.sourceforge.net">http://flac.sourceforge.net</A> and install:
<BLOCKQUOTE><CODE>
<PRE>
$ tar -xzf flac-1.1.2.tar.gz
$ cd flac-1.1.2
$ ./configure
$ make
$ su
# make install
# exit
$ 
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Download libcdaudio from 
<A HREF="http://sourceforge.net/project/showfiles.php?group_id=27134">http://libcdaudio.sourceforge.net</A> and
install:
<BLOCKQUOTE><CODE>
<PRE>
$ tar -xzf libcdaudio-0.99.12p2.tar.gz
$ cd libcdaudio-0.99.12p2
$ ./configure
$ make
$ su
# make install
# exit
$ 
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Download cdparanoia from 
<A HREF="http://www.xiph.org/paranoia/download/cdparanoia-III-alpha9.8.src.tgz">http://www.xiph.org/paranoia/down.html</A>.
<BLOCKQUOTE><CODE>
<PRE>
$ tar -xzf cdparanoia-III-alpha9.8.src.tgz
$ cd cdparanoia-III-alpha9.8
$ ./configure
$ make
$ su
# make install
# cd /usr/lib
# ln -sf libcdda_interface.so.0.9.8 libcdda_interface.so
# ln -sf libcdda_paranoia.so.0.9.8 libcdda_paranoia.so
# exit
$ 
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="ss17.2">17.2</A> <A HREF="#toc17.2">Mandriva</A>
</H2>

<P>Mandriva has a number of the prerequisites available on the
installation CD.  Some of the software you're going to need will have to be
obtained from the "contrib" or "cooker" development repositories. 
Applications downloaded from "cooker" come from the development branch, so
there may be issues with some software.  It isn't recommended that you mix
cooker and release-level software.</P>

<P><B>urpmi</B> is the simplest tool for installation of packages from the
command line.  The difficult part is the configuration, but this has been
made easier at the following website: 
<A HREF="http://addmedia.linuxfornewbies.org/">http://addmedia.linuxfornewbies.org/</A> The website will allow
you to choose a mirror site and then present the command-line configuration
text for that mirror.  You will most likely need to add a "Contrib" mirror
to your setup.  Once you have done that, you can proceed.  If <B>urpmi</B>
prompts you about other modules that need to be installed to satisfy
dependencies, say "Yes".</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
# urpmi libmad0 libmad0-devel libflac4 libflac4-devel libcdaudio1 cdparanoia
# urpmi libcdda0 libcdda0-devel libvorbis0 libvorbis0-devel
# urpmi libcdaudio1-devel libid3tag0 libid3tag0-devel
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H3>Additional options with MythMusic</H3>

<P>Additional visualizations have been added to MythMusic.  If you wish to
use these, there are some prerequisites you must install prior to compiling.</P>
<P>
<UL>
<LI>fftw</LI>
<LI>OpenGL</LI>
<LI>SDL</LI>
</UL>
</P>
<P><CODE>fftw</CODE> may be obtained from 
<A HREF="http://www.fftw.org/">http://www.fftw.org/</A>.  In Mandriva it may be installed by
typing:
<BLOCKQUOTE><CODE>
<PRE>
# urpmi libfftw2 libfftw2-devel
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P><CODE>OpenGL</CODE> should be installed on practically all distributions. 
However, you will need the devel module.  In Mandriva it may be
installed by typing:
<BLOCKQUOTE><CODE>
<PRE>
# urpmi libMesaGLU1-devel
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P><CODE>SDL</CODE> may be obtained from 
<A HREF="http://www.libsdl.org">http://www.libsdl.org</A>.  In Mandriva it may be installed by
typing:
<BLOCKQUOTE><CODE>
<PRE>
# urpmi libSDL1.2 libSDL1.2-devel
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="ss17.3">17.3</A> <A HREF="#toc17.3">Red Hat Linux 9</A>
</H2>

<P>Red Hat provides packages for several of the prerequisites, making 
installation very simple. Of the prerequisites, Red Hat provides 
packages for Vorbis, cdparanoia, SDL, and OpenGL (which you probably 
already have installed). To install these all at once, simply type (all on
the same line):
<BLOCKQUOTE><CODE>
<PRE>
$ up2date --solvedeps libvorbis libvorbis-devel vorbis-tools cdparanoia-devel cdparanoia-libs cdparanoia SDL-devel SDL
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>If you get the following message: "None of the packages you requested 
were found, or they are already updated" it probably means you already 
have all of those packages installed.</P>
<P>You must install the remaining packages, (MAD, FLAC, libcdaudio and
optionally fftw) manually following the installation directions above. When
installing fftw do not use the rpm package offered on the website because it
will cause an error, so use the source package instead.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: you can use the instructions given at the 
<A HREF="#atrpms">automated installation section</A> to install all of MythMusic in one
step.</CAPTION>
</FIGURE>
</P>
<H2><A NAME="ss17.4">17.4</A> <A HREF="#toc17.4">Compiling MythMusic</A>
</H2>

<P>Once all the prerequisites have been installed, you can proceed with
compiling MythMusic.</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ cd ~/mythplugins-0.21
$ ./configure --disable-all --enable-mythmusic --enable-fftw --enable-sdl --enable-aac
$ qmake mythplugins.pro
$ make
$ su
# make install
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="ss17.5">17.5</A> <A HREF="#toc17.5">Configuring MythMusic</A>
</H2>

<P>Configuration of MythMusic occurs in two places.  The main mythfrontend
Setup is for global MythMusic configuration.  Go to the
Setup/MythMusic/General Setup screen and adjust it for your particular
configuration.</P>
<P>The second configuration screen is within the MythMusic program and will
allow you rescan your music library, etc.</P>
<P>Here's some explanation about the Ignore_ID3 and The NonID3FileNameFormat:</P>
<P>If Ignore_ID3 is set to TRUE, MythMusic will try to determine the
Genre, Artist, Album, Track Number, and Title from the filename of the
mp3 file.  The NonID3FileNameFormat variable should be set to the
directory/file format where the mp3 files are stored.  For instance, I
store mine in the above shown Genre/Artist/Album/Track format.  MythMusic
will then use this information to fill in the proper fields when it
populates the musicmetadata table rather than searching for an ID3 tag in
the mp3 file.</P>
<P>The files can be laid out in any format, such as:</P>
<P>Genre/Artist/Album/Title
Artist/Genre/Album/Title
Artist/Album/Title (with Genre left as Unknown)</P>
<P>The track number is optional but can be specified with the title by using
the TRACK_TITLE keyword instead of TITLE.  If TRACK_TITLE is used,
then the filename can have a space, hyphen, or underscore separating the
track number from the track title.  Keywords are case insensitive, so if
you specify GENRE it's the same as Genre in the format field.</P>
<P>The Ignore_ID3 option does not disable the code that determines the track
length, just the portion that tries to read ID3 info.</P>

<H2><A NAME="ss17.6">17.6</A> <A HREF="#toc17.6">Using MythMusic</A>
</H2>

<P>MythMusic is fairly simple to use.  It is recommended that you insert the
CD before selecting "Import CD".  You should also ensure that your system
doesn't try to automount the CD and begin playing it automatically.</P>
<P>Here's some information on playlist management:</P>
<P>Q: How do I create a new playlist?  
A: Using the MythMusic "Select Music" menu option, setup the playlist as you
normally would by adding songs or other playlists as needed.  When you are
ready to save the new playlist, highlight "Active Play Queue" at the bottom
of the selection tree and hit the "i" key. This will pop up a menu allowing
you to name and save the new playlist.  You can also hit Enter to bring up
the popup on the Active Play Queue. This does not work on the playlists
above, as Enter is obviously bound to checking/unchecking the boxes. Any
number (i.e. keypad on remote) will also bring up the menu in both cases.</P>
<P>Q: How do I enter the playlist name in the text field without a keyboard?
A: Use the keypad number keys (bound to your remote) to select letters
quasi-cell phone style. Keys 2-9 work pretty much like any cell phone text
entry. 1 cycles through a few special characters, delete, and space. 0 is
like a CAPS LOCK. Hard to describe, fairly easy to use. You will soon be
able to specify the cycle timing in a Setup screen. You can type fairly
quickly through a combination of jumping around the number keys AND hitting
a non-number key (right arrow is particularly good for this) to force the
current character.</P>
<P>Q: How do I edit a playlist? 
A: Highlight the playlist in the selection tree and hit the "i" key then
select "Move to Active Play Queue" in the popup.  You can now modify the
"Active Play Queue" like normal, adding songs and playlists by selecting
them from the song tree.  When you are done, highlight the "Active Play
Queue" in the selection tree and hit the "i" key then select "Save Back to
Playlist Tree".  And whatever you were editing as your Active Queue before
you moved an existing playlist "on top" of Active reappears. Think of Active
has having a push on, pop off capability, but with a depth of only 1.</P>
<P>Q: How do I delete an item from a playlist?
A: Highlight the item in the selection tree and hit the "d" key.</P>
<P>Q: How do I rearrange the songs in my playlist?
A: Highlight a song and hit the "space" bar, the song will now have pair of
red arrows in front of it.  Use the up and down arrow keys to move it around
in the playlist.  When you have it where you want it, hit the "space" bar
again.</P>
<P>Q: How do I delete a playlist?
A: Highlight the playlist in the selection tree and hit the "i" key then
select "Delete this Playlist" from the popup.</P>

<H2><A NAME="ss17.7">17.7</A> <A HREF="#toc17.7">Troubleshooting MythMusic</A>
</H2>

<P>You may run into errors when running MythMusic.</P>
<H3>When I run MythMusic and try and look up a CD, I get an error message </H3>

<P>The full text of the message will say: </P>
<P>databasebox.o: Couldn't find your CD. It may not be in the freedb database. 
More likely, however, is that you need to delete &nbsp;/.cddb and &nbsp;/.cdserverrc
and restart mythmusic. Have a nice day.</P>
<P>If you get this message, you should go to the home directory of whatever
user MythMusic is running as and type:
<BLOCKQUOTE><CODE>
<PRE>
rm .cdserverrc
rm -rf .cddb/
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>These files aren't automatically deleted because of a conscious design
decision by the author that programs that automatically delete things are
bad.</P>
<P>The files are used to locally cache CD lookups. If you are re-inserting
CDs, your machine will not actually have to go out to the Internet to
determine what is on them.  However, the URL used to access the freedb
database has recently changed, so the stale information in the files from
previous runs of MythMusic would cause the error above.  Once the files have
been deleted the stale information will be gone and your local database
will be rebuilt as you use CDs.</P>

<H2><A NAME="s18">18.</A> <A HREF="#toc18">MythWeather.</A></H2>

<P>MythWeather is a part of the <B>mythplugins</B> package.  See 
<A HREF="#mythplugins_">MythPlugins</A> for instructions on downloading the
tarball.</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ cd ~/mythplugins-0.21
$ ./configure --disable-all --enable-mythweather
$ qmake mythplugins.pro
$ make
$ su
# make install
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>MythWeather uses MSNBC.com as its source for weather data and weather.com
for its radar image.</P>
<P>These are the keyboard commands for MythWeather:
<BLOCKQUOTE><CODE>
<PRE>
Left Key             Goes back one page, and extends the time spent
                     on the page you are on.
Right Key            Goes forward one page, see above.
Space                Pause, wait on the current page until space is hit
                     again.
Numeric Keys         You can check other weather by keying in other ZIP codes.
Enter Key            Switch between Celsius and Fahrenheit. Can also
                     be used a way to force a data update.
"m" Key              Resets the location to the database default, then updates the data.
"i"                  Enter / Save settings
ESC                  Exit the settings screen without saving / Exit the program
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>MythWeather also has an "Aggressiveness" setting.  This affects how long
MythWeather waits for data from the msnbc.com website before timing out.  If
you are on a slow connection, or have a slow DNS, or MythWeather just
doesn't seem to be working and you've already tried everything else, then
try increasing the aggressiveness level parameter.  This parameter is
inverse; a higher number actually means that MythWeather will be less
aggressive, and will therefore wait longer before timing out.</P>
<P>MythWeather will print debugging information on the terminal.  If you wish
to see additional debugging information while MythWeather is running, run
mythweather from the command line with as <CODE>mythweather --debug</CODE></P>
<P>You may also force mythweather to re-run the configuration by starting it on
the command line as <CODE>mythweather --configure</CODE>.  These two options are
mutually exclusive.</P>

<H2><A NAME="s19">19.</A> <A HREF="#toc19">MythVideo.</A></H2>

<P>MythVideo is a part of the <B>mythplugins</B> package.  See 
<A HREF="#mythplugins_">MythPlugins</A> for instructions on downloading the
tarball.</P>
<P>MythVideo will allow you to use an external program to watch media files
that are not directly supported by MythTV.</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ cd ~/mythplugins-0.21
$ ./configure --disable-all --enable-mythvideo
$ qmake mythplugins.pro
$ make
$ su
# make install
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>See MythVideo's <CODE>README</CODE> file for additional information.</P>

<H2><A NAME="s20">20.</A> <A HREF="#toc20">MythDVD.</A></H2>

<P>MythDVD is a part of the <B>mythplugins</B> package.  See 
<A HREF="#mythplugins_">MythPlugins</A> for instructions on downloading the
tarball.  MythDVD is an application which rips DVDs and makes them available for
use with MythVideo.  You may also transcode the DVD content from MPEG-2 to
other formats which should greatly reduce the amount of space the DVD
material takes up on your hard drive.</P>
<P>MythDVD has a number of prerequisites to enable transcoding functionality. 
If you only wish to play DVDs rather than convert them to something like
MPEG-4 or xvid you may skip the prerequisite installation step.</P>

<H2><A NAME="ss20.1">20.1</A> <A HREF="#toc20.1">Manual Compilation of Prerequisites</A>
</H2>


<H2><A NAME="ss20.2">20.2</A> <A HREF="#toc20.2">Pre-compiled binaries</A>
</H2>

<P>Mandriva users may install the prerequisites this way:
<BLOCKQUOTE><CODE>
<PRE>
# urpmi libdvdread3 libdvdread3-devel a52dec liba52dec-devel 
# urpmi mplayer ogle xine
</PRE>
</CODE></BLOCKQUOTE>

Assuming that you've added a PLF mirror, you may also load the rest of the
prerequisites using the following command:
<BLOCKQUOTE><CODE>
<PRE>
# urpmi xvid xvid-devel fame libfame0.9-devel transcode libdvdcss
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>In the example below, we have enabled support for transcoding and for VCD
playing.  You may remove these options if you don't need them.
<BLOCKQUOTE><CODE>
<PRE>
$ cd ~/mythplugins-0.20
$ ./configure --disable-all --enable-mythdvd --enable-transcode --enable-vcd
$ qmake mythplugins.pro
$ make
$ su
# make install
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H2><A NAME="ss20.3">20.3</A> <A HREF="#toc20.3">Running the Myth Transcoding Daemon</A>
</H2>

<P>Transcoding ("ripping") a DVD requires you to run the Myth Transcoding
Daemon (mtd).  To ensure that mtd is configured correctly, you should first
test it at the command line.
<BLOCKQUOTE><CODE>
<PRE>
$ mtd -n
</PRE>
</CODE></BLOCKQUOTE>

The last line of text should show something like:
<BLOCKQUOTE><CODE>
<PRE>
mtd is listening on port 2342
</PRE>
</CODE></BLOCKQUOTE>

This indicates that mtd is ready for use.  Once you've successfully
tested mtd in the foreground, type <B>CTRL-C</B> to stop mtd.  You may
then start it as a background (daemon) process.
<BLOCKQUOTE><CODE>
<PRE>
$ mtd -d
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Running mtd as a daemon will allow you to automatically start it during the
boot process.  For example, you may add <CODE>mtd -d</CODE> to your
<CODE>rc.local</CODE> file, or you can adjust the script/steps outlined in the
section called 
<A HREF="#mythbackend_autostart">Automatically starting mythbackend at system boot time</A> to start mtd instead of mythbackend.</P>

<H2><A NAME="s21">21.</A> <A HREF="#toc21">MythNews.</A></H2>

<P>MythNews is a part of the <B>mythplugins</B> package.  See 
<A HREF="#mythplugins_">MythPlugins</A> for instructions on downloading the
tarball.  MythNews is a RSS reader.
<BLOCKQUOTE><CODE>
<PRE>
$ cd ~/mythplugins-0.21
$ ./configure --disable-all --enable-mythnews
$ qmake mythplugins.pro
$ make
$ su
# make install
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="s22">22.</A> <A HREF="#toc22">Troubleshooting.</A></H2>

<H2><A NAME="ss22.1">22.1</A> <A HREF="#toc22.1">Compiling</A>
</H2>

<H3>Compile errors</H3>

<P>Some compile errors are worse than others.  If you get an error that
doesn't abort the compilation, and says something like:
<BLOCKQUOTE><CODE>
<PRE>
cc1plus: warning: changing search order for system directory
"/usr/local/include"
cc1plus: warning:   as it has already been specified as a non-system
directory
</PRE>
</CODE></BLOCKQUOTE>

then it shouldn't be a problem.</P>
<P>If you get an error like <CODE>/usr/bin/ld: cannot find -lXext</CODE>, the
compiler is telling you that you don't have XFree86-devel installed, or that
your distribution hasn't set it up correctly.  This needs to be fixed before
MythTV will compile.</P>

<H3><A NAME="mkspecs_error"></A> make: *** No rule to make target /usr/lib/qt3/mkspecs/default/qmake.conf', needed by Makefile'.  Stop. </H3>

<P>This error happens when there's a missing link in the
<CODE>/usr/lib/qt3/mkspecs</CODE> directory.  There are two ways to fix this
error:</P>
<P>1.  Create the link manually:
<BLOCKQUOTE><CODE>
<PRE>
$ su
# cd /usr/lib/qt3/mkspecs
# ln -sf linux-g++ default
</PRE>
</CODE></BLOCKQUOTE>

and then restart the compile,</P>
<P>or</P>
<P>2.  Run <B>qmake mythtv.pro</B> in the mythtv directory.  Rerunning
<B>qmake</B> will create a new Makefile for you, however this still
doesn't fix the root cause of the issue, which is that your distribution
didn't create the symlink for you when the qt3 package was installed.  The
first choice is the better solution.</P>

<H3>make: *** No rule to make target /mkspecs/default/qmake.conf', needed by Makefile'.  Stop.</H3>

<P>You didn't set your <CODE>QTDIR</CODE>.  Re-read the section on 
<A HREF="#Setting_up_paths">Setting up paths</A>.</P>

<H3>Internal Segmentation Fault.</H3>

<P>This is most likely to be caused by an overheating processor rather than
an actual programming fault within gcc.</P>

<H2><A NAME="debugging"></A> <A NAME="ss22.2">22.2</A> <A HREF="#toc22.2">Debugging </A>
</H2>

<H3>MythTV segfaults</H3>

<H3>MythTV isn't doing anything</H3>

<H3>Debugging with GDB</H3>

<P>Without details, the developers will not be able to determine if you have
discovered a genuine code-bug,  or if the problem is with your system.  In
order to determine what's going on, you must recompile MythTV with debugging
support and run MythTV within <B>gdb</B>, the GNU debugger.
Note that, on OS X, some data is provided without going through these steps.
See &nbsp;/Library/Logs/CrashReporter/MythFrontend.crash.log</P>
<P>Re-run the <B>configure</B> script and add <CODE>--compile-type=debug</CODE>
to any previous configuration options you may have used.  Check the
<CODE>config.log</CODE> file if you have forgotten.</P>
<P>Now, you need to clear out the old versions of the software to ensure that
you're running with the debugging code, then compile and install.
<BLOCKQUOTE><CODE>
<PRE>
$ make distclean
$ ./configure --compile-type=debug
$ make
$ su
# make install
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>At this point, you now have debug-enabled software ready.  To make sure that
you don't forget to type a command required for debugging, it's best to
setup a <CODE>gdbcommands</CODE> file.  This will be read by <B>gdb</B> when it's
started.
Put the following into <CODE>gdbcommands</CODE> in your home directory:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
handle SIGPIPE nostop noprint
handle SIG33 nostop noprint
set logging on
set pagination off
set args -l myth.log -v record,channel,siparser
run
thread apply all bt full
set logging off
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Let's assume that the problem you're having is in <B>mythbackend</B>.</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ gdb mythbackend -x gdbcommands
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-linux".Using host libthread_db library "/lib/tls/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P><B>gdb</B> will automatically read the commands that you've placed in the
<CODE>gdbcommands</CODE> file and begin running the program you specified on the
command line.</P>
<P>If the program appears to be locked up, press CTRL-C to create the backtrace
file.</P>
<P>All of the output from <CODE>gdb.txt</CODE> should be posted to the mythtv-dev
mailing list, along with the steps you followed to get the program to crash.</P>
<P><B>NOTE</B>:  If you're trimming the <CODE>gdb.txt</CODE> file to remove
extraneous information from the beginning of the file, make sure you include
at least 10 lines <EM>prior</EM> to the point where the backtrace actually
begins.  This ensures that there is some context to the backtrace, and so
that it's possible to see what exactly caused the segfault.</P>
<P><B>gdb</B> has a number of options, read the <CODE>man</CODE> page for more
information.  </P>
<P>Using the <CODE>gdbcommands</CODE> file in conjunction with a <B>while</B> loop
will ensure that <B>gdb</B> creates a trace file and then restarts:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ while true; do date >> gdb.txt; gdb mythbackend -x gdbcommands; done;
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P><B>NOTE</B>: To exit this loop you will need to kill the while loop.</P>
<P>If you're trying to troubleshoot and you can't get back to the <B>gdb</B> window
for some reason, it may be easier to use two systems or to start
mythfrontend from the text console.</P>
<P>If you're going to troubleshoot from a remote system, connect to the machine
that you're going to test using <B>ssh</B> or <B>telnet</B>. Next, type
<CODE>$ export DISPLAY=localhost:0.0</CODE>.  This will allow the graphics to be
displayed on the X console (usually ALT-F6 or ALT-F7) and still give you
output and control of <B>mythfrontend</B>, either from the <B>ssh</B>
session, or by switching back to the text console by pressing CTRL-ALT-F1. 
You can now continue troubleshooting using <B>gdb</B> as detailed in the
instructions.</P>

<H3>MythTV is crashing your system</H3>

<P>When run as a non-privileged user, MythTV <EM>can not</EM> crash your
system.  If your system is crashing when you run MythTV, then you have some
issue with the drivers for your capture card or other hardware, or the CPU
fan has fallen off/broken and your system is overheating when asked to
perform a CPU intensive task like encoding video.</P>
<P>If you are running as root, which is <B>strongly discouraged</B>, it is
possible that your system may crash due to the real-time thread using all
available CPU.  You will not be able to interrupt the process, so for all
intents and purposes your computer will have crashed.</P>

<H2><A NAME="ss22.3">22.3</A> <A HREF="#toc22.3">Installing</A>
</H2>

<H3>When trying to run mythtv-setup, you get an error like this: "mythtv-setup: error while loading shared libraries:"</H3>

<P>You didn't add <CODE>/usr/local/lib</CODE> to <CODE>/etc/ld.so.conf</CODE>.  See the
section on modifying 
<A HREF="#modifying_ld.so.conf">/etc/ld.so.conf</A>.</P>

<H2><A NAME="ss22.4">22.4</A> <A HREF="#toc22.4">Using</A>
</H2>

<H3>No programs are displayed in "Watch Recordings"</H3>

<P>This situation occurs most often with a system that acts as a frontend
and a slave backend. MythTV supports system-global and user-specific
configuration files, with user-configuration files taking precedence.  99%
of the configuration for MythTV is in the MySQL database, but MythTV still
needs to know where the MySQL server is running.  This information is in the
<CODE>mysql.txt</CODE> file.  By default, it will be installed to
<CODE>/usr/local/share/mythtv</CODE>, but a copy placed into <CODE>~/.mythtv</CODE>
will over-ride the global configuration.</P>
<P>You must ensure that there aren't multiple, conflicting versions of this
file on your system!
<BLOCKQUOTE><CODE>
<PRE>
$ locate mysql.txt
/usr/local/share/mythtv/mysql.txt
/home/mythtv/.mythtv/mysql.txt
$
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>As you can see, in this example there are two <CODE>mysql.txt</CODE> files.  If
they are not identical, then there may be unintended consequences.</P>
<P>You may also see this error if you completely fill the <CODE>/var</CODE>
partition. The most likely <EM>mythtv-related</EM> reason for this is an
overly large mythbackend or mythfrontend log file in <CODE>/var/log</CODE>. If
you have logging enabled for the backend, and myth runs for weeks at a time,
this may creep up and surprise you. Note that many system processes also
write to <CODE>/var</CODE> and the system may not boot if it is unable to write
to <CODE>/var</CODE> due to a full partition.</P>

<H3>MySQL not connecting correctly</H3>

<P>Your <B>MySQL</B> installation may have networking turned off. 
Check that <CODE>/etc/mysql/my.cnf</CODE> <EM>does not</EM> contain
<CODE>skip-networking</CODE>.  If it does, remove it.  Also verify that 
<CODE>bind-address</CODE> is set to your IP address instead of 
<CODE>127.0.0.1</CODE>.  If you change either of these items, restart 
<B>MySQL</B>.</P>

<H3>MySQL database is corrupt</H3>

<P>If you have reason to believe that your MySQL database is corrupt,
execute the following commands to attempt to repair it.</P>
<P><B>NOTE</B>: Ensure that there are no programs accessing the database
while you attempt to repair it.  Make sure that all backend and frontend
programs have exited.</P>
<P><CODE>mysqlcheck -r -umythtv -p&lt;password&gt; mythconverg</CODE></P>

<H3>Using a MPEG-2 encoder card and the video appears "jittery"</H3>

<H3>Using a MPEG-2 encoder card and the video is jumping up and down</H3>

<P>This is a different problem than the one discussed in the previous
section.  Currently, the ivtv driver or firmware appear to have some issues
if the vertical capture resolution is not the full screen height.  If you
are having a jitter problem then ensure that you are capturing either 480
lines (for NTSC) or 576 lines (for PAL).  The default capture profiles may
need to be edited for your setup.  Go to Settings->TV Settings->Recording
Profiles and adjust the <B>Default</B> and <B>Live TV</B> options to
480 or 576 from their defaults.</P>

<H3>Screen goes blank but returns when mouse is moved or keyboard is used</H3>

<P>This is due to DPMS, the Display Power Management System, which is used
to save power by turning off your monitor when the system decides that it's
not being used or due to a screensaver that has defaulted to a blank screen. 
MythTV now has DPMS support built-in, and should intelligently handle the
screen.  Continue reading if you wish to override DPMS and force it off.</P>
<P>Since it's likely that watching TV will not generate keyboard or mouse
events for a time, you need to turn off DPMS and the screensaver.  There are
a few ways to do this.  You may also need to check your BIOS for power
saving modes and disable screen blanking there as well.</P>
<P>Edit your <CODE>/etc/X11/XF86Config-4</CODE> or <CODE>/etc/X11/xorg.conf</CODE>
file, and look for:
<BLOCKQUOTE><CODE>
<PRE>
Section "ServerFlags"
    #DontZap # disable &lt;Ctrl>&lt;Alt>&lt;BS> (server abort)
    #DontZoom # disable &lt;Ctrl>&lt;Alt>&lt;KP_+>/&lt;KP_-> (resolution switching)
    AllowMouseOpenFail # allows the server to start up even if the mouse doesn't work

    Option "blank time" "0"
    Option "standby time" "0"
    Option "suspend time" "0"
    Option "off time" "0"
    Option "NoPM" "1"
EndSection
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Also, look for:
<BLOCKQUOTE><CODE>
<PRE>
Section "Device"
    Identifier "device1"
    VendorName "nVidia Corporation"
    BoardName "NVIDIA GeForce 256 (generic)"
    Driver "nv"
    Option "DPMS"
EndSection
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>In this case, you would need to either delete the <CODE>Option "DPMS"</CODE>
line, or change it to <CODE># Option "DPMS"</CODE> to comment it out.  The next
time you start XFree this change will take effect.</P>
<P>Finally, check:
<BLOCKQUOTE><CODE>
<PRE>
Section "Monitor"
    Identifier "monitor1"
    VendorName "Plug'n Play"
    HorizSync 30-85
    VertRefresh 50-160

    # Sony Vaio C1(X,XS,VE,VN)?
    # 1024x480 @ 85.6 Hz, 48 kHz hsync
    ModeLine "1024x480"    65.00 1024 1032 1176 1344   480  488  494  563 -hsync -vsync

    # TV fullscreen mode or DVD fullscreen output.
    # 768x576 @ 79 Hz, 50 kHz hsync
    ModeLine "768x576"     50.00  768  832  846 1000   576  590  595  630

    # 768x576 @ 100 Hz, 61.6 kHz hsync
    ModeLine "768x576"     63.07  768  800  960 1024   576  578  590  616
EndSection
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Ensure that there isn't an <CODE>Option "DPMS"</CODE> in the Monitor
configuration.</P>
<P>You can also turn off DPMS from the Command Line, but this will not survive
a reboot.
<BLOCKQUOTE><CODE>
<PRE>
$ xset -dpms
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Using <CODE>xset +dpms</CODE> will turn it back on.</P>
<P>Another technique to try, which will turn off the screensaver:
<BLOCKQUOTE><CODE>
<PRE>
$ xset s off
</PRE>
</CODE></BLOCKQUOTE>

You may also combine the command to turn off DPMS and the screensaver:
<BLOCKQUOTE><CODE>
<PRE>
$ xset -dpms s off
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Finally, depending on your distribution, you may be able to turn it off from
within the control panel.</P>
<H2><A NAME="ss22.5">22.5</A> <A HREF="#toc22.5">Miscellaneous</A>
</H2>

<H3>mythfilldatabase failing</H3>

<P>If mythfilldatabase suddenly appears to be failing, there are at least
two things to check.  </P>
<P>First, if you are in North America, ensure that your DataDirect subscription
is still valid, otherwise, check to see what version of XMLTV you're
running and that it's the latest version.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  It is highly recommended that you run the latest
version of XMLTV available.  Your listings provider may have made changes
which negatively impact XMLTV.</CAPTION>
</FIGURE>
</P>

<H3><A NAME="Setting_DMA"></A> Fast CPU, choppy or jittery video </H3>

<P>First, you should check that your kernel has been enabled for DMA:
<BLOCKQUOTE><CODE>
<PRE>
[mythtv@pvr mythtv]$ dmesg |grep DMA
    ide0: BM-DMA at 0xd800-0xd807, BIOS settings: hda:DMA, hdb:DMA
    ide1: BM-DMA at 0xd808-0xd80f, BIOS settings: hdc:DMA, hdd:pio
hda: 156301488 sectors (80026 MB) w/2048KiB Cache, CHS=9729/255/63, UDMA(33)
hdb: 80043264 sectors (40982 MB) w/2048KiB Cache, CHS=4982/255/63, UDMA(33)
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>From the listing above, you can see that hda, hdb and hdc are set for DMA,
and hdd is set for pio.  If your kernel is not reporting DMA being enabled,
you may need to recompile your kernel. Check your motherboard's chipset
(look in the "ATA/IDE/MFM/RLL support" section in "make menuconfig") for more
information.</P>
<P>Next, check that the hard drive has DMA enabled.  Use the <B>hdparm</B>
program to check and enable DMA.
<BLOCKQUOTE><CODE>
<PRE>
# hdparm -d /dev/hd?
</PRE>
</CODE></BLOCKQUOTE>
 will tell you the DMA status for your hard drives.  If you run
<B>hdparm</B> with the <CODE>-d1</CODE> parameter, it will turn DMA on.</P>

<P>You may also setup your PC to do this at boot time, either by adding the
command to your <CODE>/etc/rc.local</CODE> file, or by adding files to
/etc/sysconfig.</P>
<P>On Mandriva and other distributions, if you install <B>hdparm</B> from an RPM you
will most likely get a <CODE>/etc/sysconfig/harddisks</CODE> file installed. 
This file will be parsed by the <CODE>/etc/rc.sysinit</CODE> script.  If you use
the default <CODE>harddisks</CODE> file, your changes will affect all IDE devices
(including CD ROMs).  If you wish to use different parameters for various
devices, rename and/or copy the file to <CODE>harddiskhda</CODE>,
<CODE>harddiskhdb</CODE>, etc.  Edit the file to your liking and on the next
reboot your setting will be preserved.</P>

<H3>Frontend appears to be slow at jumping / seeking.</H3>

<H3>On-screen Display shows incorrect program length.</H3>

<P>This may occur when MythTV doesn't have an accurate seek table.  Run
<B>mythcommflag --rebuild</B></P>

<H3><A NAME="Troubleshooting_Audio"></A> Troubleshooting audio </H3>

<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  the following instructions do not apply to PVR-250/350
encoders; the MPEG-2 file will have the audio embedded in the stream so it
is not accessible using <CODE>/dev/dsp</CODE>. </CAPTION>
</FIGURE>
</P>
<P>Audio appears to be one of the bigger issues that users run into on the
mailing list.  If the audio isn't configured correctly, then MythTV will
often appear to hang, when in fact it is trying to manipulate the audio
subsystem and failing.  You may or may not receive error messages indicating
that the source of the error is the audio subsystem.</P>
<P>You can not use <B>xawtv</B> to determine if your audio is working
correctly, since <B>xawtv</B> is simply using the analog sound patched
through line-in to line-out. It doesn't need to digitize the sound unless
you are using the recording function.</P>
<P>A better test to verify that sound will work for MythTV (and recording with
<B>xawtv</B> for that matter) is to startup <B>xawtv</B>, mute the
line-in then run <CODE>aplay /dev/dsp</CODE>. You should hear the recorded audio
slightly delayed behind the real-time video. You should see messages about
"underrun". These can be ignored but they do confirm that the driver is
loaded and there is an active device. Once this test succeeds, MythTV
should work correctly because it writes to and read from /dev/dsp in
the same way that <B>aplay</B> does.</P>
<P>To record audio along with video the audio signal must be digitized by a DSP
so that the audio data can be stored in a file. On playback, the audio data
is written to /dev/dsp and converted back to an analog signal. This analog
signal should then be sent to your speakers. Here is what is needed in
<B>alsamixer</B>. If you are using an ALSA version after 1.0.6, use
<B>alsamixer -V all</B>:</P>
<P>CAPTUR source - the analog source to be sent to the DSP. This should be set
to the input source from the tuner card to the sound card. In most cases
this is Line but this could also be Aux, CD, Mic, etc., depending on how you
connect the input cable. This source should be muted to prevent patching
through the analog sound. The volume of this source will not affect the
record level.</P>
<P>Capture mixer - this sets the level for the analog to digital recording.
While a volume of 100% is recommended for testing, distortion may occur.
Lowering this level to 75% to 85% may result in better audio quality.
"Capture" should be marked as the CAPTUR destination.</P>
<P>PCM mixer - this sets the level for the digital to analog playback. While a
volume of 100% is recommended for testing, distortion may occur. Lowering
this level to 75% to 85% may result in better audio quality.</P>
<P>Master mixer - sets the level for the analog signal sent to line-out or the
speakers.</P>
<P>You may also want to ensure that <CODE>/dev/dsp</CODE> , or whatever device file
is being used, hasn't already been grabbed by another process, like
<B>esd</B> or <B>artsd</B>.  If the device file isn't available, then
MythTV won't work.  You may wish to run <B>configure</B> and enable
support for these.</P>
<P>If you wish to see what application is grabbing a resource, you can use the
<CODE>fuser</CODE> command:
<BLOCKQUOTE><CODE>
<PRE>
# fuser -v /dev/dsp
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>To disable aRts in KDE, go to KDE->Control Center->Sound->Sound System and
uncheck the "Start aRts soundserver on KDE startup" box.  Run <CODE># killall
artsd</CODE> from the command line to stop the artsd program.</P>
<P>If you're using multiple sound cards and multiple tuners, use <CODE>alsamixer
-c 1</CODE> to work with the second sound card.  The first card is #0, the
second card is #1, etc.</P>

<H3>Mythbackend reports that your card is not reporting full duplex capabilities</H3>

<H3>The mythbackend program told me to look at this section</H3>

<P>mythbackend does a check to see if your sound device is capable of full
duplex operation.  If it's not, it's most likely that you're going to run
into issues when you try to record and play sound at the same time.  If your
backend is a separate machine than your frontend, then there's no problem,
since you're only going to be doing one thing at a time with the card. 
Likewise, if you're running the frontend and backend on the same machine,
but you're using btaudio or a hardware encoder card such as the Hauppauge
PVR-250, DVB cards or HDTV capture cards as your recording source and you're
only using the playback function of your sound card, then you also shouldn't
have an issue, since the sound card isn't being asked to perform two
functions at once.</P>
<P>If you can't get your sound card to go full-duplex and need it to, then check
your distribution for updated sound drivers.  If your sound card is not
capable of full-duplex operation, either because the drivers don't support
it, or it has been designed that way, then you're pretty much out of luck
and will either need to purchase a new sound card, or will need to get
btaudio 
<A HREF="#btaudio">operational</A>.</P>

<H3>My remote doesn't work / works sometimes and not others / "ghost" keypresses</H3>

<P>This can be due to a number of factors.  The simplest case is the
"ghost" keypresses.  For me, it was due to compact fluorescent lights in
the same room as the IR receiver, which the receiver was picking up as
keypresses.  Once the lights were switched to incandescent bulbs, the ghost
went away.</P>
<P>You may have an issue with <B>lirc</B> misinterpreting IR commands from a
different remote.  I also have an issue where the TiVo "Peanut" remote will
eventually cause <B>lircd</B> to stop responding; even though <B>lircd</B>
is configured for the Pinnacle Systems remote, the TiVo remote IR patterns
are being seen by the IR receiver.</P>
<P>If your remote has been properly configured, and <B>irw</B> and
<B>irxevent</B> are working correctly, then it's highly likely that your
window manager is not giving focus correctly to the various Myth programs as
they run.  The following window managers are known to work correctly:</P>
<P>
<UL>
<LI>fvwm</LI>
<LI>blackbox  (using "Sloppy Focus" and "Focus New Windows")</LI>
</UL>
</P>
<P><B>NOTE</B>:  You do not need to use <B>irxevent</B> if you are using
MythTV's native LIRC support, so the window manager focus issue does not
apply in that case.</P>

<H3>Where's "canada-cable"?</H3>

<H3>Channels are off by one</H3>

<P>There is no such thing as "Canada Cable"; Canada uses the same
frequencies as the United States.  "Canada Cable" was a hack that some
people used when they would discover that their channels were off-by-one,
i.e. when tuning to channel 42, they might get channel 41 or 43.  This is
actually due to the tuner on the video capture device being mis-detected. 
You must manually specify the tuner type in your <CODE>/etc/modules.conf</CODE>. 
See the video4linux mailing list (
<A HREF="https://listman.redhat.com/mailman/listinfo/video4linux-list">https://listman.redhat.com/mailman/listinfo/video4linux-list</A>) for
more information.</P>

<H3>Mythweb is showing a db_open error when I connect to it</H3>

<P>Find your <CODE>php.ini</CODE> file. Make sure you've got a line in it like this:</P>
<P><CODE>extension=mysql.so</CODE></P>
<P>Restart <B>apache</B> for it to take effect.</P>

<H3>Mouse pointer disappears when placed over the MythTV windows</H3>

<P>This is the intended behavior.  The MythTV interface is meant for use
with a remote control or a keyboard.</P>

<H3>What does "strange error flushing buffer" mean on the console?</H3>

<P>Nothing, really.  It's just lame (the mp3 encoder) complaining for some
obscure reason.  This seems to be fixed in more recent versions of the
libmp3lame library.</P>

<H3>Can't change the channel when watching Live TV.</H3>

<P>Something's wrong with your program database.  Did mythfilldatabase run
with no major errors?  Or, MythTV may not have permissions to the
appropriate video4linux devices.  See the section titled 
<A HREF="#devperms">Device Permissions</A> for an example.</P>

<H3>Screen goes black when you try to play something</H3>

<P>MythTV prints error and status messages to the shell that was used to
start the application.  If nothing seems to be happening when you try to
view a program, try switching back to the shell and look for error messages
there, or, if you're running from a startup script, check the log file.</P>

<H3>Poor performance with NVidia cards and XvMC</H3>

<P>XvMC is a NVidia driver feature which is supposed to help with decoding
video.  Users have reported that rather than speeding up their video it
appears to be doing the opposite.  You may want to check that your color
depth is set for 24bpp.</P>

<H3>Computer is loading a media player application when you insert a CD or DVD</H3>

<P>You need to disable any sort of auto-running media player in your
environment, otherwise MythDVD or MythMusic will not be able to work
properly.</P>
<P>In KDE, you may want to perform the following:
<BLOCKQUOTE><CODE>
<PRE>
$ rm ~/.kde/Autostart/Autorun.desktop
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H2><A NAME="s23">23.</A> <A HREF="#toc23">Miscellaneous. </A></H2>

<H2><A NAME="ss23.1">23.1</A> <A HREF="#toc23.1">I'd like to watch the files without using MythTV / I'd like to convert the files to some other format</A>
</H2>

<P>First, check if the <B>mytharchive</B> plugin does what you want.  If not, then
read on:</P>
<P>MythTV comes with a utility called <B>mythtranscode</B> which can
decode nuv files into raw format for use with other applications.  This
command-line utility was not designed to be used by the end-user, but
instead to be called by other applications or scripts.  Programs like
<B>nuvexport</B> (
<A HREF="http://forevermore.net/myth/">http://forevermore.net/myth/</A>) are better suited for the end user. 
However, since <B>mythtranscode</B> can be a useful tool, directions on
using it follow.</P>
<P><B>mythtranscode</B> creates raw streams, which means that they do not
contain any container information such as resolution, frame-rate, or audio
sampling rate.  In order to process the output, you must supply this
information to the processing utility.  <B>mythtranscode</B> provides the
relevant information on STDOUT.</P>
<P>There are two modes in which <B>mythtranscode</B> can create raw streams. 
The first has no synchronization and assumes that the processing utility
will read audio and video at a constant rate.  This method is useful when a
single application will be processing the raw output, such as
<B>mencoder</B> or <B>ffmpeg</B>.  The second method assumes that two
separate applications will be processing the audio and video streams
independently, and there is no rate control between them which means that
the two programs don't coordinate their efforts to maintain synchronization.</P>

<H3>mythtranscode example</H3>

<P>First, start <B>mythtranscode</B>.  You will need to determine the
channel and the start time manually.
<BLOCKQUOTE><CODE>
<PRE>
$ mythtranscode --chanid 1036 --starttime 2003-10-20T15:30:00 --profile \
autodetect --fifodir . &amp;
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>When <B>mythtranscode</B> begins executing, it will create two FIFOs
("audout" and "vidout") in the directory specified (in this case ".",
meaning the current directory) and will print out information about the
video stream.</P>
<P>The next step is to start the processing application.  The following assumes
that the stream is NTSC 640x480 with 32Kbps audio.</P>
<P>To use <B>mencoder</B> you would enter a command like:
<BLOCKQUOTE><CODE>
<PRE>
mencoder -audiofile audout -audio-demuxer 20 -rawaudio rate=32000 \
-rawvideo on:w=640:h=480:fps=29.97 -ovc lavc -oac mp3lame -o out.avi \
vidout
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: You must use mencoder 1.0PRE1 or later. <B>mencoder</B>
version 0.9x <EM>WILL NOT WORK!</EM></CAPTION>
</FIGURE>

Using ffmepg:
<BLOCKQUOTE><CODE>
<PRE>
ffmpeg -f u16le -ar 32000 -ac 2 -i audout -f rawvideo -s 640x480 -r 29.97 \
-i vidout -vcodec mpeg4 -b 2000 -acodec mp3 -ab 128 out.avi
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Or to play directly using mplayer (again 1.0PRE1 or later is needed):
<BLOCKQUOTE><CODE>
<PRE>
mplayer -audiofile audout -audio-demuxer 20 -rawaudio rate=32000 \
-rawvideo on:w=640:h=480:fps=29.97 vidout
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>If you wanted to write the raw data to separate audio and video files for
later processing, the following would work (note the use of --fifosync
for rate-control):
<BLOCKQUOTE><CODE>
<PRE>
$ mythtranscode --chanid 1036 --starttime 2003-10-20T15:30:00 \
--profile autodetect --fifodir . --fifosync &amp;
$ cat audout > audio.raw &amp;
$ cat vidout > video.yuv
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="ss23.2">23.2</A> <A HREF="#toc23.2">Using a different window manager</A>
</H2>

<P>MythTV is not dependent on any particular window manager.  If you wish to
run a lightweight window manager, the <CODE>contrib/configfiles/</CODE> directory has an
example of a <CODE>.twmrc</CODE> and <CODE>.fvwmrc</CODE> file you may use.</P>

<H2><A NAME="capture_resolution_"></A> <A NAME="ss23.3">23.3</A> <A HREF="#toc23.3">What capture resolution should I use?  How does video work? </A>
</H2>

<P>While MythTV allows you to set various GUI and capture resolutions, not
all combinations make sense.</P>
<P>First, analog video signals have a defined vertical resolution.  In NTSC,
the video standard specifies that there are 525 vertical scan lines.  Once
the "extra" lines are removed (they're used to synchronize the video signal,
and encode closed captioning data), you have 480 horizontal lines stacked
vertically.</P>
<P>In PAL, there are 625 "raw" lines of resolution, with a net of 576
horizontal lines stacked vertically.</P>
<P>Horizontally, the maximum value allowed for a Bt8X8 chip is 720. However,
due to limitations in the chip and other limitations of broadcast
television, there may not be a noticeable improvement in image quality
beyond 400 or 500 pixels.</P>
<P>With this in mind, there are certain commonly accepted values for
resolution.  While other values may be accepted for the vertical
resolution, they will cause scan lines to be repeated or dropped.</P>
<P>From "best" to "worst", in NTSC:
<UL>
<LI>720x480 "DVD" resolution. ReplayTV High and medium resolution</LI>
<LI>704x480 DVD standalone recorder standard resolution</LI>
<LI>640x480 4:3</LI>
<LI>544x480 TiVo Best resolution</LI>
<LI>480x480 SuperVCD (SVCD) Video CD resolution, TiVo High resolution</LI>
<LI>352x480 ReplayTV "Standard" quality, TiVo Basic and Medium resolution, DVD "LP" resolution</LI>
<LI>320x480 </LI>
<LI>544x240</LI>
<LI>480x240 </LI>
<LI>352x240 Video CD (VCD) resolution</LI>
<LI>320x240</LI>
</UL>
</P>
<P>As you can see, the lower quality values are half of the better ones. 
720x240 is possible, but isn't a good tradeoff relative to the number of
vertical lines lost.  In a PAL country, the you would use values like
720x576 or x288.</P>
<P>The higher resolutions will be more CPU intensive if you're using software
encoding (PVR-250/350 will have minimal host CPU impact even if you're using
720x480). If the CPU is overtaxed, frames will be dropped causing uneven
motion. You will likely see the best results at resolutions which average at
least 10% CPU idle time.  You can use system tools such as <CODE>top</CODE> or
<CODE>sar</CODE> to check the CPU % idle while recording.  If the CPU average
usage is consistently exceeding 90%, frames will need to be dropped during
peak times when more than 100% of the available CPU would be needed to
process all of the frames.</P>
<P>If you'd like to read more on this, go to the vcdhelp website at 
<A HREF="http://www.vcdhelp.com/forum/userguides/94382.php">http://www.vcdhelp.com/forum/userguides/94382.php</A>.</P>

<H2><A NAME="ss23.4">23.4</A> <A HREF="#toc23.4">MythTV GUI and X Display Sizes</A>
</H2>

<P>MythTV is designed to be run as dedicated full screen TV application
but can also be run as a desktop application on a computer monitor. Here
are a few consideration for configuring sizes to best suit you needs.</P>

<H3>X Dimensions</H3>

<P>For output to a Television, common resolutions are 640x480, 800x600, and
some rare devices support 1024x768. Generally, higher resolutions are
better. However, you may find that you prefer the picture quality at one of
the lower resolutions. Everything in MythTV is scalable and should 'fit'
regardless of the resolution you choose.</P>
<P>Edit your X configuration file, usually <CODE>/etc/X11/XF86Config-4</CODE> for
XFree, or <CODE>/etc/X11/xorg.conf</CODE> for Xorg, so that the resolution you
want to use is listed first in the lists under "Screen". If this resolution
is higher than the resolutions supported by your output device, you will see
a 'panning' effect where moving the mouse to the edge will scroll around a
desktop area which is larger than the display size. If this happens, edit
your X configuration file to match the display size then restart X.</P>

<H3>MythTV Dimensions</H3>

<P>From "mythfrontend" go to Setup->Appearance.
The default for the height and width is "0" - this will cause
MythTV to automatically size itself to full screen.</P>
<P>If the MythTV GUI width and height are not 0, mythfrontend uses these GUI
dimensions and is anchored to the upper left corner of the X Desktop. If
the GUI X and/or Y are not 0, the upper left corner is positioned at the
specified coordinates. If the "Run the frontend in a window" box is checked,
the window will have a frame and can then be dragged to any position on the
desktop.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: When the GUI is full screen, you may see windows rapidly
flipping on top of each other. If this happens you will need to set your
window manager to 'Click to Focus' for windows to stack properly.</CAPTION>
</FIGURE>

The fonts for the GUI and OSD will scale to whatever sizes you use. Most
font sizes can be changed in setup selections or in the .xml files under
<CODE>/usr/local/share/mythtv/</CODE> . Make sure to use fonts large enough
to be read on a TV screen from a distance.</P>
<P>The full screen TV size is based on the X display size. For Xinerama, you
can specify a screen in Setup->General. The TV picture will be stretched
to fit the entire GUI area regardless of the 
<A HREF="#capture_resolution_">capture resolutions</A> used. However, during playback, the "W" key can
to used to correct differences between 16:9 and 4:3.</P>

<H3>Overscan Dimensions</H3>

<P>Because picture edges can be ragged and screen edges aren't straight,
Television is designed to project an image larger than the physical screen.
This is called "overscan". Underscan is fitting the entire image inside the
screen. Underscan is useful for computer monitors so that toolbars and
scrollbars at the edges can be seen.</P>
<P>For best results, match the X display area as close as possible to the edges
of the physical screen. This can only be adjusted by your tv-out device or
by the settings for the television set. Many sets have these adjustments in
a 'service mode'. If you cannot make these adjustments, there will be black
borders around the edges of the X desktop, MythTV GUI and TV playback.</P>
<P>MythTV has settings for "Overscan" in Setup->Playback. These can not, and do
not, cause the image to display beyond the edge of the X display area. The
purpose of these settings are to cut off rough edges and to expand the image
so that objects will appear to be the same size as a normal overscanned TV
picture.</P>

<H2><A NAME="backupdb"></A> <A NAME="ss23.5">23.5</A> <A HREF="#toc23.5">Saving or restoring the database </A>
</H2>

<P>See the <B>mysqldump</B> manpage for more information.
<BLOCKQUOTE><CODE>
<PRE>
$ mysqldump -u mythtv -pmythtv mythconverg -c > mythtv_backup.sql
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>To restore: (assuming that you've dropped the database)
<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u root
mysql>create database mythconverg;
mysql>exit
$ mysql -u mythtv -pmythtv mythconverg &lt; mythtv_backup.sql
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>You may need to alter the MySQL permissions if this database is being shared
with multiple systems.  See the 
<A HREF="#modify_perm_mysql">Modifying access to the MySQL database for multiple systems</A> section for more
information.</P>

<H2><A NAME="ss23.6">23.6</A> <A HREF="#toc23.6">Deleting the MySQL database</A>
</H2>

<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  Performing this step will remove the entire database. You will lose all of your settings and will need to re-run the mc.sql script
to setup the database structure before running the mythtv-setup program.</CAPTION>
</FIGURE>

<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u root
mysql> drop database mythconverg;
mysql> quit
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="ss23.7">23.7</A> <A HREF="#toc23.7">Moving your data to new hardware</A>
</H2>

<P>This assumes that you will be moving your data to newer / bigger hardware
and don't want to lose your programs.</P>
<P>The first step is to create a database backup as demonstrated in an earlier
section.</P>
<P>Next, you will extract only the data that is relevant to the programs:
<BLOCKQUOTE><CODE>
<PRE>
$ grep "INSERT INTO record "          mythtv_backup.sql > restore.sql
$ grep "INSERT INTO recorded "        mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO oldrecorded "     mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO recordedprogram " mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO recordedrating "  mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO recordedmarkup "  mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO recordedseek "    mythtv_backup.sql >> restore.sql
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P><B>NOTE</B>:  Newer versions of <B>mysqldump</B> place backticks around
the table names.  Backticks are not the same as apostrophes!  On a typical
North American keyboard, backticks are located to the left of the "1" key,
on the same key as the tilde.  Also, because the <B>bash</B> shell may try
to interpret the backticks, make sure you use a \ before each one.</P>
<P>If your <CODE>restore.sql</CODE> file is empty, you'll need to re-run the
commands like this:
<BLOCKQUOTE><CODE>
<PRE>
$ grep "INSERT INTO \`record\` "          mythtv_backup.sql > restore.sql
$ grep "INSERT INTO \`recorded\` "        mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO \`oldrecorded\` "     mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO \`recordedprogram\` " mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO \`recordedrating\` "  mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO \`recordedmarkup\` "  mythtv_backup.sql >> restore.sql
$ grep "INSERT INTO \`recordedseek\` "    mythtv_backup.sql >> restore.sql
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Note the space after the table name and the ">>" to append to the file for
all but the first <B>grep</B>. "recordedmarkup" and "recordedseek" are
huge and there may be hundreds of thousands of lines if you had lots of
hours of recordings.</P>
<P>After you have moved the data files to the new hardware, configure MythTV
using the <B>mythtv-setup</B> program as you normally would with a
standard MythTV installation.</P>
<P>At this point we will restore the information about your programs back into
the database:
<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u mythtv -pmythtv mythconverg &lt; restore.sql 
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>After successful insertion of the data you may delete the
<CODE>restore.sql</CODE> file.</P>

<H2><A NAME="btaudio"></A> <A NAME="ss23.8">23.8</A> <A HREF="#toc23.8">btaudio </A>
</H2>

<P>btaudio allows you to obtain the audio data from your tuner card directly
over the PCI bus without using a sound card.  This is useful if you would
like to use multiple tuner cards in a system without adding a sound card for
each one, or if your existing sound card is not capable of full-duplex
operation.</P>
<P>In order to use btaudio, your tuner card will need certain hardware
installed on it, and that hardware must be wired correctly.  The chip that
will allow you to use the btaudio module is the MSP34xx.  However, having a
MSP34xx is no guarantee that you will be able to use the btaudio module.</P>
<P>As of 2003-03-31, this is the current list of cards and their status:
Works with btaudio:</P>
<P>
<UL>
<LI>Hauppauge WinTV-radio with dbx-TV stereo, model 401</LI>
<LI>Hauppauge WinTV-Theater, model 495, 498 (Europe)</LI>
<LI>ATI TV Wonder</LI>
</UL>
</P>
<P>The following cards do not work:
<UL>
<LI>Pinnacle Studio PCTV Pro - note: this has a MSP34xx, but it's not
wired correctly to the BT878 chip.</LI>
<LI>ATI TV Wonder VE</LI>
<LI>Leadtek Winfast 2000 XP (PAL, UK and NTSC)</LI>
<LI>I/O Magic PC-PVR.  No MSP34xx chip.</LI>
</UL>
</P>
<P>The following cards have been reported to work, but have issues:
<UL>
<LI>Avermedia AVerTV Studio (no digital DSP output, "whiney noise" on
analog)</LI>
</UL>
</P>
<P>Once btaudio loads, it should register additional <CODE>/dev/dsp</CODE> and
<CODE>/dev/mixer</CODE> devices.  Typing <CODE>$ dmesg</CODE> will let you know
what's going on.</P>

<H2><A NAME="ss23.9">23.9</A> <A HREF="#toc23.9">Removing unwanted channels</A>
</H2>

<P>If <B>mythfilldatabase</B> grabbed a channel which you do not want to
include in your TV listings, you can remove the entries from the grabber
configuration and the MySQL database.  This often happens with premium
channels; for example, HBO or Showtime may be available on your cable TV
system, but is scrambled because you're not a subscriber to that channel. 
Since you can never watch it, you want to get rid of it.</P>
<P>If you are using the DataDirect service, login to your account at
<A HREF="http://labs.zap2it.com/">http://labs.zap2it.com/</A> to
modify your lineup. Uncheck the boxes for any unwanted channels, and they
will no longer be included in your download.</P>
<P>If you are using a grabber from XMLTV, comment out the channel from the
<CODE>~/.mythtv/&lt;sourcename&gt;.xmltv</CODE> file by inserting the word "not
" (including the space) in front of the unwanted entry. This will prevent
<B>xmltv</B> from grabbing future listings.</P>
<P>Next, delete the unwanted item from the channel table so that it will not
appear in the EPG or when changing channels.  To delete the data from the
database we need to perform some steps.  First, assuming that HBO is channel
15, we need to find out the internal <CODE>chanid</CODE> used by MySQL:
<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u root mythconverg
mysql> select chanid from channel where channum=15;
+--------+
| chanid |
+--------+
|   1015 |
+--------+
1 row in set (0.00 sec)
mysql> delete from channel where chanid = 1015;
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Old program data will be removed over the course of a week. However, you may
want to immediately delete any current program listings for the channel that
has been removed:
<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u root mythconverg
mysql> delete from program where chanid = 1015;
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="ss23.10">23.10</A> <A HREF="#toc23.10">NFS</A>
</H2>

<P>You may want to use a central server to store your files.  </P>
<P>On the host machine, (in this case, the hostname is "masterbackend") you'll
want to edit your <CODE>/etc/exports</CODE> file and use something like:
<BLOCKQUOTE><CODE>
<PRE>
/var/video (rw)
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>To export the <CODE>/var/video</CODE> directory with read / write privileges.</P>
<P>On the "slave" machine, you'll want to edit the <CODE>/etc/fstab</CODE> file and
add something like:
<BLOCKQUOTE><CODE>
<PRE>
masterbackend:/var/video /var/video nfs rsize=8192,wsize=8192,hard,intr,nfsvers=3,actimeo=0
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Then run <CODE># mount -a</CODE> to re-read the file to mount the file system.</P>
<P>In this case, the source is a machine called "masterbackend" which is
exporting the directory "/var/video", which we're mounting locally at
"/var/video".  The rsize and wsize options are used to increase the
performance of NFS; "hard,intr" is there because that's the recommendation
of the NFS-HOWTO, the nfsvers is required for filesizes over 2GB and actimeo
is used to turn off file attribute caching.  Attribute caching for a shared
media point causes problems; you always want to see the latest state of the
directory and files.  See 
<A HREF="http://www.mythtv.org/wiki/index.php/Optimizing_Performance">http://www.mythtv.org/wiki/index.php/Optimizing_Performance</A> for
additional information regarding performance optimization.</P>

<H2><A NAME="ss23.11">23.11</A> <A HREF="#toc23.11">Automatically starting mythfrontend at system boot time</A>
</H2>

<P>Here's an example submitted to the mythtv-dev list by Pat Pflaum
<A HREF="mailto:pat@netburp.com">mailto:pat@netburp.com</A> using fvwm:
<BLOCKQUOTE><CODE>
<PRE>
$ cat > .xinitrc
fvwm &amp;
mythfrontend
^D
$ cat > .fvwmrc
Style myth* NoTitle, NoHandles, Sticky, WindowListSkip, SloppyFocus, GrabFocus, BorderWidth 0
^D
$
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>The following also works with blackbox:
<BLOCKQUOTE><CODE>
<PRE>
$ cat > .xinitrc
xset -dpms s off &amp;
irxevent &amp;
mythfrontend &amp;
blackbox
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Make sure that your <CODE>.blackboxrc</CODE> file has:
<BLOCKQUOTE><CODE>
<PRE>
session.screen0.focusNewWindows:        True
session.screen0.focusModel:     SloppyFocus
</PRE>
</CODE></BLOCKQUOTE>
 in it.</P>
<P>
<A NAME="mythbackend_autostart"></A> </P>
<H2><A NAME="ss23.12">23.12</A> <A HREF="#toc23.12">Automatically starting mythbackend at system boot time</A>
</H2>

<H3>Red Hat And Mandriva</H3>

<P>Here's a method for automatically starting mythbackend submitted by Mike
Thomson (
<A HREF="mailto:linux@m-thomson.net">mailto:linux@m-thomson.net</A>) and Stu Tomlinson (
<A HREF="mailto:stu@nosnilmot.com">mailto:stu@nosnilmot.com</A>).</P>
<P>Copy the files from the MythTV <CODE>contrib</CODE> directory or from Mike's web
site (
<A HREF="http://m-thomson.net/mythtv/">http://m-thomson.net/mythtv/</A>) as follows:</P>
<P><CODE>etc.rc.d.init.mythbackend</CODE> should be made executable and copied to
<CODE>/etc/rc.d/init.d/</CODE>:
<BLOCKQUOTE><CODE>
<PRE>
$ cd contrib
$ su
# chmod a+x etc.rc.d.init.d.mythbackend
# cp etc.rc.d.init.d.mythbackend /etc/rc.d/init.d/mythbackend
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P><CODE>etc.sysconfig.mythbackend</CODE> should be copied to
<CODE>/etc/sysconfig/</CODE>:
<BLOCKQUOTE><CODE>
<PRE>
$ cd contrib
$ su
# cp etc.sysconfig.mythbackend /etc/sysconfig/mythbackend
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Edit <CODE>/etc/sysconfig/mythbackend</CODE> if you want to change the defaults
(the userid that should start mythbackend, location of the logfile and (if
required) the name and location of the mythbackend binary).</P>
<P>Use <B>chkconfig</B> to make sure the script is called when
entering runlevels 3, 4 or 5:
<BLOCKQUOTE><CODE>
<PRE>
$ su
# chkconfig --level 345 mythbackend on
# exit
$
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>
<A NAME="logrotate"></A> </P>
<H3>Log files </H3>

<P>By default, the log file for mythbackend will be written to
<CODE>/var/tmp/mythbackend.log</CODE>. This has been tested and is known to work
on Mandriva and Red Hat, but many people prefer to place logs under
<CODE>/var/log/</CODE>.</P>
<P>To do this, create a group called <CODE>mythtv</CODE> (or anything you prefer)
and add your usual MythTV users to that group. If you changed the user that
starts mythbackend from the default of root you <EM>must</EM> perform this
step.</P>
<P>Create the directory <CODE>/var/log/mythtv</CODE> and set its
permissions as follows:
<BLOCKQUOTE><CODE>
<PRE>
$ su
# mkdir /var/log/mythtv
# chown root:mythtv /var/log/mythtv
# chmod 0775 /var/log/mythtv
# exit
$ ls -ld /var/log/mythtv
drwxrwxr-x    2 root     mythtv       4096 Apr 28 21:58 /var/log/mythtv/
$
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Create a <CODE>mythtv</CODE> file in <CODE>/etc/logrotate.d</CODE>:
<BLOCKQUOTE><CODE>
<PRE>
$ su
# cat > /etc/logrotate.d/mythtv
# Set default values for all log files first...

# Rotate the logs once a week, or more frequently if they 
# exceed 10Mb in size (size is checked daily).
weekly
size 10M

# 'copytruncate' is used for logs generated by 
# currently-running programs that should not be restarted 
# (and can't be signalled to start a new log) after the 
# rotation.  It duplicates the existing log file and then 
# sets the length of the existing file to 0.  The only time 
# this would break would be if the program writing the log 
# was using lseek.
copytruncate

# After rotating the files, leave the most recent rotated 
# copy alone but gzip everything else to save space.
compress
delaycompress

# If a log isn't present then don't worry about it.
missingok

# Don't rotate an empty file.
notifempty

# end of the global options

/var/log/mythtv/mythbackend.log /var/log/mythtv/mythfrontend.log {
  # Keep logs until they are 2 months old or the number of 
  # logs reaches 12.  If the log files stay small, the age will 
  # kick in first and you'll only have 8 log files.  If they 
  # get larger than 10Mb then you won't keep all 60 days.
  rotate 12
  maxage 60
}

# Different options for mythfilldatabase:
/var/log/mythtv/mythfilldatabase.log {
  rotate 2
}
^D
#
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H3>Mandriva </H3>

<P>Mandriva adds one more twist in the form of the <CODE>msec</CODE> utility,
which runs regularly and (at the default or any higher security level) sets
permissions on many files, including those under <CODE>/var/log</CODE>.</P>
<P>To tell msec about the MythTV log files and their directory, you need to
edit the <CODE>/etc/security/msec/perm.local</CODE> file to include the
following:
<BLOCKQUOTE><CODE>
<PRE>
# /etc/security/msec/perm.local
# Local overrides to the msec program
#
# Full file path                user.group              permissions
/var/log/mythtv/                root.mythtv             775
/var/log/mythtv/*               root.mythtv             664
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>A copy of the above has been included in the contrib/ directory.  You may
add it by typing:
<BLOCKQUOTE><CODE>
<PRE>
$ cd contrib
$ su
# cat etc.security.msec.perm.local >> /etc/security/msec/perm.local
# exit
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Finally run the <CODE>msec</CODE> tool to check and implement your
changes.
<BLOCKQUOTE><CODE>
<PRE>
$ su
# msec
# exit
$
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>: msec can only <EM>reduce</EM> the permissions of files, so if
you don't get the results you expect, check that you're not asking
<CODE>msec</CODE> to add missing permissions to the files or directories you
created.</CAPTION>
</FIGURE>
</P>
<H3>Gentoo</H3>

<P>The portage file for MythTV has scripts that will allow you to run
mythbackend at startup.</P>
<P>To run mythbackend as a daemon which starts at boot time:
<BLOCKQUOTE><CODE>
<PRE>
# rc-update add mythbackend default
</PRE>
</CODE></BLOCKQUOTE>

To stop mythbackend as a daemon:
<BLOCKQUOTE><CODE>
<PRE>
# /etc/init.d/mythbackend stop
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>To obtain a list of options:
<BLOCKQUOTE><CODE>
<PRE>
# /etc/init.d/mythbackend
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H2><A NAME="advanced_backend_config"></A> <A NAME="ss23.13">23.13</A> <A HREF="#toc23.13">Advanced Backend Configurations </A>
</H2>

<P>MythTV is flexible in the way that you define multiple backend tuner
configurations.  The only hard-and-fast rule is that the Master backend
<EM>must</EM> have a capture device defined, but shouldn't imply that the
capture device in the Master backend must be the first capture card defined in the
database.</P>
<P>One example of an advanced configuration is the round-robin scheme.  Rather
than defining all of the cards on the master, you could first go into
mythtv-setup on the master to define globals such as the general configuration
and the channel lineup but not the host-specific configuration item like the
capture card.  In this example, we will use a 4 tuner configuration, where two
slaves have one card each and the master has two.
<OL>
<LI>Add the first capture card on one of the slaves.  Complete the
configuration, connecting the input source to the card.  This will get
cardid #1 in the database.  Exit mythtv-setup.</LI>
<LI>Configure the first capture card on the master backend.  This will get
cardid #2 in the database.  Exit mythtv-setup.</LI>
<LI>Configure the first capture card on the second slave.  This will be
cardid #3 in the database.  Exit mythtv-setup.</LI>
<LI>Configure the second capture card on the master backend.  This will
get cardid #4 in the database.  Exit mythtv-setup.</LI>
</OL>
</P>
<P>Using this scheme, the master backend will not use both capture cards until
one of the following happens:
<UL>
<LI>There are four recordings scheduled for the same time</LI>
<LI>Both slaves are unavailable</LI>
</UL>
</P>
<P>The scheduler in MythTV checks whether an encoder is available; if a slave
backend isn't running, its encoder isn't available, so the scheduler will
look for the next available encoder.  This makes MythTV very flexible; slave
tuners can come and go, and as long as there are enough tuners for what
you'd like to record it doesn't matter which tuner in particular is going to
be used.</P>
<P>Using this round-robin scheme along with a shared storage directory like
NFS and enabling the Master Backend Override setting will allow you to view
content even if the slave backend that recorded a program is not available.</P>

<H2><A NAME="ss23.14">23.14</A> <A HREF="#toc23.14">Using the transcoder</A>
</H2>

<P>MythTV's built-in transcoder re-encodes recordings from one codec to
another.  The transcoder has three primary uses; it can transcode MPEG-2
files captured using a hardware encoder (PVR cards, DVB cards, ATSC HD,
etc.) to MPEG-4, it can be used to transcode RTjpeg files (usually only used
on systems that can not real-time encode to MPEG-4 using a framegrabber) to
MPEG-4, and finally it can be used to remove commercials from a MPEG-2 file
while leaving the file in MPEG-2 format.</P>
<P>When MythTV transcodes a file to MPEG-4 or RTjpeg the resulting file format
is NuppelVideo (nuv).  NuppelVideo is a container which provides a method of
keeping the audio and video in sync throughout the recording, which is why
it is used instead of the <CODE>.avi</CODE> format.  You may have difficulty
playing <CODE>.nuv</CODE> files in non-MythTV systems.</P>

<P>The original file is removed when the transcoding process is complete. 
Unless you're sure that you will be satisfied with the result you may want
to enable the <B>mythtv-setup</B> option which causes <B>mythbackend</B>
to keep the original file after transcoding.  This option is on the second
page of the General section in mythtv-setup.  Enabling this allows you to
compare the two files and restore the original if you like.  Outside of the
initial setup phase it usually isn't necessary to leave this option enabled.
A recording can be transcoded in two ways:</P>
<P>
<UL>
<LI>Automatically transcode the file once it has completed
recording.</LI>
<LI>Manually choosing to transcode a recording, usually after
importing a cutlist or manually marking commercials to be
removed.</LI>
</UL>
</P>
<P>The second method can be used on files that have already been transcoded (or
files which were are already in the desired format), so only the frames
immediately following a cut section will be re-encoded, resulting in a
minimal loss of quality when removing commercials with the added benefit of
being extremely quick.</P>
<P>The current transcoding system has a lot flexibility, but there are
a number of steps involved in setting it up.  In order to
automatically transcode a given recording you must do the following:
<OL>
<LI>Configure recording profile for your capture source and enable
transcoding on one or more profiles.</LI>
<LI>Configure one or more transcoding profiles.</LI>
<LI>Create or alter existing scheduled recordings to enable
transcoding for that recording.</LI>
</OL>
</P>

<H3>Configuring Recording Profiles to Allow Transcoding</H3>

<P>Enter the Utilities/Setup > Setup > TV Settings > Recording Profiles
section in <B>mythfrontend</B>.  Choose the option that corresponds to
your capture source (ignore the Transcoders for now.) Choose the quality
profile you are interested in using for transcoding.  Ensure that "Enable
auto-transcode after recording" is checked.  </P>

<H3>Configure Transcoding Profiles</H3>

<P>Enter the Recording Profiles > Transcoders menu.  There are three quality
settings to choose from and a two special Autodetect settings.  Later, when
scheduling recordings you'll have to choose one of Autodetect, High, Medium,
and Low Quality transcode settings in addition to the recording profile we
set up above.  If you choose the Autodetect transcoding profile for a
recording, MythTV will use the "Autodetect from RTjpeg/MPEG-4" profile for
recordings which are RTjpeg/MPEG-4 files.  Otherwise, it will use the
"Autodetect from MPEG-2" profile provided it's an MPEG-2 recording.  If you
choose one of the others (High, Medium, Low) it will use the settings in
that profile regardless of the codec of the original recording.</P>
<P>There are a number of options for transcoding but the simplest is to enable
lossless transcoding (the first option) which subsequently removes all other
options. Enabling lossless encoding simply removes commercials (if you've
marked them) and attempts to clean up MPEG-2 streams.  Note that with this
option MythTV will not apply any sort of filters and will only attempt to
normalize the stream into something cleaner and less likely to have trouble
with other less forgiving MPEG-2 hardware/software (including players, video
editors, etc.)</P>
<P>If you enable resizing of the recording the next page has the settings for
choosing the final resolution.  MythTV will scale the video as appropriate,
not crop it to this resolution.</P>
<P>The final two pages allow configuration of the video and audio codecs.
Although RTjpeg is an option for video codec there is no reason to transcode
<EM>to</EM> this format because it will produce larger files than MPEG-4 and
the recording will take <EM>more</EM> CPU power to play back.  The MPEG-4
settings are described in the documentation for the <B>ffmpeg</B> project
at 
<A HREF="http://ffmpeg.sourceforge.net/ffmpeg-doc.html">http://ffmpeg.sourceforge.net/ffmpeg-doc.html</A>.  It's a matter of
trial and error to discover which settings achieve a good compromise between
size and quality.</P>
<P>If you wish to return to the default settings, they are Bitrate: 2200-2500,
MaxQ: 2, MinQ: 15, MaxQDiff: 3, and "Scale bitrate for frame size" is
enabled.  The other options are unchecked.  </P>

<H3>Create/Alter Scheduled Recordings to Enable Transcoding</H3>

<P>Transcoding is actually enabled on a per-recording basis.  Two things
must be true before any given recording will be auto-transcoded, however. 
The first is that the recording must have been made with a recording profile
that has auto-transcode enabled. Under "Storage Options" for the recording
you must set the "Record using the "X" profile" to the profile you
configured in the first step.  In addition, under the "Post Recording
Options" section of the recording you must also set "Transcode new
recordings." This is also where you specify the Transcoding profile to use
(Auto, High, Medium, Low.)</P>
<P>It may not be obvious from above but the flexibility of this system is
primarily to make it possible to auto-transcode a show recorded via one
source (ie: pcHDTV 3000), and not transcode that same show if it's recorded
on another kind of card (ie: PVR-250.) There are other uses however.  You
could have a PVR-250 and a V4L card.  You may want to transcode the MPEG-2
from the PVR-250 but there is no need to transcode the recordings made with
the V4L card, as it's already likely to be MPEG-4.</P>
<P>As an example, you could configure the Default profile for "Hardware DVB
Encoders" (the profile group used for DVB cards, including ATSC cards like
the pcHDTV 3000) to "Enable auto-transcoding". In the Default profile for
MPEG-2 Encoders (PVR cards) you'd leave "Enable auto-transcoding" unchecked. 
For programs that are available on both kinds of cards you'd set the
recording profile to Default and enable auto-transcoding in the record
settings.  Then you pick your transcoding profile.  The result is that when
a program is recorded on your DVB card, it will get transcoded.  When it
plays on a channel available via your PVR card, it won't be.</P>

<H3>Manual Transcoding</H3>

<P>Manually transcoding is activated while watching a show by hitting 'x',
from the OSD menu by choosing the Transcode option, or by choosing Job
Options/Transcode from the info menu from the Watch or Delete
Recordings screens.</P>
<P>The transcoding profile used for manual transcoding is whatever was set when
the recording was originally configured, even if you didn't enable
auto-transcoding.  The only way to change what transcoding profile will be
used is to alter the transcoder column in the recorded table in the
database.  The transcoder column contains a number which corresponds with
the id column in the recordingprofiles table.  You can find out the id
number for each profile in the transcoder group with an SQL command like:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
mysql> select r.* from recordingprofiles r,profilegroups p where p.name='Transcoders' and p.id=r.profilegroup;
+----+----------------+------------+------------+--------------+
| id | name           | videocodec | audiocodec | profilegroup |
+----+----------------+------------+------------+--------------+
| 21 | RTjpeg/MPEG4   | MPEG-4     | MP3        |            6 |
| 22 | MPEG2          | MPEG-4     | MP3        |            6 |
| 27 | High Quality   | MPEG-4     | MP3        |            6 |
| 28 | Medium Quality | MPEG-4     | MP3        |            6 |
| 29 | Low Quality    | MPEG-4     | MP3        |            6 |
+----+----------------+------------+------------+--------------+
5 rows in set (0.01 sec)

mysql>                                                                        
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Armed with the knowledge of what the profile ID's are you can also choose to
run mythtranscode from the command line and explicitly specify the transcoder
profile.  Run <CODE>mythtranscode --help</CODE> for usage information.</P>

<H2><A NAME="ss23.15">23.15</A> <A HREF="#toc23.15">Changing your hostname</A>
</H2>

<P>If you need to change the name of the computers used with MythTV you'll
need to perform a sequence of steps.  There are a number of pieces of
information that MythTV keeps track of which are tied to the hostname of the
box, so changing the hostname involves altering the name in the
operating system and in the MySQL database.  In the examples below, the old
name of the system was "frontend1" and we're going to change it to
"kidsroom".</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  Changing the hostname using direct SQL update commands will
break things.  You <EM>MUST</EM> use this indirect method.</CAPTION>
</FIGURE>
 </P>
<P>1.  Stop all backends.  If you run <B>mythbackend</B> from a terminal
session, press control-c. If your backends are started with an init
script, you would do something like the following:
<BLOCKQUOTE><CODE>
<PRE>
$ su
# /etc/init.d/mythbackend stop
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>2.  Change the hostname.</P>
<P>For Red Hat and derived distributions, edit the
<CODE>/etc/sysconfig/network</CODE> file.  Look for
<CODE>HOSTNAME=frontend1</CODE> and change this to
<CODE>HOSTNAME=kidsroom</CODE> or whatever you'll be using.  For other
distributions, refer to the documentation, such as the
<PRE>
hostname(1)
</PRE>
 man page.</P>

<P>To alter the
hostname in the current session, run:
<BLOCKQUOTE><CODE>
<PRE>
# hostname kidsroom
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>3.  Dump the database.
<BLOCKQUOTE><CODE>
<PRE>
$ mysqldump -u mythtv -pmythtv mythconverg -c > mythtv_backup.sql
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>4.  Rename the host in the database.  First, ensure that the new hostname
you'll be using isn't already in the database.
<BLOCKQUOTE><CODE>
<PRE>
$ grep kidsroom mythtv_backup.sql
</PRE>
</CODE></BLOCKQUOTE>

Now we're actually going to change the name.  The following should all be
typed on the same line:
<BLOCKQUOTE><CODE>
<PRE>
$ cat mythtv_backup.sql | sed s/\'frontend1\'/\'kidsroom\'/g >> mythtv_restore.sql
</PRE>
</CODE></BLOCKQUOTE>

If you don't feel comfortable using <B>sed</B>, you can open the
<CODE>mythtv_backup.sql</CODE> file in a text editor and perform a global search
and replace.  When saving the file, make sure you use the new name,
<CODE>mythtv_restore.sql</CODE> or the rest of the steps below will fail.</P>
<P>5.  Drop and recreate the database.
<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u root
mysql>drop database mythconverg;
mysql>create database mythconverg;
mysql>exit      
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>6.  Restore the database using your edited version.
<BLOCKQUOTE><CODE>
<PRE>
$ mysql -u mythtv -pmythtv mythconverg &lt; mythtv_restore.sql
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>If you are running slave backends or frontends, don't forget to re-enable
access as detailed in 
<A HREF="#modify_perm_mysql">Modifying access to the MySQL database for multiple systems</A>. </P>
<P>7.  Start the backends.  If you use init scripts, do the following, otherwise
start them from terminal consoles.
<BLOCKQUOTE><CODE>
<PRE>
# /etc/init.d/mythbackend start
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>8.  Quit and restart all frontends.  Delete the <CODE>mythtv_backup.sql</CODE>
and <CODE>mythtv_restore.sql</CODE> files.</P>

<H2><A NAME="ss23.16">23.16</A> <A HREF="#toc23.16">Can I run MythTV on my TiVo?</A>
</H2>

<H2><A NAME="ss23.17">23.17</A> <A HREF="#toc23.17">Can I run MythTV on my ReplayTV?</A>
</H2>

<P>No.</P>
<P>While it is true that the TiVo runs the Linux kernel, and TiVo has released
their changes to the kernel under the GPL, the TiVo is <EM>not</EM> a
general-purpose computer, and there is no programming information available
for the custom hardware contained within a TiVo.  TiVo is under no
obligation to release the source code to their <EM>application</EM>.</P>
<P>The ReplayTV runs VxWorks, a Real Time Operating System from Wind River
Systems.</P>
<H2><A NAME="ss23.18">23.18</A> <A HREF="#toc23.18">Can a wireless connection be used between the frontend and the backend?</A>
</H2>

<P>Yes, assuming that your wireless connection has sufficient bandwidth to
maintain the datarate between the frontend and the backend.  802.11b should
be sufficient if the encoded bitrate of the content is less than the
datarate of your wireless connection, which in the case of 802.11b would be
approximately 4 Mbps.  (The advertised rate of 11Mbps gives an actual
throughput of 4 Mbps.) 802.11a and 802.11g, if operating in their high-speed
modes, or proprietary 802.11b "Turbo" schemes should be adequate.  Multiple
wireless frontends, poor signal strength or other factors can severely
impact the viewing experience on the frontend.</P>

<H2><A NAME="ss23.19">23.19</A> <A HREF="#toc23.19">How can I burn shows that I have recorded to a DVD?</A>
</H2>

<P>Use the mytharchive plugin.</P>

<H2><A NAME="ss23.20">23.20</A> <A HREF="#toc23.20">Using the DBoxII within MythTV</A>
</H2>

<P>The configuration of the DBoxII for use within MythTV is tricky (as of
May 16 2005), that's why it's covered here. Your DBoxII has to be running
linux and the Neutrino GUI instead of the stock BetaNova firmware.  For
further information, please refer to 
<A HREF="http://www.tuxbox.org">http://www.tuxbox.org</A>. Additionally, you need to enable the SPTS
mode in Neutrino.</P>
<P>
<UL>
<LI>Add a new "Capture Card" in the setup. The "Card type" is "DBOX2 Input", 
the other values have to be adjusted according to your setup. 
The default values, except for the "DBOX2 host ip", should work fine.</LI>
<LI>Define a new video source. It doesn't need to be configured, 
you just need to define it. MythTV grabs the EPG from the DBoxII.</LI>
<LI>Connect the DBoxII to the newly defined input source in "input connections".</LI>
<LI>Since channel scanning is not implemented yet, you need to define channels 
in the "Channel Editor". Make sure that you use the same value for 
"Channel Name" as on the DBoxII. You can get a list of available 
channels from the web interface of Neutrino at http://ip-of-your-box:80/. 
Associate the channel with your new video source and repeat when needed.</LI>
</UL>
</P>
<P>You may leave the Setup now and proceed as usual.</P>

<H2><A NAME="ss23.21">23.21</A> <A HREF="#toc23.21">What do the icons on the Watch Recordings screen mean?</A>
</H2>

<P>Press "1" or F1 to get a popup.</P>
<H2><A NAME="ss23.22">23.22</A> <A HREF="#toc23.22">What do the letters mean when I change channels?</A>
</H2>

<P>These letters let you know what's going on with the backend as it tries
to tune to a channel.</P>
<P>Lower case = seen</P>
<P>Upper Case = seen &amp; good
<UL>
<LI>l/L = Lock  : This could be seen by PVR-250/BTTV users</LI>
<LI>a/A = PAT   : Any recording transmitted in MPEG </LI>
<LI>m/M = PMT   : Any recording transmitted in MPEG </LI>
<LI>g/G = MGT   : ATSC only</LI>
<LI>v/V = VCT   : ATSC only</LI>
<LI>n/N = NIT   : DVB only</LI>
<LI>s/S = SDT   : DVB only</LI>
</UL>
</P>
<H2><A NAME="ss23.23">23.23</A> <A HREF="#toc23.23">What is the difference between the various Hauppauge PVR models?</A>
</H2>

<P>This is covered in the hardware section, and extensively covered on the
Hauppauge website.  (
<A HREF="http://www.hauppauge.com/pages/compare_pvr.html">http://www.hauppauge.com/pages/compare_pvr.html</A>) Please check the
Hauppauge website for the most accurate information.</P>
<P>A PVR-150 comes in a number of versions:
<UL>
<LI>The PVR-150 (Model 1045) is the retail kit.  It comes with a remote
control and an IR Blaster.  It does not have a radio tuner.</LI>
<LI>The PVR-150 MCE (Model 1042) will usually come in a plain white box and is
sold as an OEM device.  It does not come with a remote control, since it's
usually used as the second, third, etc capture device.</LI>
<LI>The PVR-150 MCE Kit (Model 1062) does not have a radio tuner and
comes with a Microsoft Media Center remote control instead of Hauppauge's.</LI>
<LI>The PVR-150 low profile (Model 1086) is a low-profile card. It has a
radio tuner and is approximately half the height of a standard card. 
However, it comes with a low-profile PCI bracket, so it is not suitable for
use in a standard PCI slot without removing the bracket, which may not be
worth the trouble.</LI>
</UL>
</P>
<P>A PVR-250 (Model 980) is a retail kit which comes with an IR receiver and a
remote control.</P>
<P>The PVR-250 MCE (Model 975) contains a FM radio tuner.  The PVR-250 MCE does
not contain a IR receiver or a remote.</P>
<P>The PVR-250 Rev 1 contained an MPEG-2 decoder.  However, this function was
not connected to any output jacks, and there doesn't appear to be any way to
pull decoded video from the card, so it's a fairly useless feature.</P>
<P>The PVR-350 (model 990) has the features of the PVR-250 as well as being
able to decode MPEG-2.  The encode and decode functions may be used
simultaneously.  The MPEG-2 decoder function gives superior video quality
compared to what you'll find on a standard video card.  However, the decoder
function is only available once Linux has started, so you will not see any
boot-time messages.  Also, the card is not capable of resolutions higher
than 720x480, so it cannot be used with HDTV.  Make a conscious decision
(and ask for advice on the mailing list) that you want to tradeoff potential
HDTV use in the future compared to video quality.</P>
<P>The X-driver for the PVR-350 support playback using Xv efficiently but does
not support any other 2D or 3D acceleration. For some application this may
place a large load on the host CPU, some will run without any problem and
others (mplayer, xine, xmame etc.) should be configured to utilize the Xv
interface.</P>
<P>Note that for the PVR-350 there are some 
<A HREF="#PVR-350">considerations</A>
regarding the way audio is handled.</P>
<P>The PVR-500 is a dual-encoder version of the PVR-150 card, so you can
simultaneously record two different programs at the same time, because there
are two encoder chips on the PCI card.  Hauppuage has also installed an
onboard splitter, so you can use one COAX to feed both tuners.  Current
versions of the PVR-500 should come with an adapter to allow you to connect
a second S-Video or composite input, but this will take up a second PCI
slot.  Early adopters may need to purchase this item separately.</P>

<H2><A NAME="ss23.24">23.24</A> <A HREF="#toc23.24">Changing channels on an external Set Top Box</A>
</H2>

<P>If you need to use an external Set Top Box (STB), such as for satellite
TV or for digital cable you will need some way for MythTV to tell the STB to
switch to a new channel.  There are several methods:
<OL>
<LI>Use an IR blaster.  An IR blaster is an infrared transmitter connected
to your computer.  When MythTV needs to change channels it will send IR
pulses, thereby emulating a remote control.</LI>
<LI>Use a direct serial connection.  Some STB's have a serial port on the
back, although it may not look like a serial port.  It may look like a phone
jack, or a strange VGA connector.  It may be labeled "Low Speed Data".  A
direct serial connection is more reliable than an IR blaster.  Not all STB's
that have a Low Speed Data port have it enabled; you may need to convince
your service provider to turn it on.  Stating that you have a Tivo may help;
the Tivo has a direct-connect capability.</LI>
<LI>Use a firewire connection.  There is a <CODE>6200ch.c</CODE> in the MythTV
contrib directory which may work for you.</LI>
</OL>
</P>
<H2><A NAME="ss23.25">23.25</A> <A HREF="#toc23.25">Configuring one machine to flag all commercials</A>
</H2>

<P>Commercial flagging can be CPU intensive.  By default, the backend that
created a recording is the one which will flag commercials.  You may wish to
use a different machine to run commercial flagging.</P>
<P>On the slower machine:</P>
<P>Start the mythtv-setup program.  Advance through the pages until you get to
the Job Queue page.  Turn off the setting that says "Allow Commercial
Detection jobs", thereby preventing any commercial flagging jobs from
running on this machine.</P>
<P>Next, make sure that "Run Jobs only on original recording host" is turned
OFF so that new jobs are allowed to run anywhere.</P>
<P>Restart <B>mythbackend</B> since it only reads this setting when it starts
up.</P>
<P>On the faster machine:</P>
<P>Start the <B>mythtv-setup</B> program.  Advance through the pages until
you get to the Job Queue page.  Ensure that "Allow Commercial Detection
jobs" is turned ON for this machine.</P>
<P>Run <B>mythjobqueue</B>.  <B>mythjobqueue</B> will examine the JobQueue
and run any jobs it finds.  <B>mythjobqueue</B> should be left running so
that it will pick up any new commercial flagging jobs that are added to the
queue, otherwise new jobs will be added to the queue and your programs won't
be flagged until you run manually run <B>mythjobqueue</B>.</P>
<P>Using this technique it's possible to add commercial flagging machines as
needed, even on systems that aren't running a backend.  It's also possible
to run the commercial flagger in a virtual machine environment such as
VMWare.</P>

<H2><A NAME="s24">24.</A> <A HREF="#toc24">Example Configurations.</A></H2>

<H2><A NAME="LVM"></A> <A NAME="ss24.1">24.1</A> <A HREF="#toc24.1">Logical Volume Manager (LVM) </A>
</H2>

<P>LVM greatly increases the flexibility you have in managing your storage
than traditional physical partitions. This section will provide some brief
notes on how to use LVM to create storage space for your video files and how
to add additional disk space in the future. There's lots more that can be
done with LVM, so check the LVM HOWTO 
<A HREF="http://tldp.org/HOWTO/LVM-HOWTO/">http://tldp.org/HOWTO/LVM-HOWTO/</A> document for details.</P>

<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  If you are running MythTV 0.21 and you are using LVM to
create one large filesystem to store your recordings, it's no longer
recommended that you go the LVM route. The preferred solution is to use 
<A HREF="#storagegroups">Storage Groups</A>.  They're more flexible and less
likely to lose all of your recordings if you have a drive failure.</CAPTION>
</FIGURE>
</P>
<P>If you don't understand how to partition a drive, or how to change the
partition type you should stop and look at documentation on how to perform
these steps.</P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>BIG FAT WARNING</B>:  Using an incorrect parameter can make your files
inaccessible, prevent your computer from booting, etc.  Be careful!</CAPTION>
</FIGURE>
</P>
<P>Make sure your kernel configuration includes LVM support or that it's
available as a module. Today, most vendors include this by default. You'll
also want to ensure that you have a copy of the LVM utilities; check your
distribution, or get the latest versions from 
<A HREF="http://www.sistina.com/products_lvm.htm">http://www.sistina.com/products_lvm.htm</A> and build them manually.</P>
<P>Check that the <B>vgscan</B> program is being run at some point during
your boot sequence - most distributions do this by default. Look for a
message during boot up that looks like this: <CODE>vgscan -- reading all
physical volumes (this may take a while...)</CODE> If you don't see any
messages during boot, you may need to install a LVM init script or confirm
that you have all of the LVM packages installed from your distribution.</P>
<P>LVM uses a few concepts you should be familiar with before starting.
<UL>
<LI>PV (Physical Volume).  The actual partition on the hard drive.</LI>
<LI>VG (Volume Group).  The aggregation of all the PVs make a VG.</LI>
<LI>LV (Logical Volume).  Subdivision of the pool of space available in
the VG into individual chunks, like /usr, /var/video, etc.</LI>
</UL>
</P>
<P>The following example assumes that you want to create a LVM partition from a
chunk of space in /dev/hda5, using a reiserfs filesystem and mounted on
/var/video. You later decide to extend this filesystem by adding a new disk:
/dev/hdb.</P>
<P>You need to create at least one LVM partition for a physical volume. Use
<B>fdisk</B> or your favorite partition editor to set the type to LVM
(0x8e). If you're using an entire disk, create one big partition rather than
using the device itself. e.g. use /dev/hdb1 not /dev/hdb.  </P>
<P>In the following example, you have a 15GB disk.  The first 6GB are set as
your boot partition.  <CODE>/dev/hda2</CODE> was added as an extended partition,
and within that partition you created the <CODE>/dev/hda5</CODE> linux (ext2)
partition.</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
# fdisk /dev/hda

The number of cylinders for this disk is set to 1823.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hda: 15.0 GB, 15000330240 bytes
255 heads, 63 sectors/track, 1823 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1       764   6136798+  83  Linux
/dev/hda2           765      1823   8506417+   5  Extended
/dev/hda5           765      1823   8506417   83  Linux

Command (m for help): t
Partition number (1-6): 5
Hex code (type L to list codes): 8e

Command (m for help): p

Disk /dev/hda: 15.0 GB, 15000330240 bytes
255 heads, 63 sectors/track, 1823 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1       764   6136798+  83  Linux
/dev/hda2           765      1823   8506417+   5  Extended
/dev/hda5           765      1823   8506417   8e  Linux LVM

Command (m for help): w

#
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Create the LVM physical volume from the partitions (repeat if you have
multiple partitions to use):
<BLOCKQUOTE><CODE>
<PRE>
# pvcreate /dev/hda5
</PRE>
</CODE></BLOCKQUOTE>

Create a LVM volume group out of this physical volume called "VGforMyth" that is
allocated in chunks that are a multiple of 64MB
<BLOCKQUOTE><CODE>
<PRE>
# vgcreate VGforMyth -s 64m /dev/hda5
</PRE>
</CODE></BLOCKQUOTE>

Create a logical volume of 5GB called "video" and then create the reiserfs
filesystem and mount it:
<BLOCKQUOTE><CODE>
<PRE>
# lvcreate --name video --size 5G VGforMyth
# mkreiserfs /dev/VGforMyth/video
# mount /dev/VGforMyth/video /var/video
</PRE>
</CODE></BLOCKQUOTE>

Now create a 3GB volume for mythmusic files if you like:
<BLOCKQUOTE><CODE>
<PRE>
# lvcreate --name music --size 3G VGforMyth
# mkreiserfs /dev/VGforMyth/music
# mount /dev/VGforMyth/music /var/music
</PRE>
</CODE></BLOCKQUOTE>

Display the volume group status:
<CODE># vgdisplay -v</CODE></P>
<P>Now, lets suppose you want to add a 60GB hard disk to the system as hdb and
allocate 50GB of it to video storage.</P>
<P>First, create a single partition /dev/hdb1 covering the whole disk and make
it type 0x8e using your partition editor.</P>
<P><CODE># fdisk /dev/hdb</CODE>
.... create partition, set type, save and reboot if it says you have to</P>
<P>Create the new LVM physical volume:</P>
<P><CODE># pvcreate /dev/hdb1</CODE></P>
<P>Add the new physical volume to the volume group:</P>
<P><CODE># vgextend VGforMyth /dev/hdb1</CODE></P>
<P>
<FIGURE>
<EPS FILE="stop.eps">
<IMG SRC="stop.png">
<CAPTION><B>NOTE</B>:  You may get errors at this point stating that there are no
physical volumes available for adding to the LV, even though you know for a
fact that there are.  You may need to specify the physical volume in the <CODE>/dev/ide/host/bus/target/lun/etc</CODE> format.</CAPTION>
</FIGURE>

Once you've completed one of the following two procedures, use <B>df</B>
to check that you've got more space.</P>
<P>Make the logical volume used for video bigger:</P>
<P><CODE># lvextend --size +50G /dev/VGforMyth/video</CODE></P>
<H3>ReiserFS</H3>

<P>Unmount, resize and remount the filesystem.  Technically, you don't need to
unmount and remount the ReiserFS. 
<BLOCKQUOTE><CODE>
<PRE>
# umount /var/video
# resize_reiserfs /dev/VGforMyth/video
# mount /dev/VGforMyth/video /var/video
</PRE>
</CODE></BLOCKQUOTE>
</P>

<H3>ext2 or ext3</H3>

<P>LVM comes with a program called <B>resize2fs</B>.</P>
<P>Unmount, resize and remount the filesystem.  The filesystem <EM>must</EM> be
unmounted during this procedure.
<BLOCKQUOTE><CODE>
<PRE>
# umount /var/video
# resize2fs --size +50G /dev/VGforMyth/video
# mount /dev/VGforMyth/video /var/video
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H3>xfs</H3>

<P>XFS does not need to be unmounted to extend the size:
<BLOCKQUOTE><CODE>
<PRE>
# xfs_growfs /var/video
</PRE>
</CODE></BLOCKQUOTE>
</P>
<H2><A NAME="advancedpartitionformatting"></A> <A NAME="ss24.2">24.2</A> <A HREF="#toc24.2">Advanced Partition Formatting </A>
</H2>

<P>The partitions that your distribution sets up for you may not be
optimized for large files. Using LVM in conjunction with the following
techniques can be quite useful.</P>
<P>Unlike a typical filesystem, a MythTV video partition is usually a very
large filesystem filled with a fairly small number of large files.
Filesystem I/O is usually not an issue, even in multi-tuner and/or
multi-frontend setups.</P>
<P>There is however, one aspect of filesystem performance that can have a
bearing on the performance of MythTV.  In Linux, deleting a file will
utilize I/O bandwidth until the deletion has been completed.  If deleting
the file takes long enough, the video capture buffer may overrun, thereby
resulting in dropped frames.  Some filesystems are faster at deleting files
than others and, for multi-gigabyte MythTV video files, these differences
can be significant.</P>
<P>Fortunately, there are published tests (
<A HREF="http://aurora.zemris.fer.hr/filesystems/big.html">http://aurora.zemris.fer.hr/filesystems/big.html</A>) that provide
insight into filesystem performance under conditions relevant to MythTV
usage.  In addition, some limited testing (archived at 
<A HREF="http://www.gossamer-threads.com/lists/mythtv/users/52672">http://www.gossamer-threads.com/lists/mythtv/users/52672</A>)
with very large files (10 gigabytes) was reported in the MythTV Users
mailing list.</P>

<H3>Ext2</H3>

<P>Ext2 was the defacto standard Linux filesystem for many years.  It is
stable, provides good I/O performance and can quickly delete large files. 
The primary disadvantage of Ext2 is that it is not a journaling filesystem,
so a file system consistency check (fsck, which is normally only performed
after a system crash) can take many hours on a filesystem the size of a
typical MythTV partition.</P>

<H3>Ext3</H3>

<P>Ext3 is Ext2 with a journal, so your biggest gain is that in case of a
crash and reboot you won't have to wait very long for your partition to be
remounted.</P>
<P>There are options available when formatting an Ext3 partition, as in:
<BLOCKQUOTE><CODE>
<PRE>
# mkfs.ext3 -T largefile4 /dev/hdb1
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>This example assumes that <CODE>/dev/hdb1</CODE> has already been created using
<B>fdisk</B>. If you're using LVM, <CODE>/dev/hdb1</CODE> may be something like
<CODE>/dev/VGforMyth/video</CODE>.</P>
<P>The "-T largefile4" option creates one inode per 4 megabytes, which can
provide a few percent more storage space.  However, tests indicate that
using the "-T largefile4" option can drastically increase the amount of time
required to delete a large file and thus it should only be used with encoder
settings that produce small video files (YMMV).</P>
<P>You can check on your filesystem using the <B>dumpe2fs</B> program. See
the man page for details.</P>
<H3>ReiserFS</H3>

<P>The Reiser filesystem is another journaling filesystem commonly
distributed with Linux.  It is known to be an extremely efficient filesystem
and it especially excels at managing partitions containing a large number of
small files.  However, tests indicate it is not the fastest at deleting very
large files.  For that reason, it may not be the best choice when using
encoder bitrates that produce very large files.</P>

<H3>JFS</H3>

<P>JFS (Journaling File System) is a journaling filesystem originally
developed by IBM for AIX which was later released as open source.  While not
as common as Ext3 or ReiserFS, it is distributed with RedHat 9 (RH9), Fedora
Core and Mandriva as well as other distros.  According to tests, JFS is the
file deletion speed king, deleting virtually any file in under one second,
even files as large as 10 gigabytes.</P>

<H3>XFS</H3>

<P>XFS is a journaling file system originally developed by SGI for Irix, and
later released as open source.  While not a part of the default RedHat Linux
9 or Fedora Core installation (although it is a part of Mandriva and Fedora
Core 2+), it can be easily installed via ATrpms.  XFS provides deletion
speeds for large files only slightly slower than JFS.  According to the test
results shown at (
<A HREF="http://aurora.zemris.fer.hr/filesystems/big.html">http://aurora.zemris.fer.hr/filesystems/big.html</A>), XFS provide
higher I/O rates than JFS, albeit at a higher CPU loading.  This may cause
issues if you do not have the spare CPU capacity to handle XFS, potentially
leading to dropped frames.</P>
<P>
<A NAME="migratingtoSD"></A> </P>
<H2><A NAME="ss24.3">24.3</A> <A HREF="#toc24.3">Migrating from DataDirect Labs to Schedules Direct</A>
</H2>

<P>MythTV v0.20.2 or later is required to natively support Schedules Direct. 
Code has been included to make the transition as simple as possible.</P>
<P><B>You do not need to delete your existing video sources or add new ones!</B>  </P>
<P>The following steps should work for most users:
<UL>
<LI>Create a Schedules Direct account and use the same information as your
existing lineups at Zap2It Labs.  Do not add or delete channels at this
time.</LI>
<LI>Shut down any running <B>mythfrontend</B> and <B>mythbackend</B> programs.</LI>
<LI>Perform a backup of your existing database.  See 
<A HREF="#backupdb">Saving or restoring the database</A> for instructions.</LI>
<LI>Run <B>mythtv-setup</B> -> Video Sources.  Change the grabber to
Schedules Direct, update the username and password fields with the account
information you created at Schedules Direct and select "Retrieve Lineups". 
Click Finish.</LI>
<LI>Exit <B>mythtv-setup</B> and run <B>mythfilldatabase</B>.  Check
if there were any errors.</LI>
<LI>Restart your <B>mythbackend</B> and <B>mythfrontend</B> programs.</LI>
</UL>
</P>

<H2><A NAME="ss24.4">24.4</A> <A HREF="#toc24.4">Caching support for Schedules Direct</A>
</H2>

<P>MythTV 0.20.2 or later supports caching of downloaded information from
Schedules Direct, so devices that share a common source do not require
multiple downloads.</P>
<P>Before beginning, perform a backup of your existing database.  See 
<A HREF="#backupdb">Saving or restoring the database</A> for instructions.</P>
<P>In the following scenario, assume that you have the following:
<OL>
<LI>A PVR-150 MPEG-2 encoder card connected directly to a CATV source.</LI>
<LI>A PVR-250 MPEG-2 encoder card connected via S-Video to a CATV Set Top Box.</LI>
</OL>
</P>
<P>What we are going to do is to create a single lineup at Schedules Direct and
then create two Video Sources which use the same login information but have
different channels associated with them.</P>
<P>On your Schedules Direct account, create a lineup that has all of the
channels that you can receive.  Because we have a Set Top Box (STB), choose
a Digital lineup.  Yes, this means that you may have 900 channels in this
lineup, but that's OK.</P>
<P>Use the Schedules Direct channel editor and unselect any channels that you
can't tune without the STB.  This will usually be channels higher than 125,
but check your CATV provider lineup if you're not sure.  Once you've
deselected them (using a click on the first channel you can't receive and
then a shift-click on the last channel you can't receive will deselect all
the channels in between those two.) click the Save Changes button at the
bottom of the screen.</P>
<P>In <B>mythtv-setup</B>, create a Video Source with an appropriate name.
"SD-Analog Only" will be used in this example.  Click "Retrieve Lineups"
and select the digital lineup you just created at Schedules Direct.</P>
<P>Click "Finish" to return to the Video sources selector and then press the
ESC key to go back to the main screen.</P>
<P>Now choose Input Connections.  Select the PVR-150 which is connected
directly to the CATV.  Set the Video Source to "SD-Analog Only" and click
"Fetch channels from listings source".</P>
<P>Set the start channel to an appropriate value.</P>
<P><B>NOTE</B>:  There is a bug where the "Fetch" command may not work; you
can tell that the Fetch did not retrieve any channels in one of two ways: in
the text-mode console, you will see a connection to Schedules Direct, but it
doesn't appear to retrieve any channel information:
<BLOCKQUOTE><CODE>
<PRE>
2007-08-25 15:03:05.526 New DB DataDirect connection
2007-08-25 15:03:05.526 Connected to database 'mythconverg' at host: localhost
2007-08-25 15:03:05.536 DataDirect: Your subscription expires on 11/23/2007 01:12:10 PM
2007-08-25 15:03:05.707 New DB connection, total: 3
2007-08-25 15:03:05.707 Connected to database 'mythconverg' at host: localhost
2007-08-25 15:03:05.708 sourceid 2 has lineup type: CableDigital
2007-08-25 15:03:06.623 Data fetching complete.
2007-08-25 15:03:06.624 DataDirect: Deleting temporary files
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>or, the "Please add channels to this source" message in the "Starting
channel" field stays on the screen.</P>
<P>If either of these happens, save the information on this screen by clicking
the "Finish" button.  Exit back to the Input connections screen by pressing
ESC, then select this Input Connection again.  This time the Fetch will work
and the "Please add channels to this source" message will disappear.</P>
<P>If you look at the text-mode console, you'll see this if the channel
retrieval is working:
<BLOCKQUOTE><CODE>
<PRE>
2007-08-25 15:04:32.437 New DB DataDirect connection
2007-08-25 15:04:32.437 Connected to database 'mythconverg' at host: localhost
2007-08-25 15:04:32.447 DataDirect: Your subscription expires on 11/23/2007 01:12:10 PM
2007-08-25 15:04:32.622 New DB connection, total: 3
2007-08-25 15:04:32.622 Connected to database 'mythconverg' at host: localhost
2007-08-25 15:04:32.623 sourceid 2 has lineup type: CableDigital
2007-08-25 15:04:33.418 DataDirect: Adding channel 41 'AMC' (AMC).
2007-08-25 15:04:33.422 DataDirect: Adding channel 32 'A &amp; E Network' (AETV).
2007-08-25 15:04:33.425 DataDirect: Adding channel 66 'Black Entertainment Television' (BET).
2007-08-25 15:04:33.427 DataDirect: Adding channel 180 'Bravo' (BRAVO).
2007-08-25 15:04:33.430 DataDirect: Adding channel 51 'ABC Family' (FAM).
2007-08-25 15:04:33.432 DataDirect: Adding channel 146 'Country Music Television' (CMTV).
2007-08-25 15:04:33.435 DataDirect: Adding channel 39 'CNBC' (CNBC).
2007-08-25 15:04:33.437 DataDirect: Adding channel 36 'Cable News Network' (CNN).
2007-08-25 15:04:33.440 DataDirect: Adding channel 35 'CNN Headline News' (CNNH).
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>Repeat the Input Connection configuration for any other capture devices that
are connected directly to the CATV system.  You do not need to click Fetch
once you've done one successful download of the channel information - the
Starting channel should be automatically populated.</P>
<P>Go back to Schedules Direct and re-enable the channels that you had
previously deselected, then click Save Changes.</P>
<P>Create a new Video Source, here called "SD-All Digital Channels".  Perform
the same "Retrieve Listings" you did before.</P>
<P>Go back to the Input Connections screen, select the PVR-250 which is
connected to the STB, assign the "SD-All Digital Channels" video source and
perform a retrieve channels.  This will pull down the complete channel
listing, but only for <EM>this</EM> device.</P>
<P>When <B>mythfilldatabase</B> runs, it will cache the "big" download which
is appropriate for the STB, and then copy the information to the channels
that can only be accessed without the STB.  But by default
<B>mythfilldatabase</B> is going to notice that the "Analog only" video
source is missing the channels that are in the Digital lineup you created at
Schedules Direct, so we need to override the addition of new channels.</P>
<P>When you run <B>mythfilldatabase</B> to populate your database, you'll
need to run it like this:</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
$ mythfilldatabase --remove-new-channels
</PRE>
</CODE></BLOCKQUOTE>
</P>
<P>You will also need to modify how the <B>mythbackend</B> calls
<B>mythfilldatabase</B> when it performs its automatic listings update.</P>
<P>In <B>mythfrontend</B>, select "Setup" -> "General".</P>
<P>Continue press ENTER until you reach the Mythfilldatabase configuration
screen.  In the "mythfilldatabase Arguments" field, type
--remove-new-channels</P>
<P>then press the TAB key until you reach Finish, then press ENTER to save. 
You can then press ESC until you return to the main screen.</P>
</BODY>
</HTML>