Kubuntu Radeon HD 5850 fglrx dual monitor setup

From Urandom
Jump to: navigation, search

Contents

Basics

Getting something to display is easy, but if you dont want to fire up aticccle every time you want to use 2 monitors, then this might help.

My setup:

OS: Kubuntu 10.04
Video Card: Radeon 5850 PCI-E
2xHD monitors connected to DVI-s 
1xHD TV connected to HDMI

I use the 2 monitors all the time, so i wanted them to be active when the system starts. The TV is turned off by default(since it cant run 3 displays with 1080p.

Here is my Xorg configuration

Section "ServerLayout"
        Identifier     "aticonfig Layout"
        Screen      0  "aticonfig-Screen[0]-0" 0 0
EndSection

Section "Files"
EndSection

Section "Module"
        Load  "dbe"
EndSection

Section "ServerFlags"
        Option      "Xinerama" "off"
EndSection

Section "Monitor"
        Identifier   "aticonfig-Monitor[0]-0"
        Option      "VendorName" "ATI Proprietary Driver"
        Option      "ModelName" "Generic Autodetecting Monitor"
        Option      "DPMS" "true"
EndSection

Section "Monitor"
        Identifier   "0-DFP3"
        Option      "VendorName" "ATI Proprietary Driver"
        Option      "ModelName" "Generic Autodetecting Monitor"
        Option      "DPMS" "true"
        Option      "TargetRefresh" "60"
        Option      "Position" "0 0"
        Option      "Rotate" "normal"
        Option      "Disable" "false"
        Option      "PreferredMode" "1920x1080"
EndSection

Section "Monitor"
        Identifier   "0-DFP4"                                                                                                                                                
        Option      "VendorName" "ATI Proprietary Driver"                                                                                                                    
        Option      "ModelName" "Generic Autodetecting Monitor"                                                                                                              
        Option      "DPMS" "true"                                                                                                                                            
        Option      "TargetRefresh" "60"                                                                                                                                     
        Option      "Position" "1920 0"                                                                                                                                      
        Option      "Rotate" "normal"                                                                                                                                        
        Option      "Disable" "false"
        Option      "PreferredMode" "1920x1080"
EndSection

Section "Monitor"
        Identifier   "0-DFP2"
        Option      "VendorName" "ATI Proprietary Driver"
        Option      "ModelName" "Generic Autodetecting Monitor"
        Option      "DPMS" "true"
        Option      "TargetRefresh" "60"
        Option      "Position" "0 0"
        Option      "Rotate" "normal"
        Option      "Disable" "true"
EndSection

Section "Device"
        Identifier  "aticonfig-Device[0]-0"
        Driver      "fglrx"
        Option      "OverlayOnCRTC2" "1"
        Option      "Monitor-DFP3" "0-DFP3"
        Option      "Monitor-DFP4" "0-DFP4"
        Option      "Monitor-DFP2" "0-DFP2"
        BusID       "PCI:1:0:0"
EndSection



Section "Screen"
        Identifier "aticonfig-Screen[0]-0"
        Device     "aticonfig-Device[0]-0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Virtual   3840 3840
                Depth     24
        EndSubSection
EndSection

Script

two monitors switch to one monitor and tv(HDMI)

#!/bin/bash
xrandr --output DFP4 --off --size 3840x1080
xrandr --output DFP3 --auto --rotate normal --pos 0x0 --output DFP2  --auto --rotate normal --pos 1920x0 --right-of DFP3

one monitor and tv(HDMI) switch to two monitors

#!/bin/bash
xrandr --output DFP2 --off --size 3840x1080
xrandr --output DFP3 --auto --rotate normal --pos 0x0 --output DFP4  --auto --rotate normal --right-of DFP3


Switch pulse audio default sink and all running source to HDMI

#remember to replace alsa_output.pci-0000_01_00.1.hdmi-stereo with whatever you have
sink=`pacmd list-sinks | grep -B 1 alsa_output.pci-0000_01_00.1.hdmi-stereo | grep index | cut -d":" -f2 | cut -d" " -f2`
pacmd set-default-sink $sink 
#this part is to switch also the active sources over to the new sink
for si in `pacmd list-sink-inputs | grep index | cut -d":" -f2 | cut -d" " -f2`
do
pacmd move-sink-input $si $sink
done



Switch pulse audio default sink and all running sources to internal soundcard

#remember to replace alsa_output.pci-0000_00_14.2.iec958-stereo with whatever you have
sink=`pacmd list-sinks | grep -B 1 alsa_output.pci-0000_00_14.2.iec958-stereo | grep index | cut -d":" -f2 | cut -d" " -f2`
pacmd set-default-sink $sink 
#this part is to switch also the active sources over to the new sink
for si in `pacmd list-sink-inputs | grep index | cut -d":" -f2 | cut -d" " -f2`
do
pacmd move-sink-input $si $sink
done
Personal tools