Matthew Zimmerman has created a patch for MPlayer / Mencoder http://www.mplayerhq.hu that allows you view the files created by MythTV. MythTV doesn't use standard Nupplevideo files, which is why you MPlayer complains if you try to view them.
Download the patch to MPlayer from Matt's website. http://dijkstra.csh.rit.edu:8088/~mdz/mythtv/.
$ wget http://dijkstra.csh.rit.edu:8088/~mdz/mythtv/mplayer-0.90pre10+mythtv.patch
Download the source to MPlayer and patch:
$ wget http://ftp.lug.udel.edu/MPlayer/releases/MPlayer-0.90rc1.tar.bz2
$ tar -xjf MPlayer-0.90rc1.tar.bz2
$ cp mplayer-0.90pre10+mythtv.patch MPlayer-0.90rc1
$ cd MPlayer-0.90rc1
$ patch -p1 < mplayer-0.90pre10+mythtv.patch
At this point, you can read the MPlayer documentation and start the compile process.
MythTV is not dependent on any particular window manager. If you wish to
run a lightweight window manager, the configfiles/
directory has an
example of a .twmrc
and .fvwmrc
file you may use.
Here's an example submitted to the mythtv-dev list by Pat Pflaum mailto:pat@netburp.com using fvwm:
$ cat > .xinitrc
fvwm &
mythfrontend
^D
$ cat > .fvwmrc
Style "myth*" NoTitle, NoHandles, Sticky, WindowListSkip, BorderWidth 0
^D
$
The following also works with blackbox:
$ cat > .xinitrc
xset -dpms s off &
irxevent &
mythfrontend &
blackbox
Make sure that your .blackboxrc
file has:
session.screen0.focusNewWindows: True
session.screen0.focusModel: SloppyFocus
in it.
While MythTV allows you to set various GUI and capture resolutions, not all combinations make sense.
First, analog video signals have a defined vertical resolution. In NTSC, the video standard specifies that there are 525 vertical scan lines. Once the "extra" lines are removed (they're used to synchronize the video signal, and encode closed captioning data), you have 480 vertical lines.
In PAL, there are 625 "raw" lines of resolution, with a net of 576 vertical lines.
Horizontally, the maximum you can expect from a Bt8X8 chip is 720.
With this in mind, there are certain commonly accepted values for resolution. While other values may be accepted, they will cause scan lines to be repeated or dropped.
From "best" to "worst", in NTSC:
As you can see, the lower quality values are half of the better ones. 720x240 is possible, but isn't a good tradeoff relative to the number of vertical lines lost. In a PAL country, the you would use values like 720x576 or x288.
The higher resolutions will be more CPU intensive. If the CPU is overtaxed,
frames will be dropped causing uneven motion. You will likely see the best
results at resolutions which average at least 10% CPU idle time. You can
use system tools such as top
or sar
to check the CPU %
idle while recording. If the CPU average usage is consistently exceeding
90%, frames will need to be dropped during peak times when more than 100% of
the available CPU would be needed to process all of the frames.
If you'd like to read more on this, go to the vcdhelp website at http://www.vcdhelp.com/forum/userguides/94382.php.
MythTV is designed to be run as dedicated full screen TV application but can also be run as a desktop application on a computer monitor. Here are a few consideration for configuring sizes to best suit you needs.
There are three sizes that are important for matching the MythTV GUI and full screen TV playback to fit the screen:
The MythTV GUI uses its GUI dimensions regardless of the other two and is anchored to the upper left corner of the X Desktop.
The MythTV full screen mode uses the X display size dimensions regardless of the other two and is anchored to the upper left corner of the X display.
For output to a Television, common resolutions are 640x480, 800x600, and some rare devices support 1024x768. Generally, higher resolutions are better. However, you may find that you prefer the picture quality at one of the lower resolutions. Everything in MythTV is scalable and should 'fit' regardless of the resolution you choose.
Edit your X configuration file, usually "XF86Config-4", so that the the resolution you want to use is listed first in the lists under "Screen". If this resolution is higher than the resolutions supported by your output device, you will see a 'panning' effect where moving the mouse to the edge will scroll around a desktop area which is larger than the display size. If this happens, edit your X configuration file to match the display size then restart X.
In 0.8, from "mythfrontend" go to Setup->Appearance. The default for the height and width on 0.8 is "0" - this will cause MythTV to automatically size itself to full screen. To ensure that your new dimension settings take effect, exit and restart MythTV.
NOTE: When the GUI is full screen, you may need to set your window manager to 'Click to Focus' for windows to stack properly.
The fonts for the GUI and OSD will scale to whatever sizes you use. Most font sizes can be changed in setup selections. Make sure to use fonts large enough to be read on a TV screen from a distance.
The full screen TV size is based on the X display size. For Xinerama, you can specify a screen in Setup->General. The picture will be stretched to fit the entire screen regardless of the capture resolutions used.
Because picture edges can be ragged and screen edges aren't straight, Television is designed to project an image larger than the physical screen. This is called "overscan". Underscan is fitting the entire image inside the screen. This is useful for computer monitors so that toolbars and scrollbars at the edges can be seen.
For best results, match the X display area as close as possible to the edges of the physical screen. This can only be adjusted by your tv-out device or by the settings for the television set. Many sets have these adjustments in a 'service mode'.
MythTV has settings for "Overscan" in Setup->Playback. These can not, and do not, cause the image to display beyond the edge of the X display area. The purpose of these settings are to cut off rough edges and to expand the image so that objects will appear to be the same size as a normal overscanned TV picture.
When using MythTV on a high resolution desktop monitor, set the MythTV GUI dimensions to something much smaller than your X display resolution but still large enough to read the fonts. The GUI screens will always be in the upper left hand corner. However, your window manager may be able to minimize these (ALT-F4 in KDE for example).
The TV picture will start in full screen mode. Press "f" to put the picture in a window that can be moved and resized. By default, the picture uses the recording resolution for its dimensions. If you check the box "Fixed Aspect Ratio" in Setup->Playback, the windowed picture will always be resized to normal 4:3 shape.
See the mysqldump manpage for more information.
$ mysqldump -u mythtv -pmythtv mythconverg > mythtv_backup.sql
To restore: (assuming that you've dropped the database)
$ mysql -u root
mysql>create database mythconverg;
mysql>exit
$ mysql -u mythtv -pmythtv mythconverg < mythtv_backup.sql
You may need to alter the mysql permissions if this database is being shared with multiple systems. See the Modifying access to the MySQL database for multiple systems section for more information.
NOTE: Performing this step will remove the entire database. You will lose all of your settings and will need to re-run the mc.sql script to setup the database structure before running the setup program.
$ mysql -u root
mysql> drop database mythconverg;
mysql> quit
btaudio allows you to obtain the audio data from your tuner card directly over the PCI bus without using a soundcard. This is useful if you would like to use multiple tuner cards in a system without adding a soundcard for each one, or if your existing soundcard is not capable of full-duplex operation.
In order to use btaudio, your tuner card will need certain hardware installed on it, and that hardware must be wired correctly. The chip that will allow you to use the btaudio module is the MSP34xx. However, having a MSP34xx is no guarantee that you will be able to use the btaudio module.
As of 2003-03-31, this is the current list of cards and their status: Works with btaudio:
The following cards do not work:
The following cards have been reported to work, but have issues:
See contrib/example.modules.conf.for.btaudio
for an example file on
how to configure btaudio on your system.
Once btaudio loads, it should register additional /dev/dsp
and
/dev/mixer
devices. Typing $ dmesg
will let you know
what's going on.
If mythfilldatabase grabbed a channel which you do not want to include in your TV listings, you can remove the entries from the xmltv config file and the mysql database. This often happens with premium channels; for example, HBO or Showtime may be available on your cable TV system, but is scrambled because you're not a subscriber to that channel. Since you can never watch it, you want to get rid of it.
First, comment out the channel from the /.mythtv/<sourcename>.xmltv file by inserting a "#" in front of the unwanted entry. This will prevent mythfilldatabase from grabbing future listings.
Next, delete the unwanted item from the channel table so that it will not appear in the EPG or when changing channels. The channels will always have "1000" added to them, so for example, assuming that HBO is channel 15:
$ mysql -u root mythconverg
mysql> delete from channel where chanid = '1015';
Old program data will be removed over the course of a week. However, you may want to immediately delete any current program listings for the channel that has been removed:
$ mysql -u root mythconverg
mysql> delete from program where chanid = '1015';
NOTE: THE FOLLOWING DOCUMENTATION IS PROVIDED AS-IS AND IS NOT GUARANTEED TO WORK WITH YOUR DISTRIBUTION. FOR IVTV DRIVER ASSISTANCE, SEE THE IVTV MAILING LIST. https://lists.sourceforge.net/lists/listinfo/ivtv-devel
These instructions work for Mandrake 9.1 on a backend machine which is hosting a single PVR-250 capture card.
Install the Mandrake kernel source. If you are using a different Mandrake kernel level (ie, not 2.4.21-0.16mdk as in the example below, then alter the urpmi command appropriately.)
$ uname -a
Linux pvr 2.4.21-0.16mdk #1 Fri Apr 11 06:51:54 CEST 2003 i686 unknown
unknown GNU/Linux
$ su
# urpmi kernel-source
NOTE: You do not need to recompile your kernel.
Download the IVTV driver from CVS:
$ cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ivtv login
<enter> as password
$ cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/ivtv co ivtv
This should create an ivtv directory. Switch to it and perform the following commands:
$ cd ivtv/ivtv/utils
$ wget http://hauppauge.lightpath.net/software/pvr250/pvr250_16_21062.exe
$ su
# ./ivtvfwextract.pl pvr250_16_21062.exe
# exit
The ivtvfwextract program extracts the firmware required for the card. You may want to go to the Hauppauge website and download the latest Windows driver if the wget command fails.
Next, compile the driver:
$ cd ~/ivtv/ivtv/driver
$ make
Add the following to /etc/modules.conf
:
alias char-major-81 videodev
alias char-major-81-0 ivtv
options ivtv debug=1
options tuner type=2
options msp3400 once=1 simple=1
add below ivtv msp3400 saa7115 tuner
NOTE: You must specify the tuner type manually. See
~/ivtv/ivtv/driver/tuner.h
for a listing of tuners. In the above
example, tuner type=2
is a Phillips NTSC. Use an appropriate tuner
type for your system and video standard. The debug=1
parameter on
the ivtv line actually means less debugging output will be printed.
Next, copy the files that were compiled in the driver directory into the appropriate modules directory:
$ su
# make install
# depmod -a
Finally, load the ivtv driver:
# modprobe ivtv
# exit
Check that the card is being recognized on the PCI bus:
$ lspci -v
<snip>
00:0c.0 Multimedia video controller: Internext Compression Inc iTVC15 MPEG-2
Encoder (rev 01)
Subsystem: Hauppauge computer works Inc.: Unknown device 4801
Flags: bus master, medium devsel, latency 32, IRQ 11
Memory at d0000000 (32-bit, prefetchable) [size=64M]
Capabilities: <available only to root>
If you don't see your card on the PCI bus, make sure that it's been installed in a bus-master slot. For some motherboards, only the PCI slots closest to the AGP slot are bus-mastering.
Check that the ivtv driver has created a new video device:
$ ls -l /dev/v4l/vi*
crw------- 1 mythtv sys 81, 224 Dec 31 1969 vbi0
crw------- 1 mythtv sys 81, 0 Dec 31 1969 video0
crw------- 1 mythtv sys 81, 32 Dec 31 1969 video32
In this case, the ivtv device is video0
.
Go into setup/setup
on the machine hosting the hardware MPEG-2 card.
When you add a new capture card, ensure that you are using the
video0
device.
NOTE: As of 2003-04-25 the ivtv driver does not support VBI, so closed-captioning is not available.
Leave the VBI device, audio device and audio sampling rate limit at the default values. Change the default input to an appropriate setting for your configuration. Change the card type to "Hardware MPEG Encoder Card" and press ENTER.
The remaining setup is just like a standard V4L card; define a video source if you have not already done so, and assign the video source to a video card input on the Input Connections screen.
Some people report issues with the ivtv module not being loaded when
required by MythTV. To get around this, you can modprobe the ivtv driver
before using it. The simplest technique is to add the modprobe
command to /etc/rc.d/rc.local
:
# echo "/sbin/modprobe ivtv" >> /etc/rc.d/rc.local
By default, the IVTV driver uses a 16Mbps peak rate with a 8Mbps VBR. This
will create files at about 4GB/hour. If you wish to adjust these
parameters, add something like the following to your rc.local
:
/path/to/ivtv/utils/test_ioctl -c bitrate=4500000,bitrate_peak=6000000
The actual values to use should be adjusted to your liking and in part depend on the capture resolution. The above example is more than adequate for 480x480. Once the IVTV API has settled down MythTV will incorporate the ability to modify the bitrate internally.
NOTE: some people complain
that their PVR-250/350 card is not capturing audio. The most likely source
for this is that your system is not loading the correct msp3400.o file; ivtv
uses a custom msp3400.c, and if the resulting module isn't loaded you will
not get sound. Switch to your /lib/modules
directory and rename
the existing msp3400.o file, then copy the msp3400.o
from the ivtv
driver directory and re-run depmod. If that still doesn't work,
then check the ivtv mailing list for more information.
NOTE: Some people report "ghosting" issues with their PVR-250s, where there is a faint copy of whatever is on the screen appearing to the right of the image. If you have this issue, it's fairly obvious. This is a firmware issue, apparently. There are two ways around this:
To turn off DNR, add the following to your rc.local
:
/path/to/ivtv/utils/test_ioctl --set-codec-params=dnr_mode=0,dnr_temporal=0
You may want to use a central server to store your files.
On the host machine, (in this case, the hostname is "masterbackend") you'll
want to edit your /etc/exports
file and use something like:
/var/video (rw)
To export the /var/video
directory with read / write privileges.
On the "slave" machine, you'll want to edit the /etc/fstab
file and
add something like:
masterbackend:/var/video /var/video nfs rsize=8192,wsize=8192,soft,nfsvers=3
Then run # fstab -a
to re-read the file to mount the file system.
In this case, the source is a machine called "masterbackend" which is exporting the directory "/var/video", which we're mounting locally at "/var/video". The rsize and wsize options are used to increase the performance of NFS; soft mean that NFS will eventually timeout on an error, and the nfsvers is required for filesizes over 2GB.
Here's a method for automatically starting mythbackend submitted by Mike Thomson ( mailto:linux@m-thomson.net) and Stu Tomlinson ( mailto:stu@nosnilmot.com).
Copy the files from the MythTV contrib
directory or from Mike's web
site (
http://m-thomson.net/mythtv/) as follows:
etc.rc.d.init.mythbackend
should be made executable and copied to
/etc/rc.d/init.d/
:
$ cd contrib
$ su
# chmod a+x etc.rc.d.init.d.mythbackend
# cp etc.rc.d.init.d.mythbackend /etc/rc.d/init.d/mythbackend
etc.sysconfig.mythbackend
should be copied to
/etc/sysconfig/
:
$ cd contrib
$ su
# cp etc.sysconfig.mythbackend /etc/sysconfig/mythbackend
Edit /etc/sysconfig/mythbackend
if you want to change the defaults
(the userid that should start mythbackend, location of the logfile and (if
required) the name and location of the mythbackend binary).
Use chkconfig to make sure the script is called when entering runlevels 3, 4 or 5:
$ su
# chkconfig --level 345 mythbackend on
# exit
$
By default, the log file for mythbackend will be written to
/var/tmp/mythbackend.log
. This has been tested and is known to work
on Mandrake and Red Hat, but many people prefer to place logs under
/var/log/
.
To do this, create a group called mythtv
(or anything you prefer)
and add your usual MythTV users to that group. If you changed the user that
starts mythbackend from the default of root you must perform this
step.
Create the directory /var/log/mythtv
and set its
permissions as follows:
$ su
# mkdir /var/log/mythtv
# chown root:mythtv /var/log/mythtv
# chmod 0775 /var/log/mythtv
# exit
$ ls -ld /var/log/mythtv
drwxrwxr-x 2 root mythtv 4096 Apr 28 21:58 /var/log/mythtv/
$
Mandrake adds one more twist in the form of the msec
utility,
which runs regularly and (at the default or any higher security level) sets
permissions on many files, including those under /var/log
.
To tell msec about the MythTV log files and their directory, you need to
edit the /etc/security/msec/perm.local
file to include the
following:
# /etc/security/msec/perm.local
# Local overrides to the msec program
#
# Full file path user.group permissions
/var/log/mythtv/ root.mythtv 775
/var/log/mythtv/* root.mythtv 664
A copy of the above has been included in the contrib/ directory. You may add it by typing:
$ cd contrib
$ su
# cat etc.security.msec.perm.local >> /etc/security/msec/perm.local
# exit
Finally run the msec
tool to check and implement your
changes.
$ su
# msec
# exit
$
NOTE: msec can only reduce the permissions of files, so if
you don't get the results you expect, check that you're not asking
msec
to add missing permissions to the files or directories you
created.
The portage file for MythTV has scripts that will allow you to run mythbackend at startup.
To run mythbackend as a daemon which starts at boot time:
# rc-update add mythbackend default
To stop mythbackend as a daemon:
# /etc/init.d/mythbackend stop
To obtain a list of options:
# /etc/init.d/mythbackend
MythTV is flexible in the way that you define multiple backend tuner configurations. The only hard-and-fast rule is that the Master Backend must have a capture device defined, but shouldn't imply that the capture device in the MBE must be the first capture card defined in the database.
One example of an advanced configuration is the round-robin scheme. Rather than defining all of the cards on the master, you could first go into setup on the master to define globals such as the general configuration and the channel lineup but not the host-specific configuration item like the capture card. In this example, we will use a 4 tuner configuration, where two slaves have one card each and the master has two.
Using this scheme, the master backend will not use both capture cards until one of the following happens:
The scheduler in MythTV checks whether an encoder is available; if a slave backend isn't running, its encoder isn't available, so the scheduler will look for the next available encoder. This makes MythTV very flexible; slave tuners can come and go, and as long as there are enough tuners for what you'd like to record it doesn't matter which tuner in particular is going to be used.
Using this round-robin scheme along with a shared storage directory like NFS and enabling the Master Backend Override setting will allow you to view content even if the slave backend that recorded a program is not available.
MythTV creates large files. The partitions that your distribution sets up for you may not be optimized for large files.
With Ext3, your biggest gain is that in case of a crash and reboot you don't have to wait very long for your partition to be remounted. With Ext2, the fsck may take a long time to run on multi-gigabyte partitions.
When formatting the partition, the following command line should be better
than the default. This example assumes that /dev/hdb1
has already
been created using fdisk.
# mkfs.ext3 -T largefile4 -m 0 /dev/hdb1
The "-T largefile4" option creates one inode per 4 megabytes. The "-m 0" (zero, not "oh") parameter sets the amount of spaced reserved for root to zero. By default, this is 5%, which on a multi-gigabyte drive is a lot of reserved space.
You may also modify some aspects of a filesystem such as the reserved block percentage after it has been created using the tune2fs program:
# tune2fs -m 0 /dev/hdb1
You can check on your filesystem using the dumpe2fs program. See the man page for details.