Nvidia Dual Screen
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.
Section "ServerLayout" Identifier "TwinView_Dual" Screen 0 "Screen_TwinView_Dual" 0 0 InputDevice "Keyboard0" "CoreKeyboard" InputDevice "USB Mouse" "CorePointer" # InputDevice "LIRC-Mouse" Option "AIGLX" "false" Option "AllowEmptyInput" "off" EndSection Section "ServerFlags" Option "AllowMouseOpenFail" "true" # Option "Xinerama" "true" Option "DefaultServerLayout" "Twinview_Dual" EndSection Section "Files" FontPath "/usr/share/fonts/misc" FontPath "/usr/share/fonts/corefonts" FontPath "/usr/share/fonts/arkpandora" FontPath "/usr/share/fonts/artwiz-aleczapka-en" FontPath "/usr/share/fonts/artwiz" FontPath "/usr/share/fonts/cheapskatefonts" FontPath "/usr/share/fonts/dejavu" FontPath "/usr/share/fonts/efont-unicode" FontPath "/usr/share/fonts/essays1743" FontPath "/usr/share/fonts/TTF" FontPath "/usr/share/fonts/freefonts" FontPath "/usr/share/fonts/hunkyfonts" FontPath "/usr/share/fonts/intlfonts" FontPath "/usr/share/fonts/lfpfonts-fix" FontPath "/usr/share/fonts/mathematica-fonts" FontPath "/usr/share/fonts/sgi-fonts" FontPath "/usr/share/fonts/tengwar-fonts" FontPath "/usr/share/fonts/terminus" FontPath "/usr/share/fonts/texcm-ttf" FontPath "/usr/share/fonts/ttf-gentium" FontPath "/usr/share/fonts/unifont" FontPath "/usr/share/fonts/urw-fonts" FontPath "/usr/share/fonts/vc" FontPath "/usr/share/fonts/jmk" FontPath "/usr/share/fonts/Type1" FontPath "/usr/share/fonts/100dpi" FontPath "/usr/share/fonts/75dpi" FontPath "/usr/share/fonts/cyrillic" FontPath "/usr/share/fonts/default/ghostscript" FontPath "/usr/share/fonts/ttf-bitstream-vera" FontPath "/usr/share/fonts/cronyx/100dpi/:unscaled" FontPath "/usr/share/fonts/cronyx/misc/:unscaled" FontPath "/usr/share/fonts/cronyx/75dpi/:unscaled" ModulePath "/usr/lib/xorg/modules" ModulePath "/usr/lib/opengl/xorg-x11/extensions/" EndSection Section "Module" Load "ddc" Load "vbe" Load "dbe" Load "extmod" SubSection "extmod" Option "omit xfree86-dga" EndSubSection Load "glx" Load "bitmap" Load "freetype" Load "record" EndSection Section "InputDevice" Identifier "Keyboard0" Driver "evdev" Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-kbd" Option "CoreKeyboard" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "pl" Option "XkbVariant" ",winkeys" Option "XkbOptions" "eurosign:5,terminate:ctrl_alt_bksp" EndSection Section "InputDevice" Identifier "Serial Mouse" Driver "mouse" Option "Protocol" "Microsoft" Option "Device" "/dev/ttyS0" Option "Emulate3Buttons" "true" Option "Emulate3Timeout" "70" Option "SendCoreEvents" "true" EndSection Section "InputDevice" Identifier "PS/2 Mouse" Driver "mouse" Option "Protocol" "IMPS/2" Option "Device" "/dev/input/mice" Option "Emulate3Buttons" "false" Option "Emulate3Timeout" "70" Option "SendCoreEvents" "true" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" Identifier "USB Mouse" Driver "evdev" Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse" # Option "SendCoreEvents" "true" # Option "Protocol" "IMPS/2" Option "ZAxisMapping" "4 5" Option "Buttons" "5" EndSection Section "InputDevice" Identifier "LIRC-Mouse" Driver "mouse" Option "Device" "/var/run/lirc/lircm" Option "Protocol" "IntelliMouse" Option "SendCoreEvents" Option "Buttons" "5" Option "ZAxisMapping" "4 5" EndSection #Modes configuration for TV Sony Bravia 32 KDL32S2030 Section "Modes" Identifier "Modes_SONY" Mode "WXGA_1360x768" # vfreq 60.015Hz, hfreq 47.712kHz DotClock 85.500000 HTimings 1360 1424 1536 1792 VTimings 768 771 777 795 Flags "+HSync" "+VSync" EndMode Mode "WXGA_1280x768" # vfreq 59.870Hz, hfreq 47.776kHz DotClock 79.500000 HTimings 1280 1344 1472 1664 VTimings 768 771 778 798 Flags "+HSync" "-VSync" EndMode Mode "XGA_1024x768" # vfreq 60Hz, hfreq 48.4kHz DotClock 65.000000 HTimings 1024 1032 1176 1344 VTimings 768 771 777 806 Flags "+HSync" "-VSync" EndMode EndSection #Modes configuration for LCD Samsung Syncmaster 226bw 22 inch # Configuration for Samsung 226BW Primary LCD Monitor Section "Monitor" Identifier "Samsung_226BW" VendorName "Samsung" ModelName "226BW (22inch)" DisplaySize 473.8 296.1 HorizSync 48 VertRefresh 60 Option "DPMS" "true" EndSection # Configuration for Philips 107B Primary CRT Monitor Section "Monitor" Identifier "Philips_107B" VendorName "Philips" ModelName "107B (17inch)" DisplaySize 320 240 HorizSync 30.0 - 69.0 VertRefresh 50.0 - 130.0 Option "DPMS" "true" EndSection # Configuration for Generic Monitor Section "Monitor" Identifier "Generic" VendorName "Unknown" ModelName "Unknown" VertRefresh 60 Option "DPMS" "true" EndSection #Configuration for Sony Bravia 32in Secondary LCD TV/Monitor Section "Monitor" Identifier "Sony_Bravia_32in" Option "DPMS" "true" VendorName "Sony" ModelName "Bravia 32 inches" UseModes "Modes_SONY" #HorizSync 31.5-47.8 #VertRefresh 60 EndSection #Configuration for GForce 8800GTS Graphics TwinView Dual Section "Device" Identifier "GForce_TwinView_Dual" Driver "nvidia" VendorName "ASUS" BoardName "ASUS Nvidia EN8800GTS" BusID "PCI:4:0:0" Option "NoLogo" "false" # Option "LogoPath" "" Option "BackingStore" "true" Option "RenderAccel" "true" # Option "UBB" "true" Option "NoFlip" "true" # Option "Dac8bit" "false" # Option "Overlay" "false" # Option "CIOverlay" "false" # Option "TransparentIndex" "0" # Option "OverlayDefaulVisual" "false" # Option "EmulatedOverlaysTimerMS" "0" # Option "EmulatedOverlaysThreshold" "true" # Option "EmulatedOverlaysThresholdValue" "5" Option "RandRRotation" "true" # Option "Rotate" "" # Option "AllowDDCCI" "true" Option "PixmapCacheSize" "1000000" # Option "AllowSHMPixmaps" "0" Option "XvmcUsesTextures" "true" # Option "UseEDID" "true" Option "SWCursor" "false" Option "HWCursor" "true" Option "CursorShadow" "true" Option "CursorShadowAlpha" "64" Option "CursorShadowXOffset" "4" Option "CursorShadowYOffset" "2" Option "ConnectedMonitor" "DFP-1, CRT-0" # Option "UseDisplayDevice" "CRT" Option "UseEdidFreqs" "true" Option "TwinView" "true" Option "SecondMonitorHorizSync" "UseEdidFreqs" Option "SecondMonitorVertRefresh" "UseEdidFreqs" Option "OnDemandVBlankInterrupts" "true" Option "MetaModes" "DFP-1: 1680x1050, CRT-0: 1360x768; DFP-1: 1680x1050, CRT-0: null; DFP-1: null, CRT-0: 1360x768" Option "TwinViewXineramaInfoOrder" "DFP-1, CRT-0" Option "TwinViewOrientation" "CRT-0 RightOf DFP-1" # Option "TVStandard" "" # Option "TVOutFormat" "" # Option "TVOverScan" "" # Option "Stereo" "" # Option "AllowDFPStereo" "" # Option "ForceStereoFlipping" "" # Option "XineramaStereoFlipping" "" # Option "NoBandWidthTest" "false" # Option "MuiltisampleCompatibility" "true" # Option "NoPowerConnectorCheck" "false" # Option "AllowGLXWithCompisite" "false" Option "AddARGBGLXVisuals" "true" # Option "DamageEvent" "true" Option "TripleBuffer" "true" Option "UseEdidDpi" "true" Option "UseEvents" "false" Option "DynamicTwinView" "true" Option "ConnectToAcpid" "true" EndSection #Screen Configuration for TwinView_Dual Section "Screen" Identifier "Screen_TwinView_Dual" Device "GForce_TwinView_Dual" Monitor "Samsung_226BW" DefaultDepth 24 SubSection "Display" Depth 24 Modes "1680x1050" "1280x1024" "1280x960" "1280x768" "1152x864" "1024x768" "800x600" "640x480" EndSubSection EndSection Section "dri" Mode 0666 EndSection Section "Extensions" Option "Composite" "Enable" Option "RENDER" "Enable" 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
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.
Section "ServerLayout" Identifier "TwinView_Dual" Screen 0 "Screen_TwinView_Dual" 0 0 InputDevice "Keyboard0" "CoreKeyboard" InputDevice "USB Mouse" "CorePointer" # InputDevice "LIRC-Mouse" Option "AIGLX" "false" Option "AllowEmptyInput" "off" EndSection Section "ServerFlags" Option "AllowMouseOpenFail" "true" # Option "Xinerama" "true" Option "DefaultServerLayout" "Twinview_Dual" EndSection Section "Files" FontPath "/usr/share/fonts/misc" FontPath "/usr/share/fonts/corefonts" FontPath "/usr/share/fonts/arkpandora" FontPath "/usr/share/fonts/artwiz-aleczapka-en" FontPath "/usr/share/fonts/artwiz" FontPath "/usr/share/fonts/cheapskatefonts" FontPath "/usr/share/fonts/dejavu" FontPath "/usr/share/fonts/efont-unicode" FontPath "/usr/share/fonts/essays1743" FontPath "/usr/share/fonts/TTF" FontPath "/usr/share/fonts/freefonts" FontPath "/usr/share/fonts/hunkyfonts" FontPath "/usr/share/fonts/intlfonts" FontPath "/usr/share/fonts/lfpfonts-fix" FontPath "/usr/share/fonts/mathematica-fonts" FontPath "/usr/share/fonts/sgi-fonts" FontPath "/usr/share/fonts/tengwar-fonts" FontPath "/usr/share/fonts/terminus" FontPath "/usr/share/fonts/texcm-ttf" FontPath "/usr/share/fonts/ttf-gentium" FontPath "/usr/share/fonts/unifont" FontPath "/usr/share/fonts/urw-fonts" FontPath "/usr/share/fonts/vc" FontPath "/usr/share/fonts/jmk" FontPath "/usr/share/fonts/Type1" FontPath "/usr/share/fonts/100dpi" FontPath "/usr/share/fonts/75dpi" FontPath "/usr/share/fonts/cyrillic" FontPath "/usr/share/fonts/default/ghostscript" FontPath "/usr/share/fonts/ttf-bitstream-vera" FontPath "/usr/share/fonts/cronyx/100dpi/:unscaled" FontPath "/usr/share/fonts/cronyx/misc/:unscaled" FontPath "/usr/share/fonts/cronyx/75dpi/:unscaled" ModulePath "/usr/lib/xorg/modules" ModulePath "/usr/lib/opengl/xorg-x11/extensions/" EndSection Section "Module" Load "ddc" Load "vbe" Load "dbe" Load "extmod" SubSection "extmod" Option "omit xfree86-dga" EndSubSection Load "glx" Load "bitmap" Load "freetype" Load "record" EndSection Section "InputDevice" Identifier "Keyboard0" Driver "evdev" Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-kbd" Option "CoreKeyboard" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "pl" Option "XkbVariant" ",winkeys" Option "XkbOptions" "eurosign:5,terminate:ctrl_alt_bksp" EndSection Section "InputDevice" Identifier "Serial Mouse" Driver "mouse" Option "Protocol" "Microsoft" Option "Device" "/dev/ttyS0" Option "Emulate3Buttons" "true" Option "Emulate3Timeout" "70" Option "SendCoreEvents" "true" EndSection Section "InputDevice" Identifier "PS/2 Mouse" Driver "mouse" Option "Protocol" "IMPS/2" Option "Device" "/dev/input/mice" Option "Emulate3Buttons" "false" Option "Emulate3Timeout" "70" Option "SendCoreEvents" "true" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" Identifier "USB Mouse" Driver "evdev" Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse" # Option "SendCoreEvents" "true" # Option "Protocol" "IMPS/2" Option "ZAxisMapping" "4 5" Option "Buttons" "5" EndSection Section "InputDevice" Identifier "LIRC-Mouse" Driver "mouse" Option "Device" "/var/run/lirc/lircm" Option "Protocol" "IntelliMouse" Option "SendCoreEvents" Option "Buttons" "5" Option "ZAxisMapping" "4 5" EndSection #Modes configuration for TV Sony Bravia 32 KDL32S2030 Section "Modes" Identifier "Modes_SONY" Mode "WXGA_1360x768" # vfreq 60.015Hz, hfreq 47.712kHz DotClock 85.500000 HTimings 1360 1424 1536 1792 VTimings 768 771 777 795 Flags "+HSync" "+VSync" EndMode Mode "WXGA_1280x768" # vfreq 59.870Hz, hfreq 47.776kHz DotClock 79.500000 HTimings 1280 1344 1472 1664 VTimings 768 771 778 798 Flags "+HSync" "-VSync" EndMode Mode "XGA_1024x768" # vfreq 60Hz, hfreq 48.4kHz DotClock 65.000000 HTimings 1024 1032 1176 1344 VTimings 768 771 777 806 Flags "+HSync" "-VSync" EndMode EndSection #Modes configuration for LCD Samsung Syncmaster 226bw 22 inch # Configuration for Samsung 226BW Primary LCD Monitor Section "Monitor" Identifier "Samsung_226BW" VendorName "Samsung" ModelName "226BW (22inch)" DisplaySize 473.8 296.1 HorizSync 48 VertRefresh 60 Option "DPMS" "true" EndSection # Configuration for Philips 107B Primary CRT Monitor Section "Monitor" Identifier "Philips_107B" VendorName "Philips" ModelName "107B (17inch)" DisplaySize 320 240 HorizSync 30.0 - 69.0 VertRefresh 50.0 - 130.0 Option "DPMS" "true" EndSection # Configuration for Generic Monitor Section "Monitor" Identifier "Generic" VendorName "Unknown" ModelName "Unknown" VertRefresh 60 Option "DPMS" "true" EndSection #Configuration for Sony Bravia 32in Secondary LCD TV/Monitor Section "Monitor" Identifier "Sony_Bravia_32in" Option "DPMS" "true" VendorName "Sony" ModelName "Bravia 32 inches" UseModes "Modes_SONY" #HorizSync 31.5-47.8 #VertRefresh 60 EndSection #Configuration for GForce 8800GTS Graphics TwinView Dual Section "Device" Identifier "GForce_TwinView_Dual" Driver "nvidia" VendorName "ASUS" BoardName "ASUS Nvidia EN8800GTS" BusID "PCI:4:0:0" Option "NoLogo" "false" # Option "LogoPath" "" Option "BackingStore" "true" Option "RenderAccel" "true" # Option "UBB" "true" Option "NoFlip" "true" # Option "Dac8bit" "false" # Option "Overlay" "false" # Option "CIOverlay" "false" # Option "TransparentIndex" "0" # Option "OverlayDefaulVisual" "false" # Option "EmulatedOverlaysTimerMS" "0" # Option "EmulatedOverlaysThreshold" "true" # Option "EmulatedOverlaysThresholdValue" "5" Option "RandRRotation" "true" # Option "Rotate" "" # Option "AllowDDCCI" "true" Option "PixmapCacheSize" "1000000" # Option "AllowSHMPixmaps" "0" Option "XvmcUsesTextures" "true" # Option "UseEDID" "true" Option "SWCursor" "false" Option "HWCursor" "true" Option "CursorShadow" "true" Option "CursorShadowAlpha" "64" Option "CursorShadowXOffset" "4" Option "CursorShadowYOffset" "2" Option "ConnectedMonitor" "DFP-1, CRT-0" # Option "UseDisplayDevice" "CRT" Option "UseEdidFreqs" "true" Option "TwinView" "true" Option "SecondMonitorHorizSync" "UseEdidFreqs" Option "SecondMonitorVertRefresh" "UseEdidFreqs" Option "OnDemandVBlankInterrupts" "true" Option "MetaModes" "DFP-1: 1680x1050, CRT-0: 1360x768; DFP-1: 1680x1050, CRT-0: null; DFP-1: null, CRT-0: 1360x768" Option "TwinViewXineramaInfoOrder" "DFP-1, CRT-0" Option "TwinViewOrientation" "CRT-0 RightOf DFP-1" # Option "TVStandard" "" # Option "TVOutFormat" "" # Option "TVOverScan" "" # Option "Stereo" "" # Option "AllowDFPStereo" "" # Option "ForceStereoFlipping" "" # Option "XineramaStereoFlipping" "" # Option "NoBandWidthTest" "false" # Option "MuiltisampleCompatibility" "true" # Option "NoPowerConnectorCheck" "false" # Option "AllowGLXWithCompisite" "false" Option "AddARGBGLXVisuals" "true" # Option "DamageEvent" "true" Option "TripleBuffer" "true" Option "UseEdidDpi" "true" Option "UseEvents" "false" Option "DynamicTwinView" "true" Option "ConnectToAcpid" "true" EndSection #Screen Configuration for TwinView_Dual Section "Screen" Identifier "Screen_TwinView_Dual" Device "GForce_TwinView_Dual" Monitor "Samsung_226BW" DefaultDepth 24 SubSection "Display" Depth 24 Modes "1680x1050" "1280x1024" "1280x960" "1280x768" "1152x864" "1024x768" "800x600" "640x480" EndSubSection EndSection Section "dri" Mode 0666 EndSection Section "Extensions" Option "Composite" "Enable" Option "RENDER" "Enable" 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
Here you can find screenshots proving that above configuration is acting as expected.
If larger picture is still to small for you click it to enlarge it.