cze 8, 2010

Nvidia Dual Screen


Here you will find Xorg configuration for Nvidia proprietary driver, which uses Nvidia TwinView technology to support double screen configuration with full 3D acceleration on both attached screens.
Kategoria: Xorg
Napisał: kardasa

Foreword

Dual screen configuration for NVidia proprietary driver can be a little tricky. Nvidia has only support for very old RandR specification which is no longer used anywhere else. What is even worst when you will configure dual screen using these old configuration you will loose 3D acceleration on both screens and you can forget about games or 3D Desktop. This is shameful for such a big corporation because they was promising new RandR support with acceleration few years ago and still it's not working.

So what can we do? We can use native NVidia TwinView technology to setup the screens. The TwinView settings are well documented in driver documentation, however I found out that few configuration options provided as optional are actually needed to make both screens work without problems. I must point out that my minor problems were most likely cosed by the fact that my second screen is not fully supporting Edid auto detection. If you have problems with settings up two screens using Nvidia TwinView look and my explanation and configuration file. I hope this will help you.

Xorg Server Configuration

My primary screen is Samsung SyncMaster 226BW wide screen DFP monitor with native resolution 1680x1050. The second screen is Sony Bravia 32in LCD TV with native resolution 1360x768. This screen is connected using standard VGA cable and therefor is recognized as CRT monitor. I'm using my second monitor to watch movies and also to lunch MythTV media center. This screen is attached to 2nd VGA connector to my graphics card and is positioned on the right of my main monitor. Below you will find configuration file, that is letting me use both screens with full 3D acceleration.

