Part III The X Window System 205 Chapter 8 The X Window System The X Window System is the de facto standard GUI for UNIX. But 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 helios provided the two machines are connected via a network. The network could be a locla one (LAN) or a computer thousands of miles away, on the Internet. The X11 was first developed as an enterprise of DEC (Digital Equipment Corporation) and the project Athena at MIT (Massachusetts Institute of Tech- nology). 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. This team led to the foundation of the The XFree86 Project in 1994 whose aim it is to continue research and development on X11 and to provide it to the public. SuSE would like to thank the XFree86 team for their help and for the permission to include beta servers on our CD's, 1 because it would have been much more difficult to produce our CD's without them (if at all possible . . . ) The current release, XFree86 3.3.6, is an X11R6.3 system for PC-based UNIX systems. The next sections are about configuring the X server. Two programs are ex- plained ­ SaX (sax)2 and xf86config ­ which can help you to configure your X-Window system. In contrast to xf86config, SaX works directly with your X server and is mouse-driven. You should install the program SaX (package sax, series x, preferably with YaST and the independent packages, espe- cially the package xvga16) as well as ­ if you already know this ­ the X server which matches your graphics card; the X servers are listed in the series xsrv (see Section 3.4.3 page 84). If you have forgotten to select a server, SaX will notice this and install a suitable server, by means of YaST. To really exploit your graphics adaptor and monitor, we include, in addi- tion, an option to optimize the configuration. Even more more detailed infor- 1 Parts of this documentation are taken from chapter XFree86 Konfigurieren from[HHMK96] which was kindly given to us by DIRK HOHNDEL 2 SaX SuSE Advanced X Configuration Tool makes XF86Setup (package xfsetup, series x) obsolete. 207 8. The X Window System mation on configuring the X Window System can be found in /usr/doc/ packages/xf86. Be very careful when configuring your X Window System! Never start the X Window System until the configuration is finished. A wrongly con- figured system can cause irreparable damage to your hardware (this ap- plies 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 cannot damage your hardware. Using YaST, first install the appropriate packages. For XF86Setup, you must install the package xfsetup with all its depen- dencies. For xf86config, you must install the package xf86. You also need to install the appropriate X server for your hardware. 8.1 Configuration Using SaX The program SaX aims to provide a simple installation tool for the X Win- dow System. It runs entirely on a graphic user interface, and uses the mouse or the keyboard to enter settings. Apart from a few special cases, such as very new, or very old hardware, it recognizes most hardware components, so that it should be quite straightforward to set up the X server. 8.1.1 Installing for the First Time To install the X Window System ­ the graphical user interface for all Linux systems ­ you need to have certain information available about your com- puter: * The currently used monitor (product name). * The keyboard type * The mouse type and the interface to which it is connected. * The vendor and name of your graphics card. You have to start SaX (sax) as user `root'. You can also start SaX from YaST : `system administration' and then `XFree86[tm]' (cf. Section 3.6 page 89). The program is started from the command line by typing: earth:/root # sax As soon as the program starts it looks for any PCI cards which are installed. If a PCI graphics card is found, it will be identified and displayed in the program under graphics card. After the PCI scan, the main window is opened to present the tab win- dows for the mouse (`mouse'), keyboard (`keyboard'), graphics card (`graphics card'), monitor (`monitor') and desktop (`desk- top'). (You can change to each window by simply clicking on the appro- priate tab). Then SaX loads its own hardware database (this may take a few 208 8.1. Configuration Using SaX seconds). The data found during the system scan will be presented in its respective categories, the relevant graphics card, for example, can be found in the tab window `desktop'. SaX will do its best to recognize what hardware it can, but to be sure that the configuration settings are correct, you should check them all and modify them if necessary. If your mouse is not yet correctly configured, you can still access SaX via the keyboard. Pressing the Tab key repeatedly will cycle through each of the entry fields. To change to a different tab window, press Tab until the desired tab window title is highlighted with a black frame; then you can select the desired tab window using or ,and enter it by pressing (= Enter ). In each tab window there are a number of selection elements, such as buttons, listboxes and entry fields. These can also be accessed by keyboard. To use a button (e. g. `Apply'), press Tab repeatedly until the desired button is highlighted. Pressing or activates the button; the desired action is carried out. To select an entry in a listbox, push the Tab button until the desired box is highlighted. By pressing or you can look for an entry by way of its coloring, pressing Enter will then activate it. The Mouse The `Mouse' tab window is the first to appear when the program starts (Figure 8.1). Figure 8.1: SaX: Mouse settings If you have already configured your mouse when first installing Linux, e.g. whilst setting up gpm, these settings will be used by SaX and your mouse will work immediately in the X Window System ­ then you can ignore this. If you have not configured your mouse, you should do it now. Press Tab twice and choose the relevant mouse type in `Vendor' (move through the 209 8. The X Window System list with and ); use Enter to set the correct vendor name. Go to the selection list using Tab and choose the relevant type. If you press the `Apply' button you can check to see if your choice was correct. The mouse cursor should move across the screen. If you're not sure exactly what mouse type you are currently running on your system, your mouse is not included in the list, or if a serial mouse `Mi- crosoft' cannot run under the `Standard Mouse' protocol, choose the sub-menu `expert' to set the mouse protocol directly. There you can set further options, such as the baud rate and "three-button emulation". Via `Expert' the following tab windows are available: Figure 8.2: SaX: Expert Mouse Settings `driver': If the vendor is not known, then the mouse protocol can be set here. The device file must also be selected. If you have a bus mouse you can try out the corresponding PS/2 variety. `options' 3-button emulation, etc. `Test': You can test the mouse configuration using the lower part of the frame `Testfield' (Figure 8.2.) If the mouse has been installed cor- rectly, the mouse button symbols on the screen should react when you click on them. The Keyboard A Windows 95/98 keyboard with an English keyboard mapping has been set as the default. (Figure 8.3 on the next page). If you want to you use another keyboard, you must enter the correct settings, since the keyboard is one of the few hardware components not to be recognized independently by the hardware scan. By comparing your keyboard with the `Keyboard Image' shown on the screen you will be able to find the right model connected to your system. 210 8.1. Configuration Using SaX Figure 8.3: SaX: Keyboard Don't forget to set the `language' to English, if this is not already the case. Next to the delete tab there is a test field where you can check the settings made for the keyboard by entering various characters and seeing if they come out properly. You probably do not need the settings in `Expert' . . . The changes are put into effect by pressing the `Apply' button. The Graphics Card On the `card' tab window you can select the card vendors in the left hand list and the card version in the right hand list (Figure 8.4 on the following page). SaX tries to recognize the graphics card independently, which nearly always works for PCI cards. The utility accesses an extensive database of current hardware to achieve this; cf. the package cdb Component DataBase. Hardware that has been found will be highlighted in color. There are advanced options hidden beneath the `Expert' button (Fig- ure 8.5 on the next page). These are relevant if you choose the X server directly (`Server settings'). If you want to set memory size or spec- ify the RAMDAC value, or if you would like to set a special RAMDAC or clock chip value (in `chipsets'), these options are also important. If the screen image looks distorted ­ if, for example, during a move-window oper- ation, the window fragments or the window title suddenly blink ­ then you should reduce the RAMDAC value. Some graphics cards need special `options' which can be found in this expert menu; normally they are not needed. ISA cards will not be recognized "automagically"; for these, you have to select the relevant server "by hand". 211 8. The X Window System Figure 8.4: SaX: Graphics Card Figure 8.5: SaX: Graphics Card ­ Expert Options If you see the error message "The SVGA Server is not in- stalled...", you must install the above-mentioned package via YaST (cf. Section 3.4 page 83). The Monitor The monitor settings are the last great hurdle on your road to a running X server. You find the same divisions in the left tab window list on `Moni- tor' to choose the monitor `Vendor'. Clicking one more option, you can choose your model on the right hand list (`Type'). Should you not be able to find your own monitor on the list, you can still enter horizontal and verti- cal frequencies specific to your monitor by pushing the `Expert' button. Normally you should be able to find these in your monitor handbook. 212 8.1. Configuration Using SaX In case you do not have any monitor data available, SaX will set horizontal frequencies to 29-61 kHz and vertical frequencies will be set to 60-70 Hz. Most monitors should not be harmed by these settings. If the screen remains dark for more than a few seconds after starting the X server, or it flickers wildly, you should shut down the server immediately with Ctrl + Alt + - ( - denotes the "backspace button") If you don't, this might cause damage to your monitor. The Desktop If your graphics card installation was successful, you will have a large number of resolutions and color depths to choose from. They can be administered from the `desktop' menu.(Figure 8.6). Figure 8.6: SaX: Desktop The `desktop' tab window might remind you of another operating system ;-) In this window you can choose a different resolution (`resolutions') for each color depth (`color'). If you would like to set a list of several resolutions for a particular color depth, you can do this in expert mode (`Expert', Figure 8.7 on the following page). On the tab window `resolution' you will see: `Resolution' This tab window is divided into three sections: `Possible' Resolutions. `Current' Resolutions. `Colors' The list of color depths. 213 8. The X Window System Figure 8.7: SaX: Screen First you should choose your preferred color depth on the vertical button panel to the right (`Colors'); the resolutions have to be adjusted to these as well. The X server can start in several color depths, e. g. in 8 bit color depth; this means that 256 colors can be shown on the desktop. Each color depth in turn can have different screen resolutions, e. g. 800x600. Not all resolutions are available for each color depth. Some graphics cards do not allow a resolution of 1600x1200 at 32 bit color depth, as they don't have sufficient memory. For 8 bit color depth there are several resolutions available, from 1600x1200 down to 640x480; they are listed in the `Actual Res- olution List'. You can change resolutions by pressing Ctrl + Alt + + to cycle forwards through the list or Ctrl + Alt + - to go backwards. (you must use the keys + and - on the number block). The first entry in the list is always chosen by the X server when it is initialized. You must copy the desired resolution from the list of `possible' res- olutions to the list of `current' resolutions. First you click on the resolution to mark it; then you click on the button `I' to copy the de- sired resolution to the list of `current' resolutions. By clicking `R' you remove the current resolution. The sequence of `current' list entries can be changed via the arrow buttons at the lower end of the list window. First you mark the entry you want to move and then you left-click the up or down arrow. In this way the entry swaps places with its predecessor or successor. When you are happy with your settings at 8 bit color depth, you can select another color depth via the right button bar, such as 16 bit. Now you will see a list of `possible' resolutions at this color depth. They can be changed in the same way as described above. `Virtual resolution': this tab window lets you set the virtual res- olution of your desktop. If you want to configure a virtual desktop you need to increase the values `Virtual X' (= width) and `Virtual Y' (= height). Generally, this feature is not chosen by most people. Back- 214 8.1. Configuration Using SaX ground information: The X Window System is capable of defining a vir- tual desktop that is larger than the actual screen size, for example, using a virtual resolution of 1152x864 with a screen resolution of 800x600. `Special': The `special' tab window allows user-defined entries. In addition you can determine the `quality' of the "modelines", i.e. you can choose between two different calculation methods. Now you should set the default color depth with which the X server should start. To do this you need to select the color depth you want in the `screen' tab window (with `colors') as your current color depth; once this is done you should move to the next item on `Change current mode'; this should start the X server check . . . Testing the Configuration After a short time a message box appears; if you are satisfied, click on `ok'. Then a background image and a split window should appear; in the left half there is information on your current resolution and on the horizontal and vertical monitor frequencies. In the right half you should see two button fields, `size' and `posi- tion', which allow the image to be adjusted. The arrow boxes in `size' allow the horizontal and vertical image size to be increased or decreased; in the `Position' box you can change the position of the image relative to the monitor. Adjust the screen image to suit you. Small rectangular image controls can be found in all four corners of the screen image. Ideally they should be all be visible and not display any distortion in color. You can only make fairly small monitor adjustments using SaX; it cannot replace manual adjustment using the controls on the monitor itself ! After adjusting the screen image, there are two ways of closing the window: `Save': End your X Window System configuration, saving the current set- tings. This takes you back to the command line. `Cancel': Interrupt your X server setup and discard the settings. Press Alt + F1 if you want to return to the first console. 8.1.2 Re-configuring SaX can also be used to adjust an X server which is already running to your specific needs. SaX reads in the existing file /etc/XF86Config, where the X Window System stores and analyses the configuration data. This is why you don't really need to make all the settings from the screen, since SaX adopts the existing, functioning configuration of the X server. SaX displays this data in the tab windows mentioned above. You are free to do as you want, however, in making new settings for your X server configuration: you can select hardware from a comprehensive monitor 215 8. The X Window System database, thereby better adapting the configuration to the monitor's capabili- ties, as well as adjusting the screen position. SaX also provides a comfortable GUI to administer color depths and resolu- tions. It is easily accessed, simply by clicking on the `screen' tab window. 8.1.3 Troubleshooting Here are the main and most frequent problems encountered when configuring X windows with SaX: * If the screen image flickers during the configuration test, or the image turns black, you must shut down the X server immediately, since the mon- itor could suffer damage if you continue to run the present configuration. Press Ctrl + Alt + - You should select the `Monitor' tab window and look for a different monitor, or enter the monitor data by hand; the procedure is the same if the image begins to flicker while the screen is being adjusted. * In particularly tricky cases, SaX has some command line options avail- able, such as: --servervga16: This will start SaX with the VGA16 server instead of the server appropriate for your card. This server should run on al- most all VGA cards. This server is automatically used if your graphics card is not recognized, or if you have an ISA card. SaX documentation can be found in the /usr/doc/packages/sax di- rectory. If, when starting SaX or during configuration, something un- expected happens, the sequence of processes is recorded in the /root/ ServerLog and /root/StartLog files. Looking at these files will give you clues as to what went wrong, and how to correct it. 8.1.4 Starting the X Window System The X Window System is started with the command startx. A preconfigured GUI for the fvwm window manager is provided for the sample user. We recommend you starting the X Window System from this account, and not as `root'. X11 server error messages are saved in the /.X.err file. The startx command has a few options; for instance, you can select 16 bit color depth by typing newbie@earth: > startx -- -bpp 16 8.1.5 Checklist for Installing Graphics Cards X is running, but there are still display faults, or you wish to optimize the picture. * The main cause of many display problems: a vertical synchronization frequency (vsync) which has been set too high. Because hsync and DotClock are linearly dependent on this, it causes the most problems. A reduction of the picture frequency rate to 80 Hz, for instance, will still produce a picture which doesn't flutter, and which is also a great deal 216 8.1. Configuration Using SaX sharper than one set at 160 Hz. At a picture frequency rate of 80 Hz the pixel rate is only half of that at 160 Hz. You should therefore try reducing the maximum vertical frequency rate used. To do this, choose the `Monitor' tab in SaX, and in the `Ad- vanced' section you should set a lower maximum frequency rate. For modern monitors a normal picture frequency rate lies between 80 and 90 Hz. * Sometimes there are also problems with the "hardware cursor". Then you will see a square block or something which looks like a "bar- code" where the mouse should be. The solution to this: add the Option "sw cursor" to the Section "Device". * Hints on configuration, and the first place to look in case of problems: the README files ­ these are sorted according to chip set manufacturers ­ in the directory /usr/X11R6/lib/X11/doc/, in the manpages for the X servers, the FAQ for XFree86 (http://www.xfree86.org) and the SuSE pages for updates: http://www.suse.de/en/support/xsuse/ The following table is ordered in terms of probability, i.e. as a rule you will be successful with step 1, otherwise with the second step. Step 3 is usually a last resort . . . All the options are listed in the device section of the file /etc/XF86Config. * No mouse cursor, but a colored, square "barcode". 1. Option sw cursor in device section. 2. Option no imageblt or no bitblt. 3. Option noaccel. * Picture is too narrow or squashed. The monitor settings are already at their limits. 1. The frequency rate or the hsync frequency is probably set too high and is at the limit of the monitor. Remedy: reduce the vsync and/or the hsync frequency. 2. Adjust the picture with the program xvidtune. It is possible that just one mode is not quite correct. 3. Add the parameters +hsync +vsync to the modeline and try replac- ing + with -. * When moving windows, stripes, "lumps" or parts of windows stay where they are. They do not disappear even when the movement is stopped. They only disappear when the desktop is refreshed. 1. Reduce the picture frequency rate or the resolution. 2. Depending on the chip set, use the relevant options from the README files in /usr/X11R6/lib/X11/doc/. For example the options fifo conservative or slow dram. Attention: this is dependent on the graphic chip set, however! 217 8. The X Window System 3. The noaccel option, but possibly the options no imageblt or no bitblt may be sufficient. * "Noise" ­ Image interference when moving windows or viewing videos which disappears when the image is stationary. 1. Reduce the frequency rate, color depth or resolution. 2. Reduce the frequency rate of the card, or add or remove wait states. This sometimes works with set mclk (not with all chip sets!). More detailed information can be found in the README directory. Attention: this option is dangerous, the card could be set at too high a frequency). 3. It is possible that the bus rate is set too highly. Check the bus rate on the PCI/VLB or ISA bus. * When starting XFree86, the screen turns black. 1. Reduce the frequency rate. 2. Consider other possible sources of error: check the system for IRQ conflicts (e. g.PS/2 mouse needing IRQ 12). 8.2 Configuration Using xf86config In most cases, XF86Setup is superior to xf86config as a simple configuration tool. There are, nevertheless, some rare cases where XF86Setup fails. If so, just use xf86config, which almost always works. Make sure you have the following information available: * mouse type, port to which the mouse is connected and baud rate (the baud rate is normally optional). * specifications of the graphics card * monitor data (frequencies, etc.) If these settings are known, or you have your manuals at hand, you can start configuring. Remember that you have to be `root' to do this. The configuration is started with: earth:/root # /usr/X11R6/bin/xf86config Mouse After the welcome screen, you are asked about your mouse type. You are offered the following selections (see Output 8.2.1: 1. Microsoft compatible (2-button protocol) 2. Mouse Systems (3-button protocol) 3. Bus Mouse 4. PS/2 Mouse 5. Logitech Mouse (serial, old type, Logitech protocol) 6. Logitech MouseMan (Microsoft compatible) 7. MM Series 8. MM HitTablet Screen output 8.2.1: Mouse selection for X 218 8.2. Configuration Using xf86config While selecting the mouse, you should bear in mind that many of the new Logitech mice are either Microsoft compatible, or use the MouseMan proto- col. The selection Bus Mouse refers to any bus mouse, including Logitech! Selection is made by entering the relevant number. There may be a question whether "ChordMiddle" should be activated. This is necessary for some Logitech mice or trackballs, to activate 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, you can emulate the third button by answer- ing `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 you must 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 installa- tion, just enter /dev/mouse. Keyboard Next you are asked whether to assign Meta (ESC) to the left Alt-key and to assign ModeShift to the right Alt-key. 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', you can access the German keyboard via the right Alt , and the left Alt can serve as the meta key. 3 Monitor Next you should specify your monitor. You should be extremely careful with vertical and horizontal frequencies! These can be found in your monitor handbook. Setting frequencies incorrectly can lead to irreparable damage to your monitor! The X Window System only addresses video modes which op- erate 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.4 To enter the horizontal frequency, the following selection is displayed (see Output 8.2.2 on the following page): 3 e. g., in Emacs. 4 We cannot be held liable, of course, if this information is inaccurate! 219 8. The X Window System hsync in kHz; monitor type with characteristic modes 1 31.5; Standard VGA, 640x480 @ 60 Hz 2 31.5 - 35.1; Super VGA, 800x600 @ 56 Hz 3 31.5, 35.5; 8514 Compatible, 1024x768 @ 87 Hz interl. (no 800x600) 4 31.5, 35.15, 35.5; Super VGA, 1024x768 @ 87 Hz il., 800x600 @ 56 Hz 5 31.5 - 37.9; Extended Super VGA, 800x600 @ 60 Hz, 640x480 @ 72 Hz 6 31.5 - 48.5; Non-Interlaced SVGA, 1024x768 @ 60 Hz, 800x600 @ 72 Hz 7 31.5 - 57.0; High Frequency SVGA, 1024x768 @ 70 Hz 8 31.5 - 64.3; Monitor that can do 1280x1024 @ 60 Hz 9 31.5 - 79.0; Monitor that can do 1280x1024 @ 74 Hz 10 Enter your own horizontal sync range Enter your choice (1-10): Screen output 8.2.2: Entry for the monitor's horizontal frequency You should only choose one of the predefined modes if you are unsure of the settings for your monitor. Selection `10' allows you to enter your own frequencies. The next screen asks you to enter your monitor's vertical frequency (see Output 8.2.3). Again, using the known values (i.e., choice `5') is preferable to using one of the items `1' to `4'. 1 50-70 2 50-90 3 50-100 4 40-150 5 Enter your own vertical sync range Enter your choice (1-5): Screen output 8.2.3: Vertical frequency choices Next you should 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, and they do not affect the configuration itself. Merely pressing Enter will select the default values, which is usually sufficient. Your monitor configuration is now complete. Graphics Cards / X server Next you must specify your graphics card: Do you want to look at the card database? If you enter `y', a selection of predefined cards is presented. 220 8.2. Configuration Using xf86config Here you can select your card by pressing the corresponding number. Do not trust this list blindly, since there can be differences in clock chip and RAMDAC5 settings! This is why there is a menu item later to select a RAMDAC and a clock chip, even though 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 be used. Furthermore, some valuable information concerning the card is written to the device section in XF86Config. If your card is not listed, do not panic. You should switch back to the nor- mal 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. Further information on how to configure your card is given in chapter Sec- tion 8.3 page 225. After specifying your card, the X server is next. xf86config displays the choices, as seen in Output 8.2.4. Choice `5' only appears if you have selected one of the predefined cards in the previous step. In this case, choose `5' to select the X server most suitable for your card. 1 The XF86_Mono server. This a monochrome server that should work on any VGA-compatible card, in 640x480 (more on some SVGA chipsets). 2 The XF86_VGA16 server. This is a 16-color VGA server that should work on any VGA-compatible card. 3 The XF86_SVGA server. This is a 256 color SVGA server that supports a number of SVGA chipsets. It is accelerated on some Cirrus and WD chipsets; it supports 16/32-bit color on certain Cirrus configurations. 4 The accelerated servers. These include XF86_S3, XF86_Mach32, XF86_Mach8, XF86_8514, XF86_P9000, XF86_AGX, XF86_W32 and XF86_Mach64. These four server types correspond to the four different "Screen" sections in XF86Config (vga2, vga16, svga, accel). 5 Choose the server from the card definition, XF86_S3. Which one of these four screen types do you intend to run by default (1-4)? Screen output 8.2.4: Selecting an X server 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 you want to put it in /var/X11R6/bin/X. Do you want to set it in /var/X11R6/bin? Reply with `y', since it may not always be possible to write to /usr. 5 Random Access Memory Digital-to-Analogue Converter. 221 8. The X Window System Afterwards, if you have selected `4' (the accelerated servers) in the previous selection, a menu is presented of all available accelerated X servers, as shown in Output 8.2.5. 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: . Screen output 8.2.5: Accelerated X server options After selecting your X server, you now have to configure your graphics. First you should specify the amount of memory the card has, as seen in Out- put 8.2.6. How much memory do you have on your graphics card: 1 256K 2 512K 3 1024K 4 2048K 5 4096K 6 Other Enter your choice: Screen output 8.2.6: Selecting video memory Next, you must enter the name, vendor name and type for your graphics card. These are merely descriptive entries. If you earlier selected a card from the predefined list, pressing Enter will enter this as the default. Enter an identifier for your graphics card definition: Enter the vendor name of your graphics card: Enter the model (board) name of your graphics card : If you chose an accelerated X server, you must enter the RAMDAC settings. This only applies to the S3 and AGX servers. In most cases, simply pressing Enter will suffice. If you have selected a graphics card that supports a specific RAMDAC, this should be chosen here (see Output 8.2.7 on the facing page). After answering this question, you can enter a clock chip for accelerated cards, if you have one (see Output 8.2.8 on the next page). Entering a clock chip avoids clock lines, as the clocks needed can be programmed. 222 8.2. Configuration Using xf86config 1 AT&T 20C490 (S3 server) att20c490 2 AT&T 20C498/21C498/22C498 (S3) att20c498 3 AT&T 20C505 (S3) att20c505 4 BrookTree BT481 (AGX) bt481 5 BrookTree BT482 (AGX) bt482 6 BrookTree BT485/9485 (S3) bt485 7 Sierra SC15025 (S3, AGX) sc15025 8 S3 GenDAC (86C708) (autodetected) s3gendac 9 S3 SDAC (86C716) (autodetected) sdac 10 STG-1700 (S3) stg1700 11 TI 3020 (S3) ti3020 12 TI 3025 (S3) ti3025 Screen output 8.2.7: Setting a RAMDAC 1 AT&T 20C490 (S3 server) att20c490 2 AT&T 20C498/21C498/22C498 (S3) att20c498 3 AT&T 20C505 (S3) att20c505 4 BrookTree BT481 (AGX) bt481 5 BrookTree BT482 (AGX) bt482 6 BrookTree BT485/9485 (S3) bt485 7 Sierra SC15025 (S3, AGX) sc15025 8 S3 GenDAC (86C708) (autodetected) s3gendac 9 S3 SDAC (86C716) (autodetected) s3_sdac 10 STG-1700 (S3) stg1700 11 TI 3020 (S3) ti3020 12 TI 3025 (S3) ti3025 13 Normal DAC normal Screen output 8.2.8: Setting the clock chip If a card without a clock chip is selected, just press Enter (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. Here, we must explain why the automatically defined settings can be really dangerous: 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 pre-programmed 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) are many zeros or repeated timing values. Never ever write such values to XF86Config! To configure clock chips, follow these steps: 223 8. The X Window System * The best way is to enter an existing (programmable) clock chip if there is one. It will be programmed accordingly and your XF86Config will not contain clock lines. You can compare chips on the card with the chips offered in the menu. Most newer S3 cards have a programmable clock chip. * If you do not have a programmable clock chip, you should launch X -probeonly and compare these values with those of the manual. If these values correspond (±2), you should enter them in XF86Config. If there are no hints in the manual, you can determine the values by running X -probeonly (this works best on an unloaded machine). Check whether the values are correct, since 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 have to be entered in their exact order. Exception: if the P9000 server is used the order is irrelevant; just enter the modes for the desired clock in the clocks line. * In general: if there is a programmable clock chip, there should be no clocks line in XF86Config (exception, P9000). For cards without a programmable clock chip, there should be a clocks line in XF86Config. This avoids the tedious (and sometimes even dan- gerous) testing at each startup. Furthermore, for cards with unreadable values, there are no invalid values and there is no risk to your monitor. 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 and then a list of probed clocks will be pre- sented, or a message will appear that no clocks could be found. If you have selected a clock chip, this question will not appear, since the clocks are then programmed automatically. In this case, this section is skipped. If the previous question has been answered with `y' and the screen re- mains black for more than 30 seconds, you should cancel testing imme- diately with Ctrl + Alt + , or Ctrl + c . If this does not work, switch off the monitor and the computer to prevent the hardware from be- ing damaged! Saving your Configuration Now the configuration file has to be written. It is recommended that you 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 filesystem. xf86config first suggests that it should write XF86Config to the current directory. You should answer `no' to this: Do you want it written to the current directory as 'XF86Config'? Then you are asked where to save your configuration: 224 8.3. Optimizing the X Window System Please give a path + filename to write to: Here, you should enter: "/etc/XF86Config". Now xf86config exits to the command line. This completes the configuration of the X Window System. 8.3 Optimizing the X Window System xf86config creates /etc/XF86Config, the primary configuration file for the X Window System. You can 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: Section entry 1 entry 2 entry n EndSection The following types of sections exist: Files This section describes all paths used and the RGB color table. ServerFlags General switches are set here. Keyboard Servers for describing and setting up your keyboard. In our case, this can only be Device Standard. Pointer Assigns all necessary references to the appropriate pointer. In most cases, this will be a mouse. Other pos- sibilities are light pens or graphics boards. The main set- tings are the Protocol and the Device. Monitor Describes the monitor in use. Elements of this section include a name, referred to later in the Screen defi- nition, bandwidth (bandwidth) and sync frequencies (HorizSync and VertRefresh). Settings are given in MHz, kHz and Hz. Normally, the server refuses any modeline that does not correspond with the specification of the monitor. This is to prevent too high frequencies from being sent to the monitor by accident. Device This section defines a specific graphics card. It is refer- enced by its descriptive name. Screen This section puts together a Driver (e. g., vga2), a monitor and a Device to form all the necessary set- tings for XFree86. In the Display subsection you can specify the size of the virtual screen (Virtual, the ViewPort and the Modes) used with this virtual screen. We will now take a closer look at Monitor, Device and Screen. Infor- mation on the other sections can be found in [The96]. 225 8. The X Window System There can be several different Monitor sections in XF86Config. Even multiple Screen sections are possible; which one is started depends on the server started. Screen Section First, we will take a closer look at the screen section. As mentioned above, this combines a monitor and a device section, and determines which resolu- tion, using which color depth, should be used. A screen section might look like the example in File contents 8.3.1. Section "Screen" Driver "accel" Device "Miro Crystal 40SV" Monitor "EIZO T563-T" DefaultColorDepth 16 Subsection "Display" Depth 8 Modes "1024x768" "800x600" "640x480" ViewPort 0 0 Virtual 1024 768 EndSubsection Subsection "Display" Depth 16 Modes "1280x960" "1152x864" "1024x768" "800x600" ViewPort 0 0 Virtual 1280 960 EndSubsection Subsection "Display" Depth 32 Modes "1024x768" "800x600" "640x480" ViewPort 0 0 Virtual 1024 768 EndSubsection EndSection File contents 8.3.1: An example of the screen section in /etc/XF86Config This example shows that Section Screen contains a number of lines, each specifying an element of the screen display. The first of these, Driver, determines which X server this screen applies to. The servers listed on page 221 are accessed via the keywords in Table 8.1. Accel For special accelerated servers Mono Not VGA 1 and 4 bit server SVGA Super VGA server VGA2 1 Bit (monochrome) VGA server VGA16 4 Bit VGA server Table 8.1: Driver keywords for the screen section in /etc/XF86Config 226 8.3. Optimizing the X Window System There can be a screen section for each server in XF86Config, which will be used if the corresponding server is started. The next two lines, Device and Monitor, specify the graphics card and the monitor which belong to this definition. These just point to the Device and Monitor sections with the corresponding names. These sections are discussed later in more detail. Using DefaultColorDepth, you can select which color depth mode the server will start with if it is not explicitly stated. There is a Display subsection for each color depth. Depth assigns the color depth of 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, whereas 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 for, which has to correspond to one of the given clock rates or a clock rate to program the card. The first resolution found is the so-called Default mode. With Ctrl + Alt + gray + , you can switch to the next resolution in the list to the right, with Ctrl + Alt + gray - , to the left, thus enabling you to vary the resolution whilst X-windows is running. The last two lines of this subsection refer to the size and anchoring of the virtual screen. Size depends on the amount of memory installed on your card and the desired color depth, not on the maximum resolution of the monitor. If the card has 1 MB video RAM installed, the virtual screen can be up to 1024x1024 by 8 bit color depth. Especially for accelerated cards, it is not recommended to use up all your memory for the virtual screen, since this memory on the card is also used for several font and graphics caches. The size of the virtual screen is assigned by Virtual. Viewport assigns a viewport. This is the point where the upper left corner of the physical screen is reflected in the virtual screen. Assigning ('0 0') means that the upper left corners overlap at startup time. The visible section is moved across the virtual screen by moving the mouse to the edge. Thus the viewport is only important at startup time, and even then only if the size of the virtual screen differs from the size of the real screen. Device Section 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 differ- entiated. We will not go into further detail about the device section. Instead, we rec- ommend that you look at the extensive documentation (/usr/X11/lib/ X11/doc and the manual pages [The96]). In /usr/X11R6/lib/X11/doc/Devices, there is a collection of de- vice sections. If you used a card mentioned in this file, you should use the 227 8. The X Window System appropriate section in /etc/XF86Config and adapt the screen section by entering the appropriate device. If the card is not listed, this does not necessarily mean that this card is not supported by XFree86! It usually means that no adequate device section has yet been sent to the XFree86 team. A list of cards supported can be found in /usr/X11/lib/X11/doc/README. In /usr/X11/lib/X11/doc/ AccelCards, there is a list of accelerated cards supported. Monitor Section Monitor sections each describe, in the same way as the device sections, one monitor. Again, there can be as many Monitor sections as you want in XF86Config. The screen section specifies which monitor section is rele- vant. The same applies for monitor definitions: they should only be set by experi- enced users. A critical part of the monitor section is the so-called modelines, which set horizontal and vertical timings for the appropriate resolution. Unless you have an in-depth knowledge of monitor and graphics card func- tions, nothing should be changed in the modelines, since this could cause severe damage to your monitor! For those who may want to develop their own monitor descriptions, the doc- umentation in /usr/X11/lib/X11/doc might come in handy. It is rec- ommended that you take a look at [HHMK96] where function, hardware and the creation of modelines are explained in great detail. Predefined monitor sections which can be used in XF86Config are located in /usr/X11/lib/X11/Monitors. A monitor not listed there should be operated with the VESA standard timings, as they are set by xf86Setup or xf86config. It is most important that horizontal and vertical sync frequencies are set correctly! If you have a tested configuration which was not mentioned here, we at SuSE or the XFree86 team will be happy to include it in the list. 228