Hauppauge WinTV-PVR-USB2

From MythTV

Jump to: navigation, search
Hauppauge WinTV-PVR-USB2
Vendors Website http://www.hauppauge.com/pages/products/data_pvrusb2.html
Support Status Good support at 0.20
Driver pvrusb2 from http://www.isely.net/pvrusb2/pvrusb2.html (included with recent kernels).
Sound Driver N/A (audio encoded in MPEG-2 stream)
Chipset 29xxx: msp3400 (audio processor) plus an saa7115 (video decoder); 24xxx: cx25840 (audio processor) plus an saa7115 (video decoder)



Note: This device is not the same as the Hauppauge WinTV-USB2, which is a less expensive (and less capable) device. The Hauppauge WinTV Nova-T USB2 is another model with a confusingly similar name. See the photo of the WinTV-PVR-USB2 if you're in doubt about what you've got (or want to buy). A Mac variant of the PVR-USB2 is reported to work with the pvrusb2 driver.

The WinTV-PVR-USB2 and its remote
The WinTV-PVR-USB2 and its remote


Contents

Description

The Hauppauge WinTV-PVR-USB2 is an external video capture device that supports hardware MPEG-2 encoding. To software, it looks much like the Hauppauge WinTV PVR-x50 PCI cards, but it's a USB device, making it suitable for use with laptops and systems that have no free PCI slots. As an external device, it's also likely to be less susceptible to RF interference from internal computer components. Mine produces a cleaner image than internal capture cards from three different manufacturers, for instance. As of early 2007, these devices sell for about US$150 in common brick-and-mortar retailers, or a bit less from most mail-order sources.

As an MPEG-2 encoding device, the WinTV-PVR-USB2 requires little CPU power to operate. On a system with a 3.06GHz Celeron-D running 32-bit Ubuntu 6.10, the device consumes between 0.2% and 2% of CPU time, according to top. Hauppauge claims that the WinTV-PVR-USB2 may be used on a USB 1.1 port, but USB 2.0 is recommended.

The package ships with:

  • The main receiver unit (shown in photo)
  • A 44-button remote control (shown in photo), model RC6, complete with ugly Windows logo
  • Two AA batteries for the remote
  • FM radio antenna
  • "Wall wart" power supply
  • Driver CD-ROM (believe it or not, you will need this, or a download from the Hauppauge Web site, for Linux)
  • Quick installation guide
  • IR transmitter cable
  • USB-interfaced remote control receiver/IR blaster box (see below)

The WinTV-PVR-USB2 is available in two types of packaging: A Media Center Kit version ships with all of the above items, but the MCE edition omits the remote receiver/IR blaster box.

Connections on the main unit are (clockwise from top-left in the photo):

  • S-video input
  • Composite video input
  • Left audio input (RCA jack)
  • Right audio input (RCA jack)
  • Power supply input
  • USB cable connector
  • Coaxial input for TV antenna or cable
  • Coaxial input for FM radio antenna

A red LED near the S-video input lights up when the unit is delivering a signal to the computer.

To date (2/2007), two versions of the WinTV-PVR-USB2 have been released. These are referred to as the 29xxx and 24xxx versions, based on USB device IDs (2040:2900 or 2040:2400) and a model number printed on a sticker on the bottom of the device. Confusingly, the 24xxx version is the newer of the two. The firmware and drivers required for the two versions are slightly different, but both versions are supported. This wiki entry is based on experiences with a 24xxx model.

Driver Installation Overview

You can learn how to install drivers for the hardware at the Web site of the driver's developer, Mike Isely. In brief, you can use drivers from one of three sources: a 2.6.18 or later Linux kernel, a driver included in the V4L source tree, or a standalone driver provided by its maintainer. This page is based mainly on experiences with the driver provided with the 2.6.20 kernel; however, I've recently switched to the standalone driver from Isely's site (see the Issues and Problems section).

Although you should refer to Isely's Web site for complete installation instructions, the basic steps are:

  • Compile an appropriate pvrusb2 driver and support drivers (note that you do not need the ivtv drivers used by Hauppauge WinTV PVR-x50/500 PCI cards)
  • Extract firmware files from your Windows driver CD using a script provided on Isely's Web site
  • Place those firmware files in an appropriate directory
  • Configure your system to auto-load the firmware using hotplug or udev (udev worked for me without requiring modifications)
  • Configure your system to auto-load the drivers and their support modules (this worked without modifications on an Ubuntu 6.10 system)

There are a large number of support drivers and other details, described on Isely's Web site. You should at least skim that site, including relevant subpages, and carefully read the sections of importance to your configuration.

Verifying Driver Installation