View the full xorg.conf configuration file
  1. Section "ServerLayout"
  2. Identifier "TwinView_Dual"
  3. Screen 0 "Screen_TwinView_Dual" 0 0
  4. InputDevice "Keyboard0" "CoreKeyboard"
  5. InputDevice "USB Mouse" "CorePointer"
  6. # InputDevice "LIRC-Mouse"
  7. Option "AIGLX" "false"
  8. Option "AllowEmptyInput" "off"
  9. EndSection
  10.  
  11. Section "ServerFlags"
  12. Option "AllowMouseOpenFail" "true"
  13. # Option "Xinerama" "true"
  14. Option "DefaultServerLayout" "Twinview_Dual"
  15. EndSection
  16.  
  17. Section "Files"
  18. FontPath "/usr/share/fonts/misc"
  19. FontPath "/usr/share/fonts/corefonts"
  20. FontPath "/usr/share/fonts/arkpandora"
  21. FontPath "/usr/share/fonts/artwiz-aleczapka-en"
  22. FontPath "/usr/share/fonts/artwiz"
  23. FontPath "/usr/share/fonts/cheapskatefonts"
  24. FontPath "/usr/share/fonts/dejavu"
  25. FontPath "/usr/share/fonts/efont-unicode"
  26. FontPath "/usr/share/fonts/essays1743"
  27. FontPath "/usr/share/fonts/TTF"
  28. FontPath "/usr/share/fonts/freefonts"
  29. FontPath "/usr/share/fonts/hunkyfonts"
  30. FontPath "/usr/share/fonts/intlfonts"
  31. FontPath "/usr/share/fonts/lfpfonts-fix"
  32. FontPath "/usr/share/fonts/mathematica-fonts"
  33. FontPath "/usr/share/fonts/sgi-fonts"
  34. FontPath "/usr/share/fonts/tengwar-fonts"
  35. FontPath "/usr/share/fonts/terminus"
  36. FontPath "/usr/share/fonts/texcm-ttf"
  37. FontPath "/usr/share/fonts/ttf-gentium"
  38. FontPath "/usr/share/fonts/unifont"
  39. FontPath "/usr/share/fonts/urw-fonts"
  40. FontPath "/usr/share/fonts/vc"
  41. FontPath "/usr/share/fonts/jmk"
  42. FontPath "/usr/share/fonts/Type1"
  43. FontPath "/usr/share/fonts/100dpi"
  44. FontPath "/usr/share/fonts/75dpi"
  45. FontPath "/usr/share/fonts/cyrillic"
  46. FontPath "/usr/share/fonts/default/ghostscript"
  47. FontPath "/usr/share/fonts/ttf-bitstream-vera"
  48. FontPath "/usr/share/fonts/cronyx/100dpi/:unscaled"
  49. FontPath "/usr/share/fonts/cronyx/misc/:unscaled"
  50. FontPath "/usr/share/fonts/cronyx/75dpi/:unscaled"
  51. ModulePath "/usr/lib/xorg/modules"
  52. ModulePath "/usr/lib/opengl/xorg-x11/extensions/"
  53. EndSection
  54.  
  55. Section "Module"
  56. Load "ddc"
  57. Load "vbe"
  58. Load "dbe"
  59. Load "extmod"
  60. SubSection "extmod"
  61. Option "omit xfree86-dga"
  62. EndSubSection
  63. Load "glx"
  64. Load "bitmap"
  65. Load "freetype"
  66. Load "record"
  67. EndSection
  68.  
  69. Section "InputDevice"
  70. Identifier "Keyboard0"
  71. Driver "evdev"
  72. Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-kbd"
  73. Option "CoreKeyboard"
  74. Option "XkbRules" "xorg"
  75. Option "XkbModel" "pc105"
  76. Option "XkbLayout" "pl"
  77. Option "XkbVariant" ",winkeys"
  78. Option "XkbOptions" "eurosign:5,terminate:ctrl_alt_bksp"
  79. EndSection
  80.  
  81. Section "InputDevice"
  82. Identifier "Serial Mouse"
  83. Driver "mouse"
  84. Option "Protocol" "Microsoft"
  85. Option "Device" "/dev/ttyS0"
  86. Option "Emulate3Buttons" "true"
  87. Option "Emulate3Timeout" "70"
  88. Option "SendCoreEvents" "true"
  89. EndSection
  90.  
  91. Section "InputDevice"
  92. Identifier "PS/2 Mouse"
  93. Driver "mouse"
  94. Option "Protocol" "IMPS/2"
  95. Option "Device" "/dev/input/mice"
  96. Option "Emulate3Buttons" "false"
  97. Option "Emulate3Timeout" "70"
  98. Option "SendCoreEvents" "true"
  99. Option "ZAxisMapping" "4 5"
  100. EndSection
  101.  
  102. Section "InputDevice"
  103. Identifier "USB Mouse"
  104. Driver "evdev"
  105. Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse"
  106. # Option "SendCoreEvents" "true"
  107. # Option "Protocol" "IMPS/2"
  108. Option "ZAxisMapping" "4 5"
  109. Option "Buttons" "5"
  110. EndSection
  111.  
  112. Section "InputDevice"
  113. Identifier "LIRC-Mouse"
  114. Driver "mouse"
  115. Option "Device" "/var/run/lirc/lircm"
  116. Option "Protocol" "IntelliMouse"
  117. Option "SendCoreEvents"
  118. Option "Buttons" "5"
  119. Option "ZAxisMapping" "4 5"
  120. EndSection
  121.  
  122. #Modes configuration for TV Sony Bravia 32 KDL32S2030
  123.  
  124. Section "Modes"
  125. Identifier "Modes_SONY"
  126. Mode "WXGA_1360x768" # vfreq 60.015Hz, hfreq 47.712kHz
  127. DotClock 85.500000
  128. HTimings 1360 1424 1536 1792
  129. VTimings 768 771 777 795
  130. Flags "+HSync" "+VSync"
  131. EndMode
  132. Mode "WXGA_1280x768" # vfreq 59.870Hz, hfreq 47.776kHz
  133. DotClock 79.500000
  134. HTimings 1280 1344 1472 1664
  135. VTimings 768 771 778 798
  136. Flags "+HSync" "-VSync"
  137. EndMode
  138. Mode "XGA_1024x768" # vfreq 60Hz, hfreq 48.4kHz
  139. DotClock 65.000000
  140. HTimings 1024 1032 1176 1344
  141. VTimings 768 771 777 806
  142. Flags "+HSync" "-VSync"
  143. EndMode
  144. EndSection
  145.  
  146. #Modes configuration for LCD Samsung Syncmaster 226bw 22 inch
  147.  
  148. # Configuration for Samsung 226BW Primary LCD Monitor
  149.  
  150. Section "Monitor"
  151. Identifier "Samsung_226BW"
  152. VendorName "Samsung"
  153. ModelName "226BW (22inch)"
  154. DisplaySize 473.8 296.1
  155. HorizSync 48
  156. VertRefresh 60
  157. Option "DPMS" "true"
  158. EndSection
  159.  
  160. # Configuration for Philips 107B Primary CRT Monitor
  161.  
  162. Section "Monitor"
  163. Identifier "Philips_107B"
  164. VendorName "Philips"
  165. ModelName "107B (17inch)"
  166. DisplaySize 320 240
  167. HorizSync 30.0 - 69.0
  168. VertRefresh 50.0 - 130.0
  169. Option "DPMS" "true"
  170. EndSection
  171.  
  172. # Configuration for Generic Monitor
  173.  
  174. Section "Monitor"
  175. Identifier "Generic"
  176. VendorName "Unknown"
  177. ModelName "Unknown"
  178. VertRefresh 60
  179. Option "DPMS" "true"
  180. EndSection
  181.  
  182. #Configuration for Sony Bravia 32in Secondary LCD TV/Monitor
  183.  
  184. Section "Monitor"
  185. Identifier "Sony_Bravia_32in"
  186. Option "DPMS" "true"
  187. VendorName "Sony"
  188. ModelName "Bravia 32 inches"
  189. UseModes "Modes_SONY"
  190. #HorizSync 31.5-47.8
  191. #VertRefresh 60
  192. EndSection
  193.  
  194. #Configuration for GForce 8800GTS Graphics TwinView Dual
  195.  
  196. Section "Device"
  197. Identifier "GForce_TwinView_Dual"
  198. Driver "nvidia"
  199. VendorName "ASUS"
  200. BoardName "ASUS Nvidia EN8800GTS"
  201. BusID "PCI:4:0:0"
  202. Option "NoLogo" "false"
  203. # Option "LogoPath" ""
  204. Option "BackingStore" "true"
  205. Option "RenderAccel" "true"
  206. # Option "UBB" "true"
  207. Option "NoFlip" "true"
  208. # Option "Dac8bit" "false"
  209. # Option "Overlay" "false"
  210. # Option "CIOverlay" "false"
  211. # Option "TransparentIndex" "0"
  212. # Option "OverlayDefaulVisual" "false"
  213. # Option "EmulatedOverlaysTimerMS" "0"
  214. # Option "EmulatedOverlaysThreshold" "true"
  215. # Option "EmulatedOverlaysThresholdValue" "5"
  216. Option "RandRRotation" "true"
  217. # Option "Rotate" ""
  218. # Option "AllowDDCCI" "true"
  219. Option "PixmapCacheSize" "1000000"
  220. # Option "AllowSHMPixmaps" "0"
  221. Option "XvmcUsesTextures" "true"
  222. # Option "UseEDID" "true"
  223. Option "SWCursor" "false"
  224. Option "HWCursor" "true"
  225. Option "CursorShadow" "true"
  226. Option "CursorShadowAlpha" "64"
  227. Option "CursorShadowXOffset" "4"
  228. Option "CursorShadowYOffset" "2"
  229. Option "ConnectedMonitor" "DFP-1, CRT-0"
  230. # Option "UseDisplayDevice" "CRT"
  231. Option "UseEdidFreqs" "true"
  232. Option "TwinView" "true"
  233. Option "SecondMonitorHorizSync" "UseEdidFreqs"
  234. Option "SecondMonitorVertRefresh" "UseEdidFreqs"
  235. Option "OnDemandVBlankInterrupts" "true"
  236. Option "MetaModes" "DFP-1: 1680x1050, CRT-0: 1360x768; DFP-1: 1680x1050, CRT-0: null; DFP-1: null, CRT-0: 1360x768"
  237. Option "TwinViewXineramaInfoOrder" "DFP-1, CRT-0"
  238. Option "TwinViewOrientation" "CRT-0 RightOf DFP-1"
  239. # Option "TVStandard" ""
  240. # Option "TVOutFormat" ""
  241. # Option "TVOverScan" ""
  242. # Option "Stereo" ""
  243. # Option "AllowDFPStereo" ""
  244. # Option "ForceStereoFlipping" ""
  245. # Option "XineramaStereoFlipping" ""
  246. # Option "NoBandWidthTest" "false"
  247. # Option "MuiltisampleCompatibility" "true"
  248. # Option "NoPowerConnectorCheck" "false"
  249. # Option "AllowGLXWithCompisite" "false"
  250. Option "AddARGBGLXVisuals" "true"
  251. # Option "DamageEvent" "true"
  252. Option "TripleBuffer" "true"
  253. Option "UseEdidDpi" "true"
  254. Option "UseEvents" "false"
  255. Option "DynamicTwinView" "true"
  256. Option "ConnectToAcpid" "true"
  257. EndSection
  258.  
  259. #Screen Configuration for TwinView_Dual
  260.  
  261. Section "Screen"
  262. Identifier "Screen_TwinView_Dual"
  263. Device "GForce_TwinView_Dual"
  264. Monitor "Samsung_226BW"
  265. DefaultDepth 24
  266. SubSection "Display"
  267. Depth 24
  268. Modes "1680x1050" "1280x1024" "1280x960" "1280x768" "1152x864" "1024x768" "800x600" "640x480"
  269. EndSubSection
  270. EndSection
  271.  
  272. Section "dri"
  273. Mode 0666
  274. EndSection
  275.  
  276. Section "Extensions"
  277. Option "Composite" "Enable"
  278. Option "RENDER" "Enable"
  279. EndSection

