Friday, April 22, 2005

pcHDTV Cards and MythTV Installation

Hard drive partitioning using Disk Druid:

/dev/hda1, /boot, 100MB, ext3
/dev/hda2, swap, Same_size_as_RAM, n/a
/dev/hda3, /, Rest_of_disk, ext3

(based on suggestion from Jarod's page (wilsonet.com/mythtv)
===

Downloaded and untar'd:
FC2-3-Kernel-2.6-pcHDTV-driver-1.5.tar.gz 2.6 kernels (12/20/04)

(from pchdtv.com)

cd to the 'drivers' dir and 'make' to compile.

# make install

Ignore error message about inserting bttv (that's for the HD-2000 card).

# depmod -a
( make sure there are no msgs )

# modprobe cx8800
( look for errors in dmesg )

***Important: REBOOT

( check dmesg for errors again )

look for /dev/video32 and /dev/video33

Download from pchdtv.com:
tools-2.6.a (status unstable) only for 2.6 kernel drivers

This has the dtvsignal tool. untar. precompiled binaries are already in there, so just run from the untar subdir or 'make install' to add to $PATH.

Verify cards are working with:
dtvsignal /dev/video32 56
dtvsignal /dev/video32 56

( this shows a dynamic ascii meter )

Can scan for all active channels with:
[root@myhost tools-2.6-a]# ./dtvscan /dev/video32

===

Get mythtv via cvs. Later, when you run mythfrontend, you can see what version you are running in the stdout when mythfrontend is started:

"2005-04-22 02:24:32.937 mythfrontend version: 0.18.20050409-1 www.mythtv.org"

===

Compiling myth, requires qt and qt-devel (yum install these if they don't exist)

'yum update qt' failed because yum complained gpg key was missing for 'updates-released'. Websearch hit revealed:

rpm --import /usr/share/rhn/RPM-GPG-KEY
rpm --import /usr/share/rhn/RPM-GPG-KEY-fedora

['yum update qt' worked after this]

Later, to install MythDVD, I also needed:
# rpm --import /usr/share/doc/fedora-release-3/*GPG-KEY*

install qt-devel:
yum install qt-devel

after installing qt-devel, I have the qt binaries (qmake, etc)

Re-login as root:
# su -

Now QTDIR var is set:

# echo $QTDIR
/usr/lib/qt-3.3

# which qmake
/usr/bin/qmake

# yum install lirc
# yum install lirc-devel

# chkconfig --list | egrep lirc
# chkconfig lirc on

REBOOT

lirc now shows up in /dev :-)

===
yum install lame
yum install lame-devel

===

./configure (myth) says "XvMC support no" bummer!

after reading webpages: I see that drivers are there:

[root@mythtv ~]# cd /usr/X11R6/lib/
[root@mythtv lib]# ls -R | egrep -i xvmc
libI810XvMC.a
libI810XvMC.so
libI810XvMC.so.1
libI810XvMC.so.1.0
libXvMC.a
libXvMCNVIDIA.a
libXvMCNVIDIA_dynamic.so.1
libXvMCNVIDIA.so.1.0.7174
libXvMC.so
libXvMC.so.1
libXvMC.so.1.0
xf86xvmc.h
xvmcext.h
XvMC.h

But "XvMC" doesn't show up in Xorg.0.log like some other people's. Actually, I learned this is not true, I was looking for "XvMC" in the log, but it's listed as "XVideo-MotionCompensation".

Some people had files that I was missing so:

# yum install libXvMCW

[ This turned out to be a mistake. ]

GOOD FIND:

"xorg 6.7.0 supports XvMC, and XFree86 4.4 probably does. Check for a file named libXvMC.* in /usr/X11R6/lib. When you run X and XvMC is enabled, you will see this in /var/log/Xorg.log.0:

(II) Loading extension XVideo
(II) Loading extension XVideo-MotionCompensation"

I checked my Xorg.0.log and it DOES have this "Loading extension XVideo-MotionCompensation" line :-)

Can compile mythtv with xvmc:

configure --help

says there is an option:

./configure --enable-xvmc enable XvMC (Linux/BSD MPEG accel.)

I did this, and now says XvMC support "yes".

NOTE: Next time I should "./configure -–enable-opengl-vsync --enable-xvmc"


# qmake mythtv.pro
# make [this takes some cpu time]

got compile error "/usr/bin/ld: cannot find -lXvMCW"

so 'yum remove libXvMCW' [ pretty sure magnito didn't install libXvMCW ]

checked config.mak and it no longer has using_xvmcw :-)

then:
make clean
qmake mythtv.pro
make

Last few lines of 'make' were:

make[1]: Leaving directory `/root/cvs/mythtv/themes'
cd setup && make -f Makefile
make[1]: Entering directory `/root/cvs/mythtv/setup'
g++ -c -pipe -march=pentiumpro -Wall -W -O3 -Wall -Wno-switch -fomit-frame-pointer -D_REENTRANT -DMMX -DUSING_IVTV -DUSING_XRANDR -DUSING_XVMC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DPREFIX=\"/usr/local\" -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/usr/lib/qt-3.3/mkspecs/default -I. -I/usr/local/include -I../libs/libmythtv -I../libs -I../libs/libmyth -I../libs/libmythtv/dvbdev -I/usr/lib/qt-3.3/include -o main.o main.cpp
g++ -c -pipe -march=pentiumpro -Wall -W -O3 -Wall -Wno-switch -fomit-frame-pointer -D_REENTRANT -DMMX -DUSING_IVTV -DUSING_XRANDR -DUSING_XVMC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DPREFIX=\"/usr/local\" -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/usr/lib/qt-3.3/mkspecs/default -I. -I/usr/local/include -I../libs/libmythtv -I../libs -I../libs/libmyth -I../libs/libmythtv/dvbdev -I/usr/lib/qt-3.3/include -o backendsettings.o backendsettings.cpp
g++ -o mythtv-setup main.o backendsettings.o -L/usr/lib/qt-3.3/lib -L../libs/libmyth -L../libs/libmythtv -L../libs/libavcodec -L../libs/libavformat -lmythtv-0.18 -lmythavformat-0.18 -lmythavcodec-0.18 -lmyth-0.18 -lfreetype -lmp3lame -lasound -L/usr/X11R6/lib -lXinerama -lXv -lXxf86vm -lXvMCNVIDIA -lXvMC -lqt-mt -lXext -lX11 -lm -lpthread
make[1]: Leaving directory `/root/cvs/mythtv/setup'
cd i18n && make -f Makefile
make[1]: Entering directory `/root/cvs/mythtv/i18n'
gcc -c -pipe -march=pentiumpro -Wall -W -O3 -Wall -Wno-switch -fomit-frame-pointer -DMMX -DUSING_IVTV -DUSING_XRANDR -DUSING_XVMC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DPREFIX=\"/usr/local\" -I/usr/lib/qt-3.3/mkspecs/default -I. -I/usr/local/include -o dummy.o dummy.c
g++ -o i18n dummy.o
make[1]: Leaving directory `/root/cvs/mythtv/i18n'

Install the binaries:

# make install

Enable real-time scheduling for smoother video:

[root@mythtv mythtv]# chmod a+s /usr/local/bin/mythfrontend
[root@mythtv mythtv]# ls -l !!:2
ls -l /usr/local/bin/mythfrontend
-rwsr-sr-x 1 root root 1158481 Apr 19 02:07 /usr/local/bin/mythfrontend

Later, when you run mythfrontend and play a recording, you can verify realtime priority is being used. Check the mythfrontend messages on stdout:

"2005-04-22 02:24:41.104 Using realtime priority."
[ Might have to run as 'mythfrontend --verbose audio' to see this msg ]

----

Create some directories such as /mythtv/live, /mythtv/recordings, /mythtv/video, and /mythtv/music

make read/write privs:

chmod a+rwx /mythtv/recordings [ /mythtv/video, and /mythtv/music]

---------

per instructions, import setup commands into mysql.
if u get this error, ignore it:

ERROR 1064 at line 4: You have an error in your SQL syntax near 'TEMPORARY TABLES ON mythconverg.* TO mythtv@localhost IDENTIFIED BY "mythtv"' at line 1

(seems to happen on newer versions of mysql)

---
ignore these errors (lirc related, lirc not setup yet):

mythtv: could not connect to socket
mythtv: Connection refused

----
Before running mythtv-setup:

[root@be ~]# mythtv-setup
mythtv-setup: error while loading shared libraries: libmythtv-0.18.so.0: cannotopen shared object file: No such file or directory
[root@be ~]# ls /usr/local/lib | egrep mythtv
libmythtv-0.18.so
libmythtv-0.18.so.0
libmythtv-0.18.so.0.18
libmythtv-0.18.so.0.18.0
mythtv
[root@be ~]# vi /etc/ld.so.conf
[ Add /usr/local/lib to bottom of file ]
[root@be ~]# ldconfig


---

mythtv setup: Make sure you select card type == pchdtv2000/3000!

Add nightly cron job to update database:
$ crontab -e
----Insert the following text into your mythtv user crontab----
### Run mythfilldatabase every night at some random time after 3:01am
01 3 * * * sleep $(expr $RANDOM \% 14400) && /usr/local/bin/mythfilldatabase > /var/log/mythtv/mythfilldatabase.log 2>&1

---

Create user 'mythtv'
# adduser mythtv
# passwd mythtv
( use pw = "mythtv" )

==========

4/19/05
Started hdnet/kron recording and non-hidef dtv recording.
Went to view them, got hi cpu and lots of swapping on List of programs to watch (triggered by the small thumbnail preview?):

# vmstat 1
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 14 261608 1304 136 7292 388 44 3900 44 1581 346 1 9 0 91
0 13 261608 1360 136 7276 168 48 4856 48 1437 372 0 10 0 90
0 13 261608 1416 152 7304 208 8 7656 8 2100 567 0 10 0 90
0 16 261600 1360 152 7520 280 20 6392 20 2016 543 0 10 0 90
0 16 261608 1528 140 7268 364 132 7896 132 1736 445 0 12 0 88
0 13 261612 1304 132 7432 628 32 7272 48 1592 405 0 11 0 89
0 14 261612 1136 136 7644 584 12 8228 20 1766 443 0 10 0 90
0 16 261628 1640 164 7028 848 32 10156 32 2715 707 0 11 0 88
0 13 261628 1304 152 7472 396 4 8404 4 1673 483 0 14 0 86
0 14 261628 1360 168 7412 424 916 14092 1004 2628 807 1 38 0 61
3 16 262488 1192 148 6656 232 56 8836 56 1775 609 0 79 0 21
3 12 262492 1360 148 6504 92 28 12424 28 1790 665 0 92 0 8
3 13 262492 1192 148 6616 184 48 14680 48 2038 824 0 86 0 14
3 16 262492 1276 148 6524 152 136 13604 136 2186 851 1 80 0 19
3 15 262500 1220 148 6448 16 12 15996 12 1747 707 0 100 0 0
3 13 262500 1276 152 6500 0 84 14356 84 1915 709 0 87 0 13
3 18 262504 1276 160 6332 328 116 30760 116 3964 1781 0 94 0 6
3 16 262504 1220 152 6656 44 48 12264 48 1742 749 0 70 0 30
3 15 262512 1276 152 6344 60 48 16492 48 1865 794 0 94 0 6
3 17 262512 996 152 6700 12 32 19024 32 1890 879 0 100 0 0
2 15 262508 1276 156 6596 20 32 13024 32 1704 691 0 66 0 34
3 14 262516 1164 152 6572 40 36 14996 36 1682 802 1 80 0 19
3 14 262516 1388 156 6328 72 24 14352 24 1644 768 0 86 0 14
0 15 262516 1388 156 6480 132 48 19520 48 2247 927 0 81 0 19
3 15 262516 1388 148 6472 160 40 8888 40 1615 575 0 46 0 54
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
3 15 262512 1164 148 6424 104 20 10504 20 1655 698 0 70 0 30
3 15 262516 1052 152 6420 24 64 17340 64 1818 909 1 99 0 0
0 15 262520 1164 156 6616 0 4 13968 4 1559 682 0 95 0 5
3 16 262512 1164 148 6700 36 44 10956 44 1619 584 0 73 0 27
3 15 262512 1220 152 6476 8 20 15568 20 1877 825 0 89 0 11
3 12 263712 1052 148 6584 108 1404 15352 1404 1963 680 1 70 0 29
3 13 263704 996 148 6736 340 192 20064 192 1980 770 0 100 0 0
0 12 263676 1444 156 7224 488 204 17476 204 2052 651 0 59 0 41
2 14 264424 1556 148 6668 320 1016 8672 1016 1590 454 0 19 0 81
0 15 264412 1556 156 6536 496 136 11596 136 2428 699 1 31 0 68
0 13 264380 1108 160 6964 252 20 6352 20 1551 515 0 33 0 67
0 13 264356 1164 164 6964 112 36 5460 36 1575 518 0 45 0 55
3 13 264344 1108 148 6864 108 68 11072 68 1789 671 0 77 0 23
3 15 264356 1108 152 6840 160 68 10180 68 1844 616 0 70 0 30
3 13 264468 1164 164 6756 76 176 10648 176 2655 1011 1 42 0 57
0 16 264472 1128 164 6604 64 28 7796 28 1773 557 0 51 0 49
3 16 264480 1024 144 6836 44 28 8364 28 1626 548 0 83 0 17
3 17 264480 1108 116 6772 24 4 9472 28 1776 682 0 100 0 0
2 14 264484 1220 116 6752 56 20 8476 20 1708 703 1 99 0 0
1 14 264560 1052 120 6864 144 140 8284 144 1719 696 0 100 0 0
2 12 264564 940 120 6908 124 44 9176 44 1656 645 1 99 0 0
2 16 264564 1164 120 6568 16 32 10412 32 1732 689 0 100 0 0
3 12 264576 1444 120 6552 28 48 8272 48 1598 590 0 89 0 11
4 14 264576 996 104 6940 104 32 10928 48 1910 699 0 86 0 14
3 15 264568 996 112 7052 184 36 8512 36 1663 616 1 80 0 19
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
3 15 264556 1276 112 6800 0 16 6892 16 1614 625 1 99 0 0
2 15 264556 1108 120 7288 60 28 2768 28 1444 399 0 20 0 80
3 13 264556 1332 116 7048 32 20 4824 20 1501 514 1 21 0 78
1 14 264536 1332 112 7224 112 36 5344 36 1661 597 0 20 0 80
0 12 264556 1444 120 7068 12 52 5984 52 1532 534 0 25 0 75
0 13 264556 1108 136 7464 60 80 4004 80 1562 472 0 10 0 90
1 12 264556 996 148 7480 36 28 4120 28 1434 344 0 12 0 88
1 12 264568 1220 136 7420 32 24 9424 28 1583 532 0 22 0 78
0 14 264580 1500 144 7184 4 56 9776 56 1576 504 0 21 0 79
0 13 264572 1668 148 7088 52 8 7168 8 1477 478 0 16 0 84
0 11 264580 1108 164 7388 24 20 7728 20 1497 440 0 15 0 85
0 12 264584 1332 156 7480 4 8 6868 76 1526 477 1 13 0 86
0 14 264576 1332 136 7660 16 8 5692 8 1475 444 0 14 0 86
0 9 264568 1052 152 7944 24 0 7404 4 1569 458 0 14 0 86
0 8 264392 1388 156 9212 136 144 5384 144 1721 500 1 6 0 94
0 11 263944 2004 176 9912 56 56 888 72 1153 117 0 2 0 98
0 8 263936 2640 188 10228 16 0 340 16 1129 103 1 1 0 98
0 8 263736 3652 192 10524 188 0 332 0 1122 97 0 1 0 99
0 8 263508 3652 200 11224 392 0 984 0 1136 134 0 2 0 98
0 8 263376 3736 208 11764 272 0 820 0 1131 104 0 2 0 98
0 9 235984 26428 240 12684 348 0 1088 0 1149 131 0 2 0 98
0 10 235816 24468 308 14656 612 0 2440 204 1175 217 1 1 0 98
0 7 235236 23516 372 16084 580 0 1444 84 1202 251 1 1 0 98
0 4 235236 23052 456 16536 548 0 1044 100 1170 225 1 2 0 97
0 3 235236 23556 504 16872 208 0 544 92 1155 166 0 2 0 98
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
1 3 235148 24792 544 17012 116 0 168 84 1128 163 0 1 0 99
0 2 235060 26252 588 17100 180 0 180 88 1147 197 0 2 0 98
0 0 235060 24292 1008 18384 1092 0 2380 840 1361 879 2 4 18 76
0 0 235060 24308 1008 18384 0 0 0 0 1084 203 1 0 99 0
0 0 235060 24196 1012 18496 20 0 136 0 1071 188 0 0 96 4
0 0 235060 24084 1016 18556 20 0 84 0 1091 198 0 0 98 2
0 0 235060 24084 1016 18556 0 0 0 0 1064 177 0 0 100 0
0 0 235060 23804 1020 18696 176 0 320 0 1108 226 0 0 53 47
0 0 235060 23804 1020 18696 0 0 0 0 1064 189 0 0 100 0
0 0 235060 23804 1020 18696 0 0 0 0 1082 194 0 0 100 0
0 0 235060 23808 1020 18696 0 0 0 0 1067 171 0 0 100 0
0 0 235060 23808 1020 18696 0 0 0 0 1083 197 0 0 100 0
0 0 235060 23808 1020 18696 0 0 0 0 1064 183 0 0 100 0
0 0 235060 23808 1020 18696 0 0 0 0 1083 182 0 0 100 0
0 0 235060 23864 1020 18696 0 0 0 0 1064 182 0 0 100 0
0 0 235060 23864 1020 18696 0 0 0 0 1082 191 0 0 100 0
0 0 235060 23864 1020 18696 0 0 0 0 1066 175 0 0 100 0
0 0 235060 23864 1020 18696 0 0 0 0 1084 205 0 0 100 0
0 0 235060 23920 1020 18696 0 0 0 0 1064 169 0 0 100 0
0 0 235060 23920 1020 18696 0 0 0 0 1084 188 0 0 100 0

Alt-tab'd to terminal window, but this took lots of time and swap (~10 mins). Never fully alt-tab'd over. mythback & frontend quit. not in 'ps'.

Need more RAM?

Currently have: 256 MB DDR266 (PC2100) DIMM

Disabled thumbnail preview, just static image. much better! :)

===

Watching and Recording at the same time works ok, but not when fast-forward and rewinding while watching a show. CPU is max'd for a few seconds and this causes distorted video in the show(s) being recorded.

Researched Athlon overclocking and Gigabyte bios settings. Tried various core speeds and overvoltage settings. Tested with prime95 on windows 2000. Viewed actual core speed, Vcore, etc with CPU-Z. Highest, stable OC was:

>> Clocked at 143MHz w/ +7.5% overvoltage: Vcore = 1.984V, 13x multiplier.

After this, ff/rew was very crisp. Checked cpu with vmstat. Recording two shows while watching a 3rd show off disk was acceptable.

===

Can't get mythdvd, mythvideo, and the others via cvs? Error looks like:
cvs server: cannot find module `mythdvd' - ignored


They reorganized the cvs tree on 4/12/2005. So do this:

# cd /root/cvs
# cvs -z3 -d :pserver:mythtv@cvs.mythtv.org:/var/lib/mythcvs checkout mythplugins


All addson are now merged into 'mythplugins'.

0 Comments:

Post a Comment

<< Home