Once you've finished installing the drivers, you should verify that the device is available. First, check for an appropriate video file. If this is your only video capture device, it will probably be /dev/video or /dev/video0.

If the device file is present, you can test it by passing it to mplayer, as in mplayer /dev/video0. This should produce a video stream using whatever channel or input the device is configured to use. Alternatively, you can try using cat to copy a video stream to a file, which you can then examine using tools that can handle MPEG-2 video:

cat /dev/video0 > foo.mpeg

Note that you might get a blank display if the device is set to an input you're not using.

TV applications might or might not produce a useable display, since they might or might not work with an MPEG-2 stream. Mike Isely's Driver Usage Information page provides details for some common tools.

If you have problems or want to check some low-level configurations, you can review driver installation and USB bus options. As a reference, here are the modules loaded on one system that works with a 24xxx device:

$ lsmod | grep pvrusb2
pvrusb2               131796  2
cx2341x                11780  1 pvrusb2
tveeprom               15120  2 pvrusb2,cx88xx
videodev               27648  5 pvrusb2,cx8800,cx88xx
v4l2_common            24064  6 cx25840,tuner,pvrusb2,cx2341x,cx8800,videodev
v4l1_compat            14468  3 pvrusb2,cx8800,videodev
usbcore               128792  4 pvrusb2,ehci_hcd,uhci_hcd
i2c_core               22032  8 wm8775,cx25840,tuner,pvrusb2,cx88xx,i2c_algo_bit,tveeprom,i2c_viapro

The /proc/bus/usb/devices entry for the device looks like this:

T:  Bus=05 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=2040 ProdID=2400 Rev= 8.00
S:  Manufacturer=Hauppauge
S:  Product=WinTV
S:  SerialNumber=2401-00-00834D90
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 6 Cls=ff(vend.) Sub=ff Prot=ff Driver=pvrusb2
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

Finally, here are the kernel messages from the drivers being loaded, as reported in dmesg output:

Linux video capture interface: v2.00
usbcore: registered new interface driver pvrusb2
drivers/media/video/pvrusb2/pvrusb2-main.c: Hauppauge WinTV-PVR-USB2 MPEG2 Encoder/Tuner : V4L in-tree version
drivers/media/video/pvrusb2/pvrusb2-main.c: Debug mask is 15 (0xf)
**WARNING** I2C adapter driver [pvrusb2_a] forgot to specify physical device; fix it!
tuner 2-0043: chip found @ 0x86 (pvrusb2_a)
tda9887 2-0043: tda988[5/6/7] found @ 0x43 (tuner)
tuner 2-0061: chip found @ 0xc2 (pvrusb2_a)
cx25840 2-0044: cx25843-23 found @ 0x88 (pvrusb2_a)
cx25840 2-0044: loaded v4l-cx25840.fw firmware (16382 bytes)
wm8775 2-001b: chip found @ 0x36 (pvrusb2_a)
tveeprom 2-00a2: Hauppauge model 24012, rev D3A3, serial# 8605072
tveeprom 2-00a2: tuner model is TCL MFNM05-4 (idx 103, type 43)
tveeprom 2-00a2: TV standards NTSC(M) (eeprom 0x08)
tveeprom 2-00a2: audio processor is CX25843 (idx 37)
tveeprom 2-00a2: decoder processor is CX25843 (idx 30)
tveeprom 2-00a2: has radio, has IR receiver, has no IR transmitter
tuner 2-0061: type set to 43 (Philips NTSC MK3 (FM1236MK3 or FM1236/F))
tda9887 2-0043: Data bytes: b=0x14 c=0x30 e=0x44
tuner 2-0061: Tuner mode:      analog TV
tuner 2-0061: Frequency:       175.25 MHz
tuner 2-0061: Standard:        0x00000100
cx25840 2-0044: Video signal:              not present
cx25840 2-0044: Detected format:           NTSC-M
cx25840 2-0044: Specified standard:        PAL-M
cx25840 2-0044: Specified video input:     Composite 7
cx25840 2-0044: Specified audioclock freq: 48000 Hz
cx25840 2-0044: Detected audio mode:       forced mode
cx25840 2-0044: Detected audio standard:   forced audio standard
cx25840 2-0044: Audio muted:               yes
cx25840 2-0044: Audio microcontroller:     running
cx25840 2-0044: Configured audio standard: automatic detection
cx25840 2-0044: Configured audio system:   BTSC
cx25840 2-0044: Specified audio input:     Tuner (In8)
cx25840 2-0044: Preferred audio mode:      stereo
wm8775 2-001b: Input: 2
pvrusb2: Device initialization completed successfully.
pvrusb2: registered device video1 [mpeg]

