The firmware for ivtv cards isn't actually stored in ROM on the cards, it needs to be loaded every time the driver loads. The firmware is provided in the windows driver, and needs to be extracted from there. The required firmware files are obtained from the Hauppauge driver, but they are not Hauppauge specific and will work on all boards supported by ivtv.
It is the job of this HOWTO to tell you how to
- get the firmware files,
- install them into the correct location, and
- name them with the correct names. Readers interested only in installing the firmware as quickly as possible may skip to the Obtaining and Installing the Firmware section below.
Obtaining and Installing the Firmware
The easiest way to obtain the firmware files is to simply download this file. This file is meant for ivtv-0.4.2 and up and always contains the recommended firmware versions. You need to extract the archive in the hotplug directory (see the Location section below). For older ivtv versions you need to rename the files to what is appropriate for that ivtv version (see Firmware filenames below).
That's it! If you want to know how to manually extract the firmware files from the original distributed drivers, then read on.
There are three firmware files. The filename you should use depends on the version of ivtv:
|Name in Driver Download||Name for ivtv-0.4.0||Name for ivtv-0.4.1 and up||Description|
|HcwFalcn.ROM||ivtv-fw-enc.bin||v4l-cx2341x-enc.fw||encoder part of the CX23415 and CX23416 cards|
|ivtv-fw-dec.bin||ivtv-fw-dec.bin||v4l-cx2341x-dec.fw||decoder part of the CX23415; not needed for the CX23416|
|HcwMakoC.ROM||HcwMakoA.ROM||v4l-cx25840.fw||CX25840 A/V-processor; used to detect the audio standard|
The PVR-350 also needs a MPEG initialization file. This file is called v4l-cx2341x-init.mpg for ivtv-0.4.2 and up, and is called v4l-cx2341x-init-mpeg.bin for ivtv-0.4.0 and ivtv-0.4.1.
NOTE that the "v4l" names above are vee-four-el, short for "video-for-linux", and not vee-four-one. Many fonts make the digit 1 and the lowercase letter l difficult to distinguish. If you use 1 and not l, your firmware won't load, and it can take a lot of headscratching to figure out what happened.
The location of the firmware has changed between 0.4.0 and 0.4.1, so the location of the firmware will depend on which version of IVTV you are using.
Older Drivers: 0.4.0 and below
The default location of the firmware is /lib/modules/.
Newer Drivers: 0.4.1 and above
The hotplug mechanism of the kernel will be used to locate and load the firmware files. If the kernel does not support the hotplug mechanism then the old method of loading the firmware files is used as a fallback for 0.4.1 and up. Starting with 0.6.0, only the hotplug method is supported (this requires kernel 2.4.23 and up).
If no hotplug support is available in the kernel, then the usual /lib/modules location is used to find the firmware files.
However, if the hotplug mechanism is used then the firmware directory can differ depending on the distribution. Usually it is /lib/firmware or /usr/lib/hotplug/firmware. You can check this by looking for the file firmware.agent (usually found somewhere in /etc/hotplug, when in doubt try find /etc -name firmware.agent to find the file). SuSE and Mandriva users may need to look in the file /sbin/udev.firmware.sh (or /lib/udev/firmware.sh) for the FIRMWARE_DIRS variable. Look in this file and you should see a line like this:
This is the firmware directory where you should put the firmware files.
If you do not find the firmware.agent file, you can cut and paste these commands to identify your firmware directory. Last existing directory wins, with the most standard location (based on current distros) listed last. If your distro wants your firmware in another location, please add it to the top of this list.
test -d /lib/modules && FIRMWARE_DIR=/lib/modules test -d /usr/lib/hotplug/firmware && FIRMWARE_DIR=/usr/lib/hotplug/firmware test -d /lib/firmware && FIRMWARE_DIR=/lib/firmware test -d /lib/firmware/`uname -r` && FIRMWARE_DIR=/lib/firmware/`uname -r`
Manually Extracting and Installing the Firmware
In this section, we will download and install the appropriate firmware files for your Hauppauge PVR-xxx card. The objective here is to install a total of four firmware files in the correct location (see above), and with the correct names. Not every PVR card will use every firmware file; however, it is a good idea to go ahead and have them all, so that if you add a new PVR card of a different flavor in the future, the firmware files are all ready to go.
Note: most people will want to follow the instructions in Obtaining and Installing the Firmware instead, this section describes how to extract the files manually.
Step 1: Getting the firmware files:
The easiest way to obtain the recommended versions of ivtv-fw-enc.bin and HcwMakoC.ROM are by downloading this file and unzipping it:
cd /tmp wget --user=wtv --password=Support07! ftp://ftp.hauppauge.com/Support/PVR150/Beta/070206%20amity2%126.96.36.19937.prerelease.zip unzip "070206 amity2 188.8.131.5237.prerelease.zip"
OR: Look at http://www.hauppage.com/pages/support/support_pvr150.html and locate Beta test versions.
Now, copy the two firmware files from the "DriverA2" directory that you just extracted into the appropriate location, and name them appropriately.
For ivtv 0.4.0 and earlier, this is:
cd "/tmp/060418 Amity2 184.108.40.20608.PreRelease/DriverA2"/ cp HcwMakoC.ROM $FIRMWARE_DIR/ cp HcwFalcn.rom $FIRMWARE_DIR/ivtv-fw-enc.bin
and for ivtv 0.4.1 and later, this is (remember, the names below are vee-four-el, not vee-four-one):
cd "/tmp/060418 Amity2 220.127.116.1108.PreRelease/DriverA2"/ cp HcwMakoC.ROM $FIRMWARE_DIR/v4l-cx25840.fw cp HcwFalcn.rom $FIRMWARE_DIR/v4l-cx2341x-enc.fw
Where $FIRMWARE_DIR was set according to the cut and paste sections earlier in this document.
Now, we need to install the MPEG decoder firmware. Download the recommended version and use the ivtvfwextract.pl utility to extract the firmware ("unzip" must be installed and found in your $PATH for this to work):
cd (back to the ivtv-0.10.6 directory) wget ftp://ftp.shspvr.com/download/wintv-pvr_250-350/inf/pvr_18.104.22.16854_inf.zip utils/ivtvfwextract.pl pvr_22.214.171.12454_inf.zip
This places two files, ivtv-fw-enc.bin and ivtv-fw-dec.bin, in /lib/modules/. Note that ivtv-fw-enc.bin contains the same firmware as HcwFalcn.rom from pvr_126.96.36.19935.zip, and thus, these two files are redundant. The latter file is larger, but the extra size is all zeropadding and is ignored by the ivtv driver. If we are dealing with ivtv 0.4.0 or earlier, we just overwrote our existing /lib/modules/ivtv-fw-enc.bin file in this step, but that's OK since the files are the same. If you have ivtv 0.4.1 or later, you also need to move the decoder firmware file to the correct place, and clean up the redundant ivtv-fw-enc.bin:
rm /lib/modules/ivtv-fw-enc.bin mv /lib/modules/ivtv-fw-dec.bin /usr/lib/hotplug/firmware/v4l-cx2341x-dec.fw
Finally, we need the mpeg-init firmware. This firmware comes as a part of the ivtv tarball, and therefore you already have it. Simply cd to the directory where you untarred the ivtv-0.4.x distribution, and do the following if you are dealing with ivtv 0.4.0 or earlier:
cp v4l-cx2341x-init-mpeg.bin /lib/modules
or if you have ivtv 0.4.1,
cp v4l-cx2341x-init-mpeg.bin /usr/lib/hotplug/firmware
or if you have ivtv 0.4.2 or later,
cp v4l-cx2341x-init.mpg /usr/lib/hotplug/firmware
At this point, you are done. You should have four appropriately named firmware files installed in either /lib/modules (ivtv 0.4.0 or earlier) or in /usr/lib/hotplug/firmware (ivtv 0.4.1 or later).
For more information on the different firmware versions available see firmware versions.
The guide above shows you how to install all of the firmware files, even though all of them are not needed given a particular PVR-xxx card. There is no harm in installing all of the firmware files; the unneeded ones will just never be loaded.
The v4l-cx2341x-dec.fw firmware and v4l-cx2341x-init.mpg (named v4l-cx2341x-init-mpeg.bin in 0.4.1 and earlier) are needed for the PVR-350 only. Also, v4l-cx2341x-init.mpg is not really a firmware file, but a very small endian-flipped MPEG file needed to initialize the mpeg decoder so that the YUV playback (not the framebuffer) works.
The v4l-cx25840.fw firmware is only needed for cards with a cx2584x chip, currently only the PVR150, PVR500 and Yuan PG600/Diamond PVR-550 cards.
These are the md5sum checksums of the recommended firmware files.
If you want to verify the files in your firmware directory:
$ cd $FIRMWARE_DIR/ $ md5sum v4l-* 99836e41ccb28c7b373e87686f93712a v4l-cx25840.fw 305dba74bbe5905447add8883f3ecb68 v4l-cx2341x-dec.fw 9b39b3d3bba1ce2da40f82ef0c50ef48 v4l-cx2341x-enc.fw
NOTE: The v4l-cx2341x-dec.fw file may not exist if you are not using a pvr250 or pvr350 with hardware MPEG decoding for playback.
warning: SCSI devicename collisions
On systems that use a scsi raid array, such as a RAID-5 array of SATA drives, you will collide with the IVTV driver and temporarily lose your array, if not careful. No data is lost, it is just a bit disconcerting to have your raid array disappear!
The IVTV drivers create a scsi interface so that other programs can communicate with them. On my Mandriva 2007.1 system, the IVTV modules are loaded via /etc/modprobe.preload. The SATA drivers were loaded via /etc/modprobe.conf. This caused the IVTV drivers to enumerate their scsi devices before the SATA driver could do its devices, thus borking the values in /etc/mdadm.conf.
The solution to this is to edit the /etc/modprobe.preload and place your SATA kernel modules *before* the IVTV modules. For example:
sata_nv sata_sil24 ivtv ivtv amd64-agp