Hauppauge WinTV-HVR-3000: Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 130: Line 130:
On Ubuntu Jaunty with the latest kernel trying to use DVB-T:
On Ubuntu Jaunty with the latest kernel trying to use DVB-T:


# dvbscan -frontend 1 -demux 1 /usr/share/dvb-apps/dvb-t/(the new zealand one?) > channels.conf
# dvbscan -frontend 1 -demux 1 /usr/share/dvb-apps/dvb-t/(the new zealand one?) > channels.conf
Unable to query frontend
Unable to query frontend


==Testing==
==Testing==

Revision as of 22:05, 19 August 2009

Hvr3000.jpg

The Hauppauge WinTV-HVR-3000 is a DVB-T and DVB-S on one PCI card sharing the same Demux.

Kernel Support

Kernels 2.6.28-rc1 and later have a working multiple frontend driver built in.

Darron Broad & Fabio M. Di Nitto HVR3000/4000 comes in two flavours as a diff patch, one with a single frontend (you select frontend via options flag in modprobe.conf eg single /dev/adapter0/fe0) and the other with both frontends (selectable from adapter0/fe0 and adapter fe1)

This uses work from Steve Toths original HVR3000 repository (at time of writing 16 months old and will not compile with current v4l-dvb)

There are several sets of patches at http://people.debian.org/~pm/hauppauge/ : a single frontend patch only for HVR3000 against 2.6.26-rc version kernels, and several revisions of Darron Broad's multiple frontend scratcpad-8628.diff patch (from http://dev.kewl.org/hauppauge ), cleaned up and updated for v4l-dvb revisions 8628 and 8854.

Steve Toth's repository (22 Sep 2008)

On September 2008, you can get patched v4l sources from Steve Toth's repository ( http://linuxtv.org/hg/~stoth/s2-mfe/ ) via mercurial and you won't have to get any patch to get working this card (this version also has got support for HVR4000). It has been tested on Ubuntu 8.04.1 (working DVB-T and DVB-S, analogue audio didn't work for me) with a 2.6.24-21-generic kernel version/flavour. The way to compile the modules is the same as it would be getting the official v4l sources but without having to patch them. The way to get the v4l "patch included" sources is (supposing that you have mercurial installed):

 # hg clone -r 8894 http://linuxtv.org/hg/~stoth/s2-mfe

After it, on the s2-mfe directory you get a patched version of the v4l drivers. Maybe you will want/need to configure it, with a "make menuconfig". Finally, just compile and install the modules:

 # make && make install

Remember: on ubuntu you need to delete the "original" modules for cx88 and saa7134

 # rm -rf /lib/modules/`uname -r`/ubuntu/media/cx88
 # rm -rf /lib/modules/`uname -r`/ubuntu/media/saa7134
 # depmod -a

To load modules on the right order, follow the next bash script:

#!/bin/bash
modprobe cx8800 && modprobe cx88xx && modprobe cx8802 && modprobe cx22702 && modprobe cx88-dvb && \
echo "Successfully loaded HVR-3000 modules"
exit

On Ubuntu 8.10 Intrepid, when kernel changed from 2.6.27-7 to 2.6.27-9 or to 2.6.27-11, you must delete the previous kernel headers 2.6.27-nn, the old modules in directories cx88 and saa7134 (they are now in /lib/modules/`uname -r`/kernel/drivers/media/video/. ), do a depmod -a, then download the new s2-mfe tree, recompile and reinstall.

kewl.org HVR3000 (06 Mar 08)

Please follow these instructions based on FC8/Ubuntu 8.04 using yum or apt-get.

# yum install mercurial

Or

# apt-get install mercurial

As the current patch does NOT work with the current version of v4l you will have to pull a working revision from the repository. In order to do that you will have to install one of the newer versions of mercurial. So if your version of Mercurial doesn't support revisions you will have to get an updated package or compile a current version yourself.

# hg clone -r 7285 http://linuxtv.org/hg/v4l-dvb
# cd v4l-dvb

Or (Plan B Tested on 2.6.22 ====DVB-S==== Only)

# hg clone -r 7879 http://linuxtv.org/hg/v4l-dvb  
# cd v4l-dvb

Then get the diff you want (sfe or mfe). Note how the filename represents the version of the v4l repository that you have to use. You can also check at http://dev.kewl.org/hauppauge if a newer version of the patch exists and use another version of the repository accordingly.

# wget http://dev.kewl.org/hauppauge/sfe-7285.diff

Or

# wget http://dev.kewl.org/hauppauge/mfe-7285.diff

Or (Plan B Tested on 2.6.22 ====DVB-S==== Only)

# wget http://linuxtreme.net/Drivers/Patches/sfe.diff


Apply the patch

# patch -p1 < *fe-7285.diff

Or (Plan B Tested on 2.6.22 ====DVB-S==== Only)

# patch -p1 < sfe.diff

(Optional) Remove modules from *buntu 8.04

This step is only required if you are running an Ubuntu variant, after one of their bug fixes duplicated the modules being run.
This also may be useful to anyone who gets dmesg errors like : cx88xx: disagrees about version of symbol (videobuf_dma_free)
# rm -rf /lib/modules/`uname -r`/ubuntu/media/cx88
# rm -rf /lib/modules/`uname -r`/ubuntu/media/saa7134
# depmod -a


Compile and Install

# make
# make install


If you apply the patch and get errors, you can contact Darron at kewl dot org whom will most likely refresh the patch against the latest v4l-dvb, or jarb1 at uk2 dot net whom has a tar.gz copy of the v4l-dvb the above patch works with (Well works with FC8 2.6.23 anyway)

(With plan B ====DVB-S==== Only; No further configuration is applicable; You may configure the Kaffiene and watch Sat on Linux :))