Note that I've omitted quite a few dmesg lines unrelated to the PVR-USB2.

Of course, some details will differ on your system, particularly if you build relevant drivers into your kernel -- they won't then show up in the lsmod output.

MythTV Configuration

Once the drivers are installed and appear to be working, you can configure the device in MythTV. For the most part, you should be able to treat the encoder as if it were a Hauppauge WinTV PVR-x50/500 card: Tell MythTV that it's an MPEG encoding card, not an "Analog V4L capture card." The User Manual:Detailed configuration Backend section of this wiki describes MythTV backend configuration in more detail.

One caveat: On my system, the backend reported that it couldn't detect any MPEG decoding devices. Despite this fact, entering the device name (/dev/video1 in my case) and proceeding with configuration worked.

Some systems do not provide root access to the mythtv-setup program, and as a result, you may not be able to access the device while in the Capture Card setup screen. To fix this, open a terminal and access mythtv-setup by typing sudo mythtv-setup instead, after which the device should be recognized.

In the frontend, you can tweak your Recording Profiles in the usual way.

Issues and Problems

  • Mike Isely recommends disabling the use of VBI (a backend configuration feature; VBI carries closed captioning data). The driver doesn't (yet?) support VBI, and enabling it creates log file entries about missing ioctl() functions. These entries are probably harmless, though.
  • If "NVR: Won't work with the streaming interface, falling back VIDIOCGMBUF:: Invalid argument" appears in the mythbackend.log, it might be due to the incorrect capture device being selected. It should be "MPEG-2 encoder card (PVR-x50, PVR-500)." Probed Info may remain blank. Just go ahead and type in the /dev/video0 or /dev/video1. Only then will the "Probed Info" show Hauppauge PVR USB
  • In 2.6.24 and some earlier kernels, the pvrusb2 driver does not set video_gop_size to 15 for NTSC signals. In MythTV, the result is that the displayed recorded show length of NTSC is 125% the actual length (a 1-hour show displays as 1:15) and jumping to a 'marked position' doesn't work. The solution today is to force video_gop_size to 15 using the sysfs interface (you have to be root do do this):echo 15 > /sys/class/pvrusb2/SERIALNUMBER/ctl_video_gop_size/cur_val where SERIALNUMBER is the serial number of your device (ls in /sys/class/pvrusb2 to find it). See http://ubuntuforums.org/showthread.php?t=837607 for a more detailed description of the workaround and some references to technical descriptions of the problem. The video_gop_size problem is fixed in the the 20080629 pvrusb2 driver snapshot at http://www.isely.net/pvrusb2/download.html. This fix will probably make it to a future kernel (and it's reported to be fixed in 2.6.27).
  • The driver and MythTV seem to use different methods for setting the recording bitrate; all shows are recorded at 6,000,000 bps. This value can be changed by cating another value into the /sys/class/pvrusb2/sn-*/ctl_video_bitrate/cur_val file, where * varies from one device to another. If you want to customize your bitrate on a show-by-show basis to fine-tune disk requirements, your best bet at this point is to transcode some or all of your shows into MPEG-4 form after recording them. A brief message about this issue from Mike Isely appears on his mailing list.
  • As of 2.6.24, the driver still seems to (very rarely) get in a mode in which it records shows of 0 size, or just the last few minutes of a show. The mythbackend logs report "Error: select timeout - ivtv driver has stopped responding". If you encounter this issue, please post to the pvrusb2 mailing list http://www.isely.net/cgi-bin/mailman/listinfo/pvrusb2. There's a long thread starting in August 2008 "pvrusb2 timeout?" that discusses this issue. This might be related to the note below re: 2.6.20. Workaround seems to be to plug and unplug USB which reloads the driver.

If you know of other problems or workarounds or fixes for those described here, please update this section accordingly.

Old Issues that Probably Don't Exist in 2.6.24+ Kernels

  • I've occasionally seen extreme blockiness in the top 1/4 or so of the screen. I've seen a few references to this problem in the PVR-USB2 mailing list archives. It seems to crop up when changing channels quickly (that is, when channel surfing). This issue is fixed in Linux 2.6.21 and standalone driver version 20070127.
  • As of Linux 2.6.20, the in-kernel driver occasionally gets into a state where it won't record anything. (Recorded shows have file sizes of 0.) Unloading and re-inserting the driver didn't always help when this happened. Replacing the driver provided with the 2.6.20 kernel with the standalone driver from Isely's Web site has corrected this problem, or at least reduced its likelihood of occurrence.

Using the Remote and IR Blaster

