Hauppauge WinTV-HVR-3000: Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
No edit summary
(Rewritten page to give some meaningful instructions)
Line 1: Line 1:
====Kernel Support====
-WORK IN PROGRESS-
At the time of writing this (January 07), the HVR3000 is a fairly new card. The 2.6.19 kernel was the first stable release to include support, but the defacto kernel available for most of my current OSs is 2.6.17. Hopefully the likes of Debian and Kubuntu will upgrade soon, but if your kernel is pre 2.6.19 you will need a new version of the v4l bit of the kernel.


====V4L (Steve Toth's hvr3000)====
The HVR3000 is pretty new and I've had so much trouble trying to get it working I thought I'd make some notes here. Apologies for the quality of this page (I'm writing it as a blog until I have time to rewrite it properly), but I thought some notes was better than no notes.
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:-
I've linked to this from a relevant bit of the V4L wiki as, I'm trying to get both the DVB-T and Analogue bits of this working.
<nowiki>hg clone http://www.linuxtv.org/hg/~stoth/hvr3000</nowiki>


2) cd to hvr3000 (which has just been created)
====My System====
I've got 3 PC's I intend to make this work on, the first is called barney. Barney is an AMD64 running in 32Bit mode, with a NVidia GeForce 7800 GTX and a Logitech Quickcam Express (046d:0928) camera and the Hauppauge HVR3000 card. Barney has 2GB of RAM and a 200GB SATA disk, with XP on sda3 (100GB). I have a separate /boot partition (~1GB).
I initially had barney running fc4 and had a lot of grief trying to install a working 2.6.19 kernel. I attempted to upgrade all the various packages to make it work, before going for a full =>fc6/7 (ie dev) upgrade, breaking the computer and starting again. Hey I didn't need that system anyway (thankfully).
So I re-installed it with kubuntu edgy (as an aside I had problems with the standard kubuntu install, and had to install via the mini cd. I subsequently discovered there are issues relating to a 32bit install on a 64bit CPU).


3) make (make sure you are booted up to the right kernel before you run make)
At this point I should let you know, /proc/bus/usb/devices identifies my (unknown) camera and I have /dev/video0 and /dev/video1 corresponding to the camera and HVR3000 although I can't tune anything. When I started this, XP worked and if I rebooted from XP into fc4 having watched a channel on the WinTV2000, I could see the last channel. xawtv seems to


====Kernel Support====
=====Problems=====
I encountered a number of problems getting mine to work
Unfortunately kubuntu edgy comes with 2.6.17 and no HVR3000 support also, so I've been working on getting the latest code into /drivers/media/video/cx88 to working kernel modules. I've tried following http://www.ubuntuforums.org/showthread.php?t=311158 to upgrade my kernel, but I encountered the SATA problems it lists at the bottom.

So I installed the feisty 2.6.19 kernel, which boots and seems to have support compiled in. If only I can make it 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).

=====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> should load everything if it isn't already.

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.

====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
OK backtrack, I rebooted into the stock 2.6.17 kernel (with all the standard build stuff installed like headers and source) and followed this:- http://www.mythtvtalk.com/forum/viewtopic.php?p=17223 which explains how to build a kernel developer patch (git is a source thing linus invented which seems to allow clever things like working on just one bit of the kernel at a time). Follow this instructions and all the v4l stuff gets built.

Revision as of 03:00, 16 January 2007

Kernel Support

At the time of writing this (January 07), the HVR3000 is a fairly new card. The 2.6.19 kernel was the first stable release to include support, but the defacto kernel available for most of my current OSs is 2.6.17. Hopefully the likes of Debian and Kubuntu will upgrade soon, but if your kernel is pre 2.6.19 you will need a new version of the v4l bit of the kernel.

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).

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> should load everything if it isn't already.

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.

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