Among other things, the following sections draw attention to
the program xf86config, which can be used instead of
SaX2 to configure the monitor, graphics card, keyboard,
and mouse. Another focus is the configuration of
OpenGL and 3D. See () for the description of
the YaST modules.
The X Window System is the de facto standard GUI for UNIX.
Yet the X Window System is far more than this -- X11 is a network-based system.
Applications running on the machine earth can display their results on
the machine sun , provided the two machines are connected via a
network. The network could be a local one (LAN) or a connection between
computers thousands of miles away via the Internet.
X11 was first developed as an enterprise of DEC (Digital Equipment Corporation) and the project Athena at MIT (Massachusetts Institute of Technology). The first release of X11R1 was in September 1987. Since release 6, the X Consortium, Inc. has been responsible for the development of the X Window System.
XFree86 TM is a freely available implementation of X servers for PC systems. It was developed by a handful of ambitious programmers who founded the XFree86 team in 1992. In 1994, this team went on to found The XFree86 Project, whose aim is to continue research and development on X11 and to provide it to the public. The completely revised major release XFree86-4.0 has been available for download from http://www.XFree86.org since March 2000. By default, SuSE Linux installs XFree86-4.0. Below, take a closer look at the features of this version.
The following sections cover the configuration of the X server, introducing the two programs SaX2 and xf86config, which can be used to configure the X Window System. To use the available hardware (mouse, graphics card, monitor, keyboard) in the best way possible, the configuration can be optimized manually. Certain aspects of this optimization will be explained. Others are not covered in detail. For more information about configuring the X Window System, refer to the directory /usr/share/doc/packages/xf86 and to XF86Config.
Caution
Be very careful when configuring your X Window System. Never start
the X Window System until the configuration is finished. A wrongly
configured system can cause irreparable damage to your hardware (this
applies especially to fixed-frequency monitors).
The authors of this book and
SuSE cannot be held responsible for damage. This information has been
carefully researched, but this does not guarantee that all methods presented
here are correct and will not damage your hardware.
This version of SuSE Linux comes with version 4.x of XFree86, which differs from the previously used version 3.3 in a number of ways. Overall, there are hardly any differences for the user when operating the graphical desktop. Applications, such as the graphical desktops KDE or GNOME, behave with the new version in the same way as version 3.3.6 included in earlier distributions.
The new X server is no longer a monolithic program, but just a relatively small basic scaffolding to which the necessary program modules can later be added, if and when required. For example, there are no longer many different X servers for different graphics cards as in the previous version, but just one executable program called XFree86, which can be found in the directory /usr/X11R6/bin. This is also the actual X server. The graphics driver, which then takes on the task of controlling the graphics card, is a loadable module.
A similar method is used to support the various input devices, fonts, or X protocols. This again consists of individual modules that can be later loaded by the X server. As a rule, you do not need to worry about these modules. The configuration of the modules to operate the graphical desktop on your computer is managed, as far as possible, by SaX2.
Through this module concept, it is easy for a vendor to implement a driver for exotic hardware, such as touch screens or new graphics cards. The developers have even ensured that the necessary modules for various operating systems only need to be made available once, which means that a graphics driver module compiled in FreeBSD, for example, can also be used in Linux and vice versa. This portability, however, is limited to the same hardware platform: a module compiled for Linux on PowerPCs cannot be used on an Intel PC.
Support for the mouse has also been significantly improved. Especially under heavy loads, the reaction of the mouse to mouse movements is considerably faster and more direct than with the previous XFree86 X server. Overall, the output speed has also been improved, so graphics operations are generally performed more quickly than on the old X server due to the completely revised XAA (XFree86 Acceleration Architecture).
Compared to XFree86 3.3.x, the configuration file has a slightly different format and is now located in /etc/X11/XF86Config. For fine-tuning your X configuration, details on the structure of the configuration file and how it functions can be found in 5.
Error logging has also been improved. The X server creates a very detailed log file, which you can always find after the X server has started in the file /var/log/XFree86.0.log. One of the further features of this version is the support of special options, such as True Type fonts. Other features also include the 3D protocol extension, glx, gamma correction of the screen, and the support of multiple graphics cards for multihead configurations. More information about this can be found in 5.
In most cases, SaX is superior to xf86config for the simple configuration of the X Window System. However, if the configuration does not work with SaX, just use xf86config, which almost always works.
XFree86 4.x includes a similar text-based program, xf86config. At some points, this contains dialogs that have been somewhat modified. It writes the configuration file to /etc/X11/XF86Config. Usually XFree86 4.x does not require the use of xf86config, because ``problem'' graphics cards can also be configured with the framebuffer or with the vga module.
Make sure you have the following information available:
If these settings are known or you have your manuals at hand, start the configuration. Only SuSE @nohyphen root can do this. The configuration is started with:
earth :/root# xf86config
Following the welcome screen, select the mouse type from the following:
While selecting the mouse, bear in mind that many of the new Logitech mice are either Microsoft compatible or use the MouseMan protocol. The selection Bus Mouse refers to any bus mouse, including Logitech.
Selection is made by entering the relevant number. There may be a question as to whether to activate ``ChordMiddle''. This is necessary for some Logitech mice or track balls for activation of the middle mouse button.
Please answer the following question with either 'y' or 'n'. Do you want to enable ChordMiddle?
If you have a two-button mouse, emulate the third button by answering ` y' to the next question.
Please answer the following question with either 'y' or 'n'. Do you want to enable Emulate3Buttons?
The middle button is emulated by simultaneously pressing the two mouse buttons.
Next, specify the mouse's interface:
Now give the full device name that the mouse is connected to, for example /dev/tty00. Just pressing enter will use the default, /dev/mouse. Mouse device:
If you have already entered a port for your mouse during the system installation, just enter /dev/mouse.
Please answer the following question with either 'y' or 'n'. Do you want to enable these bindings for the Alt keys?
If you answer ` y', the left Alt key can serve as the meta key for Emacs and the keys that need ModeShift (AltGr) can be entered.
Next, specify your monitor. Be extremely careful with vertical and horizontal frequencies. These values can be found in your monitor manual.
Caution
Setting frequencies incorrectly can lead to irreparable damage to
your monitor. The X Window System only addresses video modes that operate
the monitor in the given frequency range. Entering frequencies for which
the monitor was not designed can cause severe damage to it.
Some monitors are listed under /usr/X11R6/lib/X11/doc/Monitors. However, we cannot be held liable if this information is inaccurate.
To enter the horizontal frequency, the following selection is displayed:
Only choose one of the predefined modes if you are unsure of the settings for your monitor. Use selection ` 10' to enter your own frequencies. The next screen asks you to enter your monitor's vertical frequency. It will also provide a selection:
Again, using the known values is preferable to using one of the items ` 1' to ` 4'.
Next, enter a name, vendor name, and model for your monitor:
Enter an identifier for your monitor definition:
Enter the vendor name of your monitor:
Enter the model name of your monitor:
These are just descriptive names used to document your configuration, which do not affect the configuration itself. Merely pressing will select the default values, which are usually sufficient.
Your monitor configuration is now complete.
Next, specify your graphics card:
Do you want to look at the card database?
If you enter ` y', a selection of predefined cards is presented.
Here, select your card by pressing the corresponding number. Do not
trust this list blindly, because there can be differences in clock chip and
RAMDAC settings.
This is why a menu item appears later for selecting a RAMDAC and a clock chip, although you have entered them already. Then the predefined settings for this card will be presented as an extra option.
The card definitions contain information on clock chips, RAMDAC, and the X server to use. Furthermore, some valuable information concerning the card is written to the device section in XF86Config.
If your card is not listed, do not panic. Switch back to the normal configuration by selecting ` q'. Only select one of the defined cards if it matches your card exactly. Selecting a card with a similar name is not recommended. Similar names do not necessarily refer to similar hardware.
More information about how to configure your card is given in 5.
The X server is configured next.
When you have selected a server, you are asked if you want to create a symbolic link to /usr/X11R6/bin/X. If you answer with ` y', you are asked whether to put it in /var/X11R6/bin/X.
Do you want to set it in /var/X11R6/bin?
Reply with ` y', because it may not always be possible to write to /usr tree.
Afterwards, if you have selected ` 4' (the accelerated servers) in the previous selection, a menu is presented of all available accelerated X servers.
Select an accel server: 1 XF86_S3 2 XF86_Mach32 3 XF86_Mach8 4 XF86_8514 5 XF86_P9000 6 XF86_AGX 7 XF86_W32 8 XF86_MACH64 Which accel server:
These servers support each card listed above. To create links, the appropriate server must already be installed. This means you must already have selected the correct server during the installation of your X Window System.
After selecting your X server, configure your graphics. First, specify the amount of memory the video card has.
Next, enter the name, vendor name, and type for your graphics card. If you earlier selected a card from the predefined list, pressing will enter this as the default.
If you chose an accelerated X server, you must enter the RAMDAC settings. This only applies to the S3 and AGX servers.
It is usually best to press and not make any custom selections. If you specified a graphics card that supports a given RAMDAC setting, it will be included in the selection list.
After answering these questions, enter a clock chip for accelerated cards, if you have one. Entering a clock chip avoids clock lines, as the clocks needed can be programmed.
If a card without a clock chip is selected, just press (thus not selecting a clock chip). If a card has been selected, the clock chip is set as default (if there is one).
If no clock chip has been set, xf86config suggests running X -probeonly to determine the clock timings supported. These are automatically written in XF86Config in a separate clocks line.
Automatically defined settings can be very risky: if the card has a programmable clock chip, the X server, when probing, cannot distinguish between the different clocks and only recognizes clocks 0, 1, and sometimes, 2. All other values are more or less random numbers (normally, clocks 0, 1, and 2 are repeated and are replaced by zeros).
All clocks apart from 0 and 1 are strongly influenced by the preprogrammed clock chip. Thus, clock 2 could have a different setting when probed (and which was written to the file XF86Config) than when the X server is later started. Then all the timings would be wrong and the monitor could be severely damaged.
A good indication of a programmable clock chip (and the problems this might entail) is the multiple zeros or repeating timing values. Absolutely, under no circumstances, ever write such values to XF86Config.
To configure clock chips, follow these steps:
Unless the manual offers some pertinent advice, the values can be determined by running X -probeonly (this works best on an unloaded machine). Check whether the values are accurate, as clock values cannot be determined for every card. Many zeros or repeating values are a sign of invalid settings. Enter the correct values into XF86Config. Do not omit any values. Do not try to rearrange them or change them in any way. The values must be entered in their exact order.
If the P9000 server is used, the order is irrelevant. Just enter the modes for the desired clock in the clocks line.
After having read the previous section, if you want to let clocks be recognized automatically, just answer ` y' to the following question:
Do you want me to run 'X -probeonly' now?
Now the screen will turn black before the list of probed clocks appears or a message will appear that no clocks could be found. If you have selected a clock chip, this question will not appear, because the clocks will then be programmed automatically. If this is the case, this section will be skipped.
Caution
If the previous question has been answered with ` y' and the
screen remains black for more than thirty seconds, cancel testing
immediately with + + , or +
C. If this does not work, switch off the monitor and the computer
to prevent damage to your hardware.
Now write the configuration file. It is recommended to write it to /etc/XF86Config to ensure that, even in a networking environment, each machine has its own configuration file -- even if they share the /usr file system.
Specify `/etc/XF86Config' at this point. This concludes xf86config and the configuration of the X Window System.
ifundefinedsaxii
This section describes the configuration file, /etc/X11/XF86Config. Each section starts with the keyword Section <name of section> and ends with EndSection. Below is a rough outline of the most important sections.
Afterwards, learn how to integrate additional fonts, how to configure input devices, and how 3D acceleration is implemented. This is also managed in certain sections of the XF86Config file, of course, although integrating an additional font requires the help of external programs, which are included with SuSE Linux. The methods discussed here aim to illustrate the possibilities available and serve as an incentive, but they do not claim to cover all eventualities.
The programs SaX2 and xf86config (for XFree86-4.0) create the file XF86Config, by default in /etc/X11. This is the primary configuration file for the X Window System. Find all the settings here concerning your graphics card, mouse, and monitor.
XF86Config is divided into several sections, each one dealing with a certain aspect of the configuration. A section always has the same form:
The following types of sections exist:
Monitor, Device, and Screen are explained in more detail in the following. Further information about the other sections can be found in XFree86 and XF86Config.
There can be several different Monitor sections in XF86Config. Even multiple Screen sections are possible. Which one is started depends on the server started.
First, we will take a closer look at the screen section. As mentioned above, this combines a monitor with a device section and determines what resolution and color depth should be used. A screen section might resemble the example in File 3.
The line Identifier (here Screen[0]) gives this section a defined name with which it can be uniquely referenced in the following ServerLayout section. The lines Device and Monitor specify the graphics card and the monitor that belong to this definition. These are just links to the Device and Monitor sections with their corresponding names or ``identifiers''. These sections are discussed later in more detail.
Using DefaultColorDepth, select which color depth mode the server will use if this is not explicitly stated. There is a Display subsection for each color depth. Depth assigns the color depth valid for this subsection. Possible values for Depth are 8, 16, 24, and 32. Not every X server supports all these modes. For most cards, 24 and 32 are basically the same. Some take 24 for packed pixel 24bpp mode. Others choose 32 for padded pixel mode.
After the color depth, a list of resolutions is set (Modes). This list is checked by the server from left to right. For each resolution, a suitable Modeline is searched, which must correspond to one of the given clock rates or a clock rate to program the card.
The first resolution found is the Default mode. With + + + (on the number pad), switch to the next resolution in the list to the right. With + + - (on the number pad), switch to the left. This enables you to vary the resolution while X is running.
The last line of the Display subsection with Depth 16 refers to the size of the virtual screen. The maximum possible size of a virtual screen depends on the amount of memory installed on the graphics card and the desired color depth, not on the maximum resolution of the monitor. Because modern graphics cards have a large amount of video memory, you can create very large virtual desktops. However, you may no longer be able to use 3D functionality if you fill most of the video memory with a virtual desktop. If the card has 16 MB video RAM, for example, the virtual screen can be up to 4096x4096 pixels in size at 8-bit color depth. Especially for accelerated cards, however, it is not recommended to use up all your memory for the virtual screen, because this memory on the card is also used for several font and graphics caches.
A device section describes a specific graphics card. You can have as many device entries in XF86Config as you like, as long as their names are differentiated, using the keyword Identifier. As a rule -- if you have more than one graphics card installed -- the sections are simply numbered in order the first one is called Device[0], the second one Device[1], and so on. In File 4, see the section from the Device section of a computer in which a Matrox Millennium PCI graphics card is installed.
Section "Device"
BoardName "MGA2064W"
BusID "0:19:0"
Driver "mga"
Identifier "Device[0]"
VendorName "Matrox"
Option "sw_cursor"
EndSection
If you use SaX2 for configuring, the device section should look something like the above diagram. Both the Driver and BusID are dependent on the hardware installed in your computer and are detected by SaX2 automatically. The BusID defines the PCI or AGP slot in which the graphics card is installed. This matches the ID displayed by the command lspci. The X server wants details in decimal form, but lspci displays these in hexadecimal form.
Via the Driver parameter, specify the driver to use for this graphics card. If the card is a Matrox Millennium, the driver module is called mga. The X server then searches through the ModulePath defined in the Files section in the drivers subdirectory. In a standard installation, this is the directory /usr/X11R6/lib/modules/drivers. For this purpose, simply _drv.o is added to the name, so, in the case of the mga driver, the driver file mga_drv.o is loaded.
The behavior of the X server or of the driver can also be influenced through additional options. An example of this is the option sw_cursor, which is set in the device section. This deactivates the hardware mouse cursor and depicts the mouse cursor using software. Depending on the driver module, there are various options available, which can be found in the description files of the driver modules in the directory /usr/X11R6/lib/X11/doc. Generally valid options can also be found in XF86Config and XFree86.
Monitor sections each describe, in the same way as the device sections, one monitor. The configuration file /etc/X11/XF86Config can contain as many Monitor sections as desired. The server layout section specifies which monitor section is relevant.
Monitor definitions should only be set by experienced users. A critical part of the monitor section is the mode lines, which set horizontal and vertical timings for the appropriate resolution. The monitor properties, especially the allowed frequencies, are stored in the monitor section.
Caution
Unless you have an in-depth knowledge of monitor and graphics
card functions, nothing should be changed in the mode lines, as this could
cause severe damage to your monitor.
For those who want to develop their own monitor descriptions, the documentation in /usr/X11/lib/X11/doc might come in handy. The section () deserves a special mention. It describes, in detail, how the hardware functions and how mode lines are created.
A ``manual'' setting of the mode lines is hardly ever needed nowadays. If you are using a modern multisync monitor, the allowed frequencies and optimal resolutions can, as a rule, be read directly from the monitor by the X server via DDC, as described in the SaX2 configuration section. If this is not possible for some reason, you can also use one of the VESA modes included in the X server. This will function with practically all graphics card and monitor combinations.
A standard X11R6 X server installation also includes a large number of fonts. These can be found in the directory /usr/X11R6/lib/X11/fonts, each divided into logically connected groups in subdirectories. Make sure only subdirectories of the X server are used that:
Since version 4.0, XFree86 can use not only its own format Type1 (a Postscript format) for scalable fonts and pcf for bitmap ones, but also the ttf (True Type font) fonts. As described in 5, this support is provided via loadable modules of the X server. Thus, you can also use directories containing True Type fonts together with the X server. To do this, hardly any preparation is needed.
A big advantage of most True Type fonts, apart from their very good scalability, is that these fonts almost always contain more than the normal 255 characters of the font for western Europe coded in ``iso-8859-1''. With these fonts, you can display Cyrillic, Greek, or eastern European languages without any problem and, with special software, even Asian languages.
This description is essentially about the use of fonts as 8-bit character sets. If you want to use characters of Asian languages (Japanese, Chinese, etc.), use special editors, which are also available in SuSE Linux.
An 8-bit character set contains 255 characters and basically consists of the US-ASCII character set, which defines only the first 128 of 255 possible characters, and expands it with further characters. One text character occupies 8-bits in the computer memory. As 127 characters are certainly not enough to record the special characters, for example, of all European languages, the various languages are combined into groups and this group is then given a short name. The relevant character set is named according to the appropriate norm as the ``iso-8859-x'' character set, where the x stands for a number from 1 to 15. The exact order of characters in the iso-8859-1 character set can be found in iso-8859-1.
The more well-known codings are listed in Table 5.2: further ones can be taken from the above-mentioned manual page.
The user must then, depending on the language used, select the matching encoding. Especially when transferring texts between different computers, the encoding used must also be transferred. The advantage of this procedure is obvious: To receive support for regional special characters, you only need to select the correct encoding and immediately most programs will be able to portray these special characters, since almost all programs use an 8-bit value (one byte) to represent a text character. If the wrong encoding is chosen, the special characters will be wrongly depicted. With most X applications, as well as with the KDE desktop, you can usually select the coding of the character set when you are configuring the font to use. In X applications, the encoding is usually referred to as Encoding.
The disadvantage of this method is that some language combinations are impossible: You cannot, for example, easily write a German text with umlauts in which you mention Russian place names in Cyrillic.
This dilemma can only be solved using a different approach -- with the use of Unicode. Unicode codes characters, unlike ASCII, with two or even more bytes, allowing considerably more characters to be represented. Only if you use Unicode can you depict Asian languages with more than 127 characters, such as Chinese, Japanese, or Korean, on the computer. The disadvantage of this method is that most existing software cannot handle these characters and that you can only read or write texts yourself with Unicode characters using special software. For more information about using Unicode fonts in Linux, see http://www.unicode.org. It is expected that, in the future, more and more programs will support Unicode characters. SuSE Linux offers the program yudit to enter texts in Unicode. The program yudit can be found in the package yudit and, after installation, via the SuSE menu, under Office ->Editors.
This background information is followed by a step-by-step description of the installation of additional fonts. In this example, the installation of TrueType fonts is described. Locate the fonts you want to install in your X Window System. If you already have licensed TrueType fonts on your system, you can simply use these. Mount the partition containing the fonts and change to a font directory. In SuSE Linux, you can copy the respective fonts to the directory /usr/X11R6/lib/X11/fonts/truetype.
Create symbolic links to the ttf files, replacing </path/to/the/fonts> with the respective path under which these fonts are available. Then execute SuSEconfig, which will generate the required entries in the file fonts.dir.
If the X server is already running, you can now make the fonts dynamically available. To do this, enter xset fp rehash.
Tip
The xset command accesses the X server via the
X protocol. It
must have access permissions for the X server currently
running. Find more about this in xauth.
Check if the fonts were set up correctly. To do this, use the command xlsfonts. If the fonts are correctly installed, the list of all installed fonts, including the newly installed True Type Fonts, is displayed.
You can also use the KDE font manager, which displays the installed fonts with an sample text. This can be started in the KDE Control Center. These newly installed fonts can then be used in all X applications.
If you are installing with YaST for the first time, activate 3D acceleration during installation, if YaST finds hardware for which it is supported. nVidia graphics chips are the only exception. For these, the ``dummy'' driver included must be replaced by the official nVidia driver. Download it from the nVidia web server (http://www.nvidia.com) and install it. Because of licensing restrictions, only the ``dummy'' nVidia driver package is available in the distribution.
If an update is carried out instead of a new installation or a 3Dfx add-on graphics adapter (Voodoo Graphics or Voodoo-2) needs to be set up, the procedure for configuring 3D hardware support is different. This depends on which OpenGL driver is used. Further details are described in the following section.
For security reasons, only users belonging to the group SuSE @nohyphen video may access the 3D hardware. Verify that all users working locally on the machine are members of this group. Otherwise, the rather slow Software Rendering Fallback of the OpenGL driver will be used. Use the command id to check whether the current user belongs to the group SuSE @nohyphen video. If this is not the case, use YaST to add the user to the group.
The application checks, for example, the XFree86 configuration to verify that all packages required for 3D support are installed and the proper OpenGL library is used with the GLX extension. Follow the directions in 3Ddiag if failed messages appear. Ideally, you will only see done messages on the screen.
For testing OpenGL, the program glxgears and games like tuxracer and armagetron (packages have the same names) can be useful. If 3D support has been activated, it should be possible to play these smoothly on a fairly new computer. Without 3D support, it is not possible to play these games or they run only very slowly. Use the glxinfo command to verify that 3D is active, in which case the output will contain a line stating direct rendering: Yes.
Often, you will find the line DRI is disabled in the XFree86 4.x file /var/log/XFree86.0.log. The exact cause can only be discovered by closely examining the log file -- a task requiring some experience.
In such cases, no configuration error exists, as this would have already been detected by 3Ddiag. Consequently, at this point, the only choice is to use the software rendering fallback of the DRI driver, which does not feature 3D hardware support. You should also go without 3D support if you get OpenGL representation errors or instability. Use SaX2 to disable 3D support completely.