The Hauppauge WinTV Nova-T USB2 and MCE Remote pages of this wiki both include descriptions of LIRC configuration that may be relevant to the WinTV-PVR-USB2 device's IR hardware.

WARNING: The infrared receiver in these devices is not a general-purpose IR receiver. It exclusively detects codes from the provided Hauppauge remote control (and possibly other RC5 devices). This makes the input functionality of somewhat limited utility, as it cannot be used with irrecord to capture remote codes for devices that you might wish to control.

Before you do anything to try to use IR, you must make sure that all of the following kernel drivers are loaded (in this order): i2c-core i2c-algo-bit i2c-dev lirc_i2c. It may also be necessary to load lirc_mceusb2 at the end, but I'm not sure. This may depend on your hardware. In an ideal world, those modules should have been loaded automatically, but such loading is highly sporadic, at least in Ubuntu Feisty Fawn. Your mileage may vary. If you aren't seeing a /dev/lirc0 or /dev/lirc/0 device file, one of these modules is probably not loaded. If your installation does not come with lirc_i2c, you will need to build it by choosing "Hauppauge TV Card" under the "TV Card" heading in the lirc configuration tool. Build lirc and install it.

The next problem is that there are at least four versions of the PVRUSB2 hardware, and the driver you choose depends on which version of the hardware you are using (I -think-).

The first two versions are the 29xxx and early 24xxx devices with built-in IR receivers and no IR blaster. If you are using the 29xxx, the IR hardware appears as an actual I2C bus, and on early 24xxx hardware, the pvrusb2 driver simulates an I2C bus. For both of those devices, I believe the correct choice is "Hauppauge TV Card (new I2C layer required)" under TV cards in the setup menu, though the WinTV Nova-T mentioned above might also work. I can only confirm that the Hauppauge TV Card driver successfully reads bytes from the driver, but I do not know whether it actually works because my hardware is a newer version that doesn't work the same way.

The third version of the hardware is the "Media Center Edition". This comes with a Windows Media Center remote control and a separate IR pod. There is no IR built into this version of the Hauppauge box as best I can tell. With that version, if you hare using the newest (blaster-equipped) version, instead of choosing an I2C driver, you must use the Windows Media Center Remote (mceusb2) driver. This is labeled "Windows Media Center Remotes (new version, Philips et al)" under "USB Devices" in the setup menu. If the pvrusb2 driver is able to detect that there is no IR hardware, things should just work at that point, and there should be exactly one lirc device, /dev/lirc0 (or /dev/lirc/0). If it doesn't, you'll either need to disable the fake I2C bus or tell lircd to use /dev/lirc1 (or /dev/lirc/1) instead of /dev/lirc0 (or /dev/lirc/0).

If you are using recent (April 28, 2007 or later) driver snapshots, you can disable the fake I2C bus if it there (to avoid confusion) by passing the flag "ir_mode=0" when loading the pvrusb2 kernel module. If you are using an older version of the driver, it is probably easier just to pass "-d /dev/lirc1" when starting lircd. Disabling the lirc_i2c module might have the same effect, but I don't have one of these devices to try that.

NOTE: The lirc_mceusb2 driver is broken in lirc version 0.8.1 and will not compile. Use either an earlier version or a later version.

The fourth version of the hardware comes with a built-in IR receiver just like the original versions. However, they include an extra 1/8" stereo jack on the device for an IR blaster. On the latest versions of the hardware (the version with the external IR blaster), the pvrusb2 driver's fake I2C bus is completely bogus because the IR hardware on the newer version is completely different. It does NOT use the mceusb2 driver, however. It presents a PVR150-compatible I2C bus. This means that you should use the Hauppauge TV Card option for this device. Because the pvrusb2 driver can't tell that this version of the hardware doesn't need the fake I2C hardware, it generates a fake I2C interface that shows up as /dev/lirc0 (or /dev/lirc/0). The real one is /dev/lirc1 (or /dev/lirc/1).

As with the MCE kit, you can disable the fake device by passing the flag "ir_mode=0" when loading the pvrusb2 driver, or you can change lircd to use /dev/lirc1 (or /dev/lirc/1) by passing "-d /dev/lirc1" when you start it.

I'm not certain, but I don't think that the lirc_i2c driver provided with lirc 0.8.1 works. I only had success with 0.8.2pre2. Further, the blaster does not currently appear to be usable at this time. the lirc_i2c driver identifies the working IR hardware as being a "Hauppauge IR (PVR150" device, so presumably if you can find a version of lirc that actually works correctly for the PVR150, it should work for this latest version of the PVR-USB2.

Relevant Links

Related Hauppauge products:

Additional wiki entries:

External links:

Personal tools