text:
MythTV/Installing

The easiest way to install MythTV is to follow a how-to. The following how-to is geared towards Mandrake 10.1 Official (download), but most of the steps will be similar for other linux distributions. The locations of some files may be slightly different, and instead of using urpmi to install updates, you will need a different tool depending on your distribution. So, you should first figure out what packaging tool is used on your linux distribution, and whenever commands involving urpmi arrive, use your tool instead. Examples of tools used on other command-line tools are apt-get, and emerge (used on Gentoo). There are also graphical tools, such as grpmi (graphical version of urpmi), rpmdrake (for Mandrake), Synaptic, etc.

If you're using another distribution and need to find a particular file, you can always use the find command. For instance: will find everything that starts with "file." (Note that searching starting at the root level, "/", will take a long time, so you should limit your search if you can.) This can be a great way to figure out where a file has been placed in your distribution. You can also use $ which command_name To find out where a given command or script is located. (The "whereis" command is also useful.) If the command does not exist on any defined path, this will let you know (so that you can either install the required software, or add it to the path appropriately). This is useful when a how-to asks you to run a command that you seemingly don't have. Also, before running any commands you should probably do $ man command_name to get some information on what the command does and how to use it. Many times the answer to your question is hidden inside a manual page.
 * 1) find / -name "file*"

Download and install Mandrake
You can download the latest Mandrake ISO images from the official download page, or from any number of mirrors. You then burn these ISO images to CD, and perform the installation by booting off the CD. There are many other ways to install linux of course. What you install of course depends on what you want. You should install all the multimedia options, and development tools (so that you'll be able to compile things later). It's probably a good idea to install network client functions, and if you want to access your MythTV remotely, you should install some server packages (web server and ssh server especially). Having your MythTV running an SSH server can be handy if you have another computer at your disposal, because then you can have your MythTV hooked up to your television, but configure it via command line of another computer (this is good because your MythTV, when hooked up to a television, doesn't have very good resolution, and it can be aggravating to use it as a computer). You need to install some sort of window manager. KDE is a good choice if you have no other preference.

In terms of partitioning your disk, it makes good sense to have your linux OS on one partition, and keep another partition for storing your MythTV data. That way you can reinstall linux without deleting your videos. Linux doesn't need very much space (5 or 10 Gb is sufficient). Be sure to make your swap partition (512 Mb is pretty typical, but you can make it bigger if you like). And of course the bulk of your space (100+ Gb hopefully) is allocated for mythTV. You can set the mount point of this partition as "/data/" or "/home/mythtv/data/" or "/home/" or whatever you like.

During installation, you may aswell create an account called 'mythtv'. Once the installation is complete, create the directory where you will store your MythTV data (make sure it is inside your big partition!). So, for example, if you wanted to create /data you would type 'su' to become root, and:
 * 1) cd /
 * 2) mkdir /data
 * 3) chown mythtv:mythtv /data
 * 4) mkdir /data/mythtv

You'll also want to have your kernel source installed (for compiling drivers, later). To install software on Mandrake, we use a convenient tool called "urpmi" that downloads, installs, and configures automatically. Often, you can just type: and your source will be installed. However, this won't always install the correct kernel source. You must make sure that your kernel source version matches the version of the kernel you're using. To determine your current kernel version, type: $ uname -r 2.6.8.1-12mdk In this example, a 2.6 kernel is running. To install the right 2.6 source: Of course modify this command depending on what source you're looking for. You can also use "urpmq" to query your urpmi sources, and find out what different kernel sources are available, and what the package names are called (be warned: packages like "kernel-source-2.6" might not be the exact kernel version you have, so look for something that matches exactly). If you can't find the right source, you can try configuring some urpmi sources (refer to the next section), and then use "urpmq" again to find a source that matches your kernel.
 * 1) urpmi kernel-source
 * 1) urpmi kernel-source-2.6-2.6.8.1-12mdk

Once you have your kernel source installed, it's a good idea to double check that it's the right one: $ cd /usr/src $ ls -lF lrwxrwxrwx  1 root root   19 May 28 20:50 linux -> linux-2.6.8.1-12mdk/ drwxr-xr-x 21 root root 4096 May 28 20:50 linux-2.6.8.1-12mdk/ drwxr-xr-x  3 root root 4096 May 21 13:09 RPM/ Thus, make sure that the "linux-*" directory matches what uname returned. If not, you should uninstall the current kernel source (by typing something like "# urpme kernel-source") and then install the correct source. Also, make sure that you have the above symbolic link. If you don't have one, then make it: There is another symbolic link that is often missing, which you should create if it isn't there. Check: $ cd /lib/modules/2.6.8.1-12mdk $ ls -lF lrwxrwxrwx  1 root root     15 May 28 20:07 build -> /usr/src/linux/ ... And make it if it is missing:
 * 1) ln -s /usr/src/linux-2.6.8.1-12mdk /usr/src/linux
 * 1) ln -s /usr/src/linux /lib/modules/2.6.8.1-12mdk/build

Get urpmi sources
Mandrake uses urpmi to download and install all sorts of software. After installing Mandrake from CD, you probably have three CDs listed as sources inside urpmi. When you tell urpmi to install something, it checks all of its sources, finds the package you want, and installs it. For our purposes, it's best to add some online repositories of Mandrake packages to urpmi. That way, all the dependencies will be automatically downloaded and installed as needed. So that we always get the newest packages, we can remove the current sources (which are the installation CDs): Now we need to find some good, trustworthy, and fast online package sources. There is a great online tool called Easy Urpmi. You pick your distribution, pick a trustworthy local package source, and it prints out the command you must enter to add the designated source properly. Nothing could be easier! There are numerous mirrors of Easy Urpmi: Be sure to pick the right Mandrake version and architecture. If you're not sure what you're using, try this: $ cat /etc/mandrake-release Mandrakelinux release 10.1 (Official) for i586 An example of what Easy Urpmi outputs, which you then type in a console as root: Downloading all the package information will take a little while (depending on your internet connection speed). Finally, we must add a source for the Mandrake MythTV RPM. Luckily, Thac's RPMs have what we need:
 * 1) urpmi.removemedia -a
 * Easy Urpmi official
 * Mandriva users
 * urpmi-addmedia
 * Linux for dummies
 * Linux for dummies
 * Linux for newbies
 * notix
 * 1) urpmi.addmedia main ftp://ftp.rutgers.edu/pub/Mandrakelinux/official/10.1/i586/media/main with media_info/hdlist.cz
 * 2) urpmi.addmedia contrib ftp://ftp.rutgers.edu/pub/Mandrakelinux/official/10.1/i586/media/contrib with media_info/hdlist.cz
 * 3) urpmi.addmedia jpackage ftp://ftp.rutgers.edu/pub/Mandrakelinux/official/10.1/i586/media/jpackage with media_info/hdlist.cz
 * 4) urpmi.addmedia plf-free ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandrake/free/10.1 with hdlist.cz
 * 5) urpmi.addmedia plf-nonfree ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandrake/non-free/10.1 with hdlist.cz
 * 6) urpmi.addmedia --update updates ftp://ftp.rutgers.edu/pub/Mandrakelinux/official/updates/10.1/main_updates/ with media_info/hdlist.cz
 * 1) urpmi.addmedia thacs.rpms http://rpm.nyvalls.se/10.1/RPMS with hdlist.cz

Download MythTV
With our sources defined, a single command will download, install, and configure MythTV, including all missing dependencies (MySQL, QT, etc.): The installer will prompt you for which package to select. You may notice three options, one with "nvidia" in the name, one with "via" and one that is generic. If you specifically have nvidia or via hardware, you can go that route, but the generic packages should work in most cases. When presented with the (long) list of packages to install, say "yes" and wait for it to finish (may take 30 minutes to several hours).
 * 1) urpmi mythtv-suite

Install ivtv
Now we need to install the ivtv driver, which is an open-source driver written to enable linux compatibility with Hauppauge WinTV PVR capture cards. The example below should work for the PVR-150, 250, 350, and 500. With a little imagination, you can also adapt these instructions to your own capture card. First off, let's avoid any hardware conflicts by getting rid of the default ivtv driver provided in most Mandrake installs: /lib/modules/2.6.8.1-12mdk/kernel/3rdparty/ivtv /lib/modules/2.6.8.1-12mdk/kernel/3rdparty/ivtv/ivtv-fb.ko.gz /lib/modules/2.6.8.1-12mdk/kernel/3rdparty/ivtv/ivtv.ko.gz
 * 1) find /lib -name "*ivtv*"
 * 1) rm -rf /lib/modules/2.6.8.1-12mdk/kernel/3rdparty/ivtv

The msp3400 module will be replaced too: /lib/modules/2.6.8.1-12mdk/kernel/drivers/media/video/msp3400.ko.gz
 * 1) find /lib -name "msp3400*"
 * 1) rm /lib/modules/2.6.8.1-12mdk/kernel/drivers/media/video/msp3400.ko.gz

If you're nervous about all this, then you can move the implicated files somewhere else for safe keeping. Just make sure you put them out of the modules directory, so that they are not loaded (use the "mv" command and put them in /home/mythtv/tmp for example). Now download the source code for ivtv. Go to the ivtv project page and select download. You'll then have the option to download various versions. As of the writing of this document, the 0.2 drivers are stable, whereas the 0.3 are beta and unstable. A safe bet is to pick the latest 0.2 release (ivtv-0.2.0-rc3j as of this writing). If you have problems with the driver, you can try different versions (or even try a 0.1.9 or a 0.3 driver). $ cd /home/mythtv $ lynx http://www.ivtv.tv/releases/ivtv-0.2/ivtv-0.2.0-rc3j.tgz $ tar -zxvf ivtv-0.2.0-rc3a.tgz $ cd ivtv-0.2.0-rc3j/driver $ make Those last two commands will compile the driver and put all the required files in the right places. Many users experience errors during the make operations. If you have permission errors, try switching to root and make again. Sometimes the problem is fixed by trying a different driver version. Often the problem is simply that your kernel source version does not match your running kernel (see elsewhere in this document). In extreme cases you may have to change to a different kernel. Try searching the internet (and elsewhere in this document) for the error messages you're seeing. Someone else may already have figured out the solution to your problem.
 * 1) make install

The next step is to extract the firmware for the capture card. This is binary driver information that we need to communicate with the capture card properly. For this next step to work, g++ must be installed, so let's check: $ which g++ /usr/bin/g++

If it's not on your system, install it with urpmi:
 * 1) urpmi gcc-g++

Now let's compile the firmware-extraction utility: $ pwd /home/mythtv/ivtv-0.2.0-rc3j/driver $ cd ../utils $ make
 * 1) make install

So far so good. Now we need to get the capture card driver binary and extract out the part we need. Depending on whether you have a new or old Hauppauge card, these files will be located in slightly different places on the installation CD-ROM that came with your card. The ivtv wiki has lots of helpful information. For older cards, expect a file called "pvr48wdm_1.8.22035.exe" (or something similar) but for newer cards it will be "pvr_1.18.21.22301_inf.zip" or "hcwPVRP2.sys." You can also simply download the appropriate file from the ivtv firmware page. For example: $ cd /home/mythtv $ lynx ftp://ftp.shspvr.com/download/wintv-pvr_250-350/inf/pvr_1.18.21.22301_inf.zip Then extract the firmware:
 * 1) cd /home/mythtv/ivtv-0.2.0-rc3j/utils
 * 2) ./ivtvfwextract.pl /home/mythtv/pvr_1.18.21.22301_inf.zip

This should have placed two new files in the "/lib/modules" directory, 'ivtv-fw-dec.bin' and 'ivtv-fw-enc.bin'. You can go check: $ cd /lib/modules $ ls -lF drwxr-xr-x 4 root root   4096 May 29 12:14 2.6.8.1-12mdk/ drwxr-xr-x 3 root root   4096 May 28 21:14 2.6.8.1-12mdkcustom/ -rw-r--r-- 1 root root 262144 May 28 20:09 ivtv-fw-dec.bin -rw-r--r-- 1 root root 262144 May 28 20:09 ivtv-fw-enc.bin

