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