Difference between revisions of "Hauppauge HVR-1600"

From MythTV Official Wiki
Jump to: navigation, search
(Options for Linux Drivers)
(Added a Note box in the "Startup Script for Analog Tuner" section advising users with a recent kernel to build and intall the driver as described in the "Installation Guide" section of this wiki page.)
Line 47: Line 47:
 
== Installation Guide ==
 
== Installation Guide ==
  
{{Note box|The drivers released and included in recent kernels contain a bug which may cause stuttering while watching TV, so it will be necessary to build them yourself. }}
+
{{Note box|
 +
The drivers released and included in recent kernels contain a bug which may cause stuttering while watching TV, so it will be necessary to build them yourself.  
 +
}}
  
 
===Drivers===
 
===Drivers===
Line 149: Line 151:
  
 
===Startup Script for Analog Tuner===
 
===Startup Script for Analog Tuner===
 +
{{Note box|
 +
If you're running a recent Linux kernel, then building and installing the drivers (see [[Hauppauge_HVR-1600#Installation Guide|"Installation Guide"]] above) will most likely address this issue.  Hopefully this driver issue will be resolved in a future kernel release.
 +
}}
 +
 
Because the first analog capture after system startup experiences dropped frames and/or no audio, you may want to add a script to use the analog tuner on startup so that your first recording isn't garbled. The following script reads 2MB (1-2 seconds) of data from the analog tuner and throws the data away.
 
Because the first analog capture after system startup experiences dropped frames and/or no audio, you may want to add a script to use the analog tuner on startup so that your first recording isn't garbled. The following script reads 2MB (1-2 seconds) of data from the analog tuner and throws the data away.
  

Revision as of 17:25, 10 October 2009

The Hauppauge HVR-1600 dual tuner capture card


WinTV-HVR-1600
Vendors Website http://www.hauppauge.com/site/products/data_hvr1600.html
Input Formats not applicable
Support Status Works with MythTV 0.21, but not explicitly supported
Driver Linux cx18 driver
Sound Driver Not needed, the hardware encoder will multiplex the audio with the video stream.
Chipset Conexant CX23418 MPEG-2 encoder, and CX24227 ATSC demodulator


The Hauppauge WinTV-HVR-1600 is a dual tuner ATSC/NTSC capture board by Hauppauge Computer Works. The card is PCI based, and is designed for use in North America where NTSC and ATSC signals are used for television broadcast. Non-NTSC analog baseband video can be captured using the basedband video input (CVBS or S-Video).

Description

The HVR-1600 is a capture card from Hauppauge (pronounced /hɔphɔg/ like the Hamlet on Long Island, New York where the company originated and still resides) Computer Works. The design is made entirely of Conexant chips. The Conexant CX23418 is the TV broadcast decoder, MPEG2 encoder, and host bus interface chip. The CX23418 is the next generation of the CX23416 that was used on the very well supported PVR-150 and PVR-500 series cards, it combines the hardware encoding engine of the CX23416 with a CX25843 broadcast decoder/digitizer core on one chip. The only other chip worth mentioning is the new Conexent CX24227 ATSC demodulator used for digital TV reception. The retail version of the card supports and comes with an IR Blaster and Receiver, as well as a Remote. The over-the-air tuner supports all ATSC formats, up to the high definition 1080i format. Some of the HVR-1600's (product code 74021 and 74041 found on the tuner label) also support Clear QAM, which is most likely the stuff your cable company uses for your local HD channels. Again the analog tuner supports encoding NTSC into MPEG-2 at 720x480 resolution with a data rate of up to 12Mbits/sec.

IVTV Heritage

The HVR-1600 and other CX23418 based cards are not supported by the ivtv driver. They are supported by the cx18 driver. For more information see: http://ivtvdriver.org/index.php/Cx18

The cx18 driver code is based heavily on the ivtv driver code; hence the strong similarity between the ivtv and cx18 driver (as far as MythTV is concerned).

Options for Linux Drivers

Drivers included in recent kernels may contain a bug which causes stuttering in TV playback. Concurrent Analog and ATSC capture are working with current driver. The latest stable version can be found here: http://www.linuxtv.org/wiki/index.php/How_to_Obtain,_Build_and_Install_V4L-DVB_Device_Drivers

Output Messages

Further information that may be useful are the following lspci command outputs.

lspci returns

      02:02.0 Multimedia video controller: Conexant Unknown device 5b7a

