px
px
border
px
   
px
div
Information
null.gif Home

null.gif News
 Topics
 Stories Archive
null.gif Content
 Articles
 Tutorials
 Downloads
 Web Links
 Forums
null.gif Other Stuff
interdit Feedback
 Recommend Us
 Statistics
 Search
 RSS
 Your Account

Digital Video
Installing MythTV
MythWeb Hacks
Remote Control
Hardware Kit
Complete System

Digital Surveillance
Installing Zoneminder
Hardware Kit

VIA EPIA
Comparison Chart
Performance
Optimizing

Store Information
Shipping & Returns
Privacy Notice
Conditions of Use
Contact Us

div
  TopMy Account  |  Cart Contents  |  Checkout   
Installing MythTV - Part 4
Prerequisite Software

Table of Contents

Here we will install the drivers and other libraries needed to support MythTV. Included are the WinTV PVR driver, the VIA MPEG hardware acceleration drivers, sound drivers, the Qt libraries, and MySql.

At this point we have the operation system installed on our MythTV box. However, this is not enough to enable MythTV to run. Next we need to install the device drivers that let MythTV talk to the hardware that will capture and play video and audio. There are a couple other software packages, such as Mysql database and the X Windows system we need to install as well.

I think this is probably the most difficult part of getting a MythTV box going. The steps themselves are not difficult but the software we'll need is cutting edge and are a lot of moving targets. What I'm describing here worked for me but since the pieces update so quickly it may not work a week from now. With your feedback I'll try to stay on top of it.

Installing IVTV

First we will install a device driver called ivtv so MythTV can talk to the WinTV board. This driver is maintained by Chris Kennedy and has two branches. The 0.2.0 branch supports the WinTV PVR250/350 cards and is the most mature. The 0.3.x branch is where most current development is happening. It supports the WinTV PVR150/500 as well as the 250/350 and others. It isn't quite as stable as the 0.2.0 branch but is coming along nicely.

If you are using the WinTV PVR250 or PVR350 we recommend the 0.2.0 driver. Our tests show that it works somewhat better than the 0.3.x driver on these cards. If you are using the PVR150 or PVR500 you have no choice, you must use the 0.3.x driver.

The ivtv website can be found at http://www.ivtv.tv. Currently it doesn't have a lot of information but does have the driver source. There is an ivtv wiki at http://ivtv.writeme.ch/tiki-index.php.

...for the WinTV PVR250/350

If you are using the WinTV PVR250/350 you should use the latest 0.2.0 driver. Download and build the ivtv driver with the following:

#cd /usr/local/src
#wget http://www.ivtv.tv/releases/ivtv-0.2/ivtv-0.2.0-rc3j.tgz
#tar zxvf ivtv-0.2.0-rc3j.tgz
#cd ivtv-0.2.0.rc3j/driver
#make
#make install

...for the WinTV PVR150/500

The Hauppauge WinTV PVR150 uses a different encoder chip than the 250. The PVR500 is like two PVR150's on the same card. As mentioned above, you will need the ivtv 0.3.x driver for the 150/500. Download and build the ivtv driver like above:

#cd /usr/local/src
#wget http://www.ivtv.tv/releases/ivtv-0.3/ivtv-0.3.4q.tgz
#tar zxvf ivtv-0.3.4q.tgz
#cd ivtv-0.3.4q/driver
#make
#make install

WinTV Firmware

The ivtv driver needs to install software on the WinTV card itself. This is called “firmware” (something between the “hard” of hardware and “soft” of software – firmware, get it?). The firmware is provided by Hauppauge but since they doesn't officially support Linux, it is not in a form we can use without a little work. If you bought the retail version of the PVR-250 you'll have a CD with drivers for the MS Windows operating systems. You can also download these drivers from the Hauppauge Support website.

Some CD's have the firmware as separate files. Look on your CD. If you see the files HcwFalcn.rom and HcwMakoA.ROM then this will be easy. Copy these two files to /lib/modules and soft link HcwFalcn.rom to ivtv-fw-enc.bin:

#cd /lib/modules
#cp /mnt/cdrom/HcwFalcn.rom .
#cp /mnt/cdrom/HcwMakoA.ROM .
#ln -s HcwFalcn.rom ivtv-fw-enc.bin

If you don't have the HcwFalcn.ROM and HcwMakoA.rom files you will need to extract the firmware from the Windows driver. The ivtv package has a utility called ivtvfwextract.pl in the utils/ directory. This utility is suppose to extract the firmware from the Windows drivers. Load you CD and type the following:

#cd /usr/local/src/ivtv-0.2.0-rc3j
#utils/ivtvfwextract.pl

