Hauppauge WinTV-HVR-3000: Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
(Added new instructions for compiling with newer kernels (jarb at uk2 net))
(Tighten up editing, add link.)
 
(32 intermediate revisions by 12 users not shown)
Line 1: Line 1:
[[Image:Hvr3000.jpg|right|]] The [[Hauppauge]] WinTV-HVR-3000 is a [[DVB-T]] and [[DVB-S]] on one [[DVB-T PCI Cards|PCI card]] sharing the same Demux.
[[Image:Hvr3000.jpg|right|]] The [[Hauppauge]] WinTV-HVR-3000 is a [[DVB-T]] and [[DVB-S]] on one [[DVB-T PCI Cards|PCI card]] sharing the same Demux.


====Kernel Support====
===Kernel Support===
[[
NEW - 2.6.20 onwards Darron Broad HVR3000/4000 with selectable frontend via options flag in modprobe.conf]]
Again for users wishing to access the HVR3000 DVB-S facility an option is open. I built this on FC8 with no issues and worked immediately. This is a diff patch on the V4L-DVB mercurial.


Kernels 2.6.28-rc1 and later have a working multiple frontend driver built in.
[[
OLD < 2.6.20 Steve Toths HVR3000 with Multiple Frontends (selectable from adapter0/fe0 and adapter fe1]]
The 2.6.19 kernel was the first stable release to include support for the DVB-T part of this card.
DVB-S works only as per instructions below, and only for kernel 2.6.19 or less. '''With Vanilla kernel 2.6.20 DVB-S does not work.''' With the vanilla kernel DVB-T and analog should work, but I could not get the card to work on an Ubuntu Feisty system. All I get are "cx88[1]/2-mpeg: cx8802_timeout" error messages. If this is no more the case please remove this note.<br/><br/>


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)
====kewl.org HVR3000 (25 Dec 07)====


This uses work from Steve Toths original HVR3000 repository (at time of writing 16 months old and will not compile with current v4l-dvb)
Please follow these instructions based on FC8 using yum or apt-get. If the wget does not work, go there with a browser to get the latest filename.

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.

===Components Used===

* Conexant CX23882 PCI Broadcast Audio/Video Decoder
* Conexant CX22702 DVB-T chip
* 14109LF Rev B3D3 Tuner

=== Identification ===
If your kernel doesn't support it
<pre>
01:06.0 Multimedia video controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder (rev 05)
Subsystem: Hauppauge computer works Inc. Unknown device 1402
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 32 (5000ns min, 13750ns max), Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 16
Region 0: Memory at f8000000 (32-bit, non-prefetchable) [size=16M]
Capabilities: [44] Vital Product Data
Capabilities: [4c] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
</pre>
If your kernel does support it
<pre>
01:06.0 Multimedia video controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder (rev 05)
Subsystem: Hauppauge computer works Inc. Device 1402
Flags: bus master, medium devsel, latency 32, IRQ 16
Memory at f8000000 (32-bit, non-prefetchable) [size=16M]
Capabilities: [44] Vital Product Data <?>
Capabilities: [4c] Power Management version 2
Kernel driver in use: cx8800
Kernel modules: cx8800
</pre>

===Driver Sources===

====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):

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

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:

<pre>
# make && make install
</pre>

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

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

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

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

''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
# yum install mercurial
Or
# hg clone http://linuxtv.org/hg/v4l-dvb
# 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
# cd v4l-dvb
Or
# wget http://dev.kewl.org/hauppauge/v4l-dvb-hg-2007-12-24-test.diff
(Plan B Tested on 2.6.22 ====DVB-S==== Only)
# patch -p1 < v4l-dvb-hg-2007-12-24-test.diff

# 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
# make install
# 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.
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
Now all you need to do is edit /etc/modprobe.conf to have
Line 34: Line 147:
This option will load the DVB-T frontend:<BR>
This option will load the DVB-T frontend:<BR>
options cx88-dvb frontend=1
options cx88-dvb frontend=1
</nowiki>


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.
====V4L (Steve Toth's hvr3000)====
Steve Toth is the maintainer of the hvr3000 drivers. He has a working Mercurial (like SVN) copy of v4l (hvr3000) which I believe is the bits which have been patched into the 2.6.19 kernel. I found this http://www.mythtvtalk.com/forum/viewtopic.php?p=17223, which explained how to get and install it. Here is the lowdown:-
You will need kernel source, gcc, g++, dvb-apps (aka dvb-utils on some distros) and mercurial.


====Multiple Frontend Diff (mfe)====
1) To get the source from Steve Toth type:-
<nowiki>hg clone http://www.linuxtv.org/hg/~stoth/hvr3000</nowiki>


No further configuration is applicable.
2) cd to hvr3000 (which has just been created)


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.
3) make (make sure you are booted up to the right kernel before you run make)


