Hauppauge WinTV-HVR-3000: Difference between revisions
Jamesarbrown (talk | contribs) (Reformatted) |
Jamesarbrown (talk | contribs) (Improved Lirc startup script) |
||
Line 130: | Line 130: | ||
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. |
||
⚫ | |||
<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" |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
RETVAL=0 |
|||
# depending on parameter -- startup, shutdown, restart |
|||
⚫ | |||
# of the instance and listener or usage display |
|||
⚫ | |||
case "$1" in |
|||
⚫ | |||
start) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
RESULT="Using Card : "$EVENTNO2 |
|||
echo -n $RESULT |
|||
⚫ | |||
⚫ | |||
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 |
|||
⚫ | |||
#Start mythbackend if not running |
|||
⚫ | |||
#Start the frontend |
|||
mythfrontend |
|||
⚫ | |||
====Multiple Frontends==== |
====Multiple Frontends==== |
Revision as of 20:30, 9 January 2008
The Hauppauge WinTV-HVR-3000 is a DVB-T and DVB-S on one PCI card sharing the same Demux.
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.
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.
kewl.org HVR3000 (25 Dec 07)
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.
# yum install mercurial # hg clone http://linuxtv.org/hg/v4l-dvb # cd v4l-dvb # wget http://dev.kewl.org/hauppauge/v4l-dvb-hg-2007-12-24-test.diff # patch -p1 < v4l-dvb-hg-2007-12-24-test.diff # 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.
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
</nowiki>
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.
1) To get the source from Steve Toth type:-
hg clone http://www.linuxtv.org/hg/~stoth/hvr3000
2) cd to hvr3000 (which has just been created)
3) make (make sure you are booted up to the right kernel before you run make)
Problems
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.
2) I also discovered just because gcc is installed, g++ isn't neccesarily.
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.
4) I also found after installing this, my Webcam stopped working (although I haven't tried to fix this yet).
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.
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
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.
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
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 -o event[0123456789] | grep -o [0123456789] -m 1` EVENTNO2=$[EVENTNO+CARDNO-1] RESULT="Using Card : "$EVENTNO2 echo -n $RESULT #Start Lircd with the right event daemon /usr/sbin/lircd -H dev/input -d /dev/input/event$EVENTNO2 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.