Now I will try to briefly explain this configuration. I will focus on most important things.

First thing you will see is ServerLayout section. This section is using configuration options defined lower in the file. What is important here is Screen option. You may be surprised to see only one screen definition. That is how you do it in TwinView. Second screen positioning for TwinView is defined in Device section. As you may noticed I have Lirc mouse configuration for remote controller acting as pointing device. I commented this out because I no longer find it useful. I prefer to use Bluetooth GamePad with QJoyPad application as remote pointing device. I additionally disabled AIGLX support as NVidia is using it's own extension to provide 3D desktop feature.

Second section of my file is ServerFlags section. Very important thing here is not to use native Xorg Xinerama extensions as NVidia TwinView is providing it's own implementation which will not work with default Xinerama enabled. That's why I commented out Xinerama option in my configuration file.

Section Files is place when I define my fonts location. The two last lines of this section are somehow important. Without pointing to modules and extensions catalogs Xorg was complying about not being able to load dri and dri2 modules, additionally it was also reporting not being able to use libvdpau which is NVidia video playback acceleration technology. After adding this two lines all warnings disappeared.

The Module section is loading defaults Xorg modules. Module called glx is important for NVidia driver acceleration.

Lower you will find InputDevice section. As you can see I'm using evdev, this is standard driver for input devices now. You may be surprised to see how I'm pointing to my keyboard and mouse event devices. I'm doing this this way because /dev/input/event* device nodes are changing between reboots, especially if I'm plugging in additional devices like Joysticks.

