Verifying Your HardwareBeta
From MythTV Book
| Chapter Details |
|---|
| Credits |
|
Authors: Stewart Smith, Michael Still |
| Links |
|
Published version: Verifying Your Hardware |
| Beta Chapter |
|---|
| Warning: This chapter is currently a beta. This means that the chapter hasn't had any review yet, and might be inaccurate. Please be cautious when implementing recommendations from this chapter. If you find problems with this chapter, then either fix them yourself, or send your comments to the editors. |
Contents |
Introduction
This chapter focuses on independent testing of your hardware. This can be useful if you've installed Ubuntu or MythBuntu and for some reason some part of your hardware isn't working well with MythTV. If you have a working MythTV installation after either the The Easy Way: Installing MythBuntu or The Hard Way: Installing Ubuntu chapters, then you can safely skip this chapter and move onto the Configuration chapter.
Useful tools
If you are having problems with your hardware, the first place is the output of the dmesg command after start-up. This shows the most recent log messages from the Linux kernel. During start-up or when any driver is loaded, messages are often printed here saying “Detected X” (where X is a hardware device). You can scan through these messages for anything related to your hardware. For example, successful detection of a Nova-T PCI Digital TV card can look like this:
DVB: registering new adapter (TT-Budget/WinTV-NOVA-T PCI). tda1004x: Detected Philips TDA10045H. tda1004x: Detected Philips TDM1316L tuner. DVB: registering frontend 0:0 (Philips TDA10045H)..
For a wireless card in one of our laptops, a message like this appears:
ipw2200: Detected Intel PRO/Wireless 2200BG Network Connection ipw2200: Detected geography ZZM (11 802.11bg channels, 0 802.11a channels)
The format of these messages will likely be different for each driver and perhaps between versions of the kernel. If you get an error message, perhaps you need a newer driver or a patch. We strongly recommend you buy hardware that is easily supported by the kernel you are running (most likely the kernel that ships with Ubuntu). You can determine what version of the kernel you are running using the uname -r command. Any money you might save by going for possibly cheaper but less well-supported hardware can bring you frustration when it comes to setting it up.
The other utility to look at the output of is lspci. This lists PCI devices in the system. If a device isn't listed here, then it hasn't been found on the PCI bus (the cards you plug into slots inside the computer). Some output might look like this:
0000:00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 04) 0000:01:00.0 VGA compatible controller: ATI Technologies Inc M24 1P [Radeon Mobility X600]
Which are a sound card and a graphics card. For USB devices, there is a similar command known as lsusb. You can get output like this:
Bus 005 Device 001: ID 0000:0000
Bus 001 Device 003: ID 077d:0223 Griffin Technology IMic Audio In/Out
Bus 001 Device 002: ID 046d:c00f Logitech, Inc.
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000The Logitech, Inc. device in this output is actually a mouse. Sometimes the names listed aren’t the most obvious. You can always unplug a device and see what changes, though. For example, if we unplug the mouse and run lsusb again, the output is as follows:
Bus 005 Device 001: ID 0000:0000
Bus 001 Device 003: ID 077d:0223 Griffin Technology IMic Audio In/Out
Bus 001 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000With PCI cards you will have to shut down the machine first before you remove them, but you can happily plug and unplug USB devices, and everything should "just work". If you didn't get any mention in dmesg but you did in lspci or lsusb, it might be that the driver for the device either isn't loaded or isn't installed on your system.
Sound
Ubuntu plays a start-up sound as you log in. If you heard it, odds are your sound output works. Believe it or not, we've found the most common problems for not hearing anything are the volume isn't turned up, the speakers aren't turned on, or we've plugged the speaker cable into the wrong socket. This is especially true because some sound drivers on Linux default to starting up with the volume turned all the way down. If some of your speakers are not working it may just be that they are surround, rear or center channels and are turned down or muted. To adjust these channels you will need to type in a terminal:
$ alsamixer
Now you will be shown the different channels detected and can adjust them individually. This is a common problem on laptops with multiple speakers.
You can also play various sounds under System ➤ Preferences ➤ Sound. You can also turn off the login sound from this Control Panel, which can be good to do if you don’t want to hear it every time you boot the computer.
Video Capture
You can do a simple test with some basic TV viewing programs. The best way to do this depends on what type of capture card you have, so we'll discuss some of the more common options in the following sections.
Installing IVTV Capture Cards
Many of the most popular analog capture cards are based on the IVTV chipset. Examples include the Hauppauge PVR series of PCI cards, as well as many others. To see a list of the cards which use the IVTV chipset, you should check the IVTV website. Recent versions of Ubuntu come with the IVTV driver already installed. It might therefore be as simple as loading the module to have your video card supported. You can load the module with this command:
$ sudo modprobe ivtvYou know this worked if you don't get an error message from the modprobe command, and if there are no error messages at the end of the dmesg output. If you only see output like this:
Start initialization, version 1.4.0 ivtv: End initialization
Then the driver didn't detect an IVTV chipset in your machine. In this case, you probably have a different kind of video card, and need to keep looking for the right driver. A correct detection should look something like this:
ivtv: Start initialization, version 1.4.0 ivtv0: Initializing card #0 ivtv0: Autodetected Hauppauge card (cx23416 based) -> GSI 17 (level, low) -> IRQ 17 ivtv0: Unreasonably low latency timer, setting to 64 (was 32) ivtv0: Autodetected Hauppauge WinTV PVR-250 saa7115 2-0021: saa7115 found (1f7115d0e100000) @ 0x42 (ivtv i2c driver #0) msp3400 2-0040: MSP4448G-A2 found @ 0x80 (ivtv i2c driver #0) tuner 2-0061: chip found @ 0xc2 (ivtv i2c driver #0) ivtv0: Registered device video0 for encoder MPG (16384 kB) ivtv0: Registered device video32 for encoder YUV (2048 kB) ivtv0: Registered device vbi0 for encoder VBI (8192 kB) ivtv0: Registered device video24 for encoder PCM (320 kB) ivtv0: Initialized card #0: Hauppauge WinTV PVR-250 ivtv1: Initializing card #1 ivtv1: Autodetected Hauppauge card (cx23415 based) -> GSI 18 (level, low) -> IRQ 18 ivtv1: Unreasonably low latency timer, setting to 64 (was 32) ivtv1: Autodetected Hauppauge WinTV PVR-350 saa7115 3-0021: saa7115 found (1f7115d0e100000) @ 0x42 (ivtv i2c driver #1) saa7127 3-0044: saa7129 found @ 0x88 (ivtv i2c driver #1) msp3400 3-0040: MSP4448G-A2 found @ 0x80 (ivtv i2c driver #1) tuner 3-0043: chip found @ 0x86 (ivtv i2c driver #1) tuner 3-0061: chip found @ 0xc2 (ivtv i2c driver #1) ivtv1: Registered device video1 for encoder MPG (16384 kB) ivtv1: Registered device video33 for encoder YUV (2048 kB) ivtv1: Registered device vbi1 for encoder VBI (8192 kB) ivtv1: Registered device video25 for encoder PCM (320 kB) ivtv1: Registered device radio1 for encoder radio ivtv1: Registered device video17 for decoder MPG (1024 kB) ivtv1: Registered device vbi9 for decoder VBI (64 kB) ivtv1: Registered device vbi17 for decoder VOUT ivtv1: Registered device video49 for decoder YUV (1024 kB) ivtv1: Initialized card #1: Hauppauge WinTV PVR-350 ivtv: End initialization ivtv0: Loaded v4l-cx2341x-enc.fw firmware (376836 bytes) ivtv0: Encoder revision: 0x02060039 ivtv1: Loaded v4l-cx2341x-enc.fw firmware (376836 bytes) ivtv1: Loaded v4l-cx2341x-dec.fw firmware (262144 bytes) ivtv1: Encoder revision: 0x02060039 ivtv1: Decoder revision: 0x02020023 ivtv1: Loaded v4l-cx2341x-init.mpg firmware (155648 bytes)
(In this case, the machine has two IVTV cards installed, ivtv0 and ivtv1).
If your chosen Linux distribution doesn't package the IVTV driver, or you need a more recent version for some reason, then you can install it from source. First, download the latest version of the IVTV driver that supports your kernel version from the IVTV site. At the time of this writing, the latest version depends on what kernel version you are using, with newer versions of the driver being available for newer kernels. There is a list of supported cards at the IVTV site. If you need to determine the version of the Linux kernel running on your machine, run this command:
$ uname -r 2.6.27-9-generic
Here you can see that we’re running Linux 2.6.27-9 on this machine. If you're running a different version, then you will need to change the version numbers in the following instructions to match the version you are running:
$ sudo apt-get install gcc-3.4 linux-source-2.6.27 linux-headers-2.6.27-9 ... $ cd /usr/src/ $ sudo tar --bzip -xf linux-source-2.6.27.tar.bz2 $ sudo ln -s linux-source-2.6.27 linux $ sudo ln -s /usr/src/linux /lib/modules/2.6.27-9-generic/build
If you get an error about /lib/modules/2.6.27-9-generic/build already existing, then just remove it, and run the command again. Now edit the EXTRAVERSION line in /usr/src/linux/ Makefile to match the last two fields of the Ubuntu kernel version. Our Makefile ends up looking like this:
VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 27 EXTRAVERSION = -9-386 NAME=Sliding Snow Leopard ifdef UBUNTUBUILD EXTRAVERSION = endif # *DOCUMENTATION* [...snip...]
Now you need to configure the kernel source so the build will work properly:
$ sudo cp /boot/config-2.6.29-7-386 /usr/src/linux/.config $ cd /usr/src/linux $ sudo make oldconfig
Accept the defaults for anything you are prompted for here, because this means that functionality wasn’t available when the current kernel was built. You select the default by just hitting Enter:
$ sudo make prepare0 $ sudo make scripts
Next, change directories to the place you downloaded the IVTV driver to, and execute these commands (which assume you’re using the 0.7 version of the IVTV driver):
$ tar xzf ivtv-0.7.0.tar.gz $ cd ivtv-0.7.0/ $ make $ make install $ depmod -a
Now the kernel driver is installed and ready to go. You do need to install the firmware that Ubuntu will load for the driver when the driver starts. This firmware is in two ZIP files that you download and then copy to the right place:
$ cd utils $ wget ftp://ftp.shspvr.com/download/wintv-pvr_150-500/inf/pvr_2.0.24.23035.zip $ wget ftp://ftp.shspvr.com/download/wintv-pvr_250-350/inf/pvr_1.18.21.22254_inf.zip $ unzip pvr_2.0.24.23035.zip $ ./ivtvfwextract.pl pvr_1.18.21.22254_inf.zip $ cp HcwMakoA.ROM /lib/firmware/v4l-cx25840.fw $ cp HcwFalcn.rom /lib/firmware/v4l-cx2341x-enc.fw $ mv /lib/modules/ivtv-fw-dec.bin /lib/firmware/ $ mv /lib/modules/ivtv-fw-enc.bin /lib/firmware/ $ cp ../v4l-cx2341x-init-mpeg.bin /lib/firmware $ ln -s /lib/firmware/ivtv-fw-dec.bin /lib/firmware/v4l-cx2341x-dec.fw
You’re nearly done. All you need to do now is add these two lines to /etc/modprobe.d/ aliases:
alias char-major-81-0 ivtv alias char-major-81-0 ivtv
You can test the results by running these commands:
$ depmod $ modprobe ivtv $ dmesg
Look for error messages in the dmesg output, which might indicate that something went wrong. If you need more information about this install process, check these URLs: http:// www.mythtv.org/wiki/index.php/Ubuntu_Dapper_Installation#Install_IVTV_drivers and http://ivtvdriver.org/index.php/Howto:Ubuntu. The previous description is merely an updated version of the content of those two URLs.

