tuning trouble

I used to borrow a friend’s Hauppauge WinTV card (bt878 chipset) for tv viewing until I finally bought my own Hauppauge WinTV PVR 150 . I went for the PVR series as I figured recording would be much more convient (pvr series comes with a hardware MPEG2 encoder).

In the past I had used the brooktree wintv card under linux which was really a joy since it worked out of the box along with all available soft (after trying xawtv, motv, (whatever-)tv, tvtime, etc.. I settled with KdeTV (formerly kwintv)). It even seemed the card was better supported under linux than under windows. I figured the pvr series would be supported as well as it seemed to be a fairly popular card for HTPCs. Which turned out to be slightly nuanced. 🙂

To begin with, only recently the required ivtv kernel module has finally become available in mainstream while for the brooktree chipset (bt8x8) this has been the case for ages. With the latest suse, I didn’t have any trouble setting up the card, though. But having hardware work, is only half of a tv viewing experience, you need a good player too! I never suspected that my beloved kdetv wouldn’t support the new mpeg card.. 🙂

There are several problems:

  • kdetv expects the v4l device to implement some buffering api. The ivtv driver doesn’t support that because it is not applicable since the video gets already buffered on the card itself to compress into MPEG2.
  • even if it would be able to get a stream from the card, it wouldn’t be able to show it as it would be mpeg encoded! Kdetv only understands raw video.
  • so let’s just use the ivtv’s raw video output, shall we? Not a good choice:
    • the raw video only contains the video, so we must get the audio from somewhere else, line output, which leads to sync problems. The advantage with the mpeg stream is that it is always in sync.
    • we loose the advantage of a mpeg card, recording is much more cpu intensive. It might have been subjective, but I had the impression the raw video output was less stable as the mpeg one. Probably because hardly anyone uses that.
  • Then why not use mplayer or some frontend like KPlayer which supports its pvr:// or tv:// interface? Unfortunately, the tv interface crashes mplayer due to the buffering problem (now I am hesitating if that was a mplayer only problem rather than kdetv too). The pvr interface doesn’t crash but seems to also have the buffer problem. It is not clear yet which project needs to fix this problem. There is no general buffering api defined, so ivtv is not obliged to implement anything like that. mplayer does play back the ivtv video stream, but you can’t use its channel presetting ability. A possible solution could be to have a virtual v4l device which provides video and audio like a cheap card while it actually is just decompressing output from the real v4l device. Actually, recently someone started a project for something like this, although it is only in its very early stage.

So, considering all those problems, why is the card so popular then??
Because MythTV has native support for it. 🙂

So on to the next phase. MythTv is known for its hard installation. Luckily for me, there are opensuse 10.3 packages available and it just works out of the box! So I read up on myth, and tried configuring it to my taste. Without success..

MythTV is not meant for simple tv viewing ala kdetv. It is a fully fledged home theater solution, with 10 foot mousepointerless fullscreen interface. MythTV has lots of possibilities and I sure tried my best, but eventually gave up. The web streaming plugin seemed to give the closest match to what I wanted, but somehow it wouldn’t authenticate to my db (oh yes, it uses mysql at the backend, which highlights the quite heavy HTPC overshoot I don’t need).

I just wanted tv in a window (or fullscreen _when I want to_, not through some 10 click setup process like myth) and a way to switch channels. Was that asked too much? I realised I bought the wrong card for the job. The PVR 150 is very well supported in MythTV and people who buy such card also want to use it in such ‘serious’ pvr solution. People who just want to view some tv on pc buy a cheap wintv card. 🙂

So it seems I found a void in the market 😉 Use a tv card for casual tv viewing in a window, but also have it encode MPEG2 in hardware for optimal recording. There does not exist such thing today in linux! It seems everyone living this situation helps themself by glueing some scripts together to change channel, start recording (which is as simple as cat’ing a device file), etc.
I found a lot of those, but either I couldn’t get them to work, or they were not satisfying.

So I also tried to help myself by using cli commands to switch channel and use VLC to decode the MPEG2 and have it nicely deinterlaced. I figured I could as well put it together in a program with an interface I like. That is how KTvTune was born.

KTvTune is quite a ‘dumb’ program, although useful for now. I suspect it will become deprecated once the LinuxMCE and KDE4 cooporation starts to bear its fruit. LinuxMCE is every HTPC builder’s wet dream and having it integrated with KDE4’s kick-ass plasma desktop, opens up a lot of great possibilities, including tv viewing the way I like. 😉 Until then, I use my own silly little program!

2 thoughts on “tuning trouble”

  1. I’ll start leasing my tuner card :-)…

    … or you can switch yours with Tsjoene’s ;-), It’ll save you time, and you’ll gain some sleep :-)…

    … but you’ll lose the joy…

  2. lol, I’m afraid the card has given me lot more trouble than joy so far 😉 I’ve been using my ktvtune for a couple of weeks now, so I’m calmed down a bit 😉 Unfortunately that also diminishes the drive to complete the prog. still, i need recording some day, so at least I need to finish that up (mmm, actually already wrote most of that..)

    i have to agree on the sleep part 😉

Leave a Reply

Your email address will not be published. Required fields are marked *