The modes for my Sony Bravia TV and Sony Bravia monitor definition are not used in current configuration I was using them before. They do not interfere so I'm still keeping them. The monitor definition for Samsung 226BW is used, consult Screen section.

Now we are getting to most important thing the Device section. First lines are standard for NVidia proprietary driver. The first important line for double screen is: Option "RandRRotation" "true", this option is allowing me to use RandR extension to set screen options. I use xrandr console interface in my scripts so this is very important setting for me. As I'm using CRT monitor it's important to tell driver what types of monitors are connected to graphics card, Option "ConnectedMonitor" "DFP-1, CRT-0" will do it. Option "TwinView" "true" is enabling TwinView configuration. The Option "MetaModes" is marked as optional but without providing correct meta modes for both screens the resolutions and screen positions were incorrect. If you are wondering why I put more then one meta mode, it's because only defined here meta modes will be available for xrandr console interface. As I want to be able to change screen configuration in my scripts I need to define all possible screen configurations I want to use. Another important option is: Option "TwinViewXineramaInfoOrder" "DFP-1, CRT-0" without it TwinView was acting very weird always setting my CRT-0 Bravia TV as main monitor. To define screen positioning I use Option "TwinViewOrientation" "CRT-0 RightOf DFP-1". I wouldn't recommend setting second screen on the left as some of GTK applications will have problems remembering proper positions if you will disable screens in run time. The last option used for TwinView configuration is: Option "DynamicTwinView" "true", which is enabling dynamic dual screen configuration. You shouldn't disable Option "AddARGBGLXVisuals" if you intend to use 3D desktop.

The other things in the configuration file are standard. You can see Screen configuration and enabled Composite extension required to use accelerated desktop manager.

Prove that it's working

Sources

  • Nvidia Linux driver documentation - shipped with the driver
  • man xorg.conf
  • man Xorg
  • man xranrd
titlepl: Podwójne Erany Nvidia
summarypl: Tutaj znajdziesz konfigurację Xorga dla własnościowego sterownika Nvidii, która wykorzystuje technologię Nvidia TwinView do konfiguracji dwóch ekranów z pełną akceleracją 3D na obu podłączonych ekranach.
contentpl: 

Wstęp

Konfiguracja dwóch ekranów dla własnościwoego sterownika NVidia, może być nieco kłopotliwa. Nvidia posiada wsparcie dla bardzo starej specyfikacji RandR, która nie jest już wykorzystywana przez nikogo innego. Jeszcze gorszy jest fakt, że jeśli skonfigurujesz dwa ekrany korzystając z tej starej specyfikacji stracisz możliwość akceklacji 3D na obu ekranach i możesz zapomnieć o grach i pulpicie 3D. Jest to spory wstyd, dla tak dużej korporacji jak NVidia, jako że deweloperzy obiecywali wspracie dla nowgo standardu RandR kilka lat temu a ciągle nie jest on wspierany..

Wiec co możemy zrobić? Możemy wykorzystać natywną technologię NVidia zwaną TwinView do skonfigurowania dwóch ekranów. Ustawienia TwinView są dobrze opisane w dokumentacji sterownika, jednakże przekonałem się, że niektóre opcje konfiguracyjne opisane jako opcjonalne tak na prawdę są niezbędne aby oba ekrany funkcjonowały bez problemów. Muszę zaznaczyć, że drobne problemy jakie napotkałem najprawdopodobniej były spowodowane faktem, że mój drugi ekran nie w pełni wspiera automatyczne wykrywanie ustawień poprzez Edid. Jeśli napotykasz na problemy przy ustawieniu dwóch ekranów przy użyciu NVidia TwinView spójrz na moje wyjaśnienie i plik konfiguracyjny. Mam nadzieję, że okaże się to pomocne.

