Setting Resolution Modes in xorg.conf

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Kingoftherings
Level 2
Level 2
Posts: 20
Joined: Fri Jun 27, 2008 10:11 pm

Setting Resolution Modes in xorg.conf

Post by Kingoftherings »

I asked on the Gentoo forums, and surprisingly haven't gotten an answer.

When I run xrandr, I get this output:

Code: Select all

Screen 0: minimum 2960 x 1050, current 2960 x 1050, maximum 2960 x 1050
default connected 2960x1050+0+0 0mm x 0mm
   2960x1050      50.0* 
I'm using TwinView with a 1680x1050 monitor and a 1280x1024 monitor. And I want to set up some different modes in xrandr. When I try playing Counter Strike: Source in wine, it won't let me change the resolution because xrandr only has that one mode, and I was told I needed to set up Xorg to do other resolutions.

Here are the display portions of my xorg.conf:

Code: Select all

Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "DELL E171FPb"
    HorizSync       31.0 - 80.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 8800 GTS"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "1"
    Option         "TwinViewXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "CRT: nvidia-auto-select +0+0, DFP: nvidia-auto-$
    SubSection     "Display"
        Depth       24
        Modes      "2960x1050" "1680x1050" "1440x900" "1280x1024"
    EndSubSection
EndSection
As you can see, in SubSection "Display, I tried to set up modes, but it did not work, 2960x1050 is the only mode that shows up in xrandr.
If I take that line out of that Subsection, nothing changes.
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Setting Resolution Modes in xorg.conf

Post by L. Rahyen »

On 2009-01-20 (Tuesday) 02:29:43 Kingoftherings wrote:
I asked on the Gentoo forums, and surprisingly haven't gotten an answer.

When I run xrandr, I get this output:


Code:
Screen 0: minimum 2960 x 1050, current 2960 x 1050, maximum 2960 x 1050
default connected 2960x1050+0+0 0mm x 0mm
2960x1050 50.0*




I'm using TwinView with a 1680x1050 monitor and a 1280x1024 monitor. And I
want to set up some different modes in xrandr. When I try playing Counter
Strike: Source in wine, it won't let me change the resolution because
xrandr only has that one mode, and I was told I needed to set up Xorg to do
other resolutions.

Here are the display portions of my xorg.conf:


Code:
Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "DELL E171FPb"
HorizSync 31.0 - 80.0
VertRefresh 56.0 - 75.0
Option "DPMS"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 8800 GTS"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "1"
Option "TwinViewXineramaInfoOrder" "DFP-1"
Option "metamodes" "CRT: nvidia-auto-select +0+0, DFP:
nvidia-auto-$ SubSection "Display"
Depth 24
Modes "2960x1050" "1680x1050" "1440x900" "1280x1024"
EndSubSection
EndSection




As you can see, in SubSection "Display, I tried to set up modes, but it did
not work, 2960x1050 is the only mode that shows up in xrandr.
This is what I have in my xorg.conf in Screen section:

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "NoLogo" "1"
Option "TripleBuffer" "1"
Option "TwinView" "1"
Option "DPI" "99x99"
Option "ConstantDPI" "0"
Option "FlatPanelProperties" "DFP: Scaling = Native, Dithering = Enabled"
Option "TwinViewXineramaInfoOrder" "CRT-0"
Option "metamodes" "CRT: 1280x1024_60 +0+0, DFP: 1680x1050_60 +1280+0; CRT: 1024x768_60 +0+0, DFP: 1280x800_60 +1024+0; CRT: 800x600_60 +0+0, DFP: 960x600d60 +800+0; CRT: 640x480_60 +0+0, DFP: 720x450d60 +640+0; CRT: 400x300d72 +0+0, DFP: 400x300d60 +400+0; CRT: 320x240d60 +0+0, DFP: 320x240d60 +320+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection

This is what I get from xrandr:

Screen 0: minimum 640 x 240, current 2960 x 1050, maximum 2960 x 1050
default connected 2960x1050+0+0 0mm x 0mm
2960x1050 50.0*
2304x800 51.0
1760x600 52.0
1360x480 53.0
800x300 54.0
640x240 55.0

As you can see not all resolutions can be used. If you are trying to use wrong resolution it will
be silently ignored.

And for games I recommend you to use separate account configured to use only one display.
At least this is what I do. There is a lot of good reasons to use separate X server for games,
especially when using two or more displays: no problem with mouse "escaping" window (because
account for games configured to use only one primary display), easy to switch to 8 or 16 bit depth
when necessary, better performance because you can disable all desktop effects, and a lot of other
reasons.

If you use your primary account (with two displays) for games you probably will often suffer
from "mouse escaping window" bug and other mentioned above problems.

BTW, you always can try to use virtual desktop mode (you can turned it on in winecfg) if your
game cannot find resolution it needs.
Kingoftherings
Level 2
Level 2
Posts: 20
Joined: Fri Jun 27, 2008 10:11 pm

Post by Kingoftherings »

Okay, thanks. I'll try this out.

Also, how do I set up another account to use a different xorg configuration, since there is only one xorg.conf? Just a guess, but would I use ~/.xinitrc?
User avatar
L. Rahyen
Moderator
Moderator
Posts: 338
Joined: Fri Feb 22, 2008 9:13 pm

Setting Resolution Modes in xorg.conf

Post by L. Rahyen »

On 2009-01-20 (Tuesday) 04:00:21 Kingoftherings wrote:
Okay, thanks. I'll try this out.

Also, how do I set up another account to use a different xorg
configuration, since there is only one xorg.conf? Just a guess, but would
I use ~/.xinitrc?
If you are using kdm, then you need to edit /etc/kde3/kdm/kdmrc by adding (or
editing if you already have configuration for :1) these lines:

[X-:1-Core]
# The VT the X-server should run on; auto-assign if zero, don't assign if -1.
# Better leave it zero and use ServerVTs.
# Default is 0
ServerVT=0
# The command line to start the X-server, without display number and VT spec.
# This string is subject to word splitting.
# Default is "/usr/bin/X -br"
ServerCmd=/usr/bin/X -br -config /etc/X11/xorg.conf.g
ClientLogFile=.xsession-errors-1

Where "/etc/X11/xorg.conf.g" is your xorg.conf for game account, ":1" is
number of display (you can switch to it by pressing Ctrl+Alt+F8; to switch
back to :0 (your primary account) press Ctrl+Alt+F7). In case if your game
account (its X server) stop responding (for example, because of driver bug)
you always can terminate it by pressing Alt+SysRq+K (this is direct command
to the kernel so it will work no matter what if kernel is still alive).

If you are using gdm you are need to edit /etc/gdm/gdm.conf. See the
documentation (or use google) if you don't know how. In worst case ask me, I
try to give an example (I don't use gdm so I will need to write such example
from scratch, this is why I can't give it now).

Also, you can run X server manually. First switch to text console (for
example, press Ctrl+Alt+F1). Then login as game user (make sure to create
game user first) and run X server by hand.

If you need additional assistance feel free to ask more questions.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

Kingoftherings wrote:Okay, thanks. I'll try this out.

Also, how do I set up another account to use a different xorg configuration, since there is only one xorg.conf? Just a guess, but would I use ~/.xinitrc?
You can use same account but run Wine directly under X without WM:

Code: Select all

xinit /usr/bin/wine 'c:\my_program.exe' monitor -- :1 -config xorg-wine.conf
Where xorg-wine.conf is the special X config without twinview in /etc/X11 dir.
Kingoftherings
Level 2
Level 2
Posts: 20
Joined: Fri Jun 27, 2008 10:11 pm

Post by Kingoftherings »

Okay, I added the metamodes from the first reply to xorg.conf. The new resolution shows up in xrandr, but I still can't change the resolution from the default 1280x960 in windowed mode.

I'll try the new user account later, but for now I'll deal with a virtual desktop.
Locked