Next Previous Contents

8. Increasing Performance

Playing Videos (especially DVDs) is very processor intensive. To help smooth playback, Xine attempts to use various forms of hardware acceleration. The following info is mostly relevant to x86 PCs and Linux so please send in any tips for other architectures/Unices.

8.1 Hardware

This section lists some hardware which is useful.

AGP bus and graphics card.

An AGP graphics card allows the computer to send video data more efficiently to the card. Consequently this allows for smoother video. It is strongly recommended that you have one.

Speeding up RAM (expert only!)

If you are a BIOS bit-twiddler you can try putting all RAM related timing settings (like CAS delay, RAS to CAS delay, etc) in the BIOS to 2. You might want to try some really nasty tricks, as explained on (for example) http://www.overclockers.com/tips105/index03.asp. This website centers around a Windows-tool to tweak the chipset, you can do the same on FreeBSD with pciconf. On some linux distributions there are similar tools. Please contact heiko ([email protected]) if you have any problems or tips about via apollo pro chipset tweaking.

A nice performance tuning tool can also be found at http://powertweak.sourceforge.net.

8.2 Set up and use raw devices for dvd access

Raw devices are available in linux kernel 2.4.x and there are patches for older kernels available from ftp://ftp.kernel.org/pub/linux/kernel/people/sct/raw-io/. To use raw devices, first connect a free raw device to your dvd device, use something like

  $ raw /dev/raw1 /dev/hdc
then create a link named "rdvd" pointing to that raw device
  $ ln -s /dev/raw1 /dev/rdvd

Some distributions may require you to set up the link as:

  $ raw /dev/raw/raw1 /dev/hdc
  $ ln -s /dev/raw/raw1 /dev/rdvd
instead. Also some distributions may lack the /dev/rawctl device which may be created using
  $ mknod /dev/rawctl c 162 0

8.3 The XVideo extension

The XVideo extension is a feature of versions of the XFree86 X-server from version 4.0 onwards. It currently is supported on the following cards:

3DFX Voodoo 3

The 3dfx driver works in XFree86 version 4.0.3 and above.

nVidia GeForce

Xv only works with nVidia's own drivers. The place to ask is the IRC room #nvidia on irc.openprojects.net. They can be downloaded from http://www.nvidia.com/

nVidia TNT2 and TNT1

As with the GeForce, only NVidia's drivers work.

ATI cards

Xv is reported to work with Rage 128 and Mach64 based cards with drivers from the GATOS project ( http://www.linuxvideo.org/).

Matrox Gx00 and G450 cards

Xv works `out-of-the-box' except that it only works on the first screen on G450 cards.

Intel i810 and i815

Xv works `out-of-the-box'.

Savage chips

Xv has been reported to work with some Savage cards using a modified driver module. There is more information and a list of working cards on http://www.probo.com/timr/savage40.html.

If the Xv extension is correctly installed, the output of the xvinfo program should be similar to the following:

  Adaptor #1: "Matrox G-Series Backend Scaler"
    number of ports: 1
    port base: 47
    operations supported: PutImage 
    supported visuals:
      depth 16, visualID 0x23
      depth 16, visualID 0x24
      depth 16, visualID 0x25
      depth 16, visualID 0x26
    number of attributes: 3
      "XV_COLORKEY" (range 0 to 16777215)
              client settable attribute
              client gettable attribute (current value is 2110)
      "XV_BRIGHTNESS" (range -128 to 127)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_CONTRAST" (range 0 to 255)
              client settable attribute
              client gettable attribute (current value is 128)
    maximum XvImage size: 1024 x 1024
    Number of image formats: 0

You may also need to load the v4l (Video4Linux) X extension. Type xdpyinfo | grep XV. If 'XVideo' forms part of the output, then you have it. If not add 'load "v4l"' in the Modules section of your XF86Config file (normally /etc/X11/XF86Config) and try again. Then try the 'xvinfo' command. If the output is 'no adapter present', you don't have XV support. Check if your video card is supported on the XFree86 website ( http://www.xfree86.org/), install any necessary software and try again.

8.4 MTRR (Linux)

From the Linux Kernel documentation:

  On Intel P6 family processors (Pentium Pro, Pentium II and later)
  the Memory Type Range Registers (MTRRs) may be used to control
  processor access to memory ranges. This is most useful when you have
  a video (VGA) card on a PCI or AGP bus. Enabling write-combining
  allows bus write transfers to be combined into a larger transfer
  before bursting over the PCI/AGP bus. This can increase performance
  of image write operations 2.5 times or more.

  The Cyrix 6x86, 6x86MX and M II processors have Address Range
  Registers (ARRs) which provide a similar functionality to MTRRs. For
  these, the ARRs are used to emulate the MTRRs.

  The AMD K6-2 (stepping 8 and above) and K6-3 processors have two
  MTRRs. These are supported.

  The Centaur C6 (WinChip) has 8 MCRs, allowing write-combining. These
  are supported.

Making sure MTRRs are setup correctly can considerably improve playback when using the XShm output method. To check that your kernel supports MTRR, check for the presence of the /proc/mtrr file.

Type cat /proc/mtrr and check that there is an entry relating to your video card's memory. If not then consult the file mtrr.txt file in the Linux kernel source documentation.

8.5 Optimising drive access

The following applies only to IDE drive units. Firstly make sure that your motherboard supports the UDMA/33 protocol (or a higher numbered UDMA protocol). You can use the hdparm utility to make Linux use this interface to optimise drive data transfers.

More details on hdparm can be found on http://linux.oreillynet.com/pub/a/linux/2000/06/29/hdparm.html.

Warning: hdparm is a dangerous utility and incorrect use may impact on your computer's ability to read the drive. USE IT AT YOUR OWN RISK.

Check the output of the hdparm drive_device includes the following line:

  S hdparm /dev/dvd
  ...
    using_dma    = 1 (on)
  ...

If it is off or if you want to change any options consult the hdparm manual page for details.


Next Previous Contents