You are not logged in.

#1 2007-06-25 19:59:15

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Chosing a default (virtual) resolution in xorg.conf

This seems like one of those situations where I need to do something so simple that I'm getting embarrassed when I can't figure it out...:|

I'm trying to add the resolution "1280x1024" to my xorg.conf, but still have xorg starting with a default resolution of "1024x768".

This is my Display section:

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        DefaultColorDepth 24
        Subsection "Display"
                Depth 24
                Modes "1024x768" "1280x1024"
        EndSubSection
EndSection

Since "1024x768" is specified first, it should be the default resolution, right?
Everything seems ok, I can change resolution with xrandr, and I can manually get the "1024x768" and "1280x1024" resolutions just the way I want.

And it starts with the resolution of "1024x768" pixels.:/ The problem is, it creates a larger screen (probably "1280x1024"), which the display can be "moved" around in ...:( (by moving the cursor against a side of the shown part of the screen - It's just like when you press 'Ctrl'+'+' to zoom)

When I put the resolutions in the Modes array in the opposite order, I do not have this problem (which I else have to fix manually with xrandr), but "1280x1024" will be the default resolution on start.

I've tried other ways to specify resolution, but they all seem to give the same result.

This is the output from xrandr without the "1280x1024" option in the list:

 SZ:    Pixels          Physical       Refresh
*0   1024 x 768    ( 333mm x 250mm )  *50  
 1    800 x 600    ( 260mm x 195mm )   51  
 2    640 x 480    ( 208mm x 156mm )   52  
Current rotation - normal
Current reflection - none
Rotations possible - normal 
Reflections possible - none

And this is the output when I have added the higher resolution to the list:

 SZ:    Pixels          Physical       Refresh
 0   1024 x 768    ( 333mm x 250mm )   50  
 1   1280 x 1024   ( 416mm x 333mm )   51  
 2   1280 x 960    ( 416mm x 312mm )   52  
 3   1280 x 800    ( 416mm x 260mm )   53  
 4   1280 x 768    ( 416mm x 250mm )   54  
 5   1280 x 720    ( 416mm x 234mm )   55  
 6   1152 x 864    ( 375mm x 281mm )   56  
 7    800 x 600    ( 260mm x 195mm )   57  
 8    640 x 480    ( 208mm x 156mm )   58  
*9   1280 x 1024   ( 417mm x 333mm )  *50  
Current rotation - normal
Current reflection - none
Rotations possible - normal 
Reflections possible - none

(I simply want it to chose SZ 0 by default)
Except that I'm using the nvidia drivers, there's nothing special in my xorg.conf (I have separate screens for my display and tv, but that's pretty much everything that makes it different from a standard setup), but I will post it (and other config files) if you think it could be helpful.

Last edited by 1311219 (2007-06-29 10:54:24)

Offline

#2 2007-06-25 21:52:25

rayjgu3
Member
From: Chicago IL usa
Registered: 2004-07-04
Posts: 695

Re: Chosing a default (virtual) resolution in xorg.conf

Code:
Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        DefaultColorDepth 24
        Subsection "Display"
                Depth 24
                Modes "1024x768" "1280x1024"
        EndSubSection
EndSection

change to

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        DefaultColorDepth 24
        Subsection "Display"
                Depth 24
                Modes  "1280x1024" "1024x768"
        EndSubSection
EndSection

the first mode is default has been my experience big_smile

Offline

#3 2007-06-25 21:58:24

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: Chosing a default (virtual) resolution in xorg.conf

Hi
I don't think you can change that much.
What happens is that the virtual screen size has to be calculated for the higher resolution which will be available.
Here the virtual screen size will be
1280 x 1024   ( 417mm x 333mm )

And if you choose 1024 x 768 as default resolution, the virtual screen size stays the same as for 1280 x 1024, and the 1024 x 768 screen is centered in the 1280 x 1024 ( 417mm x 333mm ) virtual screen.

You can only change the position of the 1024 x 768 screen in the 1280 x 1024 virtual screen, using
ViewPort  x0 y0

For example to put the default screen at the upper left corner of the virtual screen :
        Subsection "Display"
                Depth 24
                ViewPort  0 0
                Modes "1024x768" "1280x1024"
        EndSubSection

You have also the entry :
Virtual  xdim ydim
to force a virtual screen size.
But if you choose a smaller virtual screen size, the 1280 x 1024 resolution will not be available any more.

see 'man xorg.conf' for more details.

I hope that this will be helpful to you.

Offline

#4 2007-06-26 02:36:15

Pudge
Arch Linux f@h Team Member
Registered: 2006-01-23
Posts: 300

Re: Chosing a default (virtual) resolution in xorg.conf

If you are using the proprietary Nvidia drivers, try adding this to your xorg.conf

Section "ServerFlags"
        Option "Xinerama" "0"
EndSection

I added this section right after the "Module" section.  Then add the line

Option     "metamodes" "1400x1050_60 +0+0"

to the "Screen" section as such

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        DefaultDepth  24
        Option     "metamodes" "1400x1050_60 +0+0"
EndSection

The "metamodes" option allows you to specify your screen resolution and refresh rate.  In the above example, resolution of 1400X1050 and refresh rate of 60 Hz which are the native settings for my LCD.  With metamodes it comes up properly every time in Gnome.

I THINK you can also use the following

Option     "metamodes" "auto +0+0"

to have the Nvidia driver determined the appropriate resolution and refresh rate, but I wont guarantee it.

Bear in mind, if you ever go back to the "nv" driver instead of the "nvidia" driver, you may have to remove the above 2 additions for nv to work properly again.

Hope this helps.

Pudge

Last edited by Pudge (2007-06-26 02:51:46)

Offline

#5 2007-06-26 19:21:06

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Chosing a default (virtual) resolution in xorg.conf

Thanks for the replies.:)

rayjgu3:

That would solve all problems, except that I want the "1024x768" to be default (and just have "1280x1024" as an option in xrandr)...:(

berbae:

That seems to describe everything exactly, but I want to be able to have the "1024x768" resolution for the (real and virtual) display by default (xorg start) and still be able to chose the higher ("1280x1024") resolution when needed.:/

Pudge:

I don't think I'm using xinerama (since I have no real use for it)...

I have tried meta modes to, but they gave the same result when trying to specify multiple options, but I might have to try it some more, but will it be able to chose a default virtual and real resolution, and still allow the real and virtual resolution to be changed to higher values?

What I want is just like if I were to have the 1280x1024 resolution by default, and then switch to "1024x768" using xrandr (and thus get the same resolution for both the real and virtual screen).

Offline

#6 2007-06-26 21:55:42

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: Chosing a default (virtual) resolution in xorg.conf

I'm not sure I understand clearly what you see on your screen :
1) with

      Subsection "Display"
                Depth 24
                Modes "1024x768" "1280x1024"
        EndSubSection

you say "The problem is, it creates a larger screen (probably "1280x1024"), which the display can be "moved" around in ..."
Does that mean that the 1024x768 screen doesn't fit in the screen and is magnified outside the edges of the screen ?
2) with

      Subsection "Display"
                Depth 24
                Modes "1280x1024" "1024x768"
        EndSubSection

you say "What I want is just like if I were to have the 1280x1024 resolution by default, and then switch to "1024x768" using xrandr (and thus get the same resolution for both the real and virtual screen)."
Does that mean that, in this case, the 1024x768 screen fits in the screen when you switch to that resolution ? and that nothing happens  "by moving the cursor against a side of the shown part of the screen" ?

In each case above, can you tell the result of that command :
grep -e Virtual -e DPI /var/log/Xorg.0.log

Can you also post the entire xorg.conf file ?

Last edited by berbae (2007-06-26 22:05:10)

Offline

#7 2007-06-27 18:42:52

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Chosing a default (virtual) resolution in xorg.conf

What I want is the real and virtual resolution of the screen to be "1024x768" pixels on xorg start, but still be able to switch to a resolution of "1280x1024" pixels (both real and virtual) using xrandr (but I will not need that resolution so often, and thus, I want the lower one as default).

Does that mean that, in this case, the 1024x768 screen fits in the screen when you switch to that resolution ?

If I switch to the alternative 0 in the list from xrandr (the last list in my first post), both the real and virtual resolution gets 1024x768 pixels (but the standard is alternative 9, which makes the real resolution 1024x768 and the virtual resolution 1280x1024), and I want that to be default when I start xorg (but if I try to change the order of the Modes, I do get the resolution of 1024x168 pixels on the real screen, but the virtual resolution is 1280x1024 pixels, so the screen can only show a small area of the virtual screen - the alternative 9 in the list from xrandr).


And here's my xorg.conf:

Section "ServerLayout"
        Identifier     "Xorg Configured"
            Screen  0  "Screen0"
            Screen  1  "Screen_tv"
        InputDevice    "Keyboard0" "CoreKeyboard"
        InputDevice    "PS/2 Mouse" "CorePointer"

        Option "StandbyTime" "8"
        Option "SuspendTime" "8"
        Option "OffTime"     "8"
EndSection

Section "ServerFlags"
        Option "AllowMouseOpenFail"  "true"

EndSection

Section "Files"
        RgbPath      "/usr/share/X11/rgb"
        ModulePath   "/usr/lib/xorg/modules"
        FontPath     "/usr/share/fonts/misc:unscaled"
        FontPath     "/usr/share/fonts/misc"
        FontPath     "/usr/share/fonts/75dpi:unscaled"
        FontPath     "/usr/share/fonts/75dpi"
        FontPath     "/usr/share/fonts/100dpi:unscaled"
        FontPath     "/usr/share/fonts/100dpi"
#       FontPath     "/usr/share/fonts/PEX"
# Additional fonts: Locale, Gimp, TTF...
        FontPath     "/usr/share/fonts/cyrillic"
#       FontPath     "/usr/share/lib/X11/fonts/latin2/75dpi"
#       FontPath     "/usr/share/lib/X11/fonts/latin2/100dpi"
# True type and type1 fonts are also handled via xftlib, see /etc/X11/XftConfig!
        FontPath     "/usr/share/fonts/Type1"
EndSection

Section "Module"
#       Load  "ddc"  # ddc probing of monitor
        Load  "dbe"
#       Load  "dri"
        Load  "extmod"
        Load  "glx"
#       Load  "bitmap" # bitmap-fonts
#       Load  "type1"
        Load  "freetype"
#       Load  "record"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "keyboard"
        Option      "CoreKeyboard"
        Option "XkbRules" "xorg"
        Option "XkbModel" "pc105"
        Option "XkbLayout" "se"
        Option "XkbVariant" ""
EndSection

Section "InputDevice"
        Identifier  "PS/2 Mouse"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option          "ZAxisMapping"          "4 5"
        Option      "Device" "/dev/psaux"
        Option      "Emulate3Buttons" "false"
        Option      "Emulate3Timeout" "70"
        Option      "SendCoreEvents"  "true"
EndSection

Section "Monitor"
        Identifier "Monitor0"
        Option "DPMS" "true"
        HorizSync    31.0 - 80.0 
        VertRefresh  56.0 - 76.0
EndSection

# Auto-generated by Archie mkxcfg

Section "Device"
        Screen      0
        Identifier  "Card0"
        Driver      "nvidia"
        VendorName  "All"
        BoardName   "All"
        BusID       "PCI:1:0:0"
        Option      "NoLogo" "True"
        Option      "DPI"  "78 x 78"
#       Option "TwinView"                  "true"
#       Option "SecondMonitorHorizSync"    "30-50"
#       Option "SecondMonitorVertRefresh"  "60"
#       Option "TwinViewOrientation"       "Clone"
#       Option "TVOutFormat"               "SVIDEO"
#       Option "TVStandard"                "PAL-B"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        DefaultColorDepth 24
        Subsection "Display"
                Depth 24
                Modes "1024x768" "1280x1024"
        EndSubSection
EndSection

#tvout

Section "Device"
        Screen      1
        Identifier  "Card_tv"
        Driver      "nvidia"
        Option      "TVOutFormat" "SVIDEO"
        Option      "TVStandard"  "PAL-B"
        Option      "TVOverscan"  "0.6"
        Option      "ConnectedMonitor" "TV"
        BusID       "PCI:1:0:0"
EndSection

Section "Monitor"
        Identifier  "tv"
        HorizSync   30-50
        VertRefresh 60
EndSection

Section "Screen"
        Identifier   "Screen_tv"
        Device       "Card_tv"
        Monitor      "tv"
        DefaultDepth 24
        Subsection "Display"
                Depth 24
                Modes "1024x768"
        EndSubSection
EndSection

Last edited by 1311219 (2007-06-27 18:44:03)

Offline

#8 2007-06-27 22:35:24

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: Chosing a default (virtual) resolution in xorg.conf

I have understood what you want, that is not the problem.
But I still can't figure out clearly the answers to the question I asked you.
So I write them again.

1) when the X server is launched with :

      Subsection "Display"
                Depth 24
                Modes "1024x768" "1280x1024"
        EndSubSection

