by lunarg on October 1st 2007, at 22:06
6 pages

Installing and configuring X

Once the base installation and configuration is completed, and you have booted into your new system, it's time to move on to configuring X (Xorg).

The installation of Xorg in Gentoo is fairly easy. A lot of the components that are included in your installation, are derived from make.conf. We did most of it at The Simple Guide to a Media PC (Installing Gentoo) (skip to the section about make.conf).

Very pre-configuration

The two important parameters for Xorg, aside of the USE flags, are VIDEO_CARDS and INPUT_DEVICES, and have to be set up in /etc/make.conf.

The various parameters are like so:

VIDEO_CARDS

Known video hardware is:

  • vga: the standard VGA driver (640x480 16-color).
  • vesa: the standard VESA driver for compliant hardware.
  • fbdev: uses linux frame buffer for display.
  • fglrx: includes the proprietary ATI FireGL/Radeon driver.
  • radeon: to use the open-source driver for ATI Radeon cards.
  • ati: for open-source ATI Rage-series drivers.
  • nvidia: includes the proprietary nVIDIA driver.
  • nv: to merge the open-source nv driver for nVIDIA cards.
  • voodoo: if you have any 3Dfx Voodoo-based chipset.
  • tdfx: if you have any 3Dfx Voodoo-based chipset (or is it?).
  • i810: for the Intel 81x and 91x based cards.
  • trident: for Trident and Trident Cyberblade cards.
Notice
Know about the other flags? Let me know.

INPUT_DEVICES

Known input devices are:

  • keyboard: includes standard keyboard. Technically it's possible to omit this if you're using joystick or an RC, but I don't recommend it.
  • joystick: adds joystick and gamepad support.
  • mouse: adds basic mouse support. Like the keyboard, it's also possible to omit this, but not recommended.
Notice
Know about the other flags? Let me know.

Other USE flags

I also recommend to add these:

  • dri: adds DRI, which you need for all open-source drivers that use DRI for hardware-acceleration.
  • ntpl: adds NTPL multi-threading support in X. Always a good thing, and highly recommended if you have an HT (Intel) CPU or a multi-core (SMP or otherwise) system.
  • sdl: includes support for the SDL media libraries. It's recommended to have this enabled, but this can be done at your own discretion.
  • xorg: don't really know what it does, but my guess is that it's a pretty important flag.

The actual installation

The actual installation is done by merging the x11-base/xorg-x11 package package:

# emerge -av xorg-x11

Depending on the options in make.conf, packages will be included in the merge. One of these packages is x11-base/xorg-server, which also displays the various use flags, input, and video devices. In my case this was:

[ebuild   R   ] x11-base/xorg-server-1.2.0-r3  USE="dri ipv6 nptl sdl xorg (-3dfx) -debug -dmx -kdrive -minimal -xprint" INPUT_DEVICES="joystick keyboard mouse -acecad -aiptek -calcomp -citron -digitaledge -dmc -dynapro -elo2300 -elographics -evdev -fpit -hyperpen -jamstudio -magellan -microtouch -mutouch -palmax -penmount -spaceorb -summa -synaptics -tek4957 -ur98 -vmmouse -void -wacom" VIDEO_CARDS="fglrx nvidia* radeon v4l vesa vga -apm -ark -chips -cirrus -cyrix -dummy -epson -fbdev -glint -i128 (-i740) -i810 (-impact) (-imstt) -mach64 -mga -neomagic (-newport) (-nsc) -nv -r128 -rendition -s3 -s3virge -savage -siliconmotion -sis -sisusb (-sunbw2) (-suncg14) (-suncg3) (-suncg6) (-sunffb) (-sunleo) (-suntcx) -tdfx -tga -trident -tseng -via -vmware -voodoo" 0 kB
Notice
If for whatever reason the merge fails halfway, it is highly recommended to use emerge --resume to continue the merge.

The configuration of Xorg: xorg.conf

The main configuration file of Xorg is /etc/X11/xorg.conf. In Gentoo, a basic sample configuration file is available (and is called /etc/X11/xorg.sample).

First of, a more comprehensive guide on configuring Xorg (for Gentoo) can be found at the The X Server Configuration HOWTO. I'll only explain the system-specific stuff here.

Base configuration

Every xorg.conf has a ServerLayout which specifies which monitor, video card, and input to devices to actually use. Mine is:

Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

