The pcHDTV and MythTV Howto
Brandons' Howto's
* The Linux HTPC Howto
* HTPC Hardware Howto
* pcHDTV cards and MythTV
Other Howto's
* Jarod Wilsons' MythTV Howto
* MythTV Install Guides

Brandons' SilverStone Tek Hardware Reviews
* LC01 HTPC Case
* LC04 HTPC Case
* ST46F Power Supply
* FM84XW Fan

Get Involved
* MythTV Dev List
* pcHDTV CVS Driver
* Free Standards Group
* Linux Standard Base

Local Linux Info
* Salt Lake Linux Users Group
* Ogden Linux Users Group
* Provo Linux Users Group
* USU Linux Users Group
* Utah Valley Linux Users Group


Setting up pcHDTV cards and MythTV

Authored: 12-3-2004/Last Updated: 1-4-2004

Note: New pcHDTV DVB Howto will be published shortly after the 2.6.11 kernel comes out.

* Getting the driver installed

Go to: http://pchdtv.com/downloads.html

(Or if you're feeling more daring: pchdtv.freedesktop.org)

Download FC2-3-Kernel-2.6-pcHDTV-driver-1.5.tar.gz 2.6 kernels (12/20/04) or a newer driver.

Download tools-2.6.a or a newer set of tools.

Untar the driver and cd into the source. Inside you will find a couple different tar.gz files for different distributions. Don't worry if your distribution is not there. If your distribution is not there, try untaring a Fedora tarball and using that source.

Run 'make' in the correct directory and the driver should build. If all went well you should have all the kernel modules built and can move on, if something is not normal about your system.

Next run 'make install' to install the driver into your modules path for kernel modules.

Run 'depmod -a' to make sure your kernel dependencies are current.

Run 'modprobe bttv' if you have the HD-2000 card or run 'modprobe cx8800' for an HD-3000 card.

Run 'dmesg' to see if there were any problems loading the driver. If you have problems, see the end of this how-to for fixes.

* Checking for a good signal

Visit antennaweb.org and enter your address (Or atleast your zipcode). You will get a list of stations in your area. Stations with a * next to them are digital and can be picked up with the pcHDTV cards. On the right side of the results you will see the real frequency numbers. These are what the card tunes to (Even though PBS is channel 11, it may use channel 44's frequency).

Run the dtvsignal (this is in the tools tarball that you should now build) program that comes with the card to check the signal. If you have setup /dev/dtv* video devices you can run 'dtvsignal /dev/dtv0 44' or if you did not bother setting up the dtv devices, you can use 'dtvsignal /dev/video32 44', both where 44 is a frequency number for a valid channel. You do not need 100% signal to get HDTV. Usually a signal that stays over 70% is plenty good, but the higher the value the less chance of never getting video corruption from time to time.

If you have a newer version of mplayer you can run 'mplayer /dev/dtv' or 'mplayer /dev/video32' and be able to watch the first dtv subchannel for that station. Mplayer won't change channels (dtvsignal will though) but it will display the first subchannel coming from the device.

* Obtaining MythTV

Myth is split up into several modules, as a minimum you need mythtv.

Starting at version .16 (Current CVS) mythtv support is complete and fairly stable. If you've used CVS before, I still recommend using it for the next few months. If you're not familiar with CVS, .16 and upward should keep you pretty happy.

Download version .16 from debian packages, rpms, ebuilds, tarball, or whatever else you can get your hands on.

If you're not going to use CVS, skip to the setup section.

(For cvs, get the following modules run the commands:)

Make sure you have CVS installed on your computer.

Download the CVS version of Myth by running the command:

cvs -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs login

cvs -z3 -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs checkout mythtv

If at a later time you want the other modules, you can do the following commands, but the main MythTV module must be setup and working before the following will be of any use.

cvs -z3 -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs checkout mythmusic (Recommended)

cvs -z3 -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs checkout mythvideo (Recommended)

cvs -z3 -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs checkout mythdvd (Recommended)

cvs -z3 -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs checkout mythweather (Mostly fun)

cvs -z3 -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs checkout mythgallery (Good if you have photo's)

cvs -z3 -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs checkout mythnews (Okay)

cvs -z3 -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs checkout mythphone (Pretty "cool")

cvs -z3 -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs checkout mythbrowser (Okay, takes a lot of space)

cvs -z3 -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs checkout mythgame (Little use (mame only))

cvs -z3 -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs checkout mythweb (run this cvs checkout INSIDE of your DocumentRoot for apache (ie /var/www/mythweb/)

* Using pre-built MythTV packages

See MythTV Precompiled packages

* Building MythTV (or modules)

Make sure you have QT > 3.1 to build. (3.3 is Highly recommended)

Run the command './configure' (Not all modules will have this -- Be aware that each time you configure, you may have to specify --enable-

Run the command 'make' (If the build will not start, run 'qmake' then 'make') If you find out that you are missing a bunch of -dev/-devel packages (Such as lame-dev) to get myth compiling, you will need to download or install them and run make again.

Run the command 'sudo make install' (Or 'su' to root and run 'make install')

* Setting up MythTV.

Go to labs.zap2it.com. Create a user account and follow the instructions to setup your prefered channel lineup. Make sure you only select channels that are DTV. The DTV channels will all be xx-x. Non-HD channels have no - in them and you should NOT select any of these. *Note zap2it is kindly giving users free data in return for answering some questions every 3 months. You WILL NEED a Certificate Code to sign up. I won't repeat the code here (As requsted by zap2it), but you can find it in mythtv's documentation in docs/mythtv-HOWTO.txt.

On your filesystem, create some directories such as /mythtv/live, /mythtv/recordings, /mythtv/video, and /mythtv/music. Make sure whichever user starts the backend, or will be using mythfrontend, will have access to read and write to those directories.

Once you have built atleast mythtv and installed it, run the setup program in the setup directory (ie, mythtv/setup/setup) before running mythbackend and mythfrontend.

In the 'general settings' enter the directories for those directories that you just created for storing mythtv files.

In the 'card settings', Choose /dev/dtv0-4 (or /dev/video32-34) for our HD card and ATSC for the card type. (Note: /dev/dtv0 is the same device as /dev/video32 and so on for dtv1=video33, dev2=vidoe34, etc.)

For 'video sources' you need to pick a name for the source (ie: HDTV SOURCE). Enter your zap2it username and password.For 'input connections', select the television settings and then select the video source HDTV.

Exit the setup program by hitting Esc.

Run the mythfilldatabase command (first time only). You may want to add this to a cron job to do nightly, or setup myth to do this via the frontend. Please though, do not run it right after midnight. zap2it is kind enough to let us get data from them, and has asked us NOT to contribute to the problem of overloading their servers. There's little or no chance that running it later in the day or around noon will cause you to miss a show.

Start mythbackend in one xterm/window and watch for any errors. If all looks good then start mythfrontend in another xterm/window. Select TV and then Watch TV. Give about 10 seconds for the video t appear. It should work. If not, check the xterms/windows for error messages (You may have chosen a bad directory for storing the liveTV buffer, or may not have permission to write there, or the starting channel is weak and not possible to display. If you don't get anything, try recording a show and see if that works. You can safely ignore some HDTV errors, but if you see a "Signal 13%" or something below 65% then you may not be able to see the HDTV.

If you ever switch to a channel and myth appears to freeze (but no sudden crash) you may have to quit mythfrontend, quit mythbackend, go into the setup directory in the mythtv directory (When you built myth, or when you installed prebuilt packages) and run the main mythtv setup program (This is not the setup settings in mythfrontend). Go to the input connections and change the starting channel back to a channel that works well. Start mythbackend and mythfrontend again and be careful of switching to that channel. If you never get this channel well, reposition yor antenna or delete the channel via phpmyadmin to keep this freezing frmo happening -- Yes, it's a pain, and hopefully it will be fixed soon but until then..

* Optimizing Mythfrontend

If you already have myth built and working and want to recompile to optimize, here are some tips.

If you want to optimize mythTV (The main module) for your system, try changing the QMAKE_CXXFLAGS_RELEASE line in settings.pro to "QMAKE_CXXFLAGS_RELEASE = -O3 -march=athlon-xp -m3dnow -mmmx -msse -mfpmath=sse -fomit-frame-pointer" or "QMAKE_CXXFLAGS_RELEASE = -O3 -march=pentium4 -mmmx -msse -mfpmath=sse -fomit-frame-pointer". Also change the QMAKE_CFLAGS_RELEASE line in libs/libavcodec/libavcodec.pro to "QMAKE_CFLAGS_RELEASE += $$OPTFLAGS -DPIC -fPIC -march=athlon-xp -m3dnow -mmmx -msse -mfpmath=sse -fomit-frame-pointer -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE" or "QMAKE_CFLAGS_RELEASE += $$OPTFLAGS -DPIC -fPIC -march=pentium4 -mmmx -msse -mfpmath=sse -fomit-frame-pointer -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE libs/libavcodec/libavcodec.pro".

If you want to use XvMC edit, settings.pro and uncomment the lines to enable it. (Useful only if you have an NVidia video card Geforce 440MX or newer, and this is still a bit buggy and won't ever be as smooth as Software decoding, but it does help for slower machines on the border for displaying HD content).

If you want to use openGL vsync, edit settings.pro and uncomment the lines to enable it. (Always a good idea)

There are several things inside the frontend you can toggle to make HDTV work better. Turning on de-interlacing will remove the "Comb" effect cause by interlaced video. This option can be found in Setup->Setup->Playback. Different de-interlacing works better depending on if you're doing Software or using XvMC. If you want to use XvMC go through several of the "Next" Options under setting up playback and make sure the "Enable XvMC" option is selected.

* Channels not showing up or working correctly

Since Myth sets the pcHDTV cards based on data it gets from Zap2it it's critical that the data is correct -- and sometimes they get it wrong. The correct fix is to contact your local TV station AND zap2it and let them know of the mis-match. The time it takes this to be fixed varries greatly on how re-active your TV station is. I've had some fix it in days, others still haven't after 8 months. A 'hack' for the situation where zap2it doesn't have the correct channel, or the subchannel is wrong is as follows.

Run your mythsetup program (mythsetup or under the mythtv cvs tree setup/setup (Or use mythweb) and edit the channels. Add a *new* channel entry and set it up how things *should* look for the channel entry that is wrong. Then go and disable the viewable flag for the channel entry that is wrong. Another option is to write a script that executes after mythfilldatabase finishes that will correct the sql data (Such as changing a subchannel where the freqid = 44-1 to 44-2. People do it both ways, it's just preference.




Google







Copyright © 2004 Computer Development Services