The 1024x768 screen doesn't fit in the screen and is magnified outside the edges of the screen ?
You have to move the cursor against the sides of the screen to see what is missing ?
The 1280x1024 screen fits perfectly in the screen ?
Can you answer by yes or no to these questions please ?

And give in this case the result of  :
grep -e Virtual -e DPI /var/log/Xorg.0.log

2) when the X server is launched with :

      Subsection "Display"
                Depth 24
                Modes "1280x1024" "1024x768"
        EndSubSection

The 1280x1024 screen fits perfectly in the screen ?
The 1024x768 screen fits also perfectly in the screen when you switch to that resolution ?
In either cases nothing happens  when moving the cursor against the sides of the screen ?
Can you answer by yes or no to these questions ?

And give in this case the result of  :
grep -e Virtual -e DPI /var/log/Xorg.0.log

Please can you give clear answers for each of the cases above ?
I'm sorry if this is annoying but I think it will be easier to grasp what you see on the screen.

In your xorg.conf file you have :

Section "Device"
        ...
       Option      "DPI"  "78 x 78"

Where did you get these values ?
Because with that option, you force the values, instead of letting the nvidia driver calculate itself.
It may not be related to your problem, but it would be good to clarify all the same.

Offline

#9 2007-06-29 10:42:25

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Chosing a default (virtual) resolution in xorg.conf