lspci -vn

  02:02.0 0400: 14f1:5b7a
       Subsystem: 0070:7404
       Flags: bus master, medium devsel, latency 64, IRQ 5
       Memory at f8000000 (32-bit, non-prefetchable) [size=64M]
       Capabilities: <access denied>

lspci -v

   02:02.0 Multimedia video controller: Conexant Unknown device 5b7a
       Subsystem: Hauppauge computer works Inc. Unknown device 7404
       Flags: bus master, medium devsel, latency 64, IRQ 5
       Memory at f8000000 (32-bit, non-prefetchable) [size=64M]
       Capabilities: <access denied>


Installation Guide

Important.png Note: The drivers released and included in recent kernels contain a bug which may cause stuttering while watching TV, so it will be necessary to build them yourself.

Drivers

New drivers are needed for this card provided by linuxtv.org.

http://www.linuxtv.org/wiki/index.php/How_to_Obtain,_Build_and_Install_V4L-DVB_Device_Drivers

  • Stop the MythBackend to avoid receiving errors while installing these drivers.
 sudo /etc/init.d/mythtv-backend stop
  • Download the latest.
 sudo apt-get install mercurial linux-headers-`uname -r` build-essential
 for Fedora: yum install mercurial linux-headers-`uname -r` build-essential
 hg clone http://linuxtv.org/hg/v4l-dvb
  • Pre-Compilation Steps
 cd v4l-dvb
 sudo make rminstall
 sudo make distclean 
 sudo make menuconfig  (default selections should be appropriate)
  • Compile and add the module to the kernel:
 make
 sudo make install

Firmware

Conexant gave permission to redistribute the firmware files. The firmware from ivtvdriver.org may contain the bug that causes a stuttering problem.

Instead you will need to get the firmware from the linuxtv.org site. The firmware from yum repositories may not have the right version either.

http://linuxtv.org/downloads/firmware/

  • Get the firmware files and copy the files to the firmware directory (usually under /lib/firmware/).