Single Frontend Diff (sfe)

Now all you need to do is edit /etc/modprobe.conf to have

This option will load the DVB-S/S2 frontend and is the default:
options cx88-dvb frontend=0

This option will load the DVB-T frontend:
options cx88-dvb frontend=1

NOTE: On Debian and Ubuntu Systems you will have to enter /etc/modprobe.d/ and create a custom named file that holds the above mentioned content.

Multiple Frontend Diff (mfe)

No further configuration is applicable.

Enter directory /dev/dvb/adapterX for the HVR3000 and you should see more than one frontend (eg. demux0 demux1 dvr0 dvr1 frontend0 frontend1 net0 net1). If you only see one of each then the HVR3000 has not installed correctly and your kernel is running the release version of V4l_DVB which presently has no support for the DVB-S side of HVR3000.

If the module has not loaded (/sbin/lsmod) try

# modprobe cx88_dvb


Problems

On Ubuntu Hardy with the latest kernel the driver doesn't survive suspend/resume. tested with Mythtv using Plan A (sfe). On Ubuntu Jaunty with the latest kernel trying to use DVB-T:

# dvbscan -frontend 1 -demux 1 /usr/share/dvb-apps/dvb-t/(the new zealand one?) > channels.conf
Unable to query frontend

Testing

Untested by myself (jarb1) is analogue TV

DVB-T

To test the card the following command for testing the DVB-T can be used. Use the relevant channel info in the dvb-t folder for your transmitter.

# scandvb /usr/share/dvb-apps/dvb-t/uk-EmleyMoor > channels.conf 

If the card is working this will create a channels.conf file with the channel information

To test you can copy the channels.conf into your ~/.mplayer folder and view with mplayer by issuing a command like

# mplayer dvb://0@'BBC ONE'

Note : Some dvb-apps : scandvb is dvbscan

DVB-S

For testing DVB-S we also use scan DVB with the provided initial tuning data. Use the correct data for your satelite. Note the -f (frontend) and -d demux options to select the correct fe. You can also specify which DVB adapter by adding option -a 2 for /dev/dvb/adapter2 etc.

# scandvb -f 1 -d 1 /usr/share/dvb-apps/dvb-s/Astra28.2E > channels.conf

The method shown in DVB-T can be used to view the channel. Or you can use dvbstream to stream it into mplayer. Example.

# /sbin/dvbstream -o -f 12421 2343 2345 -p H -s 27500 -c 2 | mplayer - 

MythTv users don't forget to set the Diseqc option to LNB if you have a basic sat dish.

Sound