The 1024x768 screen doesn't fit in the screen and is magnified outside the edges of the screen ?
You have to move the cursor against the sides of the screen to see what is missing ?
The 1280x1024 screen fits perfectly in the screen ?
Can you answer by yes or no to these questions please ?

Yes, the real screen only shows a small part of the virtual screen, so if I, for example, have to look at the most right part of the screen, I'll have to move the cursor against the right side of the display (and continue to move it), to make display show that part of the virtual screen.

grep -e Virtual -e DPI /var/log/Xorg.0.log

(the NVIDIA(1) is most likely the tvout, just ignore it wink )

When I remove the "1280x1024" option (and just have 1024x768 in the Modes array) , it reads:

(**) NVIDIA(0): Option "DPI" "78 x 78"
(II) NVIDIA(0): Virtual screen size determined to be 1024 x 768
(**) NVIDIA(0): DPI set to (78, 78); computed from "DPI" X config option
(II) NVIDIA(1): Virtual screen size determined to be 1024 x 768
(==) NVIDIA(1): DPI set to (75, 75); computed from built-in default

(both real and virtual resolution gets 12024x768)

When I have the 1280x1024 option first (and 1024x768 second), I get:

(**) NVIDIA(0): Option "DPI" "78 x 78"
(II) NVIDIA(0): Virtual screen size determined to be 1280 x 1024
(**) NVIDIA(0): DPI set to (78, 78); computed from "DPI" X config option
(II) NVIDIA(1): Virtual screen size determined to be 1024 x 768
(==) NVIDIA(1): DPI set to (75, 75); computed from built-in default