The installer has also placed our new modules into the "/lib/modules/2.6.8.1-12mdkcustom/extra", but our kernel won't see these. Instead, let's put them in the right place: Now let's reload the module list. You can reboot too, just to make sure everything gets loaded:
 * 1) cp /lib/modules/2.6.8.1-12mdkcustom/extra/*.ko /lib/modules/2.6.8.1-12mdk/misc
 * 1) /sbin/depmod -a
 * 2) /sbin/reboot

After rebooting, we can try loading our new ivtv module and see if it actually works. A few modules have to be loaded in the proper order:
 * 1) /sbin/modprobe i2c-core
 * 2) /sbin/modprobe i2c-algo-bit
 * 3) /sbin/modprobe tuner type=2
 * 4) /sbin/modprobe msp3400
 * 5) /sbin/modprobe videodev
 * 6) /sbin/modprobe saa7115
 * 7) /sbin/modprobe ivtv

Note that the "tuner type=2" varies depending on your capture card's tuner type. You can find a list of the tuner types in the "tuner.h" file in your ivtv driver directory: $ cd /home/mythtv/ivtv-0.2.0-rc3j/driver $ emacs tuner.h (Note: to exit emacs use "Ctrl-x Ctrl-c".) For North American users, "tuner type=2" (Philips NTSC) will probably work. If the module loaded properly, we can run a quick test. Hook up a video input to your card, and type: Let this run for awhile (10 seconds maybe) then hit Ctrl-C to stop it. This should have captured a bit of video and saved it to the file "test.mpg". Try playing the file: If everything is working, you should see some video. If you see snow or even black, that's actually a good sign. It means the driver is probably working, but you'll need to play with settings to get it to capture on the right channel. If you instead get an error message and no video is captured, then you should start looking for solutions. Maybe your tuner type is wrong. Maybe you forgot to remove conflicting ivtv modules. Maybe a different driver version would work. Play around, search for answers.
 * 1) /bin/cat /dev/video > test.mpg
 * 1) /usr/bin/mplayer test.mpg

If everything is working, then you can create a script to load these modules. Let's call it "/usr/local/bin/start-ivtv". Open a text editor (emacs, vi, kwrite, etc.) and put this in:

#!/bin/bash # a script to load modules for MythTV /sbin/modprobe i2c-core /sbin/modprobe i2c-algo-bit /sbin/modprobe tuner type=2 /sbin/modprobe msp3400 /sbin/modprobe videodev /sbin/modprobe saa7115 /sbin/modprobe ivtv

Save and exit (in emacs "Ctrl-x Ctrl-s" does this, in vi use "ESC, :x"). Remember to make the script executable: Now if you type "start-ivtv" (as root) everything will be loaded. Later you can modify this script to start MythTV automatically when the computer boots.
 * 1) chmod u+x /usr/local/bin/start-ivtv

Configure MySQL
First set the MySQL service to automatically load during boot, and start it manually for now: And now change the database permissions so that MySQL can do what it needs to. Note that you should replace "root_password" with your root password. mysql> UPDATE user SET Password=PASSWORD('root_password') WHERE user='root'; mysql> FLUSH PRIVILEGES; mysql> quit Now update the database: $ mysql -u root -p < /usr/share/doc/mythtv-0.16/database/mc.sql MySQL should be ready to go.
 * 1) /sbin/chkconfig mysql on
 * 2) /etc/init.d/mysql start
 * 1) mysql -u root mysql

Configure MythTV
Before configuring MythTV, set up an account with a service that will give you XMLTV listings. In North America, this means setting up an account with zap2it DataDirect. Now we can setup our MythTV using a graphical configuration tool: $ mythtvsetup The options in this program are fairly self-explanatory. Set everything up consistent with your hardware and preferences.
 * 1. General:
 * For "IP address for localhost" and "Master Server IP address", you can enter your IP address, or leave it with the defaults if you're running the frontend and backend on the same computer
 * For the "recordings" and "Live-TV buffers" directories, enter the directories you've chosen. For example, "/home/mythtv/data" or "/data/mythtv" or whatever.
 * For the "TV format" selected "NTSC" (or whatever your local setting is).
 * For "VBI format" you probably want "NTSC Closed Caption". Depending on your driver, closed captioning might not be supported.
 * For "Channel frequency table" most North Americans should select "us-cable".

 * 2. Capture cards:
 * Create a new capture card, set the "Card type" to "MPEG-2 Encoder card", and set "Default input" to whatever you're using (tuner, S-video, etc.).

 * 3. Video sources:
 * Create a new video source.
 * Set "XMLTV listings grabber" to "North America (DataDirect)".
 * Enter your User ID and password for zap2it
 * Select "retrieve lineups".
 * Check that the "Data Direct Lineup" is consistent with your zap2it subscription.

 * 4. Input connections:
 * Set the "S-video0" (or whatever you're using) "Video source" to the name of your defined video source.

Now you can fill the MythTV database with your listing of TV channels: $ mythfilldatabase This operation will take awhile, as MythTV downloads all the program data (for the next few weeks). Once it's done, start MythTV: $ mythfrontend Use the keyboard to move around and see if things are working. If everything is good, then you can update your "start-ivtv" script to include "/etc/init.d/mythbackend start": #!/bin/bash # a script to start MythTV /sbin/modprobe i2c-core /sbin/modprobe i2c-algo-bit /sbin/modprobe tuner type=2 /sbin/modprobe msp3400 /sbin/modprobe videodev /sbin/modprobe saa7115 /sbin/modprobe ivtv /etc/init.d/mythbackend start
 * 1) /etc/init.d/mythbackend start

If everything is working, then you may aswell set your "start-ivtv" script to start automatically at boot time. To do this, edit your "/etc/rc.d/rc.local" file, by adding "/usr/local/bin/start-ivtv" to the end:
 * 1) echo "/usr/local/bin/start-ivtv" >> /etc/rc.d/rc.local

Configure remote control
We'll be using LIRC to read the signals from the Hauppauge remote. Refer to the mailing list archive when searching for answers to problems. First get rid of any other version of LIRC that MythTV may have installed: Go to the LIRC page and download the latest release, then untar it and start the configure script: $ cd /home/mythtv $ lynx http://prdownloads.sourceforge.net/lirc/lirc-0.7.1.tar.gz $ tar -zxvf lirc-0.7.1.tar.gz $ cd lirc-0.7.1 $ ./setup.sh What to do is pretty obvious. Select item 1, then item 5 "TV Card", then select "Hauppauge TV card". Then select "Save configuration & run configure". Now make and install everything, and link it up: $ make Open up the file "/etc/ld.so.conf" and add "/usr/local/lib" to the end. Or just type: Then run ldconfig (which updates the run-time link libraries): Copy the configuration file from MythTV documents to your lircrc directory, and add a symbolic link: $ cd /usr/share/doc/mythtv-0.17/configfiles $ cp hauppauge-lircrc-nativelirc /home/mythtv/.mythtv/lircrc $ ln -s /home/mythtv/.mythtv/lircrc /home/mythtv/.lircrc Copy the appropriate remote config file: $ cd /home/mythtv/lirc-0.7.0/remotes/hauppauge You could now update your "start-ivtv" script to load the remote (lirc_i2c) modules: #!/bin/bash # a script to start MythTV /sbin/modprobe i2c-core /sbin/modprobe i2c-algo-bit /sbin/modprobe tuner type=2 /sbin/modprobe msp3400 /sbin/modprobe videodev /sbin/modprobe saa7115 /sbin/modprobe ivtv /sbin/modprobe lirc_i2c /usr/local/sbin/lircd -d /dev/lirc0 --permission=666 /etc/init.d/mythbackend start Now you should restart everything: $ mythtvfrontend See if the remote works. It might be a good time to reboot, and see if everything starts up: Once its booted, you should be able to run "mythfrontend" and use your MythTV. You can open the "/home/mythtv/.lircrc" file and edit it to map your remote properly (more on this later). For the moment, if you're using a Hauppauge silver remote, then you should change "Rew" to "Rewind" and "FFW" to "Forward".
 * 1) rpm -e --nodeps liblirc0
 * 2) rpm -e --nodeps liblirc0-devel
 * 1) make install
 * 2) ln -s /usr/local/lib/liblirc_client.so.0 /usr/lib/liblirc_client.so.0
 * 1) echo "/usr/local/lib" >> /etc/ld.so.conf
 * 1) ldconfig
 * 1) cp ./lircd.conf.hauppauge /etc/lircd.conf
 * 1) /etc/init.d/mythbackend stop
 * 2) /usr/local/bin/start-ivtv
 * 1) /sbin/reboot

Configure TV-out
The configuration of your TV-out depends on your hardware. If you're using a video card with a TV-out, then it may simply be a matter of having a TV connected to that output during boot, and the card may output everything (the console, the GUI, and MythTV) to the TV. This is an easy solution. For other cards, you may have to edit your X server configuration file. On older versions of linux, this file would be "/etc/X11/XFree86Config" (there are many similar locations where it may be found). In a modern Mandrake distribution, the file that is used is "/etc/X11/xorg.conf" (which may just be a symlink to another config file mind you). Before going any further, make a copy of your old xorg.conf, and then you can try editing it and see if that helps. After making a change to xorg.conf, you can use Ctrl+Alt+Backspace to exit and restart the X server (and thus your window manager, KDE). If your new settings worked, then you may see output to your TV. If not, you can get back to a console by using Ctrl+Alt+Backspace, and switch back to your old xorg.conf or try something else. Some extra help can be found here and here.

To use the TV-out on the Hauppauge 350 in particular is a good idea, since the 350 has hardware MPEG decoding, which means that it will do the work of decoding the video stream, thereby taking the strain off of your processor. To enable it, there is an option in MythTV that says "use hardware MPEG decoder", which will just use the 350 to output TV. Although this will output recorded playback to the 350's TV-out, you won't have your MythTV menus on that same graphics output. To get everything to work together smoothly, we need our entire X environment (including the desktop and MythTV frontend) to output using the 350's TV-out. Here's what you do:

First, modify your "/usr/local/bin/start-ivtv" script to load "ivtv-fb" also, by adding a line "/sbin/modprobe ivtv-fb":

#!/bin/bash # a script to start MythTV /sbin/modprobe i2c-core /sbin/modprobe i2c-algo-bit /sbin/modprobe tuner type=2 /sbin/modprobe msp3400 /sbin/modprobe videodev /sbin/modprobe saa7115 /sbin/modprobe ivtv /sbin/modprobe ivtv-fb /sbin/modprobe lirc_i2c /usr/local/sbin/lircd -d /dev/lirc0 --permission=666 /etc/init.d/mythbackend start

Now let's get the ivtv driver right. Essentially, X needs a driver to use the 350's TV output. What you want is for the "ivtvdev_drv.o" driver to end up in "/usr/X11R6/lib/modules/drivers". As usual, there are a couple of options. You can build the appropriate driver from the ivtv source you have. The source is here: $ find /home/mythtv -name "ivtvdev*" /home/mythtv/ivtv-0.2.0-rc3j/utils/ivtvdev_drv_o cd /home/mythtv/ivtv-0.2.0-rc3j/utils The instructions to install are in "/home/mythtv/ivtv-0.2.0-rc3j/utils/README.X11". So essentially you should be able to run install, which will make everything. The second way (which might be easier) is to download a binary version from somewhere, and then just copy it: $ cd /home/mythtv $ lynx http://membres.lycos.fr/badzzzz/ivtvdev_drv.o.gz $ tar -xvzf ivtvdev_drv.o.gz $ cp ivtvdev_drv.o /usr/X11R6/lib/modules/drivers Now we need to determine the PCI settings of your card. There are three different ways of getting this info: or or What you will get will be information about the PCI address of devices. Find the one corresponding to your desired TV-out (the Hauppauge 350 card in our running example). The address is usually given in the order "bus", "card number", "function". Pay attention to whether the numbers are decimal or hexadecimal (preceeded by 0x). The lspci and scanpci tools report in hexadecimal, whereas Xorg outputs decimal. Keep in mind that the xorg.conf file expects things to be in decimal, although you can explicitly denote hexadecimal by preceeding a value with "0x" (or just convert them to decimal).
 * 1) /usr/X11R6/bin/Xorg -scanpci
 * 1) lspci
 * 1) scanpci

The output of lspci will look something like: 00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 03) 00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03) 00:04.0 ISA bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02) 00:04.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01) 00:04.2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 01) 00:04.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02) 00:09.0 Ethernet controller: Lite-On Communications Inc LNE100TX [Linksys EtherFast 10/100] (rev 25) 00:0b.0 Multimedia video controller: Internext Compression Inc iTVC15 MPEG-2 Encoder (rev 01) 00:0e.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10) 01:00.0 VGA compatible controller: STMicroelectronics STG4000 [3D Prophet Kyro Series] (rev 07) The "iTVC15 MPEG-2 Encoder" is the capture card, which we'll use for TV-out. This card would thus be given the bus designation: BusID "PCI:0:11:0" (Remember that 0x0b is 11 in decimal.) Now we need to know what linux device this maps to. The 350 is essentially a special kind of framebuffer device. There are many ways to do this. Let's check "/var/log/messages" and see what "ivtv-fb.o" is mapped to: grep fb /var/log/messages ... Jun 6 20:42:30 localhost kernel: ivtv-osd: fb1: iTVC15 TV out frame buffer device ... You could also use "fbset" and go device by device ("fbset -fb /dev/fb0" then "fbset -fb /dev/fb1" etc.) and see which one corresponds to your required card. In our current example, the output we want is "/dev/fb1" (for video-card TV-out, it may end up being a /dev/fb or a /dev/video).

Now we need to reconfigure xorg.conf, armed with our new information (namely that our card is /dev/fb1 at BusID "PCI:0:11:0" using ivtvdev_drv.o). As usual, be warned: improperly configuring your video settings could damage your video card and/or monitor. These instructions are provided as examples. Use them at your own risk and be sure to double-check that they make sense for your hardware. Now to start, let's add a monitor: Section "Monitor" Identifier "NTSC Television on Hauppauge card" # D: 34.563 MHz, H: 37.244 kHz, V: 73.897 Hz    HorizSync   30-68 VertRefresh 50-120 Mode "720x480" DotClock 34.564 HTimings 720 752 840 928 VTimings 480 484 488 504 Flags "-Hsync" "-Vsync" EndMode EndSection That should work for NTSC. For PAL, it would be something like: Section "Monitor" Identifier "PAL Television" HorizSync 30-68 VertRefresh 50-120 Mode "720x576" # D: 41.475 MHz, H: 44.693 kHz, V: 74.488 Hz         DotClock 41.476 HTimings 720 752 840 928 VTimings 576 580 584 600 Flags   "-HSync" "-VSync" EndMode EndSection Note that the Identifier in all xorg.conf sections is arbitrary. You can set it to whatever you like. However, once you decide on a name, remember to stick to it. Elsewhere in your file you must refer to the sections by name exactly. Any little typo will break your configuration. Now add a device: Section "Device" Identifier "Hauppauge WinTV PVR 350" Driver "ivtvdev" Option "fbdev" "/dev/fb1" BusID "PCI:0:11:0" EndSection Again the identifier is arbitrary, but remember what you pick. Above we are using the "ivtvdev" driver and the "fbdev" option. The commented-out lines are alternate options that you could try using: they may be better for your particular setup (in that case, be sure to comment-out the other line to avoid conflict). Remember to update the "/dev/fb1" as needed by your device, and change the BusID to whatever you determined before. This is critical! Now we define a screen (this again would be slightly different for PAL): Section "Screen" Identifier "Hauppauge Screen" Device "Hauppauge WinTV PVR 350" Monitor "NTSC Television on Hauppauge card" DefaultDepth 24 DefaultFbbpp 32 Subsection "Display" Depth 24 FbBpp 32 Modes "720x480" EndSubsection EndSection Lastly we switch the ServerLayout to use our new output. Just by changing this one section, you can control what input and output devices (defined above) are going to be used. This will let you switch between different configurations easily. You can have multiple ServerLayouts defined if you like. For your new ServerLayout, it's best to copy the existing one and just modify it as needed. It will end up being something like: Section "ServerLayout" Identifier "TVLayout" Screen "Hauppauge Screen" InputDevice "Keyboard1" "CoreKeyboard" InputDevice "Mouse1" "CorePointer" EndSection Save the file, restart X (Ctrl+Alt+Backspace if you are inside the GUI), and hopefully it will begin to output to the TV-out you wanted. Note that for some cards this won't work unless there is a device hooked to that output when X starts up. So make sure the TV is hooked up and turned on before trying to switch to/boot into your new X setting. If it didn't work, you can go back to your older settings or try something else.
 * 1)    Driver "fbdev"
 * 1)    Option "ivtv" "/dev/fb1"

Test everything
So now everything should be working. Upon booting, the drivers should load, and "mythbackend" should have started. If you use "pgrep" you should get a process ID number (PID) for that process: $ pgrep mythbackend 5166 MythTV should start when you invoke: $ mythfrontend Once MythTV is running, you should be able to select "Live TV" and watch TV. Using the keyboard, you can pause ('p' key), rewind and fast-forward (arrow keys) and so forth. You should be able to go into the program guide and select a particular show, and then select "Record" and then wait for it to record that show. There are many options that you can adjust to suit your preferences. You may want to increase the font size or even select an entirely different theme. If the basics of MythTV are working, you can start using it, and over the next while you can continue customizing it, and getting other functions and plugins working properly.

title: MythTV/Installing


text:
MythTV/Extras

Once MythTV is mostly running (i.e.: you're able to pause, record and play TV), then you can start tuning your system to do exactly what you want. The possibilities are endless, but there are a couple of things you'll probably want to tweak.

Remote control
For your remote control to work, LIRC must be loaded. Thus, in one of your boot scripts, you should have: /sbin/modprobe lirc_i2c This loads the lirc_i2c kernel module. Thereafter, you can configure your remote using the "/home/mythtv/.lircrc" file (which is actually a symbolic link for "/home/mythtv/.mythtv/lircrc"). Inside this file, you will find a bunch of statements like: begin prog = mythtv button = Power config = Esc end These statements should be self-explanatory. The "prog = mythtv" tells LIRC that this command should be bound to the MythTV application. The "button = Power" tells LIRC that when the "Power" button on the remote is pressed, this command should be issued. The "config = Esc" tells LIRC what command to pass along to the application. So when I press "Power" MythTV will receive the "Esc" signal (a convenient mapping, since then you can use the power button to exit from MythTV). You can set these mappings up however you like. To find out what names are allowed for your particular remote, go to the documentation provided with LIRC (created when you untarred the LIRC source). For instance: $ cd /home/mythtv/lirc-0.7.1/remotes/hauppauge/ $ emacs lircd.conf.hauppauge Obviously you should navigate to the documentation appropriate for your remote. In the end, your lircrc file should have a bunch of begin/end statements (one for each button), which are bound to MythTV functions in a way you like. If your MythTV installation went well, there are probably already some smart defaults loaded.

To make proper use of specialty buttons, you can set key bindings. In MythWeb's settings mode you can set additional key bindings (such as using F2 to launch MythWeather directly, for instance). Then in LIRC you can set a remote button to that same key.

When using MythVideo and MythDVD, mplayer is called to show video. If you want your remote control to work with mplayer, then you can set additional bindings for mplayer. The bindings might look like: begin prog = mplayer button = Vol+ config = volume +1 repeat = 2 end begin prog = mplayer button = Vol- config = volume -1 repeat = 2 end The program is now "mplayer." The allowed keys are the same as before (find the doc for your remote). The allowed "config =" lines are based on the commands that mplayer knows. Type "mplayer -input cmdlist" for a list of commands that are allowed, and then bind the ones you want. Note that the "repeat = 2" command controls what happens when a button is held down. That is, changing this number will control how quickly the button will repeat when held (a low number repeats fast, a high number is slow). You can play with these settings to suit your fancy. You can also find samples online of other people's settings, for inspiration.

LIRC Config is a free tool that creates custom lircrc's online.

Control set-top box with MyBlaster
If you have a set-top box that you want to be able to control from within MythTV, you have several options. Many types of IR blasters (whether purchased or home-built) can be controlled using the LIRC program already described.

If you're using My.Tv's MyBlaster product, then here's what you do. First of all, note that My.TV only guarantees that the serial version of their product will be compatible with linux. You can view their instructions or go to the forum for help. Another user of MythTV has written Perl module that lets us easily interface the MyBlaster product. So first you should download the MyBlaster14.zip file from somewhere. Inside the zip file, you'll find documentation for a variety of devices (TVs, satellite boxes, etc.). Find your device type and brand, and you'll see a bunch of codes that might work for your device. So next let's test to see which code works. Let's put the MyBlaster.pl perl script into "/usr/local/bin" (as root): Now edit this file in your favorite text editor. Change the "$Device_Type=" to your device type. Now change the "$remote_code=" to one of the codes suggested for your brand. Save the file and exit. Now turn on your set-top box (or TV, or whatever), and point your IR blaster product at the box, and type: This will tell the product to send the signal for "power on/off". If your box turns off, then obviously the code works for your model. If nothing happens, edit the script again, and try a different code. Eventually you'll find the code that works for your product. Then inside mythtvsetup you can change the "external channel change comamnd" option to be "/usr/local/bin/MyBlaster.pl". Now everytime MythTV wants to change channel (for that video source), it will call MyBlaster.pl, and pass the channel number as an argument. You can restart your lirc module and try it in MythTV. When you change channel, you should indeed see your set-top box change channel (remember to point your IR blaster at the device!). An alternative less expensive option is available from Mythblasterz.
 * 1) cp MyBlaster.pl /usr/local/bin
 * 1) MyBlaster.pl power

Control other devices
You can in fact use your whole setup to control multiple devices, such as your set-top box and your TV (and VCR, etc.). All it takes is some imagination and time modifying the right scripts. A useful option to be aware of is setting "prog = irexec" inside your ".lircrc" file. Here's a trivial example: let's say we modify our "/home/mythtv/.lircrc" file to contain begin prog = irexec button = Power config = echo "Hello world!" end If you save these changes, and then run "irexec" from a command line, you should see "Hello world!" output to the prompt every time you press the "power" button on your remote control. The irexec program lets us execute arbitrary shell commands using any key on the remote. The only catch is that the irexec program has to be running. You can easily arrange for this to be the case by, for instance, adding "/usr/local/bin/irexec &" to your "/usr/local/bin/start-ivtv" script (the trailing & tells the command to be placed into the background).

Now we can get a little more clever. Let's say our remote buttons are mostly bound to MythTV, and we are using the "MyBlaster.pl" program to control our set-top box. Now say we further want the "power" button on our remote control to turn the television on and off (but not turn off the set-top box!). Here's what we could do. First, let's make a copy of MyBlaster.pl: Now find the device code for your TV in the MyBlaster documents (figure out which one is the right code, as before, by modifying the file and trying "MyBlasterTV.pl power" until the TV turns off). Once your MyBlasterTV.pl file is controlling the TV, you can edit your .lircrc file and add: begin prog = irexec button = Power config = MyBlasterTV.pl power end When you press the power button on your remote, the LIRC daemon (lircd) will pass the command to "irexec" which simply executes "MyBlasterTV.pl power" which should send a signal to your IR blaster that fools your TV into turning off. Obviously you can map buttons on your remote to all sorts of different scripts. In this way, you can control a wide variety of AV equipment.
 * 1) cd /usr/local/bin
 * 2) cp MyBlaster.pl MyBlasterTV.pl

Changing channels faster
New users of MythTV are usually quite annoyed with how slowly it changes channels, especially if you're using a set-top box. MythTV is constantly buffering live TV. This is what allows you to pause and rewind at will. However, this also means that you're always 4-5 seconds behind live television. So, if you want to change channel, there's always a delay while buffering of the new channel starts. If you're using an IR blaster to control a set-top box, then there's an additional lag due to that. Can anything be done?

You can (slightly) optimize the channel changing of a set-top box. If you're using the MyBlaster script, you can optimize it. First off, in the "/usr/local/bin/MyBlaster.pl" file you can enable the finalize option by setting "$finalize=1;", which will cause the blaster to send a keystroke to immediately confirm a channel change. For most remote controls there is a "select" or "ok" button that does this, so set that in the "$finalize_key=" section. You can also try editing the "Emit_Time=0.333;" option. This is the time that each keypress IR signal lasts. By reducing this, key entry will be faster. Don't reduce it too much, however, or else keypresses will be lost. You can adjust this value and see what happens. Modern set-top boxes seem to be able to handle "Emit_Time=0.2;" without much trouble. The "$inter_key_delay=1;" option can also be changed. This is the time in between key pulses. As usual, too low a setting and your box will become confused. The default 1 second is safe, but many boxes can handle 0.2 seconds without trouble. These options can make channel switching faster.

Ultimately, however, you won't be able to get rid of that last 4 seconds of buffering delay. This leaves you with two options. First, you could set up your TV so that a live signal from your set-top box goes straight to your TV, and another signal goes to your MythTV. Then you could switch between "live mode" and "myth mode" by changing the input selection on your TV. This requires some user intelligence, however, because you might be changing channels while MythTV is trying to record something, thereby ruining that recording.

Another option is to just adapt! Most users of MythTV find that after awhile they give up the whole "channel surfing" habit, as it is mostly a relic of not being able to find anything interesting on TV at any given moment, or being bored by commercials. With MythTV, you'll hopefully only be watching recorded shows that you like, and you'll watch them when it suits you. When you sit down to watch TV, you'll just look at the listing of recently recorded shows, and watch something that interests you. Not only that, but you'll just use the auto-commercial-skip feature to avoid boredom. Give this new paradigm a chance, and you may find that the need to compulsively change channels will disappear.

MythWeb
If your MythTV installation went well, then MythWeb is probably already running perfectly. On your MythTV box, open a web browser and go to "http://localhost/mythweb/" (or "http://127.0.0.1/mythweb/"). Don't forget that trailing slash, or you'll just get a "page not found" error! If you can see your MythWeb, then all is well. Refer to the next section for information on making it accessible worldwide on the internet. If you can't see your MythWeb, then you should probably look into the options for apache, the web server that is running your MythWeb (note that the apache process/service is called httpd or httpd2 depending on your version). To modify the behavior of your MythWeb, you are meant to modify the files:
 * /var/www/html/mythweb/.htaccess
 * /var/www/html/mythweb/config/conf.php

These documentation also suggests that you add the option "UseCanonicalName on" to your apache configuration file, located at: "/etc/httpd/conf/httpd2.conf" However, the default is "on" in modern versions of apache, so adding this directive is usually not necessary.

If you have problems seeing your MythWeb page outside of your local network, then it may be that your ISP is blocking the default http port (80). You can work around this by running MythWeb on another port (anything greater than 1024, like, for example, 8050). Remember to adjust any router settings for port forwarding as well. See elsewhere in this document for more help on that.

If you have problems seeing your MythWeb page inside your local network, but can see it outside, then probably your router is not passing internal requests properly. One easy fix is to use your MythTV's internal IP address inside your network (instead of using the domain name that you would use outside of your home network). You may want to set your MythTV to use a static IP address if you do this. You may also be able to fix this by adjusting router settings (but probably not). Alternately, you can buy a router that does port forwarding properly (Cisco routers have been reported as being a good choice in this regard).

Dynamic DNS
MythWeb allows you to access your MythTV over the internet. However, to access your MythTV from outside your house (work, vacation, etc.), you need your computer to act as a web server. Linux makes running a web server easy. A program called Apache (which runs as "httpd") will do everything for you. If you've installed MythTV and MythWeb properly, then apache is already running.

However, if you connect to the internet with an ISP that uses DHCP, then you're probably assigned a random IP from a pool. This means that your IP address will change periodically. This is called having a "Dynamic IP address." With your address constantly changing, how will other computer know where to reach your MythWeb?

The solution is to use a DNS service that updates when your IP addres changes. Luckily, there are numerous free subscription services that will let you do this with linux. The most well-known appear to be no-ip.com and DynDNS. An extensive list of options is available. Pick the one that suits you! Most of these services will allow you to pick the domain name from a short list, and then will map your username onto that. So if your username with their service is "user155" then you may end up with a domain like "user155.no-ip.com" or whatever. Then you can get to your MythWeb anywhere. It's address will be: http://user155.no-ip.com/mythweb/

If you have registered your own domain, you can point a custom subdomain to your myth box even if it has a dynamic IP. Once you have established that user155.no-ip.com points to your box. Add a cname record to your "myMostFavoritestDomain.com." DNS zone that points mythtv.myMostFavoritestDomain.com. to user155.no-ip.com. Make sure you end the domains with a dot. Otherwise it appends the name of the dns zone to the name you specify. eg: in the DNS zone entry for myMostFavoritestDomain.com. a record like "mythtv.myMostFavoritestDomain.com cname user155.no-ip.com" actually points "mythtv.myMostFavoritestDomain.com.myMostFavoritestDomain.com" to "user155.no-ip.com.myMostFavoritestDomain.com" which is not desirable.

You may have to play with port options in Apache if your ISP blocks port 80. Refer to other help in this document for details. These services will provide you with a program that runs on your linux box. Whenever its IP address changes, it will update the service, so that DNS lookups always get sent back to your current IP address. It's an easy (and cost-effective) way to get your own (semi-customized) domain name. If you want a full-featured domain name, you can upgrade your service easily.

DVD menus
By default, MythTV uses mplayer to play DVDs. However, mplayer doesn't support DVD menus. You could try installing xine instead, and configuring MythTV to call xine instead (see xine man page for command line syntax).

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: MythTV/Extras


text:
MythTV/Troubleshooting

Trouble installing MythTV RPM for Mandrake
You may encounter errors after trying to "urpmi mythtv-suite". If during the MythTV package installation you receive errors like "bad signatures" try entering 'y' to continue, and see if the packages work anyway. If you get errors like "installation failed", it may be because you're running Mandrake version 10.1 Community. To figure out your Mandrake version: $ cat /etc/mandrake-release $ Mandrakelinux release 10.1 (Community) for i586 This apparently has to do with conflicting files in different packages. Let the install attempt complete, then run "urpmi mythtv-suite" again and see what happens. You can look through the error message to isolate which packages are having problems. Try installing these packages separately (urpmi package_name) and then install MythTV again (urpmi mythtv-suite). You can also try to force the install to finish: There's no guarantee this will work, however.
 * 1) urpmi --allow-force mythtv-suite

Error during make of ivtv
There are many reasons why an ivtv compilation might fail. You can try different versions of the driver. If you are receiving missing directory errors, you might be missing a symbolic link. Check that it is correct: $ cd /usr/src $ ls -lF lrwxrwxrwx  1 root root   19 May 28 20:50 linux -> linux-2.6.8.1-12mdk/ drwxr-xr-x 21 root root 4096 May 28 20:50 linux-2.6.8.1-12mdk/ drwxr-xr-x  3 root root 4096 May 21 13:09 RPM/ If the symbolic link is missing or not pointing to the right place, fix it: Then check this other symbolic link: $ cd /lib/modules/2.6.8.1-12mdk $ ls -lF lrwxrwxrwx  1 root root     15 May 28 20:07 build -> /usr/src/linux/ ... If this one is missing, add it:
 * 1) ln -s /usr/src/linux-2.6.8.1-12mdk /usr/src/linux
 * 1) ln -s /usr/src/linux /lib/modules/2.6.8.1-12mdk/build

In many cases, a make error is due to your kernel source version being wrong. Obviously the installed version must match the kernel you are using. If this is the problem, while trying to make ivtv, you may see errors like: make[2]: *** No rule to make target `modules'. Stop. Or, the make might work properly, but when trying to load modules, you'll get: ivtv FATAL: Error inserting tuner (/lib/modules/2.6.8.1-12mdk/misc/tuner.ko): Invalid module format So first check your kernel version: $ uname -r 2.6.8.1-12mdk And see what you have installed: $ rpm -qa | grep kernel kernel-source-2.6-2.6.8.1-12mdk kernel-2.6.8.1.12mdk-1-1mdk Make sure the source matches your current kernel version. If it doesn't, then you should uninstall the old source: Obviously replace "2.4.27" with whatever your "not right source" happens to be! Now add the source you really want: Again, modify the syntax to match your current kernel. You may have to use urpmq to query the available rpms until you find the one that matches. You may also need to configure urpmi to use online media repositories of rpms to give you access to the rpm you need (see elsewhere in this doc or refer to the Easy urpmi website). Don't simply use "urpmi kernel-source" or even "urpmi kernel-source-2.6" since these won't necessarily give you the exact source you want.
 * 1) urpme kernel-source-2.4.27
 * 1) urpmi kernel-source-2.6-2.6.8.1-12mdk

Double check that your source now matches your kernel version (otherwise nothing will compile properly!), and ivtv should now compile.

If ivtv still won't compile, try other versions or look up the error messages on the various ivtv forums and mailing list archives.

Time in program guide off by one hour
This is a well-known bug in MythTV caused by QT. It seems to only manifest itself half of the year (due to daylight savings time). Setting a one-hour offset inside MythTV does not solve this. If this is indeed your problem, then change your current timezone to be one hour ahead of where you are actually located. Then run "mythfilldatabase" again (you might also have to delete the channel listing in mythtvsetup and recreate it after filling the database). With your timezone setting off by one hour, everything should look normal in MythTV.

mplayer won't output to my TV-out
If you have MythTV outputting to the TV properly, but mplayer isn't (i.e.: videos and DVDs are not sent to the TV-out), then try changing the driver that mplayer uses. Inside the MythTV settings for MythDVD and MythVideo, there is a line that allows you to call an external program, that probably looks like this: mplayer -fs -zoom -quiet -vo xv %s What you need to do is find out what driver to use. The "-vo xv" is trying to use the xv driver, but there are many others (xv, x11, fbdev, fbdev2, etc.). The complete list can be obtained by typing "mplayer -vo help": xv     X11/Xv x11    X11 ( XImage/Shm ) xover  General X11 driver for overlay capable video output drivers xmga   Matrox G200/G4x0/G550 overlay in X11 window (using /dev/mga_vid) mga    Matrox G200/G4x0/G550 overlay (/dev/mga_vid) gl     X11 (OpenGL) gl2    X11 (OpenGL) - multiple textures version dga    DGA ( Direct Graphic Access V2.0 ) sdl    SDL YUV/RGB/BGR renderer (SDL v1.1.7+ only!) ggi    General Graphics Interface (GGI) output fbdev  Framebuffer Device fbdev2 Framebuffer Device aa     AAlib caca   libcaca dxr3   DXR3/H+ video out zr     Zoran ZR360[56]7/ZR36060 Driver (DC10(+)/buz/lml33/MatroxRR) zr2    Zoran ZR360[56]7/ZR36060 Driver (DC10(+)/buz/lml33/MatroxRR) vesa   VESA VBE 2.0 video output xvidix X11 (VIDIX) cvidix console VIDIX null   Null video output mpegpes Mpeg-PES to DVB card yuv4mpeg       yuv4mpeg output for mjpegtools png    PNG file jpeg   JPEG file gif89a animated GIF output tga    Targa output pnm    PPM/PGM/PGMYUV file md5sum md5sum of each frame For the Hauppauge WinTV PVR-350, using "-vo x11" seems to work fine (although it is a frame-buffer device, so perhaps fbdev could be made to work). Try different settings and see what works for your TV-out. You can always do "man mplayer" for help from the manual page.

No volume control with Hauppauge WinTV PVR-350
If you're using the TV-out on your Hauppauge 350 to run MythTV, you'll quickly discover that the volume and mute functions don't do anything. You can hear sound, but not modify it. As of the writing of this document, the ivtv driver does not support control of volume. This leaves you with two options. You can control the volume using a different remote control (use the one for your TV, for instance). You may even be able to configure your IR blaster, via LIRC, to control your TV properly. Alternately, you can feed the audio output from your capture card into your sound card, and then send the output from your sound card into the TV. That way, volume control (via the sound card) is under control of the OS. Hence when MythTV tries to change volume, it will indeed affect what you hear.

No sound in mplayer when using Hauppauge WinTV PVR-350
If you've followed the instructions above to get mplayer to work with the TV-out on your capture card, you may discover that no audio is being played through your capture card's TV-out. By default, mplayer will be sending audio to your computer's sound card. The simple fix is to feed your audio out from your capture card into your sound card, and use the output from the sound card for the TV. That way, mplayer can play sound to the TV, and so can MythTV when it is buffering video through the Hauppauge capture card TV-out.

Can't boot cleanly into TV-out
If you're using a startup script (as shown elsewhere in this guide), you may find that you can't boot cleanly into your TV-out. That is, you may be able to get the TV out to work once your window manager is up and running (you can switch graphics mode into the TV output), but that you can't simply boot into the TV-out video mode. The ServerLayout you have defined in your /etc/X11/xorg.conf file for your TV-out works properly, but the problem appears to be that the required modules are not loaded when X tries to use the TV-out drivers.

First off, using a startup script (like the /usr/local/bin/start-ivtv suggested elsewhere in this document) is not as good as using modprobe properly. That is, you should be loading modules by adding appropriate lines to your /etc/modprobe.conf file. Some users have found that this doesn't work, however, and that they must use a script that is called from /etc/rc.d/rc.local during startup.

A workaround to boot into the TV-out anyway is to let your computer boot into a normal window session (into GNOME, KDE, or whatever you're using) and then have that window session launch a new X window session onto your TV-out, and use that new X session to run mythfrontend. To implement this, first edit your /etc/X11/xorg.conf file to have at least two different "ServerLayout" sections. Make sure that each of these layouts work properly and independently before you try to make this trick work.

Section "ServerLayout" Identifier "layout1" InputDevice "Keyboard1" "CoreKeyboard" InputDevice "Mouse1" "CorePointer" Screen "screen1" EndSection Section "ServerLayout" Identifier "TVlayout" Screen "Hauppauge Screen" InputDevice "Keyboard1" "CoreKeyboard" InputDevice "Mouse1" "CorePointer" EndSection

It's very important that the Identifier contains no spaces. If the identifier contains spaces in the name, then it will cause a bug with the startx function (which we'll use later). So don't call your layout "TV layout", use "TVlayout" instead. Again make sure that the two layouts both work for their respective output sources (monitor or TV) before going to the next step. Now we can make a little script that, during the startup of KDE, will either launch our new instance, or launch mythfrontend, depending on the situation.

#!/bin/bash if [ "$DISPLAY" = ":1" ] then # We are in the second KDE instance # Launch mythTV echo "Launching MythTV..." mythfrontend & else # We are in the first KDE instance # Launch a new KDE on the Hauppauge card echo "Launching new KDE instance on Hauppauge 350..." startx -- :1 -layout "TVlayout" fi

Save this script as /home/mythtv/.kde/Autostart/mythscript.sh (or whatever). As usual, make it executable:

$ chmod +x mythscript.sh

If it's not obvious, this is what the script does: First, it checks the current $DISPLAY environment variable (you can use "set" to play with environment variables). This variable specifies the display in our current context. Normally, $DISPLAY is something like ":0.0" which means screen 0. In our script, however, we start the TV-out on screen 1 explicitly. So if the script finds that it's running on screen 1, then it launches mythTV. Alternately, if it's not being launched on screen 1, then it must be running on the default screen 0, which means that it's the first instance of KDE, and it should start a new instance of KDE, and send it to screen 1.

The startx command launches a new X session (and runs the default window manager, which is KDE in this example). The ":1" says to explicitly run this on "screen 1". The "-layout" option lets us pick exactly which ServerLayout to use. Obviously replace this with the ServerLayout that you have working for your TV-out.

With this script in the /home/mythtv/.kde/Autostart/ directory, it will run automatically when a new KDE session starts. Thus, when the computer boots, it will start KDE (on the default screen 0), and run the script. This script will not be on screen 1, so it will run startx to generate a new instance of KDE on screen 1, using the "TVlayout" ServerLayout. This new KDE session will start, and it will also automatically run the script. This time, the script will see that it is running on screen 1, so it will just launch mythfrontend.

This little work-around should get your MythTV booting into your TV-out transparently (although somewhat slowly).

Blue lines during playback
If you're seeing "faint blue lines" across the screen, you should use the "xvattr" command to fix this (according to Maiku's guide). Try this: $ xvattr -a XV_COLORKEY -v 0 If that fixes it, then you should run the command every time X starts. Reportedly, adding the command to ".xinirc" conflicts with X. Instead, you could add the command to a script and then put the script in "/home/mythtv/.kde/Autostart/"
 * 1) urpmi xvattr

I forgot to add a channel to zap2it
If you forgot to add a channel when you initially signed up for your zap2it (DataDirect) account, or want to otherwise modify your channel listing, here's what you have to do. Unfortunately, it appears that the only way for the changes to "take" is to completely erase the old channel listing and then download the listing again. First, log into your zap2it account, make your changes and save them. Then, you should run "mythtvsetup" and copy down the info you have entered under "3. video sources" and "4. Input connections."

Now, exit setup and shutdown the backend for now, and re-enter setup: This time, say "yes, delete my channel settings" and then re-configure it like you had it before. Be sure to select "download listing" to get the new channel listings. Then exit mythtvsetup and re-fill the database: $ mythfrontend Now your modifications to the channel listings should have taken effect.
 * 1) /etc/init.d/mythbackend stop
 * 2) mythtvsetup
 * 1) mythfilldatabase
 * 2) /etc/init.d/mythbackend start

MythWeb isn't accessible outside my local network
If you can get to your MythWeb by using "http://localhost/mythweb/" on your MythTV machine (and perhaps even get to it by using "http://internal.ip/mythweb/" but can't access your MythWeb from anywhere else, then perhaps your ISP is blocking port 80. Some ISPs do this to protect you from viruses and such, whereas others block it to prevent you from running a web server. In any case, you can work around this by using a port number greater than 1024. To do this, you'll need to edit your apache2 configuration file, which serves up the MythWeb files. So edit "/etc/httpd/conf/httpd2.conf" and add a line like: Listen 8050 You can use whatever port you like (8050 is just an example). Note that older versions of apache would use a command like "Port 8050" but "Listen" is the new version (refer to core features documentation). Now you should be able to access your MythWeb from anywhere by using "http://your.ip.address:8050/mythweb/" or "http://your.domain.name:8050/mythweb/".

Remember to update your router settings (if applicable). Log into your router (most have a web-page on some pre-defined IP address; check your documents), and enable port forwarding for port 8050 to the IP address of your MythTV box inside your local network.

I can't log into KDE anymore: dcopserver error!
At some point in your fiddling with MythTV, it may crash and take KDE with it. Afterwards you won't be able to get back into KDE (much less run MythTV). You may get an error message like this: There was an error setting up inter-process communications for KDE. The message returned by the system was: Could not read network connection list /home/mythtv/.DCOPserver_localhost__0 Please check that the "dcopserver" program is running! You may also notice other errors when trying to run X from a command line: usr/X11R6/bin/iceauth: timeout in locking authority file /home/mythtv/.ICEauthority Failed to load module "usr/X11R6/lib/modules/extensions/libglx.a FBIOPAN_DISPLAY: invalid argument This problem is easy to fix. Just delete any files to do with ICE and DCOP: $ cd /home/mythtv $ rm .ICEauthority* $ rm .DCOPserver* The deleted files will be re-created by KDE during logon, and everything should work after that.
 * 1) reboot

I lost my MySQL password
If you have lost (i.e. you forgot) the root password for the MySQL database system, then you cannot retrieve it, but you can reset it. First, stop the mysql daemon that is running: $ su Then start the daemon again, but this time without access control: mysqld_safe --skip-grant-tables & (Remember, the & at the end is important: it puts the process in the background.) Now enter the "mysql" database and set a new password for the root user: > UPDATE user SET password=PASSWORD("abcdef") WHERE user="root"; > FLUSH PRIVILEGES; > exit Where (obviously) "abcdef" is the password you want to set. Now restart the server, just to be safe: You can test that the new password works: $ mysql -u root -p (and then enter the password), or simply: $ mysql -u root -pabcdef
 * 1) service mysql stop
 * 1) mysql -uroot mysql
 * 1) service mysql restart

title: MythTV/Troubleshooting


text:
MythTV/Conclusion

Installing and configuring MythTV can be a challenge. However, there's no denying that having a functional MythTV is both a matter of fun and pride. There's so much a MythTV can do, that you'll be happily playing and tinkering for a while to come. Also, most users of MythTV note that they change their viewing habits entirely. Instead of watching TV based on the network's choices, you can watch on your own schedule. This doesn't necessarily mean you'll watch more TV. Rather, you'll find that the time you spend watching TV is better spent. You watch quality shows and don't waste time surfing, unable to find something interesting on TV when you are in the mood to watch. You'll also be amazed how many good shows and movies routinely play on TV (especially at odd hours). By using your MythTV, you'll be able to finally take full advantage of your subscription to cable or satellite television. It's a liberating experience, especially because you're in full control of both your TV viewing experience, and the hardware/software that makes it all possible. So enjoy it!

title: MythTV/Conclusion


text: Template:MythTV

title: Template:MythTV


text:
User:TristanSabel

My full profile can be found at: http://en.wikipedia.org/wiki/User:C3H5N3O92010

title: User:TristanSabel


text:
User:TakuyaMurata/Topological groups

Topological spaces
Given an arbitrary set $$X$$, a subset of the power set of $$X$$ is called a topology $$t$$ for $$X$$ if it includes The members of $$t$$ are said to be open in $$X$$. Immediate examples of topologies are $$\{ \varnothing, X \}$$ and the power set of $$X$$. They are called trivial and discrete topologies, respectively. In the discrete topology, every set is open. On the other hand, $$\varnothing$$ and $$X$$ are the only subsets that are open in the trivial topology.
 * (i) the empty set and $$X$$
 * (ii) the union of any subset of $$t$$, and
 * (iii) the intersection of any two members of $$t$$.

In application, we are usually given some set $$X$$ (which often carries an intrinsic structure on its own) and then induce a topology to $$X$$ by defining a $$\tau$$ according to how we want to do analysis on $$X$$. The key insight here is that saying some set is open and another closed is merely the matter of labeling. One way to induce a topology is to combine existing ones. For that, we use:

1 Lemma The intersection of topologies for the same set is again a topology for the set.

Proof: Let $$\mathcal{F}$$ be a family of topologies for the same set. If $$\tau \subset \cap \mathcal{F}$$, then $$\tau \subset$$ every member of $$\mathcal{F}$$, which is closed under unions. Thus, $$\cup \tau$$ is in every member of $$\mathcal{F}$$. The other properties can be verified in the same manner. $$\square$$

Another common method of inducing a topology is to define topology from convergence of filters. A filter $$s$$ is said to converge to $$x$$ if $$s$$ contains every neighborhood of $$x$$. The convergence depends on which sets are considered neighborhoods of $$x$$; in other words, it depends on a topology. We could go in the other way: given a collection of filters $$s \to x$$, we declare sets to be open so that $$s \to x$$. We only have to check this in fact defines a topology.

Let $$f$$ be a function to some topological space. Then the set of $$f^{-1} (G)$$ for every open set $$G$$ is a the weakest among topologies that make $$f$$ continuous. If $$\mathcal{F}$$ is a family of functions defined on the same set, then a weak topology generated by $$\mathcal{F}$$ is the intersection of the weakest topology that makes each member of $$\mathcal{F}$$ continuous. A weak topology is indeed a topology since the intersection of topologies for the same set is again a topology by Lemma.

Two important types of topological spaces are constructed by this method: product and quotient spaces.

A subset $$E \subset X$$ is said closed in $$X$$ when $$E \backslash X$$ is open. The intersection of all closed set containing $$E$$ is called the closure of $$E$$ and denoted by $$\overline{E}$$. By (iii) in the definition, the closure of $$E$$ is closed. Moreover, a set is closed if and only if $$E = \overline{E}$$.

1 Lemma Proof: (i) Since $$\overline{E_j} \subset \overline{\bigcup_i E_i}$$ for all $$j \in I$$ the desired inequality holds, and since the finite union of closed sets is closed the equality holds if $$I$$ is finite. A similar argument shows (ii).$$\square$$
 * (i) $$\bigcup_{i \in I} \overline{E_i} \subset \overline{\cup E_i}$$ where the inequality holds if $$I$$ is finite, and
 * (ii) $$\overline{\bigcap_{i \in I} E_i} \subset \bigcap_{i \in I} \overline{E_i}$$.

A neighborhood of a point $$x \in X$$ is an "open" subset of $$X$$ containing $$x$$. A point $$x$$ is in the closure of $$E$$ if and only if every neighborhood of $$x$$ intersects $$E$$. Paraphrasing in the language of filter, $$x$$ is in the closure of $$E$$ if and only if a filter containing $$E$$ converges to $$x$$.

In a sense, a filter is a generalization of the notion of "neighborhoods of a point." This explains why a filter, by definition, doesn't contain the empty set (the empty set is a neighborhood of no point as well as the property $$A$$ is in a filter then any set containing $$A$$ is in the filter (if $$A$$ is a neighborhood of a point, then any larger set should also be a neighborhood of that point.) In fact, given a point $$x$$ in some set $$X$$, let $$f = \{ A \subset X : x \in A \}$$. Then $$f$$ is an ultrafilter on $$X$$.

Let $$f: A \to B$$. We say $$f$$ is continuous when its pre-image of every open set in $$B$$ is open.

1.4 Theorem ''Let $$f:X \to Y$$. The following are equivalent:'' Proof: (i) $$\Rightarrow$$ (ii) $$f(x) \in V$$ means that $$x \in f^{-1}[V]$$. Thus, $$f^{-1}[V]$$ is a neighborhood of $$x$$ and $$f[f^{-1}[V]] \subset V$$. Take $$U = f^{-1}[V]$$. (ii) $$\Rightarrow$$ (iii): If $$V$$ is a neighborhood of $$f(x)$$, then there is $$U$$ as in (ii). Since $$U$$ is a neighborhood of $$x$$, by convergence, $$U \in s$$; thus, $$f[U] \in f[s]$$ and so $$V \in f[s]$$. (iii) $$\Rightarrow$$ (i): We claim:
 * (i) $$f$$ is continuous.
 * ''(ii) If $$V \subset Y$$ is an open subset and $$f(x) \in V$$, then there exists a neighborhood $$U$$ of $$x$$ such that $$f[U] \subset V$$.
 * (iii) If a filter $$s \to x$$, then $$f[s] \to f(x)$$.
 * $$f[\overline{E}] \subset \overline{f[E]}$$

for any subset $$E \subset Y$$. Suppose a filter $$s$$ containing $$E$$ converges to some point $$x \in X$$. By (iii), $$f[s] \to f(x)$$. This proves the claim. (By the way, the claim is then another equivalent definition of continuity.) Now, given a closed subset $$F \subset X$$, applying the claim we get:
 * $$f[\overline{f^{-1}[F]}] \subset \overline{f[f^{-1}[F]]} \subset \overline{F} = F$$

Thus, $$\overline{f^{-1}[F]} \subset f^{-1}[F]$$ and so $$f^{-1}[F]$$ is closed. Since $$Y \backslash f^{-1}(U) = f^{-1}(X \backslash U)$$, $$f^{-1}$$ is an open mapping then. $$\square$$

In particular, (iii) means that if $$X$$ is a discrete space, then every function on $$X$$ is continuous.

1 Theorem The composite of continuous functions is again continuous.

Proof: If a filter $$s \to x$$, then $$f[s] \to f(x)$$ and so $$(g \circ f)[s] \to (g \circ f)(x)$$. $$\square$$

A subset of a topological space is locally closed if it can be written as the intersection of a closed set and open set. (Note: sets here are allowed to be empty; so, closed sets and open sets are locally closed.) Equivalently, a set is locally closed if and only if it is open in its closure.

A topological space is said to be connected if it is not a disjoint union of nonempty open sets. Equivalently, a topological space is connected if it has no proper open closed subsets.

A topological space is said to be irreducible if it cannot be written as a union of two proper closed subsets.

1. Theorem Let X'' be a topological space. Then the following are equivalent. Proof: (i) $$\Rightarrow$$ (ii): Let $$U \subset X$$ be a nonempty open subset. X is then the union of $$\overline{U}$$ and the complement of U. By (i), $$\overline{U}$$ cannot be a proper subset. (ii) $$\Rightarrow$$ (iii): Let A and B be open subsets. By (ii), $$A$$ is dense and so intersects B. (iii) $$\Rightarrow$$ (i): If X is not irreducible, then X is the union of proper closed subsets A and B. Then $$(X \backslash A) \cup (X \backslash B)$$ is the disjoint union of nonempty open subsets; thus, not connected. $$\square$$
 * (i) X is irreducible.
 * (ii) Every nonempty open subset of X is dense.
 * (iii) Every open subset of X (in particular X) is connected.

If X is irreducible, then $$\operatorname{C}(X, \mathbf{C})$$ is a domain. (Consider the zero set of the product $$fg$$)

1. Corollary A continuous image of an irreducible space X is again irreducible.

Proof: Let $$f:X \to f(X)$$ be a continuous map. Let $$V \subset f(X)$$ be an open subset. Then $$f^{-1}(V)$$ is open. By (ii) in the theorem and continuity, we have:
 * $$f(X) = f(\overline{f^{-1}(V)}) \subset \overline{f(f^{-1}(V))} \subset \overline{V}$$. $$\square$$

Compact sets and Hausdorff spaces
A subset of a topological space is said to be compact if every ultrafilter in it converges to exactly one point. (Note: This definition, due to Bourbaki, is slightly different but much simpler than one in literature.) In particular, a compact set is closed, and a closed subset of a compact space is compact.

1 Theorem A continuous function sends compact sets to compact sets.

Proof: Let $$K$$ be a compact set, and suppose $$f[s]$$ is an ultrafilter on K. Then s is an ultrafilter and so converges to, say, x. By continuity, f[s] converges to f(x).$$\square$$

1 Corollary A function with compact graph is continuous.

Proof: Let $$f: X \to Y$$ be a function that has compact graph. Let $$\pi: \operatorname{gra}(f) \to Y$$ and $$i:X \to \operatorname{gra}(f)$$ be canonical surjection and injection, respectively. Then $$f = \pi^{-1} \circ i$$. By hypothesis, $$\pi$$ is a closed map; its inverse is thus continuous. Hence, $$f$$ is continuous. $$\square$$

A function is said to be proper if the pre-image of a compact set is compact.

1 Theorem ''A function $$f: X \to Y$$ is proper if and only if
 * $$x_n \to \infty$$ implies $$f(x_n) \to \infty.$$.

Here $$x_n \to \infty$$ means that every compact set contains only finite many $$x_n$$.''

Proof: ($$\Rightarrow$$) is obvious. For the converse, suppose f is not proper. Then there exists a compact subset $$K \subset X$$ such that $$f^{-1}(K)$$ is not compact. The non-compactness allows us to find a strictly increasing sequence $$U_n$$ of open subsets such that $$f^{-1}(K) \not \subset U_n$$ for every $$n$$ but the union $$\bigcup U_n$$ contains $$K$$. Inductively, we can then find a sequence $$x_n \in f^{-1}(K)$$ such that $$x_n \in U_n \backslash U_{n-1}$$. Now, $$f(x_n) \not\to \infty$$ since $$f(x_n) \in K$$ for all $$n$$. On the other hand, $$x_n \to \infty$$. Indeed, suppose $$L \subset X$$ is a compact subset. Since $$\{ x_1, x_2, ... \}$$ consists of isolated points; thus, closed, the set $$\{ x_1, x_2, ... \} \cap L$$ is a compact subset, of which $$U_n$$ is an open cover. Thus, there is some $$n_0$$ such that $$U_{n_0} \supset \{ x_1, x_2, ... \} \cap L $$. Thus, $$x_n \not\in L$$ for all $$n > n_0$$. $$\square$$

1 Theorem ''Every proper map into a locally compact space is a closed map. (Recall that we assume every locally compact space is Hausdorff.)''

1 Theorem Every continuous bijection from a compact space to a Hausdorff space is a homeomorphism.

1 Theorem ''A topological space X is compact if and only if, for all topological spaces Y, the projection $$X \times Y \to Y$$ is closed.''

A Hausdorff space X is said to be compactly generated if closed subsets A of X are exactly subsets such that $$A \cap K$$ is closed in K for all compact subsets $$K \subset X$$.

1 Theorem (Tychonoff's product theorem) ''The following are equivanelt: Proof: (i) $$\Rightarrow$$ (ii). Let $$\{ X_\alpha \}_{\alpha \in A}$$ be a collection of compact spaces and $$\pi_\alpha$$ be a projection from $$\prod X_\alpha \to X_\alpha$$. Let $$\mathcal{F}$$ be an ultrafilter on $$\prod X_\alpha$$. For each $$\alpha$$, since $$\pi_\alpha (\mathcal{F})$$ is again an ultrafilter and $$X_\alpha$$ is compact, $$\pi_\alpha (\mathcal{F})$$ must converge. Then it follows that $$\mathcal{F}$$ converges. Axiom of Choice implies that the product space is compact. Conversely, let $$\{ X_\alpha \}_{\alpha \in A}$$ be a nonempty collection of nonempty sets. Let $$p$$ be a point such that $$p \in X_\alpha$$ for all $$\alpha$$. Such a $$p$$ must exist; if not, the intersection of $$X_\alpha$$ is the universal set, contradicting that it is a proper class. For each $$\alpha$$, let $$Y_\alpha = X_\alpha \cup \{ p \}$$ and $$\tau_\alpha = \{ 0, p, X_\alpha, Y_\alpha \}$$. Then $$\tau_\alpha$$ is a topology for $$Y_\alpha$$ and since finiteness is compact. Using (i) $$\prod Y_\alpha$$ is compact and thus $$\{ X_\alpha \}$$ has the finite intersection property and this implies the statement equivalent to (ii). $$\square$$
 * (i) Every product space of compact spaces is compact.
 * (ii) Axiom of Choice.

A topological space X is called a Tychonoff space if it is Hausdorff and, given a closed set F and a point x outside F, there exists a continuous function $$f: X \to \mathbf{R}$$ such that $$f = 1$$ on F and $$f(x) = 0$$.

1 Theorem Every locally compact space is Tychonoff.

1 Theorem (Stone-Čech compactification) Let X'' be a Tychonoff space. Then there exists a compact space $$X'$$ and a continuous injection $$i: X \to X'$$ such that for any continuous map $$f:X \to K$$ (where $$K$$ is a compact space) there is a unique continuous map $$F:X' \to K$$ with $$f = F \circ i$$
 * [[Image:Stone–Cech compactification.png|120px]]

Proof: See (See also: )

A cover of the set E is a collection of sets {$$G_{\alpha}$$} such that $$E \subset \bigcup G_{\alpha}$$. An open cover of $$E$$ is a cover of $$E$$ consisting of open sets, or equivalently, a subset of the topology whose union contains $$E$$. A subset of cover of $$E$$ is called a subcover if it is again a cover of $$E$$.

1 Theorem ''A topological space is compact if and only if Proof: ($$\Rightarrow$$) (ii) is immediate. For (i), we first remark that the following are equivalent: To see the equivalence of (i) and (b), consider the collection consisting of $$U_j^c$$, given an open cover $$U_j$$. We shall prove (a). Let $$s$$ be a nonempty collection of closed sets with the finite intersection property, and $$\tilde{s}$$ be an ultrafilter containing $$s$$. Since $$\tilde{s}$$ converges to, say, $$x$$,
 * (i) Every open cover of $$X$$ contains a subcover that is a finite set, and
 * (ii) X is Hausdorff.
 * (a) Every nonempty collection of closed subsets of $$X$$ with the finite intersection property is nonempty.
 * (b) Every nonempty collection of closed subsets of $$X$$ with empty intersection contains a finite subcollection with empty intersection.
 * (i).
 * $$x \in \cap \tilde{s} \subset \cap s$$.

($$\Leftarrow$$) Because of (ii), we only have to show that every ultrafilter converges to some point. Let $$s$$ be an ultrafilter. Since $$s$$ has the finite intersection property, by an equivalent form of (i), $$\cap s$$ has a point, say, $$x$$. For every neighborhood $$U$$ of $$x$$, we have either$$U \in s$$ or $$U^c \in s$$. The latter not being the case, we have $$U \in s$$. In other words, $$s \to x$$ $$\square$$

1 Corollary If $$K_n \supset K_{n_1} \supset ...$$ is a sequence of compact sets, then $$\cap_{n=1}^\infty K_n$$ is nonempty.

A set $$K$$ is compact if every open cover {$$G_{\alpha}$$} of it has a finite subcover; i.e.,
 * $$K \subset G_1 \cup G_2 \cdots \cup G_n \subset \bigcup G_\alpha $$ for some $$n$$.

For example, let $$\{ G_\alpha \}$$ be open cover of the finite set $$\{ a_1, a_2, ... a_n \}$$. Then for each $$a_k$$, we can find some $$G(a_k)$$. It thus follows that a finite set (e.g., the empty set) is compact since
 * $$\{ a_1, a_2, ... a_n \} \subset G(a_1) \cup G(a_2) \cup ... G(a_n) \subset \bigcup G_\alpha $$

Conversely, every compact subset of a discrete space is finite.

1 Theorem If a topological space is the union of countably many compact sets, then any of its open cover admits a countable subcover.

Proof: Let $$K_j$$ be a sequence of compact sets, and suppose that its union is covered by some open cover $$\Gamma$$. For each $$j = 1, 2, ...$$, since $$\Gamma$$ is an open cover of $$K_j$$, it admits a finite subcover $$\gamma_j$$ of $$K_j$$. Now, $$\gamma_1 \cup \gamma_2 ...$$ is a countable subcover of $$\Gamma$$. $$\square$$.

1 Theorem The following are equivalent: Proof: Let $$X$$ be a product topology and $$\{ \pi_\alpha \}$$ be a collection of projections on $$X$$. Let $$\mathcal{F}$$ be an ultrafilter on $$X$$. For each $$\alpha$$, since $$\pi_\alpha (\mathcal{F})$$ is again an ultrafilter and $$\pi_\alpha (X)$$ is compact, $$\pi_\alpha (\mathcal{F})$$ converges. From the lemma 1.something it follows that $$\mathcal{F}$$ converges. If (i) is true, then the convergence implies that $$X$$ is compact. To show (ii) implies (iii), Let $$\{ X_\alpha \}$$ be a nonempty collection of nonempty sets. Also, let $$a$$ be a element such that $$a \not\in \cap X_\alpha$$. Such an element must exist since the contrary means that $$\cap X_\alpha$$ is the universal set. For each $$\alpha$$ let $$Y_\alpha = X_\alpha \cup \{a\}$$ and induce the topology $$\tau_\alpha$$ by letting $$\tau_\alpha = \{ 0, \{a\}, X_\alpha, Y_\alpha \}$$. Then since its topology is finite, each $$Y_\alpha$$ is compact. That (iii) implies (i) is well known in set theory. $$\square$$
 * (i) Axiom of Choice.
 * (ii) Every product topology of compact topologies is compact. (Tychonoff's product theorem)
 * (iii) Something has empty intersection.

We say a point is isolated if the set $${x}$$ is both open and closed, otherwise called an limit point. If a set has no limit point, then the set is said to be discrete.

1 Lemma Every infinite subset $$E$$ of a compact space $$K$$ has a limit point.

Proof: Let $$E \subset K$$ be infinite and discrete. Then $$E$$ is closed since it contains all of limit points of $$E$$. Since $$E$$ is a closed subset of a compact set, $$E$$ is compact. It now follows: for each $$x \in E$$, the singleton $$\{x\}$$ is open and thus the collection $$\{ \{x\} : x \in E \}$$ is an open cover of $$E$$, which admits a finite subcover. Hence, we have:
 * $$E \subset \{ x_1, x_2, ... x_n \}$$,

contradicting that $$E$$ is infinite. $$\square$$.

We say a topological space is Hausdorff if two distinct points are covered by disjoint open sets. This definition can be strengthened considerably.

1 Theorem ''A topological space $$X$$ is Hausdorff if and only if every pair of disjoint compact subsets of $$X$$ can be covered by two disjoint open sets. '' Proof: Let $$K_1, K_2 \subset X$$ be compact and disjoint, and $$x \in K_1$$ be fixed. For each $$y \in K_2$$ we can find disjoint open sets $$A(y)$$ and $$B(y)$$ such that $$x \in A(y)$$ and $$y \in B(y)$$. Since $$K_2$$ is compact, there is a finite sequence $$y_1, y_2, ..., y_n \in K_2$$ such that:
 * $$K_2 \subset B(y_1) \cup B(y_2) ... B(y_n)$$.

Let $$A(x) = A(y_1) \cap A(y_2) \cap ... A(y_n)$$, and $$B = B(y_1) \cup B(y_2) ... B(y_n)$$. Since $$A(x)$$ is disjoint from any of $$B(y_1) ... B(y_n)$$, $$A(x)$$ and $$B$$ are disjoint. $$A(x)$$ is open since it is a finite intersection of open sets. Since $$K_1$$ is compact, there is a finite sequence $$x_1, ..., x_n \in K_1$$ such that:
 * $$K_1 \subset A(x_1) \cup A(x_2) ... A(x_n) \subset B^c \subset {K_2}^c$$. $$\square$$

1 Theorem A topological space is Hausdorff if and only if a filter $$s$$ on it converges, if it ever does, to at most one point.

Proof: Suppose $$\mathcal{F}$$ converges to two distinct points $$x$$ and $$y$$. By the separation axioms, we can find disjoint subjects $$A$$ and $$B$$ such that $$x \in A$$ and $$y \in B$$. Since convergence, $$\{ A, B \} \subset \mathcal{F}$$. But this then implies that $$A \cap B = 0 \in \mathcal{F}$$, a contradiction. $$\square$$

A Hausdorff space is said to be locally compact if every point in it has a compact neighborhood. A locally compact space is thus locally closed.

We also give two other characterizations of Hausdorff spaces, which are sometimes useful in application.

1 Lemma A topological space $$T$$ is Hausdorff if and only if for every point $$p \in T$$ the set $$\{ p \}$$ is the intersection of all of its closed neighborhoods.

1 Lemma ''Let $$\mathcal{F}$$ be a family of functions from $$X$$ to a Hausdorff space $$Y$$. Let $$\Gamma$$ be the union of $$f^{-1} (G)$$ taken all over open sets $$G$$ of $$Y$$ and $$f \in \mathcal{F}$$. Then $$\Gamma$$ satisfies the Hausdorff separation axiom if and only if for each $$x, y \in X$$ with $$x \ne y$$, there is some $$f \in \mathcal{F}$$ such that $$f(x) \ne f(y)$$.

Proof: First suppose the separation axiom. Then we can find two disjoint sets $$A, B \in \Gamma$$ such that $$x \in A$$ and $$y \in B$$. Then since by definition, there is some function $$f$$ and sets $$G_1$$ and $$G_2$$ such that $$A = f^{-1}(G_1)$$ and $$B = f^{-1}(G_2)$$. Thus, $$f(x) \ne f(y)$$. Conversely, suppose the family $$\mathcal{F}$$ separates points in $$X$$. Then by the separation axiom there are disjoint open open sets $$A$$ and $$B$$ such that $$x \in A$$ and $$y \in B$$. Then by the definition of $$\Gamma$$ $$f^{-1}(A)$$ and $$f^{-1}(B)$$ are disjoint and both open. $$\square$$

1 Theorem ''Let $$f:X \to Y$$ be continuous. If $$Y$$ is Hausdorff, then the graph of $$f$$ is closed.''

Proof: Let $$E$$ be the complement of the graph of $$f$$. If $$(x, y)\in E$$, then, since $$f(x) \ne y$$ and $$Y$$ is Hausdorff, we can find in $$Y$$ disjoint neighborhoods $$U$$ and $$V$$ of $$f(x)$$ and $$y$$, respectively. It follows: $$(x, y) \in f^{-1}(U) \times V \subset E$$ since there is no point $$z$$ such that $$z \in f^{-1}(U)$$ and $$f(z) \in V$$. By continuity, $$f^{-1}(U)$$ is open; thus, $$E$$ is open. $$\square$$

1 Corollary ''Let $$f, g: A \to B$$ be continuous functions. Suppose $$B$$ is Hausdorff. If $$f = g$$ on some dense subset, then $$f = g$$ identically.

Proof: Let $$E$$ be the intersection of the graph of $$f$$ and the graph of $$g$$. $$E$$ is dense in the graph of $$f$$ by hypothesis and closed by the preceding theorem. $$\square$$

1 Theorem A dense subspace X of a compact Hausdorff space Y is locally compact if and only if X is an open subset of Y.

A graph of a function $$f$$ is the set consisting of ordered pairs $$(x, f(x))$$ for all $$x \in$$ the domain of $$f$$. In the set-theoretic view, of course this set is $$f$$. But since we usually do not see a function as a set, the notion is often handy to use.

1 Lemma ''Let $$f: X \to Y$$ be a function. Suppose $$X$$ is locally compact. Then $$f$$ is continuous if and only if $$f$$ is continuos on every compact subset of $$X$$.''

Proof: Suppose $$f(x) \in U$$ where $$U \subset X$$ is an open subset. By local compactness, $$f(x)$$ has a neighborhood $$V \subset K \subset U$$ where $$K$$ is a compact set. Since $$f|_K$$ is continuous by hypothesis, $$x$$ has a neighborhood $$W$$ such that: $$f(W) \subset V$$. $$\square$$

Topological groups
Let G be a topological group, which we don't assume to be Hausdorff.

1 Theorem Proof: Left to the reader. $$\square$$
 * (i) G is Hausdorff if and only if $$\{e\}$$ is closed.
 * (ii) If G is Hausdorff, then its discrete subgroup is closed.

1 Theorem (Baire) ''Let $$X$$ be a locally compact space. If $$X$$ is written as a union of countably many sets, then one of those sets contains a nonempty open subset.''

Proof: Similar to one given in Baire category theorem.

1 Corollary If $$G$$ is countable and locally compact, then $$G$$ is discrete.

Proof: We write $$G = \{ g_1, g_2, ... \}$$. Then $$\{g_j\}$$ is then open for some $$j$$. It follows that $$\{g_j^{-1}\}$$ and so $$\{e\}$$ is open. (Recall that every finite subset of a Hausdorff space is closed.) Hence, every subset of $$G$$ is open and closed. $$\square$$

In particular, the only topology that makes $$\mathbf{Q}$$ a locally compact topological group is the discrete one.

1. Theorem ''Let $$K \subset G$$ be a compact subset. Then $$C(K)$$ consists of uniformly continuous functions.''

Proof: We only show right uniform continuity, since the proof for the left uniform continuity is completely analogous. Let $$f \in C(K)$$, and $$\epsilon > 0$$ be given. By continuity, for each $$x \in K$$, there is a neighborhood $$V_x$$ of e such that
 * $$|f(y) - f(x)| < \epsilon \qquad $$   for all $$y \in x {V_x}^2$$.

(Note: by the continuity of translation, for any neighborhood V of e, one can always find another neighborhood W of e such that $$W^2 \subset V$$.) By compactness, $$K$$ is contained in the union of some $$x_1 V_{x_1}, x_2 V_{x_2}, ..., x_n V_{x_n}$$. Let $$V = \cap_k V_{x_k}$$. It follows that:
 * $$|f(y) - f(x)| < \epsilon$$    for all $$y \in x V$$.

Indeed, if $$x \in K$$, then $$x \in x_k V_{x_k}$$ for some $$k$$ and so:
 * $$|f(y) - f(x)| \le |f(y) - f(x_k)| + |f(x_k) - f(x)| < 2\epsilon $$   for all $$y \in x V$$.

for any $$y \in x V \subset x_k {V_{x_k}}^2$$.

1. Corollay Every function in $$C_c(G)$$ is uniformly continuous. (Actually, true for C_0(G)?)

title: User:TakuyaMurata/Topological groups


text:
Speech-Language Pathology/Stuttering/Development of Childhood Stuttering

Stuttering isn't a physical disorder. It's not a psychological disorder. Stuttering is a developmental disorder.

Children grow up in a certain order. They crawl before they walk. They walk before they run. They run before they ride bicycles. They ride bicycles before they borrow your car keys.

Usually. Some children walk before they crawl. My three-year-old nephew borrows my car all the time. Just joking. I don't own a car.

At each stage of physical development, a child's brain develops too. E.g., crawling helps the child develop communication between the left and right hemispheres of his brain. If all goes well, the child's physical, neurological, and psychological systems develop together.

A small, sometimes imperceptible, developmental misstep in early childhood can nudge a child off the normal developmental track. The child then grows on an abnormal developmental track. A minor problem can develop into a major disability as the child grows up.

Language-Learning Impairment

Some children can't hear the difference between short duration speech sounds. The difference between /b/ and /d/ sounds occurs within a few milliseconds (thousands of a second). Some children's brains' auditory processing isn't fast enough to hear fast speech sounds. To these kids, "bad" and "dad" are the same word, "bug" and "dug" are the same, and so are "buck" and "duck." (This is a form of central auditory processing disorder, or CAPD).

You'd think this would be a minor problem. After all, you know the difference between "sew" and "so." But it's not a minor problem. These children develop speech slower than other children. Slow speech development causes them to miss other developmental stages. Their grammar develops poorly. Listeners have difficulty understanding these children's speech. These children understand the difference between boys and girls, but interchange "he" and "she." They mix up past, present, and future tense.

Then these children are labeled mentally challenged, even though they're normal or even excel at non-language activities (e.g., building with Legos). They're put into special ed classes, with children who really are mentally retarded.

The children miss more developmental stages. As adults, these individuals may be unable to read, or have poor social skills, or be unable to work at more than menial jobs.

This disorder is called language-learning impairment (LLI). In the last ten years a treatment has been developed. These children can distinguish /b/ from /d/ if the words are slowed down. Children with LLI now play a computer game that trains them to hear the difference between short-duration speech sounds.

When their auditory dysfunction is corrected, the children develop normally. The children usually catch up with their peers, e.g., advancing four reading grade levels in six months.

Analogously, children's brains are like a railroad going from New York to Los Angeles. A little dysfunction can bump a child onto a sidetrack. The sidetrack may start out only a few feet from the main track, but twenty years later he's lost somewhere in South America.

Treatment is like giving the child a shove back onto the main railroad track. The child then zooms ahead to catch up with his peers.

(Brain scans show that adult stutterers have a different form of CAPD, which may affect how we hear our own voices or feel our speech-production muscles moving. No researchers have investigated whether children who stutter also have this form of CAPD, or if treating this form of CAPD stops stuttering from developing.)

 * Wikipedia doesn't have an article about language learning impairment (LLI) but it has an article about specific language impairment (SLI).

Early Intervention Is Best

Stuttering is similar to LLI, in that something small nudges a child off the normal developmental track at the age of two or three. This small nudge causes the child to grow on an abnormal developmental path. By adulthood, the stutterer has developed a variety of core symptoms, secondary behaviors, and psychological problems.

The average age of stuttering onset is 30 months. I.e., two-and-half-years-old is the typical age that children begin to stutter. Stuttering rarely begins after age six.

65% of preschoolers who stutter spontaneously recover, in their first two years of stuttering. These children grow up to have normal speech. Some pediatricians tell parents to "wait and see" if a child outgrows stuttering on his own. But this advice is wrong. Children who stutter should be treated by a speech-language pathologist as soon as possible. (Schools provide free speech therapy to children as young as three years old.)

However, children who stutter longer are less likely to recover without treatment. Only 18% of children who stutter five years recover spontaneously.

The peak age of recovery is 3.5 years old. By age six, a child is unlikely to recover without speech therapy.

If your child is in grade school and has stuttered for five years, he or she will need a bigger shove to get back onto the normal development track.

Critical Ages in Stuttering Development

At two or three years old, children are quickly developing communication skills. Their brains are growing rapidly. A child's language skills may develop faster than his speech skills. He wants to communicate but can't easily and freely generate speech.

The child interjects "uh" and "um." He repeats words. He has silent pauses. He revises what he's saying in the middle of sentences, or leaves sentences incomplete. He's most dysfluent with long sentences, when interrupting or being interrupted, or during stressful periods, such as a divorce, the birth of a sibling, or moving to a new home.

Those are normal dysfluencies. All children have normal dysfluencies. Normal dysfluencies aren't stuttering.

The "experts" say that some children move from normal dysfluencies into stuttering. These children's frustration trying to talk leads them to push out words. The children tense their breathing, their vocal folds, and their lips, jaws, and tongues. The children struggle to talk, getting into longer repetitions, prolongations, and silent blocks.

Recognizing which behaviors are normal dysfluencies and which behaviors are stuttering is a key issue. The Stuttering Foundation of America has a videotape to help parents differentiate normal dysfluencies from stuttering.

Because children's brains are growing at this time, their stuttering behavior becomes hardwired. Their brains shift onto an abnormal development path. The "experts" have identified five stages children go through as stuttering develops, over months and years.

Or are the "experts" wrong? Some parents report that their children woke up one morning stuttering severely. These children went from normal dysfluencies to severe stuttering overnight. The children skipped the development stages in between.

In a later chapter, you'll learn that a disorder similar to stuttering is triggered by a streptococcal infection causing a child's immune system to attack his or her brain's putamen motor control area. It's possible that a similar autoimmune dysfunction could attack a child's left caudate nucleus speech motor control area, causing severe stuttering to develop overnight.

You'll also learn that three genes are linked to stuttering. These genes affect the neurotransmitter dopamine, which functions abnormally in adult stutterers. I.e., some children are genetically predisposed to a class of disorders that includes stuttering.

You'll also learn that adult stutterers have abnormal auditory processing. (This abnormality is different from the auditory processing abnormality that causes language-learning impairment.)

These questions are important because they affect what therapy should be effective for children. If the "experts" are right that stuttering develops in five stages, beginning with normal dysfluencies, then early intervention is paramount, but the therapy can be a gentle nudge (e.g., telling the parents not to interrupt when the child is speaking).

But if the "experts" are wrong, and some children develop severe stuttering without going through intermediate stages, then therapy should start with a big shove back onto the normal developmental track. This important issue—direct vs. indirect therapy—is addressed in the chapter Stuttering Therapies for Pre-School Children.

References

 * 1) Merzenich, M., Jenkins, W., Johnston, P., Schreiner, C., Miller, S., and Tallal, P.  “Temporal Processing Deﬁcits of Language-Learning Im-paired Children Ameliorated by Training,” Science vol. 271, January 5 1996, p.77-80.
 * 2) Yairi, E., Ambrose, N. "Onset of stuttering in preschool children: Selected factors," Journal of Speech and Hearing Research, 35, 1992, 782-788.
 * 3) Yairi, E. (1993) "Epidemiologic and other considerations in treatment efficacy research with preschool-age children who stutter," Journal of Fluency Disorders, 18, 197-220. Yairi, E., Ambrose, N. "Onset of stuttering in preschool children: Selected factors," Journal of Speech and Hearing Research, 35, 1992, 782-788.
 * 4) Finn, Patrick. "Children Recovered From Stuttering Without Formal Treatment: Perceptual Assessment of Speech Normalcy," Journal of Speech, Language, and Hearing Research, 40, 867-876, August 1997.
 * 5) Andrews, et al., "Stuttering: a review of research findings and theories," Journal of Speech and Hearing Disorders, 48, 226-246, 1983.

Recommended Books

 * Early Childhood Stuttering, by Ehud Yairi and Nicoline Ambrose (2004, ISBN 0890799857)


text:
Trigonometry/Vectors in the Plane

In practice, one of the most useful applications of trigonometry is in calculations related to vectors, which are frequently used in Physics. A vector is a quantity which has both magnitude (such as three or eight) and direction (such as north or 30 degrees south of east). It is represented in diagrams by an arrow, often pointing from the origin to a specific point.

A plane vector $$\vec{A}$$ can be expressed in two ways -- as the sum of a horizontal vector of magnitude $$A_x$$ and a vertical vector of magnitude $$A_y$$, or in terms of its angle $$\theta$$ and magnitude $$\left|\vec{A}\right|$$ (or simply A). These two methods are called "rectangular" and "polar" respectively.

Rectangular to Polar conversion
For simplicity, assume $$\vec{A}$$ is in the first quadrant and has x-component $$A_x$$ and y-component $$A_y$$ (which will necessarily be positive). Given these components, we want to find the angle $$\theta$$ and the magnitude $$A$$.

If we draw all three of these vectors, they form a right triangle. It is easy to see that $$\tan \theta = \frac{A_y}{A_x}$$, or $$\theta = \arctan \frac{A_y}{A_x}$$ (A vector with an angle of zero is defined to be pointing directly to the right.) Furthermore, by the Pythagorean Theorem, $$A_x\,^2 + A_y\,^2=A^2$$, or $$A=\sqrt{A_x\,^2 + A_y\,^2}$$.

Polar to Rectangular conversion
This is essentially the same problem as above, but in reverse. Here, $$\theta$$ and $$A$$ are known and we want to calculate the values of $$A_x$$ and $$A_y$$.

Using the same triangle as above, we can see that $$\cos \theta = \frac{A_x}{A}$$, or $$A_x=A \cos \theta$$. Also, $$\sin \theta = \frac{A_y}{A}$$, or $$A_y=A \sin \theta$$.

Review of conversions

 * $$\theta = \arctan \frac{A_y}{A_x}$$
 * $$\left|\vec{A}\right|=A=\sqrt{A_x\,^2 + A_y\,^2}$$
 * $$A_x=A \cos \theta$$
 * $$A_y=A \sin \theta$$

title: Trigonometry/Vectors in the Plane