This part of the article is original and has not been rewritten since Steve Toths version as I use the onboard sound card.

To hear sound from the card you will need to pipe the sound output from the cards sound device back into your sound card. There are a number of ways of doing it, but I only managed to make 1 work properly. In theory you can use sox to stream from one device to another, but I had problems with resampling and it just sounded wrong. You can also use arecord to get data from the alsa device, then pipe it to aplay using - as a source (stdin), but when I did that the sound came out nearly a second later than the picture. I had success only using mplayer:-

 mplayer tv://25 -tv driver=v4l2:device=/dev/video0:norm=PAL-I:chanlist=europe-west:\
                   alsa:adevice=hw.2,0:amode=1:audiorate=48000:volume=100:\
                   immediatemode=0:buffersize=32 -aspect 16:9

Where My Sky DigiBox is tuned to channel 25, my video card is /dev/video0 it's PAL-I (europe-west) and the cx88_alsa device is card2 sub 0 (ie hw.2,0). I want sound in stereo (amode=1) at 48k. I had problems with buffers overflowing, so I set the buffersize to twice what was needed and the sound is now perfect.

My Sky DigiBox is setup for a 16:9 screen, even though PAL-I isn't so the -aspect 16:9 corrects the screen size

Useful Information

Remote Control

The HVR3000 has onboard IR receiver. This can be configured by following the V4L wiki here at LinuxTV. Search Remote Contollers.

I found however when you booted with or without a keyboard and mouse the event no changed and you had to manually start lircd each time. The following bash script is a simple way of automatically determining the event no and starting lircd.

The startup script has a work around for systems with more than one HVR3000 card. Please adjust the cardno to start.

/etc/init.d/lircdhvr3000

#!/bin/bash
#
# chkconfig: 5 90 10
# description: Startup for lircd with multiple HVR3000 cards
# This will only funtion in run level 5 (X)... where else is a remote
# useful?
#
. /etc/init.d/functions
RUNAS="root"

#If we have 2 tuner cards with IR set this as 2, otherwise 1
CARDNO=2
RETVAL=0

# depending on parameter -- startup, shutdown, restart 
# of the instance and listener or usage display 
case "$1" in
   start)
       echo -n "Starting HVR3000 IR (lircd) : "
       #Determin the first IR Input card number
       EVENTNO=`cat /proc/bus/input/devices |grep HVR300 -A 4 |grep H: | grep H: -n | grep $CARDNO | grep -o event[01123456789] | grep -o [01234567890]`
       
       RESULT="Using Card : "$EVENTNO       
       echo -n $RESULT
       #Start Lircd with the right event
       daemon /usr/sbin/lircd -H dev/input -d /dev/input/event$EVENTNO
       RETVAL=$?
       echo
       touch /var/lock/subsys/lircd
       exit $RETVAL
       ;;
   stop)
       echo -n "Stopping HVR3000 IR (lircd) : "
       killproc lircd
       RETVAL=$?
       echo
       rm -f /var/lock/subsys/lircd
       exit $RETVAL
       ;;
   reload|restart)
       $0 stop
       $0 start
       exit $RETVAL
       ;;
   *) 
       echo "Usage: $0 start|stop|restart|reload"
       RETVAL=1
       ;;
esac
exit $RETVAL

Then enable the script

# /sbin/chkconfig --add lircdhvr3000
# /sbin/chkconfig --levels 5 lircdhvr3000 on

Multiple Frontends

There does not seem to be a consensus on multiple frontends and how to handle them in applications. The basic DVB apps can easily select the correct frontend, but for instance in MythTV this support is not available and will only select a complete adapter.

It is suggested to create symbolic links as follows.

mkdir /dev/dvb/adapter1 
ln /dev/dvb/adapter0/demux1 /dev/dvb/adapter1/demux0 
ln /dev/dvb/adapter0/frontend1 /dev/dvb/adapter1/frontend0 
ln /dev/dvb/adapter0/net1 /dev/dvb/adapter1/net0 
ln /dev/dvb/adapter0/dvr1 /dev/dvb/adapter1/dvr0 

But be warned it is one or the other, if your application tries to open both adapters at the same time it will fail. ITS HARDWARE not software!

External Links