If the module has not loaded (/sbin/lsmod) try
=====Problems=====
# modprobe cx88_dvb
I encountered a number of problems getting mine to work


1) I found that that failed first time, because I was booted into a homemade kernel, and discovered the build expects the kernel uname -r to match that of the kernel source. The first time you run make it stores a file with these details in it and if they're wrong, you're doomed until you <make distclean> and ensure the kernel name and source or the same, or give the build code the appropriate parameters.


=====Problems=====
2) I also discovered just because gcc is installed, g++ isn't neccesarily.


On Ubuntu Hardy with the latest kernel the driver doesn't survive suspend/resume. tested with Mythtv using Plan A (sfe).
3) I had multiple build errors relating to files in v4l/aci.c relating to sound mixing or something. So go into <make menuconfig> select 'audio devices for multimedia', then unselect 'ACI Mixer' (press space to unselect), now press escape twice and save your kernel settings. Rebuild this time without the ACI stuff.
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
4) I also found after installing this, my Webcam stopped working (although I haven't tried to fix this yet).
Unable to query frontend


===Testing===
5) Kernel 2.6.19 under FC6 : Try and make, it fails. Edit the ~/hvr3000/v4l/config-compat.h file and change #include <linux/config.h> to #include <linux/autoconf.h>. I also had to remove the .mdelay = xx line from cx88_i2c.c, zoran_card.c and bttv_i2c.c.


Untested by myself (jarb1) is analogue TV
=====Installation=====
If that was all successfull then:-


1) make install (this will install the built modules over your kernel ones, in your /lib/modules directory)

2) reboot

====Configuration====
Once the modules are installed, type

# modprobe cx88_dvb

This should load everything if it isn't already.

Enter directory /dev/dvb/adpaterX 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 side of HVR3000.

There seems to be some issue getting the tuner to attach to the card, which needs further tracking down. Needless to say, someone suggested adding 'options cx88xx i2c_scan=1' to my /etc/modules.conf so I created a file containing just that line in my /etc/modprobe.d directory and it seems to work. This needs work to figure out why.

LIRC seems to work out of the box (at least for me). The remote sends cursor commands (up down left right) and enter and numbers quite happily regardless of application. I need to do further work to get the other things to work in a normal way.

==Testing==
====DVB-T====
====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.
To test DVB-T the [[wiki:Scan|scandvb]] command 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
# scandvb /usr/share/dvb-apps/dvb-t/uk-EmleyMoor > channels.conf
Line 97: Line 188:
====DVB-S====
====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.
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 frontend. 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
# scandvb -f 1 -d 1 /usr/share/dvb-apps/dvb-s/Astra28.2E > channels.conf
Line 105: Line 196:
# /sbin/dvbstream -o -f 12421 2343 2345 -p H -s 27500 -c 2 | mplayer -
# /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.
MythTv users don't forget to set the Diseqc option to LNB if you have a basic satelite dish.

