Next Previous Contents

8. 增进效能

播放影片 (特别是 DVDs) 是 非常 依赖处理器的。 要帮助播放平顺, Xine 试图使用各种形式的 硬体加速功能。 下列资料对 x86 PCs 和 Linux 是最相关的所以请在你的系统架构中加入所有技巧。

8.1 硬体

本章列出一些有用的硬体。

AGP bus 和显示卡。

一个 AGP 显示卡让电脑传送影像资料到显示卡更有效率。 因此播放会较平顺,强烈建议使用。

RAM 超频(仅限高手!)

若你熟悉 BIOS 设定,你可以将所有 RAM 在 BIOS 中相关的时间设定 (如 CAS delay, RAS to CAS delay, 等) 设为 2. 你可能想尝试一些疯狂的技巧, 如陈述於 (举例来说) http://www.overclockers.com/tips105/index03.asp. 此网站是利用一个 Windows-工具来充分利用晶片组功能, 你可以用 FreeBSD 上的 pciconf来作同样的事。 在一些 linux 发行套件中也有类似工具。 若使用 via apollo pro 晶片组有问题,请联系 heiko (heiko@users.sourceforge.net)。

http://powertweak.sourceforge.net可以找到一个调整的好工具。

更多有关资讯请参考 http://oreilly.linux.com/pub/a/linux/2000/06/29/hdparm.html

8.2 在你的核心启动 MTRR 支援。

若你仍使用 XFree 3.x, 你将必须自己告知核心那边有图形记忆体可用。 在 linux dvd howto 中可以得到更多讯息。 若你使用 XFree 4.x 只要启动 MTRR 支援就可以了。 试打 cat /proc/mtrr - 若此档案存在且有显示你有的图形记忆体量,那就没问题了。

8.3 设定并使用原生装置(raw devices)供 dvd 读取

linux 核心 2.4.x 开始支援原生装置也有给较旧核心的补钉档 ftp://ftp.kernel.org/pub/linux/kernel/people/sct/raw-io/. 要使用原生装置,要先连接一个空的原生装置给你的 dvd 装置,例如:

  $ raw /dev/raw1 /dev/hdc
然後,产生一个链结叫 "rdvd" 指向原生装置
  $ ln -s /dev/raw1 /dev/rdvd

8.4 XVideo 延伸功能

XVideo 延伸功能是 XFree86 X-伺服器从 4.0 以後的一个功能。 现在有下列显示卡支援:

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 cards

Xv 功能内建。

Intel i810 and i815

Xv 功能内建。

若 Xv 延伸功能正确安装, xvinfo 程式的输出将像下列:

  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

也可能必须在你的 XF86Config-4 档案的 Modules 段加入这行 `Load "v4l"'。

8.5 MTRR (Linux)

从 Linux 核心文件:

  在 Intel P6 家族处理器 (Pentium Pro, Pentium II 与以後)
  Memory Type Range Registers (MTRRs) 被用来控制处理器存取记忆体区段。
  这对 PCI 或 AGP bus 显示卡 (VGA)是最有用的。 启动 write-combining
  allows bus 写入 transfers to be combined into a larger transfer
  before bursting over the PCI/AGP bus. 这将增进影像写入动作效率达 2.5 倍以上。

  Cyrix 6x86, 6x86MX and M II 处理器有 Address Range Registers (ARRs) 它提供一个类似
  於 MTRRs 的功能。 在此, ARRs 被用於模拟 MTRRs。

  AMD K6-2 (stepping 8 及以上) 与 K6-3 处理器有两个 MTRRs。 它们也受支援。

  Centaur C6 (WinChip) 有 8 MCRs, 允许 write-combining. 它们也受支援。

当使用 XShm 输出方法,确定 MTRRs 设定正确可 明显的 增进播放效果。 可以检查是否有 /proc/mtrr 以确定你的核心支援 MTRR。

cat /proc/mtrr 且确定有一行关於你的显示卡的记忆体。 若没有,参阅 Linux 核心原始文件的 mtrr.txt 档。

8.6 最佳化磁碟存取

下列说明仅对 IDE 硬碟有效。 首先确定你的主机板支援 UDMA/33 协定 (或更高阶 UDMA 协定)。 你可使用 hdparm 工具程式使 Linux 使用此介面来最佳化磁碟资料传输。

警告: hdparm 是一个有危险性的工具,不正确的使用可能影响你的电脑读取 此硬碟的能力。 使用危险自己负责。

检查 hdparm drive_device 输出包含下列:

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

若它显示 off 或你想改变任何参数请详见 hdparm 手册。


Next Previous Contents