Konfiguracja serwera Xorg

Mój główny ekran to Samsung SyncMaster 226BW panoramiczny monitor DFP z natywną rozdzielczością 1680x1050. Drugi monitor to telewizor LCD Sony Bravia 32 cale z natywną rozdzielczością 1360x768. Jest on podłączony przy użyciu standardowego kabla VGA i dlatego jest rozpoznawany jako monitor CRT. Drugi monitor wykorzystuję do oglądania filmów a także do uruchamiania centrum multimedialnego MythTV. Jest on podłączony do drugiego gniazda mojej karty graficznej i położony po prawej stronie mojego głównego ekranu. Poniżej znajdziesz plik konfiguracyjny, który pozwala mi wykorzystać oba ekrany z pełną akceleracją 3D.

Wyświetl pełny plik konfiguracyjny xorg.conf
  1. Section "ServerLayout"
  2. Identifier "TwinView_Dual"
  3. Screen 0 "Screen_TwinView_Dual" 0 0
  4. InputDevice "Keyboard0" "CoreKeyboard"
  5. InputDevice "USB Mouse" "CorePointer"
  6. # InputDevice "LIRC-Mouse"
  7. Option "AIGLX" "false"
  8. Option "AllowEmptyInput" "off"
  9. EndSection
  10.  
  11. Section "ServerFlags"
  12. Option "AllowMouseOpenFail" "true"
  13. # Option "Xinerama" "true"
  14. Option "DefaultServerLayout" "Twinview_Dual"
  15. EndSection
  16.  
  17. Section "Files"
  18. FontPath "/usr/share/fonts/misc"
  19. FontPath "/usr/share/fonts/corefonts"
  20. FontPath "/usr/share/fonts/arkpandora"
  21. FontPath "/usr/share/fonts/artwiz-aleczapka-en"
  22. FontPath "/usr/share/fonts/artwiz"
  23. FontPath "/usr/share/fonts/cheapskatefonts"
  24. FontPath "/usr/share/fonts/dejavu"
  25. FontPath "/usr/share/fonts/efont-unicode"
  26. FontPath "/usr/share/fonts/essays1743"
  27. FontPath "/usr/share/fonts/TTF"
  28. FontPath "/usr/share/fonts/freefonts"
  29. FontPath "/usr/share/fonts/hunkyfonts"
  30. FontPath "/usr/share/fonts/intlfonts"
  31. FontPath "/usr/share/fonts/lfpfonts-fix"
  32. FontPath "/usr/share/fonts/mathematica-fonts"
  33. FontPath "/usr/share/fonts/sgi-fonts"
  34. FontPath "/usr/share/fonts/tengwar-fonts"
  35. FontPath "/usr/share/fonts/terminus"
  36. FontPath "/usr/share/fonts/texcm-ttf"
  37. FontPath "/usr/share/fonts/ttf-gentium"
  38. FontPath "/usr/share/fonts/unifont"
  39. FontPath "/usr/share/fonts/urw-fonts"
  40. FontPath "/usr/share/fonts/vc"
  41. FontPath "/usr/share/fonts/jmk"
  42. FontPath "/usr/share/fonts/Type1"
  43. FontPath "/usr/share/fonts/100dpi"
  44. FontPath "/usr/share/fonts/75dpi"
  45. FontPath "/usr/share/fonts/cyrillic"
  46. FontPath "/usr/share/fonts/default/ghostscript"
  47. FontPath "/usr/share/fonts/ttf-bitstream-vera"
  48. FontPath "/usr/share/fonts/cronyx/100dpi/:unscaled"
  49. FontPath "/usr/share/fonts/cronyx/misc/:unscaled"
  50. FontPath "/usr/share/fonts/cronyx/75dpi/:unscaled"
  51. ModulePath "/usr/lib/xorg/modules"
  52. ModulePath "/usr/lib/opengl/xorg-x11/extensions/"
  53. EndSection
  54.  
  55. Section "Module"
  56. Load "ddc"
  57. Load "vbe"
  58. Load "dbe"
  59. Load "extmod"
  60. SubSection "extmod"
  61. Option "omit xfree86-dga"
  62. EndSubSection
  63. Load "glx"
  64. Load "bitmap"
  65. Load "freetype"
  66. Load "record"
  67. EndSection
  68.  
  69. Section "InputDevice"
  70. Identifier "Keyboard0"
  71. Driver "evdev"
  72. Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-kbd"
  73. Option "CoreKeyboard"
  74. Option "XkbRules" "xorg"
  75. Option "XkbModel" "pc105"
  76. Option "XkbLayout" "pl"
  77. Option "XkbVariant" ",winkeys"
  78. Option "XkbOptions" "eurosign:5,terminate:ctrl_alt_bksp"
  79. EndSection
  80.  
  81. Section "InputDevice"
  82. Identifier "Serial Mouse"
  83. Driver "mouse"
  84. Option "Protocol" "Microsoft"
  85. Option "Device" "/dev/ttyS0"
  86. Option "Emulate3Buttons" "true"
  87. Option "Emulate3Timeout" "70"
  88. Option "SendCoreEvents" "true"
  89. EndSection
  90.  
  91. Section "InputDevice"
  92. Identifier "PS/2 Mouse"
  93. Driver "mouse"
  94. Option "Protocol" "IMPS/2"
  95. Option "Device" "/dev/input/mice"
  96. Option "Emulate3Buttons" "false"
  97. Option "Emulate3Timeout" "70"
  98. Option "SendCoreEvents" "true"
  99. Option "ZAxisMapping" "4 5"
  100. EndSection
  101.  
  102. Section "InputDevice"
  103. Identifier "USB Mouse"
  104. Driver "evdev"
  105. Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse"
  106. # Option "SendCoreEvents" "true"
  107. # Option "Protocol" "IMPS/2"
  108. Option "ZAxisMapping" "4 5"
  109. Option "Buttons" "5"
  110. EndSection
  111.  
  112. Section "InputDevice"
  113. Identifier "LIRC-Mouse"
  114. Driver "mouse"
  115. Option "Device" "/var/run/lirc/lircm"
  116. Option "Protocol" "IntelliMouse"
  117. Option "SendCoreEvents"
  118. Option "Buttons" "5"
  119. Option "ZAxisMapping" "4 5"
  120. EndSection
  121.  
  122. #Modes configuration for TV Sony Bravia 32 KDL32S2030
  123.  
  124. Section "Modes"
  125. Identifier "Modes_SONY"
  126. Mode "WXGA_1360x768" # vfreq 60.015Hz, hfreq 47.712kHz
  127. DotClock 85.500000
  128. HTimings 1360 1424 1536 1792
  129. VTimings 768 771 777 795
  130. Flags "+HSync" "+VSync"
  131. EndMode
  132. Mode "WXGA_1280x768" # vfreq 59.870Hz, hfreq 47.776kHz
  133. DotClock 79.500000
  134. HTimings 1280 1344 1472 1664
  135. VTimings 768 771 778 798
  136. Flags "+HSync" "-VSync"
  137. EndMode
  138. Mode "XGA_1024x768" # vfreq 60Hz, hfreq 48.4kHz
  139. DotClock 65.000000
  140. HTimings 1024 1032 1176 1344
  141. VTimings 768 771 777 806
  142. Flags "+HSync" "-VSync"
  143. EndMode
  144. EndSection
  145.  
  146. #Modes configuration for LCD Samsung Syncmaster 226bw 22 inch
  147.  
  148. # Configuration for Samsung 226BW Primary LCD Monitor
  149.  
  150. Section "Monitor"
  151. Identifier "Samsung_226BW"
  152. VendorName "Samsung"
  153. ModelName "226BW (22inch)"
  154. DisplaySize 473.8 296.1
  155. HorizSync 48
  156. VertRefresh 60
  157. Option "DPMS" "true"
  158. EndSection
  159.  
  160. # Configuration for Philips 107B Primary CRT Monitor
  161.  
  162. Section "Monitor"
  163. Identifier "Philips_107B"
  164. VendorName "Philips"
  165. ModelName "107B (17inch)"
  166. DisplaySize 320 240
  167. HorizSync 30.0 - 69.0
  168. VertRefresh 50.0 - 130.0
  169. Option "DPMS" "true"
  170. EndSection
  171.  
  172. # Configuration for Generic Monitor
  173.  
  174. Section "Monitor"
  175. Identifier "Generic"
  176. VendorName "Unknown"
  177. ModelName "Unknown"
  178. VertRefresh 60
  179. Option "DPMS" "true"
  180. EndSection
  181.  
  182. #Configuration for Sony Bravia 32in Secondary LCD TV/Monitor
  183.  
  184. Section "Monitor"
  185. Identifier "Sony_Bravia_32in"
  186. Option "DPMS" "true"
  187. VendorName "Sony"
  188. ModelName "Bravia 32 inches"
  189. UseModes "Modes_SONY"
  190. #HorizSync 31.5-47.8
  191. #VertRefresh 60
  192. EndSection
  193.  
  194. #Configuration for GForce 8800GTS Graphics TwinView Dual
  195.  
  196. Section "Device"
  197. Identifier "GForce_TwinView_Dual"
  198. Driver "nvidia"
  199. VendorName "ASUS"
  200. BoardName "ASUS Nvidia EN8800GTS"
  201. BusID "PCI:4:0:0"
  202. Option "NoLogo" "false"
  203. # Option "LogoPath" ""
  204. Option "BackingStore" "true"
  205. Option "RenderAccel" "true"
  206. # Option "UBB" "true"
  207. Option "NoFlip" "true"
  208. # Option "Dac8bit" "false"
  209. # Option "Overlay" "false"
  210. # Option "CIOverlay" "false"
  211. # Option "TransparentIndex" "0"
  212. # Option "OverlayDefaulVisual" "false"
  213. # Option "EmulatedOverlaysTimerMS" "0"
  214. # Option "EmulatedOverlaysThreshold" "true"
  215. # Option "EmulatedOverlaysThresholdValue" "5"
  216. Option "RandRRotation" "true"
  217. # Option "Rotate" ""
  218. # Option "AllowDDCCI" "true"
  219. Option "PixmapCacheSize" "1000000"
  220. # Option "AllowSHMPixmaps" "0"
  221. Option "XvmcUsesTextures" "true"
  222. # Option "UseEDID" "true"
  223. Option "SWCursor" "false"
  224. Option "HWCursor" "true"
  225. Option "CursorShadow" "true"
  226. Option "CursorShadowAlpha" "64"
  227. Option "CursorShadowXOffset" "4"
  228. Option "CursorShadowYOffset" "2"
  229. Option "ConnectedMonitor" "DFP-1, CRT-0"
  230. # Option "UseDisplayDevice" "CRT"
  231. Option "UseEdidFreqs" "true"
  232. Option "TwinView" "true"
  233. Option "SecondMonitorHorizSync" "UseEdidFreqs"
  234. Option "SecondMonitorVertRefresh" "UseEdidFreqs"
  235. Option "OnDemandVBlankInterrupts" "true"
  236. Option "MetaModes" "DFP-1: 1680x1050, CRT-0: 1360x768; DFP-1: 1680x1050, CRT-0: null; DFP-1: null, CRT-0: 1360x768"
  237. Option "TwinViewXineramaInfoOrder" "DFP-1, CRT-0"
  238. Option "TwinViewOrientation" "CRT-0 RightOf DFP-1"
  239. # Option "TVStandard" ""
  240. # Option "TVOutFormat" ""
  241. # Option "TVOverScan" ""
  242. # Option "Stereo" ""
  243. # Option "AllowDFPStereo" ""
  244. # Option "ForceStereoFlipping" ""
  245. # Option "XineramaStereoFlipping" ""
  246. # Option "NoBandWidthTest" "false"
  247. # Option "MuiltisampleCompatibility" "true"
  248. # Option "NoPowerConnectorCheck" "false"
  249. # Option "AllowGLXWithCompisite" "false"
  250. Option "AddARGBGLXVisuals" "true"
  251. # Option "DamageEvent" "true"
  252. Option "TripleBuffer" "true"
  253. Option "UseEdidDpi" "true"
  254. Option "UseEvents" "false"
  255. Option "DynamicTwinView" "true"
  256. Option "ConnectToAcpid" "true"
  257. EndSection
  258.  
  259. #Screen Configuration for TwinView_Dual
  260.  
  261. Section "Screen"
  262. Identifier "Screen_TwinView_Dual"
  263. Device "GForce_TwinView_Dual"
  264. Monitor "Samsung_226BW"
  265. DefaultDepth 24
  266. SubSection "Display"
  267. Depth 24
  268. Modes "1680x1050" "1280x1024" "1280x960" "1280x768" "1152x864" "1024x768" "800x600" "640x480"
  269. EndSubSection
  270. EndSection
  271.  
  272. Section "dri"
  273. Mode 0666
  274. EndSection
  275.  
  276. Section "Extensions"
  277. Option "Composite" "Enable"
  278. Option "RENDER" "Enable"
  279. EndSection