If you're using ATI proprietary FireGL/Radeon drivers, be sure to explicitly disable AIGLX:

        Option      "AIGLX" "false"

The identifiers used can be just about anything, just as long as they match the other sections.

Files

The Files section specifies where the Xorg modules, RGB files, and fonts are located.

Modules

The Modules section specifies which modules for Xorg to load. Mine are:

Section "Module"
        Load  "glx"
        Load  "extmod"
        Load  "xtrap"
        Load  "record"
        Load  "dbe"
        Load  "dri"
        Load  "freetype"
        Load  "type1"
EndSection

Specific modules are:

  • glx: enables GLX which is the hardware-accelerated OpenGL architecture for X.
  • dri: loads DRI for DRI support. Include this to have hardware-acceleration through the DRM. This is a requirement for a whole bunch of cards, including ATI, Intel - not sure about nVIDIA.
  • freetype and type1: enables Freetype TTF and Type1 font support.

Input devices

Specific info can be found here: The X Server Configuration HOWTO.

In my case, there are two sections, one for keyboard, the other for mouse:

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "105"
        Option      "XkbLayout" "be"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option      "Device" "/dev/input/mice"
        Option      "ZAxisMapping" "4 5 6 7"
EndSection

Monitor

The Monitor can be either very simple, or very complicated. When relying on EDID to set up the monitor, this section contains the minimal:

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
        Option      "DPMS" "true"
EndSection

Notice the DPMS option, which enables power saving on your monitor. If the machine idles (e.g. in MythTV menus), this will turn off the monitor. MythTV has support for this built-in, so it won't interfere when looking at video recordings and/or DVDs.

Video device

The video card is set in the Device section.

nVIDIA (and probably a whole bunch of others)

My configuration is an nVIDIA one. I've kept things pretty basic for my setup, but the nVIDIA driver has a whole bunch of configuration parameters. Read the README included with the driver for more information on that:

Section "Device"
        Identifier  "Card0"
        Driver      "nvidia"
EndSection
Notice
I have yet to tweak the driver some more. Once I did, I'll update this part here.
ATI Radeon

When I was using the onboard ATI Radeon X1250, I had this as configuration file. It is originally (partially) inherited from my laptop (which has a X700):

Section "Device"
        Identifier  "Card0"
        Driver      "fglrx"
        VendorName  "ATI Technologies Inc"
        BoardName   "Radeon X1250 (PCIE)"
        Option      "VideoOverlay" "on"
        Option      "OpenGLOverlay" "off"
        BusID       "PCI:1:5:0"
EndSection

A word of explanation: for Radeon, you have to specifically enable the video overlay. I've also disabled the OpenGL overlay (because of interference with the video overlay).
Notice the BusID, which is specific to my system. It can be fetched by running lspci as root:

As an example, the output from my laptop:

# lspci | grep VGA
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility X700 (PCIE)

This means the BusID will be PCI:1:0:0.

Other video cards
Notice
Other video cards? Please donate your video driver setup.
Screen resolution

By default, the EDID of your monitor tells the resolution Xorg can use. However, for the sake of proper configuration, it's very recommended to set up the proper color depth and available resolutions. This is done in the Screen section, and its subsection Display. I'm using a 19-inch TFT monitor, and therefore, have this in my config file:

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        DefaultDepth     24
        SubSection "Display"
                Depth     24
                Modes    "1280x1024" "1024x768" "800x600" "640x480" "640x400"
        EndSubSection
EndSection

Hardware acceleration (DRI)

To be Gentoo-compliant, check whether the following is added:

Section "DRI"
        Group        "video"
        Mode         0660
EndSection

This makes sure that only members of the group video can access and use DRI. Simply add your user (or the mythtv user, if you're using autostart) to that group.

Testing Xorg

To properly test Xorg, you can start X with your own user with the well-known command:

# startx

The log file of each session is kept at /var/log/Xorg.0.log, so if you have any problems, that's the first place to consult.

Notice
You need to have Xorg up and running with proper acceleration for video playback, before you can start with MythTV. MythTV won't run with a broken X.
 
 
« November 2024»
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930
 
Links
 
Quote
« Debating Windows vs. Linux vs. Mac is pointless: they all have their merits and flaws, and it ultimately comes to down to personal preference. »
Me