wget http://linuxtv.org/downloads/firmware/v4l-cx23418-cpu.fw
wget http://linuxtv.org/downloads/firmware/v4l-cx23418-apu.fw
wget http://linuxtv.org/downloads/firmware/v4l-cx23418-dig.fw
sudo cp cx18-firmware/*.fw /lib/firmware              # Preferred.
...or...
sudo cp cx18-firmware/*.fw /lib/firmware/`uname -r`   # Repeat after kernel updates.

Reboot

  • If one or both of the previous steps were done:
 sudo shutdown -r now
  • Verify that everything was installed correctly. Expect the following (probably more):
 dmesg | grep cx18
 [    8.651532] cx18:  Start initialization, version 1.0.1
 [    8.651572] cx18-0: Initializing card #0
 [    8.651575] cx18-0: Autodetected Hauppauge card
 [   23.555603] cx18-0: loaded v4l-cx23418-apu.fw firmware V00120000 (141200 bytes)
 [   24.227119] cx18-0: loaded v4l-cx23418-cpu.fw firmware (158332 bytes)
 [   25.651060] cx18-0: loaded v4l-cx23418-dig.fw firmware (16382 bytes)


Important.png Note: The Drivers, Firmware and Reboot sections may need be repeated after each kernel update. When these drivers are out of beta, this will hopefully all be handled by the package manager.


Backend Setup

  • Configure MythTV to use both "halves" of the card
  1. Enter mythsetup and go to Capture cards
  2. Select (New capture card)


  • Configure the analog half of the card like a supported MPEG-2 Encoder PVR-150 card. Treating the analog half of the card as an ivtv based card in MythTV works as the cx18 driver is heavily based on (i.e. cut and pasted from) the ivtv driver.
  1. Under Card type, choose IVTV MPEG-2 encoder (or MPEG-2 encoder card (PVR-x50, PVR-500)). Do not select Analog V4L capture
  2. Choose the correct video device (usually /dev/video0 unless there is more than one card). Note: if the video device is not listed and a could not open to probe its inputs message appears, add /dev/video0 manually
  3. Probed info should populate with Hauppauge HVR-1600 [cx18]
  4. To use NTSC RF from an antenna or cable TV provider, choose 'Tuner 1' under Default input
  5. Select Finish.


  • Configure the ATSC (digital) half of the card as any other DVB DTV capture card
  1. Add another tuner card
  2. Under Card type choose 'DVB DTV capture card (v3.x)'.
  3. Choose the correct value under DVB Device Number (usually 0, this should be the same number appended to /dev/video when configuring the analog portion of the card). Starting with 0.22, this field will be a string like: /dev/dvb/adapter0/frontend0. A second card would be /dev/dvb/adapter1/frontend0.
  4. Frontend ID should populate to something like "Samsung S5H1409 QAM/Subtype: ATSC'.
  5. Select Recording Options.
  6. Change Max recordings to 1, since this card can only record one thing at a time.
  7. Select Finish.
  8. Select Finish again.


  • Under 'Video Sources' create two video sources, one for each half of the card. I called mine 'Analog' and 'Digital'.


  • To scan for channels:
  1. Go back to the main menu an select Input connections, then select the correct DVB input for the card just configured.
  2. Set the video source to 'Digital', created in step 4.
  3. Select Scan for channels.
  4. A DVB device should be selected under Input.
  5. Scan Type should be 'Full Scan'.
  6. For cable, change Frequency Table to 'Cable' (you'll probably want to use 'Cable High' since most QAM channels are in the high range).
  7. For cable, change Modulation to 'Cable (QAM-256)'. All U.S. cable companies either use QAM-256 or QAM-64, most including Comcast use QAM-256.
  8. Choose an ATSC Channel Separator (most television tuners use a period).
  9. Select Next and then wait for the scan to complete. This may take a while.
  10. When it's done scanning, select Finish


MythTV has been known to have some issues scanning for all ATSC channels, see Adding Digital Cable Channels (For ATSC/QAM Tuner Cards -- USA/Canada) for more information.

Startup Script for Analog Tuner

Important.png Note: If you're running a recent Linux kernel, then building and installing the drivers (see "Installation Guide" above) will most likely address this issue. Hopefully this driver issue will be resolved in a future kernel release.

Because the first analog capture after system startup experiences dropped frames and/or no audio, you may want to add a script to use the analog tuner on startup so that your first recording isn't garbled. The following script reads 2MB (1-2 seconds) of data from the analog tuner and throws the data away.

  • Save this script as tune.sh (probably in /usr/share/mythtv).
  #!/bin/bash
  function tune {
    # Make sure an argument was passed.
    if [ -z "$1" ]; then echo "Use: $0 /dev/<device>" ; return ; fi
    # Try to make sure we're working with a /dev/xxx item.
    if [ -c "$1" ]; then
       dd if=$1 bs=1024k count=2 &>/dev/null
    else
      echo "Error: $1 is not a device."
      return
    fi
  }
  
  tune "/dev/video0"
  • Repeat the last line for each of the analog tuners installed, (tune /dev/video0, tune /dev/video1, etc.)
  • In MythSetup under General > Shutdown/Wakeup Options, under Startup Command put "bash /usr/share/mythtv/tune.sh" (or whatever the path to the script is). Or call this from an existing script.

IR Transmitter

A cable set top box, for example, can be controlled by this card's IR transmitter.

Information.png Tip: Type in the next line. Then configure as needed.

 dmesg|egrep "haup-ir-blaster|pvr150"
 20.123294] lirc_pvr150: chip found with RX and TX
 20.123400] i2c ir driver 4-0070: firmware: requesting haup-ir-blaster.bin
 20.234544] lirc_pvr150: firmware of size 302355 loaded
 20.234780] lirc_pvr150: 743 codesets loaded
 20.278765] lirc_pvr150: Hauppauge PVR-150 IR blaster: firmware version 2.1.
  • See this page for details.
  • If the firmware lines are missing,start at step 6.
  • And/Or start at step 8 for setting up a specific device.

Resources

Here are some resources to take a look at. The data sheets for the Hauppauge HVR-1600 and the Conexant CX23418 MPEG-2 encoder chip.

The mailing lists at http://www.ivtvdriver.org where use and development of the cx18 driver is discussed for the HVR-1600 and other CX23418 based cards.

Hauppauge product page for the HVR-1600

Conexant product page for the CX23418-chip


This is a link to the linuxtv.org page that lists currently supported cards, as well as the unsupported cards.

 From the Hauppauge product support page:
 "Linux support for the WinTV-HVR-1600 is in the upcoming kernel 2.6.26 release. Also, there is WinTV-HVR-1600
  Linux support for both the analog TV tuner and the digital TV tuner available at LinuxTV.ORG in the "cx18"
  section."