Slackware 9.1 MythTV Install ===Install Slackware 9.1 from CD=== Boot from Slackware 9.1 CD disc1 logging in as root #cfidsk Partition the drive(s) how ever you like. This is pretty much like partitioning in windows. You will however need to create what is known as a swap partition. This partition should be 1.5x to 2.0x the amount of ram you have. I would make this partition second. The first would be where the OS will be installed to. The partition the OS is going on should be made bootable with the bootable option. Once you have created the root and swap partitions, you'll have to declare a swap type for the swap partion. This would be type 82. Once these are set, write the table and exit. Format any other drives you may be using and continue to the next step. =Run setup= # setup Use target partitions above. Format as EXT3. Inode Density 1024. -Choose Install from CD -Auto scan for CD -Select Full install - No prompting -Insert Disc2 when prompted -Choose Cdrom when asked to install linux kernel -Choose a kernal to install(i suggest bare.i) -Create boot disk or skip (your choice) -No modem (unless you need it for some reason. you're on your own if you do.) -Yes to enable Hotplug system at boot -Simple lilo -Framebuffer 800x600x64 (change to whatever you like) -Skip kernel parameters -Install lilo to root -Select your mouse (i sugest either ps2 or usb depending on what you're using) -Yes to gpm -Yes to configure network -Hostname: (choose a name for this computer, i use MythTV) -Domain: (enter your network domain name or workgroup name) -DHCP (at least for most people) -DHCP hostname: (skip this if you are behind a NAT/router) -Yes to confirm network setup On the startup services page add these: - rc.mysqld (MySQL (needed by MythTV)) - rc.httpd (Apache web server (if you intend to use MythWeb)) - rc.samba (Samba (if you want to add this computer to your windows network)) Note: these should already be selected: rc.inetd, rc.pcmcia, rc.sendmail,rc.sshd Select yes or no to screen fonts, your choice Set your hardware clock to your time Choose a default window manager. I use KDE and this how-to is geared towards KDE. Select Yes to adding Root password Reboot after install finishes ===Compile 2.4.24 kernel=== Download 2.4.24 kernel source to /usr/src From within the /usr/src directory: # tar -zxvf linux-2.2.zz.tar.gz # rm linux # ln -s linux-2.4.24 linux # cd linux # make oldconfig (configure your kernel as needed. I enabled acpi and selected my processor, etc.) # make dep # make clean # make bzImage # make modules # make modules_install # mv /boot/System.map /boot/System.map.old # cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.24 Edit /etc/lilo.conf Add this section: image =/boot/vmlinuz-2.4.24 root = /dev/hda1 label = linux-2.4.24 append="mem=nopentium" <---only add this line if not using an intel processor read-only Now update lilo # /sbin/lilo ===Add new user=== add a user named MythUser so i can access my linux machine from my windows machine # adduser mythuser Accept defaults, enter password. Add user kevin to samba users(you don't need to do this unless you're setting up samba. I won't cover how to do that though, since its not *necessary* for setting up MythTV) # smbpasswd -a kevin (again blank password) ===Setup MySQL=== This fixes MySQL it will stop dying at boot. As root: # su mysql # mysql_install_db # exit # login # mythuser From here on out i assume you're logged in as a user other than root. This should be your mythtv user. $ startx ===Install Mplayer=== This step isn't necessarily needed, but it helps when testing the IVTV driver later. If you are able to transfer files from your linux machine to a windows machine easily (such as using samba networking) then you can skip this step if you like. Download Mplayer from http://www.mplayerhq.hu/homepage/ In this case MPlayer-0.92.tar.bz2 $ tar -jxvf MPlayer-0.92.tar.bz2 $ cd MPlayer-0.92 $ ./configure $ make $ su # make install # exit ===Install Lame=== Download lame from http://www.mp3dev.org/mp3. In this case lame-3.93.1.tar.gz tar -xzf lame-3.93.1.tar.gz $ cd lame-3.93.1 $ ./configure $ make $ make test $ su # make install ====North America Users Only==== Users in North America No longer use XMLTV to retrieve listings. Instead you now use Zap2It's DataDirect Service. ===Configure the Zap2It DataDirect Service=== First go to http://labs.zap2it.com/ and click on the "New User Signup" link. Accept the terms and condistions. Fill in your information and enter ZIYN-DQZO-SBUT for the Certificate Code. Next configure the lineup for your location and the channels you have. You can now proceed to the "Install IVTV Driver" section ====Non-North America only users==== XMLTV is now only for those not in North America. If you're in North America, you now use the Zap2it DataDirect service. ===Install XMLTV=== Download the most recent XMLTV from http://xmltv.sourceforge.net. As of this writing, that would be xmltv-0.5.31.tar.bz2 Extract the xmltv source: $ tar -xjf xmltv-0.5.31.tar.bz2 =Install the XMLTV prerequisites= Type no when asked if you want to setup manually When prompted for any other actions, just hit enter $ su # perl -MCPAN -e shell cpan> install XML::Parser cpan> install XML::Twig cpan> install Date::Manip Date::Manip is up to date. cpan> install LWP cpan> install XML::Writer cpan> exit # exit If you get errors when trying to install throught the -MCPAN method, then you'll have to manually build the prerequisites. First download the latest prerequisites package from http://xmltv.sourceforge.net. As of this writing its xmltv_prereq-6.tar.bz2. If you didn't get any errors, skip to Compiling XMLTV $ tar -xjf xmltv_prereq-6.tar.bz $ cd xmltv_prereq-6 $ su From here you go cd into each directory and do the following # perl Makefile.PL # make # make test # make install You shouldn't need to build everything in the xmltv_prereq-6 directory, but when in doubt, build them all. You may be thinking, don't I just need these: XML-Twig-?.?? (where ?.?? is a version number, these change with each prereq release.) XML-Writer-?.?? DateManip-?.?? libwww-perl-?.?? Yes you do need those, but they also rely on some other prequisites. I'm not quite sure which they rely on, the MCPAN method handles all that for you. When i was unable to get MCPAN to work, i just built everything in the prereq package. Took quite a while, but beggers can't be choosers. =Compile XMLTV= $ cd xmltv-0.5.31 $ perl Makefile.PL Do you want to proceed with this configuration? [yes,no (default=yes)] no Say yes to the grabber for your area. You can say no to everything else. $ make $ make test $ su # make install # exit ===Install IVTV Driver=== Download and compile the IVTV driver for the PVR-350/250 from http://sourceforge.net/projects/ivtv/ As of this writing use ivtv-0.1.9.tar.gz, don't use the CVS latest. **Note: As of this update 9/5/04, PVR-350 users intending to use the tv-out should use one of chris kennedy's ivtv drivers. You can get a link to his current repository by going to http://www.poptix.net/ivtv/current/threads.html and looking for a post made by chris kennedy. The current link to his repository should be in one of his posts. As of this writing, ivtv-0.1.10-pre2-ck107e appears to be a good driver, but i've only been using it for a short time. If this driver is buggy for you, try using ivtv-0.1.10-pre2-ck63p. It can take some time to locate this older driver on chris's site, but ivtv-0.1.10-pre2-ck63p worked very well for me, with the only problem being when the driver reloaded itself and you get a green screen for a few seconds. This is much better than getting a system freeze though, which is what used to happen. $ tar -xzf ivtv-0.1.9.tar.gz $ cd ivtv/utils $ wget http://hauppauge.lightpath.net/software/pvr250/pvr250_17_21288.exe $ su # ./ivtvfwextract.pl pvr250_17_21288.exe # exit $ cp videodev2.h ../driver $ cd ../driver $ make $ su # make install # cd ../utils # make # make install If you get errors during make install from utils directory, just manually move the binaries: # cp ivtvfbctl /usr/local/bin # cp ivtvplay /usr/local/bin # cp mpegindex /usr/local/bin # cp test_ioctl /usr/local/bin If these files are not present, then something else went wrong. Game Over, insert another coin and try again. Now its time to update /etc/modules.conf -PVR250 users and PVR350 users not using the PVR350's tv-out, add these lines to /etc/modules.conf alias char-major-81 videodev alias char-major-81-0 ivtv options tuner type=2 options msp3400 once=1 simple=1 add below ivtv msp3400 saa7115 tuner -PVR350 users intending to use it's tv-out add these lines (in order) to /etc/modules.conf: alias char-major-81 videodev alias char-major-81-0 ivtv options tuner type=2 options saa7127 enable_output=1 output_select=0 <----use this for composite output options saa7127 enable_output=1 output_select=1 <----use this for s-video output options msp3400 once=1 simple=1 add below ivtv msp3400 saa7115 saa7127 tuner add above ivtv ivtv-fb Next run depmod # depmod -ae Next check that your video devices have been created # ls -l /dev/video* you should get something like this: lrwxrwxrwx 1 root root 6 Mar 9 2003 /dev/video -> video0 crwxrwxrwx 1 root sys 81, 0 Mar 9 2003 /dev/video0 crwxrwxrwx 1 root sys 81, 1 Mar 9 2003 /dev/video1 crwxrwxrwx 1 root sys 81, 2 Mar 9 2003 /dev/video2 crwxrwxrwx 1 root sys 81, 3 Mar 9 2003 /dev/video3 Lets go ahead and make sure that our mythtv user can access the device: # chmod 777 /dev/video0 Now we need to see which device ivtv is running on # /bin/dmesg |grep ivtv You should see something like this: ivtv: Found an iTVC16 based chip tuner: probing ivtv i2c driver #0 i2c adapter [id=0x10005] saa7114.c: starting probe for adapter ivtv i2c driver #0 (0x10005) ivtv: Encoder revision: 0x02040011 ivtv: Registered v4l2 device, minor 0 <---The first device entry is what we're interested in ivtv: Registered v4l2 device, minor 32 ivtv: Registered v4l2 device, minor 224 This means ivtv is using /dev/video0 Now check that there is a symlink to /dev/video0 from /dev/video. (substitute the device your ivtv is using for /dev/video0) # ls -l /dev/video you should get something like this: lrwxrwxrwx 1 root root 6 Feb 29 12:51 /dev/video -> video0 If you do procede to loading the driver modules If you don't you'll need to make a symlink. # ln -s /dev/video0 /dev/video Next load the driver modules # modprobe ivtv # modprobe ivtv-fb <-----Only if using the PVR350's tv-out # exit Next lets check that your pci bus is recognizing your card: $ /sbin/lspci -v You're looking for an entry something like this: 00:0d.0 Multimedia video controller: Internext Compression Inc iTVC15 MPEG-2 Encoder (rev 01) Subsystem: Hauppauge computer works Inc.: Unknown device 4000 Flags: bus master, medium devsel, latency 64, IRQ 5 Memory at c8000000 (32-bit, prefetchable) [size=64M] Capabilities: [44] Power Management version 2 Make note of the first part, in this case 00:0d.0. You'll need this information later if you plan to run the MythTV interface on your television. PVR-250 users and PVR-350 users not using the PVR-350's tv-out skip on to Test Capturing *PVR-350 users using PVR-350 tv-out only* We need to determine what frame-buffer device ivtv-fb is using $ cat /var/log/messages |grep "iTVC15 TV out" You should get something back like this: Mar 5 19:39:11 MythTV kernel: fb1: iTVC15 TV out frame buffer device In this case fb1 is the frame-buffer device. Lets make sure you myth user has permissions for it: $ su # chmod 777 /dev/fb1 # exit If you're using the S-video out of the PVR-350: $ su # /sbin/rmmod saa7127 # /sbin/insmod saa7127 enable_output=1 output_select=1 test_image=1 If you're using the Composite TV-out: $ su # /sbin/rmmod saa7127 # /sbin/insmod saa7127 enable_output=1 output_select=1 test_image=1 You should see a colored bars test pattern. If you do go ahead and unload the module: S-Video: # /sbin/rmmod saa7127 # /sbin/insmod saa7127 enable_output=1 output_select=1 # exit Composite: # /sbin/rmmod saa7127 # /sbin/insmod saa7127 enable_output=1 output_select=0 # exit =Test Capturing= First lets set the video standard and resolution: For NTSC $ /usr/bin/test_ioctl -u 0x3000 $ /usr/bin/test_ioctl -p 4 $ /usr/bin/test_ioctl -f width=720,height=480 For PAL $ /usr/bin/test_ioctl -u 0xff $ /usr/bin/test_ioctl -p 4 $ /usr/bin/test_ioctl -f width=720,height=576 Ok, lets test that its working $ cat /dev/video0 > /tmp/test.mpg <---This will store the video in the /tmp directory as test.mpg. You can substitute whatever directory you like, for instance ~/test.mpg will place it in your home directory ~/. If you are using a pvr-250 and get this error: cat: /dev/video0: Input/output error Then try reloading the ivtv driver (this won't work for PVR-350 users, you'll need to reboot) $ su # /sbin/rmmod ivtv # /sbin/modprobe ivtv # exit Now either play the file from a windows machine or lauch MPlayer if you installed it: $ mplayer /tmp/test.mpg If you have sound working on your computer, you should get video and sound. PVR250 users/PVR350 users not using tv-out can skip to the next section Installing Lirc. PVR-350's users should now test the tv-out: $ ivtvfbctl /dev/fb1 -noglobalalpha -localalpha $ dd if=/dev/video0 of=/dev/video16 bs=64k (control -c to stop) If you're video has a bunch of horizontal lines through it try this: $ ivtvfbctl /dev/fb1 -alpha -on -globalalpha -nolocalalpha $ dd if=/dev/video0 of=/dev/video16 bs=64k If you just get a black/blank screen, you're /dev/video16 probably wasn't created correctly. This has happened to me almost everytime i've installed ivtv. Try this: $ su # rm /dev/video16 # mknod /dev/video16 c 81 16 # chmod 777 /dev/video16 # exit $ dd if=/dev/video0 of=/dev/video16 bs=64k You should now get video and sound on your tv. If you're not, refer to the IVTV FAQ here: http://ivtv.writeme.ch/tiki-view_faq.php?faqId=1 If everything is working, restore the alpha settings: $ ivtvfbctl /dev/fb0 -globalalpha -nolocalalpha ===Install Lirc=== These instructions are for those using the Hauppauge PVR-250/350 remote. Download and compile the latest lirc from http://lirc.sourceforge.net/software/snapshots/ In this case lirc-0.7.0pre2.tar.bz2 $ tar -xjvf lirc-0.7.0pre2.tar.bz2 $ cd lirc-0.7.0pre2 $ su # ./setup.sh -Choose 1 - driver configuration -Choose 5 - TV card -Select f - Hauppauge TV card -Choose 3 - Save configuration & run Configuration # make # make install Add the following lines to your /etc/modules.conf alias char-major-61 lirc_i2c add above ivtv lirc_dev lirc_i2c For reference, this is what my complete modules.conf looks like: alias char-major-81 videodev alias char-major-81-0 ivtv alias char-major-61 lirc_i2c options tuner type=2 options saa7127 enable_output=1 output_select=0 options msp3400 once=1 simple=1 add below ivtv msp3400 saa7115 saa7127 tuner add above ivtv ivtv-fb add above ivtv lirc_dev lirc_i2c Next build dependencies # depmod -ae Now lets load the lirc modules: # modprobe lirc_dev # modprobe lirc_i2c # lircd # exit now lets check that the appropriate devices were created $ ls -l /dev/lirc* You should get 2 devices looking something like this: crw-r--r-- 1 root root 61, 0 Mar 15 18:36 /dev/lirc srw-rw-rw- 1 root root 0 Mar 15 18:49 /dev/lircd= Now lets copy the lirc config over to /etc First cd into your ivtv/utils directory From there: $ cp lircd-g.conf /etc/lircd.conf ===Install MythTV=== Download and compile the latest MythTV. In this case mythtv-0.15.tar.bz2 Extract the MythTV source: $ tar -xjf mythtv-0.15.tar.bz2 $ cd mythtv-0.15 We'll need to enable native lirc support by editing settings.pro # Native lirc support #CONFIG += using_lirc <-----uncomment this line #LIRC_LIBS = -llirc_client <-----uncomment this line. Now lets build MythtTV It should now look like this: # Native lirc support CONFIG += using_lirc LIRC_LIBS = -llirc_client Now it's time to compile MythTV: $ ./configure $ qmake mythtv.pro $ make $ su # make install # exit Now lets setup the initial database: $ cd database $ mysql -u root < mc.sql ===MythTV Setup=== First lets setup the backend: $ cd ../setup $ ./setup Answer yes to the 2 questions: Would you like to clear all capture card settings before starting configuration? [no] yes Would you like to clear all program/channel settings before starting configuration? [no] yes Refer to the MythTV documentation located at http://www.mythtv.org/modules.php?name=MythInstall for more information on the settings. Here's how mine is setup. Anything entries not listed were left at default.modp ==General== ==Host Address Backend Setup== leaving the defaults here will work for most people IP address for MythTV: (If you're not using static IP addresses on your network, then type the address you'll be assigning to this computer) Port the Server runs on: (unsure, if you're reading this how-to, you probably don't need to mess with this.) Port the Server shows status on: (unsure, if you're reading this how-to, you probably don't need to mess with this.) Master Server IP address: (use this if the computer you're setting up isn't your master backend. Put the IP address for your master backend here) Port the master server runs on: (unsure, if you're reading this how-to, you probably don't need to mess with this.) ==Host-specific Backend Setup== This is where you'll tell myth to store your recorded shows and live video buffer. directory to hold recordings: (point this to the directory where you want to store your recordings) directory to hold Live-TV buffers: (point this to the directory where you want to store your live tv buffer. I suggest a different directory than your recordings.) Live TV buffer(GB): (This sets the maximum amount myth will use for the live tv buffer. Higher number=more live tv recorded and temporarily stored. This means higher numbers allow you to rewind farther back in live tv. Minimum free Live Buffer(MB): (This tells myth what the minimum space allowable should be in order to use the live tv buffer. This means that if your free space falls below this, myth won't let you watch live tv. I think thats what this does anyway.) Save original files after transcoding: (Checking this preservers the original recordings if you use transcoding. This means that if you transcode a show, you'll end up with a transcoded file in addition to the original file.) ==Global Backend Setup== Format: (This sets your video format. NTSC for the U.S. Pal for Europe, etc.) VBI format: (this is for teletext and closed captioning. You're own your own here.) Channel Frequency table: (this is for selecting the type of channel frequency your using. Broadcast television (antenna), cable, etc.) Time offset for XMLTV listings: (this is the times the tv listings use don't match your time zone.) Master Backend Override: (Not quite sure about this one. Has to do with streaming video.) =Shutdown/Wakeup Options= You're own your own here for now. These are shutdown/wakeup options for the backend. I left everything default. startup command: Block shutdown before client connected: Idle timeout(secs): Max. wait for recording (min): Startup before rec. (secs): (This is the amount of time myth will start recording before a recording is set to start. Usefull to make sure you get a show recorded completely. This helps prevent missed show begginings because your computers clock was a little off for example.) Wakeup time format: Set wakeuptime command: Server halt command: Pre Shutdown check-command: =WakeOnLan settings= You're on your own here as well. I used defaults. Reconnect wait time (secs): Count of reconnect tries: Wake Command: Wake command for slaves: ==Capture Cards== Now you're going to setup of your capture cards. (New Capture Card) <---select this Card Type: MPEG-2 Encoder card(PVR250, PVR-350) Video Device: (select your video device, this was determined when we setup the IVTV driver. it can be found by issuing this command: # /bin/dmesg |grep ivtv) VBI device: (You're on your own here, i used the default) Audio device: (select your audio device. I'm using the PVR-350's tv-out so this doesnt effect me) Audio sampling rate limit: (just what it says, i left it default) Do not adjust BT audio volume: (you're on your own, i left it default) Default input: (select the input method for your tv signal. If using the coaxial input, select tuner 0) ==Video Source== (New Video Source) <---- select this Video Source Name: (give the source a name, i used "cable") XMLTV listings grabber: (Choose your XMLTV listings grabber for your location.) Zip/postal code: (enter your zip code) Provider: (choose the correct provider from the list) Channel frequency table: (Most people should just leave this default.) ==Input Connections== Select the input that matches your default input. For me its: [MPEG: /dev/video0](Tuner 0)->(none) ==Connect source to input== Video Source: (use what you defined as a name in video source above) Input preference: (this used is if you're using multiple tuner cards. I left default) External channel change command: (this is if you're controlling a tuner box. you're on your own, i'm not using an external cable box.) Preset tuner to channel: (used with the above setting, you're on your own) Starting channel: (the channel Live tv first tunes to when selected. Can be left default.) ==Channel Editor== It is recommend you leave this alone for now. More info can be found at http://www.mythtv.org/ Once everything is setup it's time to populate the database: $ mythfilldatabase Now we're going to setup a cron job so that mythfilldatabase will run periodically to update the tv listings. $ cd ../configfiles $ cp mythfilldatabasecron ~/.mythtv $ cp mythcrontab ~/.mythtv $ cd ~/.mythtv $ crontab mythcrontab $ crontab -l NOTE: this is a lowercase L. You should now see something like this: # The following will run the mythfilldatabase shell script at 0430 # every day. Format is # minutes hour day_of_month month day_of_week # man 5 crontab for more information # Need to use a shell script because the QTDIR environment variable isn't # being honored by crontab? # The next text should be all on the same line. 30 04 * * * /bin/bash $HOME/.mythtv/mythfilldatabasecron This means that mythfilldatabase will run at 4:30am every morning. To change this, simply edit the mythcrontab file and run the following: $ crontab mythcrontab Once thats complete, we can start the backend $ mythbackend ===Finishing Touches=== ==Autostarting Mythbackend at boot== Now would be a good time to set the backend to start up at boot time. We'll also set it up to write to log file for debugging. To do this, add the following line to your /etc/rc.d/rc.local file. /usr/local/bin/mythbackend > /home/kevin/mythbackend.log 2>&1 & ==Autostarting mythfrontend with X== Now lets setup mytfrontend to start with X and to write to a log file. First lets create a file called mythfrontendauto in your /usr/local/bin directory. You can do this by running the following command. $cd /usr/local/bin $ su # kedit mythfrontendauto Add the following lines: #!/bin/bash /usr/local/bin/mythfrontend >/home/kevin/mythfrontend.log 2>&1 & Next lets make it executable: # chmod 755 mythfrontendauto # exit Now we need to put a link to this file in the ~/.kde/Autostart directory $ cd ~/.kde/Autostart $ ln -s /usr/local/bin/mythfrontendauto mythfrontend Now if in the future you need to troubleshoot problems with Myth, you can check the mythfrontend.log and mythbackend.log files which you'll find in your home directory (thats ~/). You can now start the mythfrontend if you prefer to configure it while its running on your computer monitor by issuing the command: $ mythfrontend Or you can wait and configure mythfrontend after you have it running on your TV. ===Running X through PVR-350 TV-out=== For those using PVR-350's you'll need to edit your /etc/X11/XF86Config file so that Myth will be displayed on your TV instead of the computer monitor. I recommend making a copy of your XF86Config in case you have problems. You'll need to add the following lines to your /etc/X11/XF86Config file under the Monitor section: Section "Monitor" Identifier "NTSC Monitor" HorizSync 30-68 VertRefresh 50-120 Mode "720x480" <-----For PAL change this to "720x576" DotClock 34.564 HTimings 720 752 840 928 VTimings 480 484 488 504 Flags "-HSync" "-Vsync" EndMode EndSection Section "Device" Identifier "Hauppauge PVR 350 iTVC15 FrameBuffer" Driver "ivtvdev" Option "fbdev" "/dev/fb1" <-----change this to what ever fb# device you're using BusID "0:0x0d:0" <----see note below EndSection For the BusID section, change what i have listed to the busID you retrieved during the IVTV setup with the $ /sbin/lspci -v command. I mentioned you should make note of it. However you need to convert it to hexidecimal format. For example, fom the $ /sbin/lspci -v command, i got 00:0d.0 for my bus id. This converts to 0:0x0d:0 (even though it looks like it, there are NO spaces in there). Now we need to get the X driver for the pvr-350. You can get it here: http://membres.lycos.fr/badzzzz/ivtvdev_drv.o.gz Now lets unzip and install it: $ gunzip ivtvdev_drv.o.gz $ su # cp ivtvdev_drv.o /usr/X11R6/lib/modules/drivers/ # exit ====The End====