Home Search {msgAddContent} Ask question {msgOpenQuestions} Help

Categories

Show all categories

  • No Categories found.

Home

change language


Linux WinTV Tuner Support

http://www.linuxlogin.com/linux/wintv.php

Linux WinTV Tuner Support

My setup includes:

WinTV Stereo

wintv stereo board

After having a lot of success with my previous TV Tuner, I decided to upgrade to a higher quality board that included more features like a FM tuner. The board I picked was a Hauppauge WinTV Radio. The board has these features

  • VHF/UHF TV Stereo Tuner (720x480 Max Res)
  • FM Stereo Radio Tuner
  • DBX-Stereo Sound
  • IR Remote Control
  • S-Video IN
  • Composit IN
  • Audio IN
  • Audio OUT

BTTV

For almost all TV boards there is a great module included with the 2.4.x+ tree called BTTV (http://bytesex.org/bttv/). This supports a ton of chipset and has lots of nice tweakable features. And since it's included in the main kernel branch life is even better. Most distrubtions include it as a loadable module that you can just modprobe or insmod.

After installing the board and loading the modules, you should see something like this in your kernel logs.

<?php
[kernel] bttv: driver version 0.9.4 loaded
[kernel] bttv: using 8 buffers with 2080k (520 pages) each for capture
[kernel] bttv0: detected: Hauppauge WinTV [card=10], PCI subsystem ID is 0070:13eb
[kernel] bttv0: using: BT878(Hauppauge (bt878)) [card=10,autodetected]
[
kernel] bttv0: Hauppauge/Voodoo msp34xx: reset line init [5]
[
kernel] tuner: chip found @ 0xc2
[kernel] tuner(bttv): type forced to 2 (Philips NTSC (FI1236,FM1236 and compatibles)) [insmod]
[
kernel] bttv0: Hauppauge eeprom: model=44371, tuner=Philips FM1236 (2), radio=yes
[kernel] tuner: type already set (2)
[
kernel] msp34xx: init: chip=MSP3435G-B6 +nicam +simple +radio
[kernel] tvaudio: TV audio decoder + audio/video mux driver
[kernel] bttv0: registered device video0
[kernel] bttv0: registered device vbi0
[kernel] bttv0: registered device radio0
?>

tvtime

Tvtime is a high quality TV viewer with lots of processing to give the best picture for your card. Along with having lots of high quality de-interlacing modes, it also has a great full screen mode.

Tvtime also supports auto-scan, naming, and enable/disabling channels. Once you have your channels setup, you can very quickly surf through them with using the mouse scroll wheel. Or any other key you want to use via-remapping it in the configuration file. Take a look at a few screenshots of version 0.9.9-pre17 below.

NOTE: These images were changed to JPEG to save bandwidth and reduce download time. So there may be JPEG artifacts from the compression, they are not from tvtime.

tvtime ss tvtime ss tvtime ss tvtime ss

gqradio

gqradio ss GQRadio is a great FM tuner app for this board. Current I'm using version 0.99 and have had no problems at all with it. Very strait forward, easy to use and has a nice range of features. It's skinnable and even has a RGB Tint so you can tweak sinks to match your fancy.

Digital VCR

If you're like me, you hate having to watch commericals. It's also sometimes hard to always be around when shows you'd like to see are on. The answer is a simple bash script and streamer which is part of the xawtv package. Streamer allows you to record from your TV card to many different formats. I use a cron job and a simple bash script to record shows and watch them later using xine to skip commericals. One nice note, by default xine skips 60 seconds (usually two commericals) so it's almost perfect for watching pre-recorded shows.

<?php
#!/bin/bash
# ================= record-tv.sh ==========================
# = copyright 2003 by Greg Watson <gwatson> =
# = GPL2 License =
# = usage record-tv.sh prefix-filename record-time channel =
# = Example: ./record-tv.sh enterprise 61:00 20 =
# ==========================================================
# Version 0.8
# Last Mod: Wed Jan 7 12:48:15 MST 2004

# Output directory
OUTPUT=$HOME/NFSHOME/vcr
# Streamer location
STREAMER=/usr/bin/streamer
# Alsa Mixer
AMIXER=/usr/bin/amixer
# v4lctl path
V4LCTL=/usr/bin/v4lctl
# Capture Volume to ensure sound is recorded (80%)
CAPTURE_VOLUME=100

# Tvtime settings file for color/brightness/contrast values
TVTIME=$HOME/.tvtime/tvtime.xml

# End of Config
###############

# check if I'm running TV, if so just exit
if [ `ps -C tvtime | grep -c tvtime` -gt 0 ]; then
echo &quot;TVtime is running, aborting recording.&quot;
exit
fi

# If the filename prefix wasn't given, set it to 'recording'
if [ -z $1 ]; then
PREFIX
=&quot;recording&quot;
else
PREFIX=$1
fi

# if time is blank, record for 30 minutes
if [ -z $2 ]; then
TIME
=&quot;30:00&quot;
else
TIME=$2
fi

if [ ! -z $3 ]; then
$V4LCTL setchannel
$3
fi

# Check for vcr dir
if [ ! -x $OUTPUT ]; then
mkdir $OUTPUT
fi

DATE
=`date +%m-%d-%Y-%H:%M`

# Set the AC97 volume to 0 (so we don't hear the sounds)
# Get mixer values first
PLAY_VOL=`$AMIXER cget name='Analog Mix Playback Volume' | grep : | sed 's/^.*=\([^,]*\).*$/\1/'`
CAP_VOL=`$AMIXER cget name='Analog Mix Capture Volume' | grep : | sed 's/^.*=\([^,]*\).*$/\1/'`
# Fix for my card since sometimes it wants to record PCM, which I DON'T Want
$AMIXER -q cset name='PCM Capture Volume' 0

$AMIXER
-q cset name='Analog Mix Playback Volume' 0
# We want to ensure that volume is set (just in case it wasn't before)
$AMIXER -q cset name='Analog Mix Capture Volume' $CAPTURE_VOLUME

# if tvtime.xml is set, then grab settings out of it
if [ -f $TVTIME ]; then
CONTRAST
=`cat ${TVTIME} | grep DefaultContrast | sed 's/^.*value=&quot;\([^&quot;]*\).*$/\1/'`
BRIGHTNESS=`cat ${TVTIME} | grep DefaultBrightness | sed 's/^.*value=&quot;\([^&quot;]*\).*$/\1/'`
COLOR=`cat ${TVTIME} | grep DefaultColour | sed 's/^.*value=&quot;\([^&quot;]*\).*$/\1/'`
HUE=`cat ${TVTIME} | grep DefaultHue | sed 's/^.*value=&quot;\([^&quot;]*\).*$/\1/'`

$V4LCTL bright ${BRIGHTNESS}% color ${COLOR}% contrast ${CONTRAST}% hue ${HUE}%
fi

$STREAMER
-p 4 -q -t ${TIME} -r 24 -q -o ${OUTPUT}/${PREFIX}-${DATE}-${TIME}.avi -j 90 -f mjpeg -F mono16

# Sometimes streamer doesn't always re-mute audio, mute it again just to be sure
$V4LCTL volume mute on

# Restore volumes
$AMIXER -q cset name='Analog Mix Playback Volume' $PLAY_VOL
$AMIXER
-q cset name='Analog Mix Capture Volume' $CAP_VOL</gwatson>
?>
Download Here

Then to use it, add a cronjob like this:

<?php
# Record Enterprise Wed 1859-2001 (start 1min early and go 1min long just to be sure)
59 18 * * Wed $HOME/vcr/record-tv.sh enterprise 62:00 20
?>

You will more then likely want to change the quality. This is just a very low quality recording but I generally don't mind as I'm watching broadcast signal anyway. This also only uses 5-10% CPU so it's not using up system resources! To improve the quality, just edit the $STREAMER line to the format you want. Supported formats can be found using streamer --help.

Last update: 2005-04-30 01:53
Author: Erkan Kaplan

printer-friendly version printer-friendly version
Send to a friend Send to a friend
Show this as PDF file Show this as PDF file
export as XML-File export as XML-File

Please rate this entry:

Average rating: 5 from 5 (1 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry

1 User online lapis Phpmyfaq