(both real and virtual resolution gets 1280x1024)

When I have the 1024x768 option first (and 1280x1024 second), I get:

(**) NVIDIA(0): Option "DPI" "78 x 78"
(II) NVIDIA(0): Virtual screen size determined to be 1280 x 1024
(**) NVIDIA(0): DPI set to (78, 78); computed from "DPI" X config option
(II) NVIDIA(1): Virtual screen size determined to be 1024 x 768
(==) NVIDIA(1): DPI set to (75, 75); computed from built-in default

(real resolution is 1024x768 (just as I want it to be), but the virtual resolution gets 1280x1024 (which causes it to only show partly on screen ("zoomed") hmm ))

About the DPI:

Where did you get these values ?
Because with that option, you force the values, instead of letting the nvidia driver calculate itself.
It may not be related to your problem, but it would be good to clarify all the same.

I just chose the DPI which would give the best text size for my screen. (since it's just meant to determine how many pixels there are per inch?)

Last edited by 1311219 (2007-06-29 10:53:34)

Offline

#10 2007-06-29 12:14:25

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: Chosing a default (virtual) resolution in xorg.conf

Thank you for the precisions you gave.
You can notice that :
1) When you have the 1024x768 option first (and 1280x1024 second), you get
(II) NVIDIA(0): Virtual screen size determined to be 1280 x 1024
2) When you have the 1280x1024 option first (and 1024x768 second), you get the same
(II) NVIDIA(0): Virtual screen size determined to be 1280 x 1024

