Hauppauge WinTV-HVR-2200

From LinuxTVWiki
Revision as of 10:52, 30 December 2017 by SteveGoodey (talk | contribs) (Typo.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
HVR-2200 Image

The Hauppauge WinTV-HVR-2200 is a hybrid analogue and DVB-T PCIe card

Support for its digital side was added to Hg in September 2009.

Overview/Features

Features a hardware MPEG2 encoder and dual tuners (DVB-T/Analog TV Input)

Components Used

Based on as far as I know: PCIe dual channel hybrid PC TV PCV520/20

- In Latest HG

  • NXP SAA7164E - NXP PCI Express dual-channel, PC TV capture/encode IC

- In Development by Steven Toth

- In Latest HG

Identification

02:00.0 Multimedia controller: Philips Semiconductors Unknown device 7164 (rev 81)
        Subsystem: Hauppauge computer works Inc. Unknown device 8901
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0, Cache Line Size: 32 bytes
        Interrupt: pin A routed to IRQ 255
        Region 0: Memory at fd400000 (64-bit, non-prefetchable) [size=4M]
        Region 2: Memory at fd000000 (64-bit, non-prefetchable) [size=4M]
        Capabilities: [40] Message Signalled Interrupts: Mask- 64bit+ Queue=0/4 Enable-
                Address: 0000000000000000  Data: 0000
        Capabilities: [50] Express (v1) Endpoint, MSI 00
                DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <256ns, L1 <1us
                        ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
                DevCtl: Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
                        RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
                        MaxPayload 128 bytes, MaxReadReq 128 bytes
                DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
                LnkCap: Port #1, Speed 2.5GT/s, Width x2, ASPM L0s L1, Latency L0 <4us, L1 <64us
                        ClockPM- Suprise- LLActRep- BwNot-
                LnkCtl: ASPM Disabled; RCB 128 bytes Disabled- Retrain- CommClk-
                        ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
                LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
        Capabilities: [74] Power Management version 3
                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
        Capabilities: [7c] Vendor Specific Information <?>
        Capabilities: [100] Vendor Specific Information <?>
        Capabilities: [160] Virtual Channel <?>

Making it Work

  • Install the firmware:
wget http://www.steventoth.net/linux/hvr22xx/22xxdrv_27086.zip
wget http://www.steventoth.net/linux/hvr22xx/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip
wget http://www.steventoth.net/linux/hvr22xx/extract.sh

sh extract.sh
cp *fw /lib/firmware
# for some linux distros, might need the following line instead of the above
cp *fw /lib/firmware/`uname -r`

Install tools. For Ubuntu or debian:

apt-get install get patchutils lsdiff libproc-processtable-perl build-essential

At this point you should install the source or at least the headers for your kernel. The linuxtv drivers probably need to build against your kernel source. I am not 100% sure on this requirement, but it seems like an easy enough step to take.

Download the build tree and build it. It will download compatibility patches for your kernel if available:

git clone git://linuxtv.org/media_build.git
cd media_build 
./build.sh

Note: this method (as of 2012/03/02) will only give NTSC for analog TV, the driver does not have PAL support. You can at this point patch your code with the patch here: http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/26212/focus=26524. A bit of fiddling is needed to apply the patch in the newer kernels, but I have it working with 3.2.1. Apply the patch to the linux subdirectory of the git archive (after calling ./build.sh), and then call ./build again (or just make). --- patch for 3.2.1-gentoo kernel: https://github.com/reinhrst/nl.claude.tools/tree/2594dd91cb81a3c905a53b9168f52a42e317cd1f/misc

Note: (as of 2012/11/27) Revision 2 of this card will fail to initialize correctly with a dmesg error similar to the below: Full details are available here

[    3.682021] saa7164 driver loaded
[    3.682640] CORE saa7164[0]: subsystem: 0070:8900, board: Hauppauge WinTV-HVR2200 [card=5,autodetected]
[    3.682646] saa7164[0]/0: found at 0000:02:00.0, rev: 129, irq: 16, latency: 0, mmio: 0xfe400000
[    3.693267] saa7164_downloadfirmware() firmware corrupt
[    3.693277] saa7164_downloadfirmware() Waiting for firmware upload (NXP7164-2010-03-10.1.fw)
[    3.705989] saa7164_downloadfirmware() firmware read 4019072 bytes.
[    3.705995] saa7164_downloadfirmware() firmware loaded.
[    3.705996] Firmware file header part 1:
[    3.705999]  .FirmwareSize = 0x0
[    3.706000]  .BSLSize = 0x0
[    3.706001]  .Reserved = 0x3d538
[    3.706003]  .Version = 0x3
[    3.706005] saa7164_downloadfirmware() SecBootLoader.FileSize = 4019072
[    3.706010] saa7164_downloadfirmware() FirmwareSize = 0x1fd6
[    3.706012] saa7164_downloadfirmware() BSLSize = 0x0
[    3.706014] saa7164_downloadfirmware() Reserved = 0x0
[    3.706015] saa7164_downloadfirmware() Version = 0x1661c00
[    8.247111] saa7164_downloadimage() image corrupt
[    8.247139] bootloader d/l has failed
[    8.247368] Failed to boot firmware, no features registered

To get the card working you'll have to

Now that we've built all the latest linuxtv drivers install them (from the media_build folder):

sudo make install

Finally reboot to load the driver (or use sudo make unload, then sudo modprobe driver name to unload and reload the drivers - see http://www.linuxtv.org/wiki/index.php/How_to_Obtain,_Build_and_Install_V4L-DVB_Device_Drivers for more info.)

Note: Some kernels will not have enough free memory available for the driver. The dmesg error will start with a message like this:

] modprobe: page allocation failure: order:10, mode:0x2000d0

followed by a stack trace and other debugging information. While the driver will load, no devices will be registered.

The simple workaround is to allocate more memory for the kernel:

sudo /bin/echo 16384 > /proc/sys/vm/min_free_kbytes
sudo rmmod saa7164
sudo modprobe saa7164
  • NB: One user found that the output of grep saa7164 /var/log/dmesg (on Ubuntu 11) was:
[    4.604840] saa7164 driver loaded
[    4.604890] saa7164 0000:02:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[    4.606586] CORE saa7164[0]: subsystem: 0070:8851, board: Hauppauge WinTV-HVR2250 [card=7,autodetected]
[    4.606591] saa7164[0]/0: found at 0000:02:00.0, rev: 129, irq: 16, latency: 0, mmio: 0xe8000000
[    4.606596] saa7164 0000:02:00.0: setting latency timer to 64
[    4.764079] saa7164_downloadfirmware() no first image
[    4.764088] saa7164_downloadfirmware() Waiting for firmware upload (NXP7164-2010-03-10.1.fw)
[    4.947883] saa7164_downloadfirmware() Upload failed. (file not found?)

This necessitated the download of http://www.steventoth.net/linux/hvr22xx/firmwares/4019072/NXP7164-2010-03-10.1.fw and copy to /lib/firmware/<current kernel> (this firmware version doesn't get generated using the instructions further up the page).

  • After running
    sudo make unload
    and
    sudo modprobe saa7164
    the /dev/dvb/adapter0&1 devices were properly populated.

Making it Work Easily

This was tested under Ubuntu 12.04

  • Create a file named options in the /etc/modprobe.d folder , the first line should have : options saa7164 card=8
  • reboot

card=8 is for most 2250 cards. card=4 for an 8940 card. To find out what number to put in the card=x do the following

 dmesg | grep saa7164

The third line should have something like [card=8,insmod option]

NOTE: You should use dmesg to find the card number before you create the modprobe.d file. If you don't, it will use the card number you put in modprobe.d instead of autodetecting the card number (ugh!)

You can see a list of the card numbers here: http://linuxtv.org/hg/v4l-dvb/file/tip/linux/Documentation/video4linux/CARDLIST.saa7164

In your dmesg option, you can find card version in the line that includes the word subsystem. Mine was 0070:8851 which is card=7 not 8.


WARNING: Another user here... These Making it Work Easily instructions did not work for me (Mythbuntu 12.04.3). These instructions only install the NXP7164 firmware. This initially appeared to get the card to work, however every 10-30 minutes or so I would get very bad pixellation issues that lasted for approx 1-2 minutes, before going good again. On inspection, the dmesg log contained a reference to another missing firmware dvb-fe-tda10048-1.0.fw. I then followed the instructions on this page in the Making it work section to install the firmware by manually extracting from the zip file. This fixed up the issue completely.

Ubuntu 14.04

Hit the same problem in Ubuntu 14.04 with Making it Work Easily where dmesg showing missing dvb-fe-tda10048-1.0.fw message

WORK AROUND

Follow "Making it Work Easily" instructions, then:

# wget http://www.steventoth.net/linux/hvr22xx/22xxdrv_27086.zip
# wget http://www.steventoth.net/linux/hvr22xx/HVR-12x0-14x0-17x0_1_25_25271_WHQL.zip
# wget http://www.steventoth.net/linux/hvr22xx/extract.sh
# sh extract.sh
# sudo cp dvb-fe-tda10048-1.0.fw /lib/firmware
# sudo reboot

Making it work using a GUI

I've put together a tv tuner config tool which sets up many cards:

https://github.com/map7/tvconfig

Alternative method using (older) mercurial tree:

Install tools. For Mythdora:

yum install mercurial

For Ubuntu or Debian:

apt-get install mercurial libncurses5-dev

For stable tree

hg clone http://kernellabs.com/hg/saa7164-stable/
cd saa7164-stable

For development tree

hg clone http://kernellabs.com/hg/~stoth/saa7164-dev/
cd saa7164-dev

For Ubuntu or Debian, deconfigure the firedtv driver in the following process per Devin Heitmueller:

make menuconfig
perl -p -i -e 's/FIREDTV=m/FIREDTV=n/' v4l/.config
edit as needed but should have all enabled that is needed
make
make install
reboot

For non-Ubuntu or Debian:

make menuconfig
edit as needed but should have all enabled that is needed
make
make install
reboot

Every time the linux kernel is upgraded to a new version, you'll need to reboot and then repeat the above steps.

MythDora: With a fresh Mythdora 10 install, chances are the above won't work until you install the kernel source code.

yum install kernel-devel

Repeat the make commands above after installing the kernel source.

Sample kernel output

saa7164 driver loaded
ACPI: PCI Interrupt Link [APC5] enabled at IRQ 16
saa7164 0000:02:00.0: PCI INT A -> Link[APC5] -> GSI 16 (level, low) -> IRQ 16
CORE saa7164[0]: dev->lmmio  = 0xf9800000
CORE saa7164[0]: dev->lmmio2 = 0xf9c80000
CORE saa7164[0]: dev->bmmio  = 0xf9800000
CORE saa7164[0]: dev->bmmio2 = 0xf9c80000
CORE saa7164[0]: subsystem: 0070:8901, board: Hauppauge WinTV-HVR2200 [card=6,autodetected]
saa7164[0]/0: found at 0000:02:00.0, rev: 129, irq: 16, latency: 0, mmio: 0xfd400000
saa7164 0000:02:00.0: setting latency timer to 64
saa7164_downloadfirmware() no first image
saa7164_downloadfirmware() Waiting for firmware upload (v4l-saa7164-1.0.2.fw)
saa7164 0000:02:00.0: firmware: requesting v4l-saa7164-1.0.2.fw
saa7164_downloadfirmware() firmware read 3978608 bytes.
saa7164_downloadfirmware() firmware loaded.
Firmware file header part 1:
 .FirmwareSize = 0x0
 .BSLSize = 0x0
 .Reserved = 0x3cb57
 .Version = 0x3
saa7164_downloadfirmware() SecBootLoader.FileSize = 3978608
saa7164_downloadfirmware() FirmwareSize = 0x1fd6
saa7164_downloadfirmware() BSLSize = 0x0
saa7164_downloadfirmware() Reserved = 0x0
saa7164_downloadfirmware() Version = 0x51cc1
saa7164_downloadimage() Image downloaded, booting...
saa7164_downloadimage() Image booted successfully.
starting firmware download(2)
saa7164_downloadimage() Image downloaded, booting...
saa7164_downloadimage() Image booted successfully.
firmware download complete.
saa7164[0]: i2c bus 0 registered
saa7164[0]: i2c bus 1 registered
saa7164[0]: i2c bus 2 registered
tveeprom 3-0000: Hauppauge model 89619, rev B2F2, serial# 3019750
tveeprom 3-0000: MAC address is 00-0D-FE-2E-13-E6
tveeprom 3-0000: tuner model is NXP 18271C2_716x (idx 152, type 4)
tveeprom 3-0000: TV standards PAL(B/G) NTSC(M) PAL(I) SECAM(L/L') PAL(D/D1/K) ATSC/DVB Digital (eeprom 0xfc)
tveeprom 3-0000: audio processor is SAA7164 (idx 43)
tveeprom 3-0000: decoder processor is CX23887A (idx 39)
tveeprom 3-0000: has radio
saa7164[0]: Hauppauge eeprom: model=89619
tda18271 4-0060: creating new instance
TDA18271HD/C2 detected @ 4-0060
DVB: registering new adapter (saa7164)
DVB: registering adapter 2 frontend 0 (NXP TDA10048HN DVB-T)...
tda18271 5-0060: creating new instance
TDA18271HD/C2 detected @ 5-0060
DVB: registering new adapter (saa7164)
DVB: registering adapter 3 frontend 0 (NXP TDA10048HN DVB-T)...
tda10048_firmware_upload: waiting for firmware upload (dvb-fe-tda10048-1.0.fw)...
i2c-adapter i2c-4: firmware: requesting dvb-fe-tda10048-1.0.fw
tda10048_firmware_upload: firmware read 24878 bytes.
tda10048_firmware_upload: firmware uploading
tda10048_firmware_upload: firmware uploaded
tda18271: performing RF tracking filter calibration
tda18271: RF tracking filter calibration complete
tda10048_firmware_upload: waiting for firmware upload (dvb-fe-tda10048-1.0.fw)...
i2c-adapter i2c-5: firmware: requesting dvb-fe-tda10048-1.0.fw
tda10048_firmware_upload: firmware read 24878 bytes.
tda10048_firmware_upload: firmware uploading
tda10048_firmware_upload: firmware uploaded
tda18271: performing RF tracking filter calibration
tda18271: RF tracking filter calibration complete


MythDora: A non-programmer, Linux and MythTV newbie wrote the added details about MythDora 10. I got the driver to work using Kernel 2.6.27.38-170.2.113.fc10.x86_64, by installing Mercurial and kernel-devel (plus a few other guesses, documented in the Discussion tab). Other research suggested I needed ncurses and ncurses-devel, and gcc, but I'm not sure of those are really required. Hopefully someone comes along and corrects any errors and incorporates additional information in this main article, which I found most useful.

External Links

Verifying it Works

- Another user here on Debian (KDE mostly). I am unable to verify/use card as I am clueless about setting up media center type software to put it to use.

Doesn't work with Supermicro PCIe Gen3 slot motherboards

I tried to use it with a Supermicro X11SAT-F (Bios 2.0c, Release Date: 10/20/2017) and X10DRi-T (Bios 2.1a, Release Date: 05/05/2017) motherboards which have PCIe GEN 3 slots only. For both the motherboards the PCIe link speed was changed from Auto to Gen1 in the BIOS. The card was not detected by the X11SAT-F motherboard, however it was detected by X10DRi-T. Hauppauge techsupport said "The board is not supported on those Xeon Supermicro motherboards. We had discussions with Supermicro a couple of years ago about this and the simple conclusion was that the card would need a physical modification to make it work"