0) What is LAMP ?

LAMP stands for Linux Animations and Movies Player. As far as I know, it is the only program which is able to play

1) How can I install LAMP ?

Simple use "make depend", "make world" and "make install" in LAMP source directory. You will need g++, gcc and nasm. I didn't write a configure script, so you might have some problems if your configuration is too different from mine.

2) How can I configure LAMP ?

LAMP uses a configuration file, that is normally called /usr/local/lib/lamp/config. You can also specify directly a configuration file using the -f option. Here is an example of configuration file:
############################################
assoc .mpg SMPEG

# plugins_dir /usr/local/lib/lamp/plugins

load shm_renderer
load dga_renderer 

load avifile_player begin
  fourcc CVID iccvid.dll
  path /win/c/winnt/system32/
end

load mpeg3_player

load smpeg_player

load xanim_player begin
 path /usr/lib/xanim
end
###############################################
Comments start with a '#' and finish at the end of the line.

The 'assoc' keyword is used to associate an extension with a plugin. By default, filenames are read by the first plugin able to play the file, in the order of loading specified in the config file. The 'assoc' keyword allows to bypass this behavior by specifying a plugin for a particular extension. Currently, available plugins names are AVIFILE (for .avi files), SMPEG (for mpegs 1/3), MPEG3 (for mpegs 1/2) and XANIM (for most formats).

The 'load' keyword is used to specify a plugin to load. Plugins are found in the plugins directory (normally, a subdirectory called plugins/ of the directory containing the config file). Another directory can be specified in the config file, using the 'plugins_dir' keyword.

Options can be passed to the plugins in the config file. For this, add a 'begin' keyword after the name of the plugin. The options end with a keyword 'end' on a line.

Each plugin has its own options. For instance, XANIM uses a 'path' option to specify the directories to be searched for xanim codecs. AVIFILE uses also a 'path' option with the path where to find Windows codecs dlls. Particular dlls can be added using the 'fourcc' keyword, the FOURCC code identifying the AVI codec, and the name of the dll.

3) How can I improve video performance on my computer ?

Theoretically, performance of video output should be only limited by bandwidth of CPU <-> Video bus ( for PCI bus it's 133 Mb/s or 5 ms for drawing of 640x480x16 picture ). Unfortunately, this value is rarely achieved. Actual performance is affected by many factors and can vary from 20 to 150 Mb/s.

If the value for your system is higher than 50 Mb/s, then there's nothing for you to worry about, because your X server has some kind of output acceleration. ( Actually, I suspect that most current X servers have it ).

In case of this performance being worse than 30 Mb/s, you'll probably need to turn on write-combining for video card. This should generally be done by X server, but some servers ( for example, X server for XFree86 3.3.6 with s3_savage driver ) don't do it ( shame on them ). Here I'll describe how it could be done by hands in case of Linux.

4) How can I get the closest video resolution when playing a movie ?

LAMP always tries to switch to the closest resolution for each movie. It mainly depends on the available resolutions in your X server configuration. If you only have a few available resolutions, the LAMP will be enable to force the X server in another resolution. You can solve this problem in two ways:

a) Add new resolutions to your XF86Config file. For this, you can call LAMP with the -sml option. It will then print a list of ModeLine lines, that you can directly add to your XF86Config file. Then, you will have to restart X to take these modes into account. Note that adding modes to your computer may damage your computer if these modes are not correct, so do it at your own risks ! LAMP accepts two options to modify the computation of modelines:

Other parameters of the computation are taken from the current running X server, so take a look at your XF86Config to make sure the Monitor parameters are correct.

b) If you run XFree 4.0, and like to compile everything on your computer, you can download its source, and replace the file xc/programs/Xserver/Xext/xf86vmode.c by the one you will find in the patches/ subdirectory of LAMP. This patch will allow applications to dynamically add new resolutions to a running X server (it has been submitted to XFree86.org, but not yet integrated). Then, you can start LAMP with the -xf86bugfix option, to force LAMP to add new resolutions at runtime. The modes will be computed using the same algorithm as in a), and might be modified by the same options (-m_bw and -m_rr).

I'm getting the following error when trying to play an mpeg movie.

X Error of failed request:  BadName (named color or font does not exist)
  Major opcode of failed request:  45 (X_OpenFont)
  Serial number of failed request:  26
Well, your system doesn't contain the font used for drawing strings (for subtitles, position and volume). You should modify the shm_renderer.c and dga_renderer.c files and change the font used. The next version of Lamp will solve this problem soon.