That is normal and cannot be changed, because, as I said in an earlier post :

the virtual screen size has to be calculated for the higher resolution which will be available.

independently  of the order you want them.

So AFAIK, what you want is not possible, that is ,you cannot have a 1024x768 virtual screen and have at the same time a 1280x1024 resolution available.

Further more, the aspect ratio is not the same for these two resolutions :
1024x768 gives a 4/3 aspect ratio
1280x1024 gives a 5/4  aspect ratio

So it's not recommended to have the two resolutions together, if you want to keep the good aspect ratio for your screen (which is given by its native resolution or its physical dimensions).

What you can do is to remove the 1280x1024 resolution from your xorg.conf file, and when you ever want it, you can restart the X server with that resolution in the xorg.conf file. This can be satisfying enough because you said you "will not need that resolution so often".
Greetings.

Offline

#11 2007-06-29 13:58:44

lloeki
Member
From: France
Registered: 2007-02-20
Posts: 456
Website

Re: Chosing a default (virtual) resolution in xorg.conf

maybe you will be interested in
Option "IncludeImplicitMetaModes" "boolean"
or
Option "MetaModes" "<list of MetaModes>"

the first one populates xrandr with more than the xorg.conf specified modes
the second one allows you to force modes (twinview or not: just set second device to NULL)

Last edited by lloeki (2007-06-29 14:00:36)


To know recursion, you must first know recursion.

Offline

#12 2007-07-07 11:22:10

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Chosing a default (virtual) resolution in xorg.conf

Further more, the aspect ratio is not the same for these two resolutions :
1024x768 gives a 4/3 aspect ratio
1280x1024 gives a 5/4  aspect ratio

Ok... I hadn't even thought about that, thanks for pointing it out! *feels extremely stupid...*  neutral lol


Option "IncludeImplicitMetaModes" "boolean"  ...  populates xrandr with more than the xorg.conf specified modes

If that would work, that would be exactly what I'm looking for, but xrandr still just gives me:

 SZ:    Pixels          Physical       Refresh
*0   1024 x 768    ( 333mm x 250mm )  *50  
 1    800 x 600    ( 260mm x 195mm )   51  
 2    640 x 480    ( 208mm x 156mm )   52

(I have removed the "1280x1024" resolution from the "Modes" list)



(It's weird that the built-in resolution switcher in gnome lets the user chose a default resolution (at least, I think so... neutral ), whilst it's almost impossible to do it using xorg.conf tongue )

Last edited by 1311219 (2007-07-07 12:47:29)

Offline

#13 2007-07-07 13:56:24

ianegg
Member
Registered: 2007-06-18
Posts: 38

Re: Chosing a default (virtual) resolution in xorg.conf

What DE do you use? My workaround with KDE is to tell "kranrtray" to apply it's settings at startup, so as soon as it gets started, it resizes the virtual desktop size to match my actual resolution.

I would really like to know a proper solution to this too though!

Offline

#14 2007-07-15 14:03:11

1311219
Member
From: Sweden
Registered: 2007-01-09
Posts: 121

Re: Chosing a default (virtual) resolution in xorg.conf

I'm just using ratpoison (nice way to organize loads of xterms... wink ), so I were looking for a way to chose default virtual and real resolution from the xorg.conf

I just got an idea, maybe I should just ad a line to the .xinitrc script to call xrandr to change resolution? lol (or is there a better alternative? hmm )

Last edited by 1311219 (2007-07-17 13:49:06)

Offline

Board footer

Powered by FluxBB