Teraz postaram się zwięźle wyjaśnić tą konfigurację. Skupię się na najważniejszych rzeczach.

Pierwszą rzeczą jaką zobaczysz jest sekcja ServerLayout. Ta sekcja wykorzystuje opcje konfiguracyjne zdefiniowane poniżej w pliku konfiguracyjnym. To co jest ważne w tej sekcji to opcja Screen. Możesz być zaszkoczony widząc definicję tylko jednego ekranu. Właśnie tak należy zrobić dla konfiguracji TwinView. Pozycjonowanie drugiego ekranu dla TwinView jest definowane w sekcji Device. Jak pewnie zauważyłeś mam zdefiniowaną konfigurację myszy Lirc. Zakomentowałem tą opcję ponieważ nie jest ona już dla mnie użyteczna. Wolę używać mojego blutoothowego pada do gier wraz z programem QJoyPad, w ten sposób mam zdalne bezprzewodowe urządzenie wskazujące. Dodatkowo wyłączyłem wsparcie dla AIGLX jako, że NVidia posiada swoje własne rozszerzenia do obsługi funkcjonalności pulpitu 3D.

Drugą sekcją mojego pliku jest sekcja ServerFlags. Bardzo ważne jest tutaj aby nie używać natywnego dla Xorg rozszerzenia Xinerama jako, że TwinView NVidii posiada swoją własną implementację, która nie będzie działać jeśli domyślna Xinerama będzie włączona. Właśnie dla tego zakomentowałem opcję Xinerama w moim pliku konfiguracyjnym.