This didn't work for me. If it did for you, great. You can skip ahead to the next section.

I was able to modify the utility so it would work. I'll show you what I did but you can also get the firmware file ivtv-fw-enc.bin from the Download section. If you download the firmware copy it to your /lib/modules directory.

Now, to fix the utility. If you dig through ivtvfwextract.pl at bit you will notice that the utility is looking for the file pvr48xxx.exe on the CD. This filename is given on line #44. This file is an archive which is unzipped (line #156) into a temporary directory to get the file hcwpvrp2.sys (named on line #45). The firmware is magically extracted from the hcwpvrp2.sys file.

Unfortunately I don't have a file named pvr48xxx.exe on my CD. I do have a file called hcwpvrp2.sys though. So instead of unzipping the .exe file and then processing hcwpvrp2.sys, we just need to skip the unzip part and process the .sys file directly. All you need for that is to modify “$unzipcmd” (line 155) so it copies instead of unzipping. Here's what mine looks like after the modification:

#$unzipcmd = "unzip -L -d $tmpdir $driverfile $fw_driver_name";
$unzipcmd = "cp $readpath/$fw_driver_name $tmpdir";

Then I ran the utility and the firmware files ivtv-fw-dec.bin and ivtv-fw-enc.bin appeared in /lib/modules.

Module Configuration

We have the ivtv driver and WinTV firmware installed. Now we need to tell the operating system about the driver. To do that add the file “ivtv” with the following content to the /etc/modules.d directory:

#nano -w /etc/modules.d/ivtv

alias char-major-81 videodev
alias char-major-81-0 ivtv

Press ctrl-X to exit and answer “yes” to save the file. Next execute the following:

#modules-update

Now we should be able to load the ivtv driver:

#modprobe ivtv

Check the log to make sure there were no errors:

#dmesg | less

Press “q” to exit the listing. You can also execute the following and should see ivtv in the listing:

#lsmod

If you want to test your capture card now you can load the driver and capture video to a file. Connect a video signal to the TV input and enter the following:

#modprobe ivtv
#cat /dev/video0 > /root/test.mpg

After 10 or 20 seconds press Ctrl-c to stop capturing. Then you can open the file /root/test.mpg in a video player like mplayer and see the results.

If you only see static, a common mistake is to build a tuner module with the kernel. That kernel tuner module will usually load first but doesn't work with the latest ivtv driver. Instead your system must use the tuner module included with the ivtv driver. Search the /lib/modules//* directories for a tuner.ko file. There should be one in the ivtv directory but if you find any other, delete it. You can quickly search the module directories with this:

#cd /lib/modules/
#find -name tuner.ko

Everything ok? I hope so. If not see what you can figure out from the log and jump on the forums for help.

Install Mysql Database

That was a little intense so we'll do something easy for a while. MythTV needs the Mysql database engine, the X Windows system and the Qt graphics library. We'll go ahead and install those now. It will take a couple hours for Mysql and bit longer for X Windows and Qt.

#emerge mysql
#/usr/bin/mysql_install_db
#/etc/init.d/mysql start
#mysqladmin -u root -h localhost password '<your password>'
#rc-update add mysql default

Don't forget your root password to Mysql. We'll need it in Part 5.

Install Qt Graphics Library

#FEATURES="keepwork" emerge qt

Installing Qt will also install x11-base/xorg-x11 as a dependency. In my case x11-base/xorg-x11-6.8.0-r3. XOrg is the X Windows implementation we will use. By using the "keepwork" feature the source and object files are not deleted after the installation. We will need these to build the Unichrome X Windows driver for the VIA CLE266.

Configuring X Windows is almost an art in itself. If you want to configure it yourself you can start with xorgconfig then hand edit /etc/X11/xorg.conf. Or you can download my xorg.conf from the Download section.

Install CVS

Later we will need to get files from the Unichrome project via CVS. So we will install the CVS client to enable this.

#emerge cvs

Next we move on to installing the software needed for EPIA's hardware MPEG acceleration.

Build and Install Direct Rendering Manager

DRI is the Direct Rendering Infrastructure. It is a framework for allowing direct access to graphics hardware under the X Window System. DRI makes modifications to the X server, some client libraries, and the kernel.

DRM is a kernel module that gives direct hardware access to DRI clients. In this step we will build the DRM kernel module.

To begin we download drm software from its cvs repository.

#cd /usr/local/src
#cvs -z3 -d:pserver:anonymous@dri.freedesktop.org:/cvs/dri co drm

Change to the “drm” directory and take a look.

#cd drm
#ls

