Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 35 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
35
Dung lượng
1,4 MB
Nội dung
Chapter 6 Building a Personal Video Recorder with MythTV In This Chapter ᮣ Building your personal video recorder (PVR) ᮣ Watching TV ᮣ Managing your recordings ᮣ Managing your media O ne of the things I like about running Linux as my operating system is the availability of a large number of open source, free programs. One such program I use is MythTV; with it, I have converted an old, rarely used PC to a personal video recorder (PVR), and now it’s one of the most used PCs in my house. Most people know what a PVR is, and many people have commercial versions such as TiVo or proprietary PVRs supplied by the cable or satellite compa- nies. With a PVR, you can pause live TV and record whatever you desire whenever you desire. Typically, you have to pay a subscription fee to TiVo or your cable or satellite provider for the privilege of using its PVR. But, if you have an old PC, you can build your own PVR for little or no cost — and you won’t have to pay a subscription fee either — by downloading and installing MythTV. MythTV lets you build your own PVR, download TV programming information, watch, pause, and record live TV, as well as schedule recordings. But MythTV can do so much more: With MythTV, you can gain complete con- trol of all your online media content and access the Internet for news and weather information. This chapter shows you how to build your MythTV system. Note: The MythTV program is very complex and could fill an entire For Dummies book alone. The information in this chapter tells you how to set up and configure a basic MythTV system. I highly recommend that you do some research on your own and explore the MythTV information that is available on the Web. A good place to start is the MythTV official site at www.mythtv.org. 12_598236 ch06.qxp 6/27/06 7:42 PM Page 113 Building Your MythTV PVR In the following sections, you find out how to set up your PC hardware to use with MythTV. You must meet some specific hardware requirements before you can install and configure MythTV. After you configure your hardware, you download, install, and configure MythTV. Selecting the hardware The first consideration for using MythTV is choosing and configuring the hard- ware that the system will use. Your hardware must meet some basic require- ments, and I include a list of required hardware items and their purposes. You can set up MythTV in several different configurations by using one PC as the master backend unit (not connected to the TV) and another as the front- end unit (connected to the TV). Or, you can use one PC for both the backend and frontend units. In this chapter, you find out about using one PC for both the backend and frontend units. Just about any recent PC that is capable of running Linux should have enough processing power to run MythTV. The fol- lowing list shows the basics. Following the list of generic hardware types, I list the specific hardware I used when I set up my system. Generic hardware types This list shows generic types of hardware that you need to set up your system with MythTV: ߜ CPU: Pentium II class or higher CPU. (This includes AMD CPUs, as well.) ߜ RAM: A 256MB minimum. ߜ Hard drive: Any ATA 66/100/133, 30GB or larger for storing video. ߜ Sound card: An onboard or a PCI card. (Nearly any card will work.) ߜ Video card: An onboard or a PCI/AGP card. (The card must have a TV out port to connect to TV.) ߜ Optical drive: Required only if you want to play or record CD/DVDs. ߜ Video capture card: Used to get the video into your PC. MythTV sup- ports many kinds. Because it isn’t possible for me to discuss every type of hardware that might work with MythTV in this section, I recommend that you check out http:// mythtv.org/docs/mythtv-HOWTO-3.html#ss3.1 (to find more detailed information about hardware requirements) and http://pvrhw.goldfish. org/tiki-pvrhwdb.php (to find a list of many hardware configurations known to work with MythTV). You can save yourself a lot of time and aggra- vation if you configure your system with hardware that is known to work with MythTV. 114 Part III: Entertaining Your Brain with a Little Help from Linux 12_598236 ch06.qxp 6/27/06 7:42 PM Page 114 I followed my own advice and made sure that my hardware would work before I downloaded, installed, and configured MythTV. My system-specific hardware Here’s the specific hardware I am using on my system: ߜ Motherboard: Shuttle AK32A ߜ CPU: AMD Athlon 1800 ߜ RAM: 1GB pc133 ߜ Hard drive: Seagate 7200rpm ATA100 80GB ߜ Sound card: onboard AC97 ߜ Video card: XFX GeForce FX 256mb TV/DVI AGP ߜ Video capture: Plextor PX-M402U ߜ Optical drive: Generic DVD+/-RW, CD-RW, DVD-ROM, CD-ROM ߜ NIC: onboard Realtek Regardless of which hardware you decide to use, be sure to properly install and configure it before you begin to install and configure MythTV. I can’t know what hardware you’re using, so I leave it to you to be sure it’s working properly. I can only repeat; be sure you select hardware that is known to work with MythTV! Installing MythTV When you have hardware that is compatible with MythTV and you know it is properly configured, you’re ready to install MythTV. My instructions are based on using Fedora Core 4 (FC4) as the Linux distribution, but you can also run MythTV with SUSE or Debian and Debian-based distributions such as Knoppix or Linspire. Note: If you’re running FC4 or SUSE, you can follow the instructions here using yum for the installation. If you’re running Debian or a Debian-based dis- tribution, you can use the apt-get command instead of yum to do your installation. Before you begin the installation, you have some prep work to do: ߜ Install the drivers required by your specific hardware and be sure your hardware is working properly. You are using hardware supported by MythTV, aren’t you? 115 Chapter 6: Building a Personal Video Recorder with MythTV 12_598236 ch06.qxp 6/27/06 7:42 PM Page 115 ߜ Install the LIRC packages if you plan to use a remote control with your system (perhaps one came with your capture device). Go to www.myth tv.org/docs/mythtv-HOWTO-8.html for details. (You don’t need to use a remote; you can use keyboard commands to control MythTV.) ߜ Make sure that you have free space on your system hard drive. You need this space to hold your TV recordings. You should probably have at least 20GB free for this purpose. (The MythTV program will use about 100MB.) ߜ Create a user on your system called mythtv. You will log in as this user to configure and run MythTV. ߜ Create a directory /mnt/store. This is where MythTV will save your recordings. ߜ Be sure that mysql is installed on your system. If it isn’t, you need to install it. ߜ Enable NTP on your system. This ensures that your system time will always be accurate. ߜ Be sure your system is updated with the most recent packages. You can run yum upgrade to do this. ߜ Set up the atrpms and freshrpms repositories for use with yum. You can edit the /etc/yum/conf file, or you can place a configuration file for each repository in /etc/yum.repos.d. In the code examples, the first character indicates the command prompt. A dollar sign ($)indicates a non-root user. A pound sign (#) indicates the root user. You don’t type these characters — only the text following these characters. Now you’re ready to begin the installation; just follow these few steps: 1. Open a terminal window and log in as root. 2. At the command prompt, type # yum install mythtv-suite The installer searches the rpm repositories and will finds the necessary packages and any required dependencies. 3. When you are asked whether you want to install the selected pack- ages, answer Yes to continue. When the installer says Complete! and the command prompt returns, the installation is complete. The next step is to configure MySQL. 116 Part III: Entertaining Your Brain with a Little Help from Linux 12_598236 ch06.qxp 6/27/06 7:42 PM Page 116 Configuring MySQL For MythTV to work properly, you must have MySQL installed, properly con- figured, and running. If you haven’t already installed MySQL, do it now. If you have it installed, go ahead and configure it. First, you want MySQL to start whenever you start your PC. You can issue the following command as the root user to ensure MySQL always starts: # chkconfig mysqld on Then you can start MySQL immediately by entering # service mysqld start Now you need to set the root password for MySQL by entering the following command. Be sure to use your own password where it shows ‘Enter your desired password here’. (The single quotes are required.) # mysql -u root mysql mysql> UPDATE user SET Password=PASSWORD(‘Enter your desired password here’) WHERE user=’root’; mysql> FLUSH PRIVILEGES; mysql> quit Then you must create the database that MythTV will use by entering the fol- lowing command: $ mysql -u root -p < /usr/share/doc/mythtv- 0.18.1/database/mc.sql (When prompted, enter the password you just set previously.) You are now ready to configure MythTV. Configuring the MythTV backend server To configure the MythTV backend server, you run a program called mythtv- setup. Just follow these steps: 1. Log in as the mythtv user you create earlier. (Refer to the preparatory tasks I list in the “Installing MythTV” section.) 2. From a terminal prompt, enter the following command: $ mythtv-setup 117 Chapter 6: Building a Personal Video Recorder with MythTV 12_598236 ch06.qxp 6/27/06 7:42 PM Page 117 The program starts and opens to a window asking whether you want to clear your capture card settings. 3. Highlight Yes and press Enter. Next you are asked whether you want to clear channel settings. 4. Select Yes and press Enter. The program opens to the main settings menu, which lists five options: • General • Capture Cards • Video Sources • Input • Channel Editor You’ve got the mythtv-setup program up and running. Adjusting the main settings In many cases, you don’t need to change the default settings. In the following subsections, I briefly explain the five menu choices and explain in more detail those settings that you need to change, providing illustration where neces- sary. Use your up- and down-arrow keys to move through the menus and additional pages; press Enter or the spacebar to select. General You use these settings to set the IP address and port numbers of your back- end server as well as other settings. Because you’re setting up a PC that is both the backend and frontend of your MythTV system, you don’t need to change any settings here. Selecting General opens eight additional pages. Feel free to open them and have a look at their purposes. Remember that you don’t need to change any settings for your configuration here. Press Esc to go back to the main settings menu. Capture Cards Choosing the Capture Cards option opens a page that shows your video cap- ture cards. Because this is the first time running mythtv-setup, no cards are configured and the highlight is on the (New capture card) option. Press the spacebar to select this choice. When the Capture Card Setup window (shown in Figure 6-1) opens, follow these steps to configure your card: 1. Use the up- or down-arrow keys to highlight the Card Type field and the right- or left-arrow keys to move through the list of supported cards; when you find your card, press Enter or the spacebar to select it. The window returns to the Capture Card display window, and your cap- ture card is listed. 118 Part III: Entertaining Your Brain with a Little Help from Linux 12_598236 ch06.qxp 6/27/06 7:42 PM Page 118 2. Press Enter when the card is highlighted to go back to the Capture Card Setup window for your capture card and make any changes needed. Your video device should be listed in the Video Device field, typically as /dev/video0, and your audio device should be listed as /dev/dsp. You might need to set the default input type according to the signal coming into the card. The signal might be either Composite or S-Video. 3. Press Enter or the spacebar to accept your changes and then press Esc to return to the main settings menu. Video Sources Selecting the Video Sources option opens a window that displays the video sources. Because this is your first time here, no video sources are set up yet, and New video source is highlighted. Press the spacebar or the Enter key. The Video Source Setup window appears. See Figure 6-2. To configure the video source, follow these steps: 1. Use the up- or down-arrow keys to move the highlight to the Video Source Name field and enter the name you want to give this video source. I called mine Dish Network because this is where I get my programming. 2. Enter your Zap2it username and password in the User ID and Password fields, respectively. Figure 6-1: The Capture Card Setup window for selecting your capture card. 119 Chapter 6: Building a Personal Video Recorder with MythTV 12_598236 ch06.qxp 6/27/06 7:42 PM Page 119 If you don’t have an account, you need one so that you can retrieve your TV listings. Here’s how to set up a Zap2it account: a. Go to http://labs.zap2it.com, and click the New User? Sign Up link. b. Click Accept to the terms of the subscription agreement if you want to use this service. c. Fill in the requested information on the next window (the sub- scription registration); in the Certificate Code field, enter ZIYN- DQZO-SBUT. d. Fill in the survey and then click Subscribe. e. Go to the program information area and select your location and TV service provider. Then customize your channel listings. 3. After entering your user ID and password into the appropriate fields, move the highlight to Retrieve Lineups and then press Enter. 4. Highlight Finish and then press Enter. Your video source is now displayed in the list of video sources. Press Esc to go back to the main settings menu. Input In the Input settings, you need to specify the type of input for the capture device. This is one of the video sources. The highlight is on the card you just configured, so press the spacebar or Enter to open the Connect Source to Input window, as shown in Figure 6-3. Figure 6-2: The Video Source Setup window for selecting your video source. 120 Part III: Entertaining Your Brain with a Little Help from Linux 12_598236 ch06.qxp 6/27/06 7:42 PM Page 120 Use the up- or down-arrow keys to move the highlight to the Video Source field and then use the right- or left-arrow keys to select the video source you configured in the preceding section. Press spacebar or Enter to accept your choice. The input connection now appears in the list of connections. Press Esc to go back to the main settings menu. Channel editor You typically don’t need to make changes to your channel lineup because these are imported into MythTV from the Zap2it service you signed up for earlier. But you can make any changes you desire. Press the spacebar or Enter to go into the Channels window. Move the highlight over the channel you want to edit and press the spacebar or Enter. After you finish, be sure to press the spacebar or Enter to apply your changes. To exit the MythTV setup program, press Esc. Populating the program guide You need to fill the MythTV database with your settings and your program guide information. From the command prompt, you start the MythTV back- end server by issuing the following command: $ mythbackend & Figure 6-3: The Connect Source to Input window. 121 Chapter 6: Building a Personal Video Recorder with MythTV 12_598236 ch06.qxp 6/27/06 7:42 PM Page 121 This starts the backend server and runs it in the background. When your command prompt returns, issue the following command: $ mythfilldatabase This program fills the database with your program guide information from the Zap2it database that you subscribed to in the “Video Sources” section. This process takes a little while, so be patient. After a few minutes, the com- mand prompt returns, and the configuration is almost complete. Next, you need to start the MythTV frontend. Configuring the MythTV frontend server After you’ve configured the MythTV backend server and populated the pro- gram guide with your TV listing information, you’re ready to start the MythTV frontend server. You can start the MythTV frontend server by issuing the following command: $ mythfrontend This command starts the frontend server and gives you your interface to the MythTV system. If all has gone well so far, you should see a window similar to the one in Figure 6-4. Figure 6-4: The MythTV main window showing your media viewing choices. 122 Part III: Entertaining Your Brain with a Little Help from Linux 12_598236 ch06.qxp 6/27/06 7:42 PM Page 122 [...]... determined by the types of formats supported by the media client Fortunately, the D-Link media client supports a large variety of formats: ߜ MP3: The MP3 format is the most widely used format for distributing audio across the Internet and for playing on portable music players This is the best choice for most users Files in MP3 format end with the extension mp3 ߜ WMA: The WMA format is used by Windows... want to set your own IP information, you do it on this page: a Highlight the DHCP entry and press Enter on the remote 1 35 136 Part III: Entertaining Your Brain with a Little Help from Linux Figure 7-3 : The Your Current Network Settings screen for changing IP information b Use the arrow keys to select Static IP and then press Enter c Be sure to enter the appropriate IP information for your network into... in Figure 7 -5 appears 137 138 Part III: Entertaining Your Brain with a Little Help from Linux Figure 7 -5 : The Grip program used to rip and encode music When Grip starts, it’s setup by default to encode the ripped files to OGG format If this is what you want to use as your music format, you don’t need to make any changes In the following steps, I show you how to set up Grip to encode MP3 format music... connection types are labeled on the D-Link unit Refer to the documentation for your stereo and video components, and use the appropriate connections for your system The unit has an RJ- 45 jack, but you won’t be using it You’re using wireless, right? So you don’t need the RJ- 45 jack 3 Be sure the antenna is attached to the back of the unit 4 Plug in the power cord, and turn on the D-Link client A welcome screen... 7-4 Figure 7-4 : The D-Link media client main menu The media client is now configured to connect to your network and should display the main menu shown in Figure 7 -5 You can choose Music, Photo, Video, or Online Media to show the content from those areas In the next section, you discover how to add some music content Chapter 7: Streaming Music without the Wires Choosing Your Music Format The music format... Streaming Music without the Wires 5 Press the Enter key on the D-Link remote control 6 Use the down-arrow key to highlight Next and then press Enter 7 The Select Your Network Connection screen appears and displays Wireless as the network type 8 Use the down-arrow key to highlight Next and then press Enter The next screen shows the SSID for your network 9 Use the up- and down-arrow keys on the remote to... mythfilldatabase program for TV program listings, and system logging 123 124 Part III: Entertaining Your Brain with a Little Help from Linux Figure 6 -5 : The MythTV frontend Setup menu for configuring your media options ߜ Appearance: These settings control how MythTV appears on your display You can choose from many different themes, as well as change font sizes, languages, and time and date display formats ߜ TV... of town CamStream is a simple, useful Linux program that makes it easy for you to do all these things, so it’s a good starting place for your Linux webcam adventures 142 Part III: Entertaining Your Brain with a Little Help from Linux Installing CamStream Web streaming software such as CamStream is not usually included as one of the standard applications in most Linux distributions, so you probably... are shown (see Figure 7-2 ) You might need to make changes on this page depending on how your network is set up For example, if you’re using WEP, you should enable WEP on this page and enter the appropriate key for your network To enable WEP, highlight the WEP entry, press Enter on the remote, and use the up- and down-arrow keys to change the setting; then press Enter Figure 7-2 : Checking your wireless... with the additional features I chose the D-Link DSM-320 as my media client for two reasons: ߜ It was listed as a supported device by the TwonkyVision Web site for use with their Linux media software Finding hardware that is clearly supported is always a good idea You can save yourself a lot of time and aggravation if you pick a device that is known to work with Linux ߜ It was on sale at my local electronics . card: onboard AC97 ߜ Video card: XFX GeForce FX 256 mb TV/DVI AGP ߜ Video capture: Plextor PX-M402U ߜ Optical drive: Generic DVD+/-RW, CD-RW, DVD-ROM, CD-ROM ߜ NIC: onboard Realtek Regardless. which to receive information. Figure 6 -5 : The MythTV frontend Setup menu for configuring your media options. 124 Part III: Entertaining Your Brain with a Little Help from Linux 12 _59 8236 ch06.qxp. as shown in Figure 6-3 . Figure 6-2 : The Video Source Setup window for selecting your video source. 120 Part III: Entertaining Your Brain with a Little Help from Linux 12 _59 8236 ch06.qxp 6/27/06