Sekcja Files to miejsce, w którym definiuję położenie moich czcionek. Dwie ostatnie linie tej sekcji są jednakże znaczące. Bez wskazania katalogów z modułami i rozszerzeniami Xorg narzekał na nie możność załadowania modułów dri i dri2, oraz dodatkowo zgłaszał, że nie będzie w stanie wykorzystać libvdpau, która jest technologią akceleracji video NVidia. Po dodaniu tych dwóch linii wszystkie powyższe ostrzeżenia zniknęły.

Sekcja Module ładuje domyślne moduły Xorga. Moduł nazwany glx jest istotny dla akceleracji sterownika NVidia.

Poniżej znajdziesz sekcje InputDevice. Jak widzisz używam evdev, jest to standardowy sterownik dla urządzeń wejściowych. Możesz być zdziwiony tym w jaki sposób wskazuje moje urządzenia myszy i klawiatury. Robię tak dlatego, że węzły /dev/input/event* zmieniają się pomiędzy poszczególnymi restartami komputera, w szczególności jeśli podłączam dodatkowego urządzenia jak na przykład Joysticki.

Ustawienia modów dla telewizora Sony Bravia i definicja monitora Sony Bravia nie jest wykorzystywana w bieżącej konfiguracji, używałem tych konfiguracji poprzednio. Nie kolidują one jednakże z bieżącą konfiguracją wiec zachowałem je na wszelki wypadek. Definicja monitora dla Samsunga 226BW jest wykorzystywana zajrzyj do sekcji Screen.