You will see a list of directories for different architectures. You only need to build in one of these directories. The one you need depends on the kernel you've installed. If you have a Linux kernel prior to 2.6.11 then build the “linux-2.6” tree:

#cd linux-2.6
#make
#make install

If you are using Linux kernel 2.6.11 or later, then build the “linux-core” tree. If you are following along this tutorial then you have a 2.6.11 or later kernel and need to use these instructions:

#cd linux-core
#make
#make install

When I did this there was a problem with the Makefile, it didn't have a target for “install”. If you get that error when you run “make install” then you will need to copy the files yourself with these commands:

#cp drm.ko /lib/modules//kernel/drivers/char/drm
#cp via.ko /lib/modules//kernel/drivers/char/drm
#modules-update

Build and Install The VIA MPEG Decoder

One of the neat features of the VIA mainboards is the hardware assisted MPEG decoding. Just as we did on the input side, we'll need drivers to enable the output side. The Unichrome project on Sourceforge is working to create MPEG drivers that work with the VIA hardware.

Notice for this driver, and the XvMC library in the following section, we are loading the source into the XOrg source tree. Normally Gentoo's emerge process deletes the source when its done. This is why we need to include the “keepwork” feature when we installed it.

For the first step we will download the driver source from the Unichrome project's CVS repository and build it:

#cd /var/tmp/portage/xorg-x11-6.8.0/work/xc/programs/Xserver/hw/xfree86/drivers
#cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/unichrome co xfree86
#rm -rf via
#ln -s xfree86 via
#make Makefiles
#cd via
#make
#make install

Now that we have the hardware driver we can move on to the XvMC library.

Build and Install The XvMC Library

Xv is an extension to the X Window System for video. XvMC is the X-Video Motion Compensation API and is how our VIA drivers will talk to the X Windows system. The Unichrome project has a VIA XvMC library that we will download with CVS then build with the following:

#cd /var/tmp/portage/xorg-x11-6.8.0/work/xc/lib/XvMC/hw
#cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/unichrome co libxvmc
#ln -s libxvmc via
#cd ..
#nano -w Imakefile

Edit line #32 which says SUBDIRS=hw/i810 to say SUBDIRS=hw/i810 hw/via. Note the space between hw/i810 and hw/via. Exit with ctrl-X and save your changes. Continue with:

#make Makefile
#make Makefiles
#cd hw/via
#make depend
#make
#make install
#cp vldXvMC.h /usr/include/X11/extensions

To recap, in the last three pages we installed:

  • The DRM kernel module
  • The VIA Unichrome driver
  • The XvMC library for X Window

That completes the work we need to do for the video stream. Next we move to audio.

Sound

The MPEG stream contains both video and audio. The video part will head through the VIA driver we just loaded. The audio will go through the standard Advanced Linux Sound Architecture or ALSA sound system. We can load the sound drivers with these commands:

#emerge lame
#emerge alsa-utils

alsa-utils will load the alsa library as a dependency. Lame is used by MythTV. Like we did with the ivtv driver we need to tell the operating systems about our sound drivers. Create the file /etc/modules.d/alsa with the following content:

#nano -w /etc/modules.d/alsa

alias char-major-116 snd
alias snd-card-0 snd-via82xx
options snd-via82xx dxs_support=3

Exit with ctrl-X and save your changes. Then enter the following:

#modules-update
#rc-update add alsasound default

Ok, we're just about done.

Optional: Install Webmin

This is completely optional. I like a nice web interface to admin a system and use Webmin to do that. You can read more about it here. If you want to install it on your system type:

#emerge webmin
#rc-update add webmin default

If you want to start it up to see what it looks like, enter /etc/init.d/webmin start and then point your browser at https://<your system ip>:10000. Login in with user name “root” and your root password.

Next: Part 5 – MythTV

History
14 Feb 2005Initial Publication
8 Apr 2005Updated for MythTV 0.17
Added CVS download and build of DRM driver.
16 May 2005Added table of contents, html cleanup. Updated ivtv links and added information for the PVR-150/500 capture cards.









Tim

Copyright © by MagicITX All Right Reserved.

Published on: 2005-02-14 (11569 reads)

[ Go Back ]
div
Survey
Are you doing a Car-PC project?

Yes, active now
Yes, planning stage
Thinking about it
No, not interested



Results
Polls

Votes: 329
Comments: 0

Login
Login Name

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Who's Online
There are currently, 4 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here

div



MagicITX Logo © 2004.
All other logos and trademarks in this site are property of their respective owner. Comments are the property of their poster.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty for details see the license.
Page Generation: 0.119 Seconds