====Newbie stuff====
Ok, so it all seems to be working, how do you test it. Well firstly the devices the drivers create should exist. Firstly /dev/video? (where ? will be a number, in my case its /dev/video0) shows the video stream. Next there will be a /dev/dsp? which shows the audio stream (presented as a line in type ossdsp device), which also shows up as an alsa device (if you've loaded cx88_alsa). For alsa see /proc/asound/cards to see which device is for the cx88, then look in /dev/snd/pcmC?D0c (where ? will be the card number found earlier) aka ALSA:hw.?,0.
To test the card use tvtime or xawtv or even mplayer to watch the video stream. I found tvtime slightly easier to setup and control (with a mouse). Once you're happy you can change channel (up and down I believe) and change device (the key i) you're ready to try pulling it all together.


=====Sound=====
=====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:-
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:-


Line 122: Line 212:
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
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 ==
=== Useful Information ===



====Remote Control====
====Remote Control====



The HVR3000 has onboard IR receiver. This can be configured by following the V4L wiki here at LinuxTV. Search Remote Contollers.
The HVR3000 has onboard IR receiver. This can be configured by following the V4L wiki here at LinuxTV. Search Remote Contollers.
Line 132: Line 220:
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.
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 script has a work around for systems with more than one HVR3000 card. Please adjust the cardno to start.
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
<pre>
<pre>
#!/bin/bash
#!/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
#Determin the first card number
CARDNO=2
EVENTNO=`cat /proc/bus/input/devices |grep HVR300 -A 3 | grep -o event[[:digit:]] | grep -o [[:digit:]] -m 1`
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
</pre>

Then enable the script
# /sbin/chkconfig --add lircdhvr3000
# /sbin/chkconfig --levels 5 lircdhvr3000 on

=====lircd.conf=====
A working lircd.conf:
<pre>
begin remote


name Hauppauge_3000
#If we have 2 tuner cards with IR set this as 2, otherwise 1
bits 16
CARDNO=2
eps 30
EVENTNO2=$[EVENTNO+CARDNO-1]
aeps 100


one 0 0
#Start Lircd with the right event
zero 0 0
echo "Starting lircd...."
pre_data_bits 16
sudo /usr/sbin/lircd -H dev/input -d /dev/input/event$EVENTNO2
pre_data 0x1
post_data_bits 32
post_data 0x1
gap 32994
toggle_bit_mask 0x0


begin codes
#Start mythbackend if not running
Power 0x0074
sudo /etc/init.d/myth* start
Go 0x0161
Skip 0x00A3
Replay 0x00A5
Rewind 0x00A8
Forward 0x00D0
Play 0x00CF
Stop 0x0080
Pause 0x0077
Record 0x00A7
TV 0x0179
Videos 0x0189
Music 0x0188
Pictures 0x016F
Guide 0x016D
Radio 0x0181
Up 0x0067
Down 0x006C
Left 0x0069
Right 0x006A
OK 0x001C
Back/Exit 0x00AE
Menu 0x008B
Prev.Ch 0x019C
Mute 0x0071
Vol+ 0x0073
Vol- 0x0072
Channel+ 0x0192
Channel- 0x0193
Red 0x018E
Green 0x018F
Yellow 0x0190
Blue 0x0191
Text 0x0184
Sub/CC 0x0172
1 0x0002
2 0x0003
3 0x0004
4 0x0005
5 0x0006
6 0x0007
7 0x0008
8 0x0009
9 0x000A
0 0x000B
end codes


end remote
#Start the frontend
mythfrontend
</pre>
</pre>


Line 169: Line 364:
</pre>
</pre>


But be warned it is one or the other, if your application tries to open both adapters at the same time it will fail.
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==
==External Links==
* [http://www.hauppauge.co.uk/pages/products/data_hvr3000.html WinTV-HVR-3000 product page]
* [http://www.hauppauge.co.uk/site/products/data_hvr3000.html WinTV-HVR-3000 product page]
[[Category:DVB-T PCI Cards]]
[[Category:DVB-S PCI Cards]]

Latest revision as of 08:42, 15 October 2010

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.

Components Used

  • Conexant CX23882 PCI Broadcast Audio/Video Decoder
  • Conexant CX22702 DVB-T chip
  • 14109LF Rev B3D3 Tuner

Identification

If your kernel doesn't support it

01:06.0 Multimedia video controller: Conexant CX23880/1/2/3 PCI Video and Audio Decoder (rev 05)
        Subsystem: Hauppauge computer works Inc. Unknown device 1402
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Latency: 32 (5000ns min, 13750ns max), Cache Line Size: 32 bytes
        Interrupt: pin A routed to IRQ 16
        Region 0: Memory at f8000000 (32-bit, non-prefetchable) [size=16M]
        Capabilities: [44] Vital Product Data
        Capabilities: [4c] Power Management version 2
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME-

If your kernel does support it

01:06.0 Multimedia video controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder (rev 05)
        Subsystem: Hauppauge computer works Inc. Device 1402
        Flags: bus master, medium devsel, latency 32, IRQ 16
        Memory at f8000000 (32-bit, non-prefetchable) [size=16M]
        Capabilities: [44] Vital Product Data <?>
        Capabilities: [4c] Power Management version 2
        Kernel driver in use: cx8800
        Kernel modules: cx8800

Driver Sources

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 DVB-T the scandvb command 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 frontend. 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 satelite 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
lircd.conf

A working lircd.conf:

begin remote

  name  Hauppauge_3000
  bits           16
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  pre_data_bits   16
  pre_data       0x1
  post_data_bits  32
  post_data      0x1
  gap          32994
  toggle_bit_mask 0x0

      begin codes
          Power                    0x0074
          Go                       0x0161
          Skip                     0x00A3
          Replay                   0x00A5
          Rewind                   0x00A8
          Forward                  0x00D0
          Play                     0x00CF
          Stop                     0x0080
          Pause                    0x0077
          Record                   0x00A7
          TV                       0x0179
          Videos                   0x0189
          Music                    0x0188
          Pictures                 0x016F
          Guide                    0x016D
          Radio                    0x0181
          Up                       0x0067
          Down                     0x006C
          Left                     0x0069
          Right                    0x006A
          OK                       0x001C
          Back/Exit                0x00AE
          Menu                     0x008B
          Prev.Ch                  0x019C
          Mute                     0x0071
          Vol+                     0x0073
          Vol-                     0x0072
          Channel+                 0x0192
          Channel-                 0x0193
          Red                      0x018E
          Green                    0x018F
          Yellow                   0x0190
          Blue                     0x0191
          Text                     0x0184
          Sub/CC                   0x0172
          1                        0x0002
          2                        0x0003
          3                        0x0004
          4                        0x0005
          5                        0x0006
          6                        0x0007
          7                        0x0008
          8                        0x0009
          9                        0x000A
          0                        0x000B
      end codes

end remote

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