Teraz dochodzimy do najważniejszej rzeczy sekcji Device. Początkowe linie są standardowe dla własnościowego sterownika NVidia. Pierwszą ważną linią dla konfiguracji dwóch ekranów jest: Option "RandRRotation" "true", ta opcja pozwala mi używać rozszerzenia RandR do konfiguracji ekranów. Wykorzystuję klienta konsolowego xrandr w swoich skryptach więc jest to kluczowa opcja dla mnie. Jako, że używam monitora CRT ważną kwestia jest powiedzenie sterownikowi jakie typy monitorów są podłączone do kary graficznej, opcja Option "ConnectedMonitor" "DFP-1, CRT-0" jest za to odpowiedzialna. Opcja Option "TwinView" "true" zapewnia konfigurację TwinView. Opcja Option "MetaModes" jest opisana jako opcjonalna ale bez podania prawidłowych meta modów dla obu ekranów rozdzielczość i pozycjonowanie ekranów nie działało poprawnie. Jeśli zastanawiasz się dlaczego umieściłem więcej niż jeden meta mod, zrobiłem tak gdyż tylko zdefiniowane tutaj meta mody będą dostępne dla interfejsu konsolowego xrandr. Jako, że chciałbym mieć możliwość zarządzania konfiguracją ekranów z poziomu skryptów, musiałem zdefiniować wszystkie możliwe konfigurację ekranu z jakich chce korzystać. Kolejną ważną opcją jest: Option "TwinViewXineramaInfoOrder" "DFP-1, CRT-0" bez niej TwinView w dziwny sposób zawsze ustawiała mój telewizor CRT-0 Bravia jako główny monitor. Do zdefiniowana pozycjonowania ekranów wykorzystuję opcję Option "TwinViewOrientation" "CRT-0 RightOf DFP-1". Nie polecam ustawiania drugiego ekranu po lewej stronie, gdyż niektóre aplikacje GTK mają problemy z zapamiętywaniem swojej poprawnej pozycji jeśli wyłączasz ekrany w trakcje ich działania. Ostatnią opcją istotną dla konfiguracji TwinView jest opcja: Option "DynamicTwinView" "true", która pozwala na dynamiczną konfiguracją podwójnych ekranów. Nie powinieneś wyłączać opcji Option "AddARGBGLXVisuals" jeśli zamierzasz używać pulpitu 3D.

Pozostałe ustawienia w pliku konfiguracyjnym są standardowe. Znajdziesz w nim sekcje Screen i włączone rozszerzenie Composite wymagane przez menadżery pulpitu 3D.

Dowód, że to działa

Źródła

  • Dokumentacja sterownika NVidia dla Linuxa - dostarczana wraz ze sterownikiem
  • man xorg.conf
  • man Xorg
  • man xranrd