Building a Linux PVR Part I - MythTV Setup and Install
by Kristopher Kubicki on September 3, 2004 12:05 AM EST- Posted in
- Linux
IvyTV (continued)
Supposedly, our tuner card is working correctly. We can quickly check to see if everything went OK by using the utilities included with the ivtv drivers and also by checking the /var/log/messages log. Our log reveals something like this:Sep 2 13:31:36 linux kernel: ivtv: Found an iTVC16 based chip
Sep 2 13:31:36 linux kernel: i2c-algo-bit.o: (0) scl=1, sda=1
Sep 2 13:31:36 linux kernel: i2c-algo-bit.o: (1) scl=1, sda=0
Sep 2 13:31:36 linux kernel: i2c-algo-bit.o: (2) scl=1, sda=1
Sep 2 13:31:36 linux kernel: i2c-algo-bit.o: (3) scl=0, sda=1
Sep 2 13:31:36 linux kernel: i2c-algo-bit.o: (4) scl=1, sda=1
Sep 2 13:31:36 linux kernel: i2c-algo-bit.o: ivtv i2c driver #0 passed test.
Sep 2 13:31:36 linux kernel: tuner: chip found at addr 0xc2 i2c-bus ivtv i2c driver #0
Sep 2 13:31:36 linux kernel: tuner: type set to 2 (Philips NTSC (FI1236,FM1236 and compatibles)) by insmod option
Sep 2 13:31:36 linux kernel: msp34xx: init: chip=MSP3448W-A2 +nicam +simple +radio
Sep 2 13:31:36 linux kernel: msp3410: daemon started
Sep 2 13:31:36 linux kernel: saa7114.c: starting probe for adapter ivtv i2c driver #0 (0x10005)
Sep 2 13:31:36 linux kernel: saa7114.c: detecting saa7114 client on address 0x42
dmesg also reports success:
# dmesg | tail
[<c013569b>] sys_init_module+0xeb/0x1e0
[<c0107dc9>] sysenter_past_esp+0x52/0x79
ivtv: No mem on buf alloc!
ivtv: Buffer alloc failed!
ivtv: Registered v4l2 device, minor 0
ivtv: Registered v4l2 device, minor 32
ivtv: Registered v4l2 device, minor 224
ivtv: Registered v4l2 device, minor 24
ivtv: loaded
Linux finally sees a v4l2 (video 4 linux) device. Note: YAST will not see the card. In order to run the utility packages from ivtv, particularly the tuner script, we needed to install perl and a few dependencies. All of these dependencies can be handled by YAST with the exception of:
perl-Video-ivtv-0.12-1.noarch.rpm (right click to download)
perl-Video-Frequencies-0.03-1.noarch.rpm (right click to download)
We pulled both of these RPMs off ATRPMs.net, but we have included them in the review in case you have difficulty locating them. The ptune-ui.pl utility allows us to change the channels easily for testing our PVR card.
Using the quick and dirty method to capture video, we pulled a few seconds of broadcast to test how well our device was working.
# cat /dev/video0 > /tmp/test.mpg
If we play this test.mpg back with Kaffeine (or some other player), we will get an mpeg2 stream. So far, so good. We used MPlayer to pull a single frame out of the stream, which can be seen below:
# mplayer -frames 1 -vo jpeg outdir=/tmp:quality=100 test.mpg
Keen observers will note that this image is non-interlaced - something that we will discuss later in our analysis.
Just getting SuSE install and ivtv to play nicely took two hours; our total time for installation right now is at 2.25 hours. Opting for a different distribution that supports the PVR card natively would have been a better idea, but we have already gone this far...
38 Comments
View All Comments
sprockkets - Monday, September 6, 2004 - link
Don't forget with TiVo can only do what it does and nothing else, unlike your computer which can do much more.Here are some of my thoughts on that program:
Using a LeadTek Win Fast 200XP Deluxe
Needing to setup an MySQL server just to get it to work right is downright gay. And it seems that the tv listings program was only properly installed ironically due to using apt-get by trying Freevo's installation which automatically downloaded all the necessary dependancies from people who automatically package the program for certain distros. Perhaps this has changed but when I tried doing it I got the "well I'm missing one of a few hundred sub program dependacies."
Next, using the composite or s-video in was frustrating, the only way I got it to work was to assign on the one of the config pages that s-video was for the same as TV or something. Then, since it only works by always time shifting, using the program to play games is useless due to the lag it introduces.
Then you can watch the massive files it makes when making video recordings, which them means you must transcode later. I checked off the options to do so but found it never compressed them anyhow. I'm sure it was user error for this and other stuff.
Running LeadTek's own program for recording is so painfully easy compared to using mythtv or freevo, and does it directly to Divx5/mp3 format as well, on the fly and never skips (only works at low res though but an hour gives you a 700MB file) but of course requires windows. Using motv/xawtv is just as good for tunning, but it's recording sucks (not to mention I had to toy with the tuner setting in my /etc/config stuff to get it to tune right).
Then if you can use mplayer to tune to the right frequency, read 15k lines of documentation to word the right command with xvid, then doing the same thing with Leadtek's program is great, since the main bottleneck with Leadtek's program is that since it has to encode and decode at the same time to let you see what you are recording, it prevents you from doing a higher res recording. If it allowed you to not see it while recording then it would be perfect.
Bottom line:
Mythtv:Has the Linux theme of being very configurable, works, looks great, free, and can use multiple computers and network them for remote watching. But getting all the deps to install, and running all the backend and crap makes it clumsy and frustrating at times.
Freevo: Works with python and works if you can. Using apt get makes an easy install. Uses mplayer to record so setting it to encode on the fly is great and for small files sizes that don't need transcoding later.
Xawtv: Using in SuSE 9.1 is easy and built in for BTTV cards, but recording sucks.
Windows/Leaktek software: Like anything else Windows, easy. Only flaw is the low res divx encoding (and Microsoft's constant bs tricks into making the mp3 codec on the system work only at 22khz and low bitrates to make it look crappy).
Mythtv prepackaged with Knoppix: Have downloaded it but haven't tried it.
Oh, and for the #1, I know all about TV out issues with Linux and getting it to work. But unlike previous versions of Linux, I found that SuSE 9.1 can easily switch from S-Video to normal video out on my SS40G system, using the built in SiS300 graphics and it's built in video out chip. I set the resolution easily with the Control Center in KDE.
NogginBoink - Sunday, September 5, 2004 - link
Snuffy,While you're correct on the upfront costs, MythTV has a longterm advantage. You can upgrade your hard drive at will. And, as I suspect we'll read in the second installment, MythTV supports unlimited tuners, AND HDTV tuners.
The HD part is what's motivating me to put together my first-ever Linux box.
KristopherKubicki - Sunday, September 5, 2004 - link
trikster2: We actually do the final testing (Part II) with MCE versus knoppmyth. I just wanted to show the though process in the meantimeKristopher
KristopherKubicki - Sunday, September 5, 2004 - link
NogginBoink: Yes.Kristopher
Danj2K - Sunday, September 5, 2004 - link
Something this article doesn't mention is that users outside the US and Canada can't use the Zap2it option and instead are required to use XMLTV. This is worth mentioning since XMLTV does not appear to automatically tune in channels, it just downloads schedule data for them - which makes sense, because in the UK (for example) the frequency of the various channels is dependent on where in the country you are and which transmitter you are receiving them from. When I tried to build a MythTV box that was as far as I got, since I was unable to find out how to tune it in.Quink - Sunday, September 5, 2004 - link
You don't use mythtv to save money. You use it because you like to tinker, like a challenge or anything along those lines.Secondly making use of valuable tools like irc.freenode.org #mythtv-users cuts down a lot on time.
Also, why would you not use a SFF or mATX system? Who in their right mind would spend $600+ and not make size a focus too.
Plus, from experience, its easier to go with a via mobo, NOT kt400 of any type, preferablly a kt333. ATI 9200 or thereabouts works a lot easier to IMHO. Do that, have some general linux knowledge, and get things done very quickly.
trikster2 - Sunday, September 5, 2004 - link
It's been said 10 times above, but I can't help it, I have to say it again: Shame, shame on you for not using knoppmyth!!!!!
Also your linux box should be $100 cheaper:
The case you picked is available from silverstontek under the name GD98.
It's available at www.gameve.com and sundialmicro for $29
http://www.sundialmicro.com/cgi-bin/sundial/gd98le...
To make all things equal you should have used the Hauppauge WinTV PVR-250MCE in both computers. It is available at www.pcalchemy.com fo r $99.
It's very common for people to throw together HTPC's out of spare parts. It would be cool to compare both machines with low end CPU's, like a 1 gig duron.......
mcdrama - Sunday, September 5, 2004 - link
I have been using KnoppMyth ( www.mysettopbox.tv ) for almost a year now and would never buy a TiVo now. ;)My box is an AthlonXP 1.6GHz, 768MB PC2700 DDR, 120GB IDE hard drive, Hauppauge PVR-250, Netgear USB 802.11b adapter, all inside a Shuttle XPC box that sits next to my TV. ;) I built my system for $450, after BIOS update, no problems with watching a recording at the same time as recording a TV show.
If you build one of these boxes, just make sure to NOT get a VIA based chipset. The VIA south bridge chipsets have a PCI?/IDE? bug which causes recordings to stop recording when you try to watch a different recording.
Upgrading the BIOS, and upgrading the RAM from 256MB to 768MB seems to have fixed this problem with my Shuttle XPC SK41G.
excaliberpc.com has XPC barebones from $148 up to $300+, check www.pricewatch.com for other parts prices.
Snuffaluffaguss - Sunday, September 5, 2004 - link
"Considering the cost of a TiVo, service runs anywhere from $100 to $600 per year depending on what DVR and subscription you buy."That is pretty false info. An 40 hour tivo is 199 -a 100 dollar rebate, so $99 and the lifetime subscription is $299. So its its only 500 pre rebate, 400 after rebate for LIFE, not year. An 80 hour would be $100 bucks more. Its really not that much cheaper.
NogginBoink - Sunday, September 5, 2004 - link
I'm confused.The sempron is a 32-bit chip, right?
DFI's website says that the K8M800-MLVF motherboard is an AMD-64 motherboard.
Can you put a 32 bit Sempron in a socket for a 64-bit chip?