You are not logged in.

#1 2013-12-10 20:46:04

dodo3773
Member
Registered: 2011-03-17
Posts: 820

[WORKAROUND]nvidia 331.20 driver, xrandr 1.4.1, wine, stretch 2D games

Hey guys I asked this question on nvidia forums but have not gotten a response and figured one of you may know. I have this game called peggle nights (pretty fun game if you have never tried it) and in the past (it has probably been a long time) all I had to do was disable 3d in the settings and while fullscreen the app would automatically stretch to widescreen. This required no intervention from me whatsoever. I went to play it recently and instead of working wine spit out an error:

Failed to intitialize DirectDraw: RESULT_DISPCHANGE_FAIL SetDisplayMode FullScreen: DDER_UNSUPPORTED

As far as I can tell (based on reading various forum posts here and other places) this has something to do with wine using a newer xrandr version not supported by nvidia? I read on a different forum post that metamodes needed to be added. I tried adding this to my Screen Section of my xorg.conf :

Option         "metamodes" "DFP-0: nvidia-auto-select, DFP-1: nvidia-auto-select; nvidia-auto-select {ViewPortIn=1920x1080}; nvidia-auto-select {ViewPortIn=1680x1050}; nvidia-auto-select {ViewPortIn=1600x1200}; nvidia-auto-select {ViewPortIn=1440x900}; nvidia-auto-select {ViewPortIn=1400x1050}; nvidia-auto-select {ViewPortIn=1280x1024}; nvidia-auto-select {ViewPortIn=1280x960}; nvidia-auto-select {ViewPortIn=1280x800}; nvidia-auto-select {ViewPortIn=1152x864}; nvidia-auto-select {ViewPortIn=1024x768}; nvidia-auto-select {ViewPortIn=832x624}; nvidia-auto-select {ViewPortIn=800x600}; nvidia-auto-select {ViewPortIn=700x525}; nvidia-auto-select {ViewPortIn=640x480}; nvidia-auto-select {ViewPortIn=512x384}; nvidia-auto-select {ViewPortIn=400x300}; nvidia-auto-select {ViewPortIn=320x240}"

It didn't work though. Here is my xorg.conf generated by nvidia (I added Option "RegistryDwords" "EnableBrightnessControl=1" Option "NoLogo" "1") :

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 331.20  (buildmeister@swio-display-x86-rhel47-05)  Wed Oct 30 18:20:53 PDT 2013

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 331.20  (buildmeister@swio-display-x86-rhel47-05)  Wed Oct 30 18:20:32 PDT 2013

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "LGD"
    HorizSync       44.4 - 66.6
    VertRefresh     39.9 - 59.9
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 560M"
    Option "RegistryDwords" "EnableBrightnessControl=1"
    Option "NoLogo" "1"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "nvidia-auto-select +0+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    Option         "IncludeImplicitMetaModes" "True"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

I only have one screen (my laptop). I am pretty confused about the whole metamodes thing. On 3d mode the game does go fullscreen there is just black bars. Maybe I need to set a scaling option somewhere (that wouldn't change the 2d error though probably)? Has anyone came across this issue or have any tips for me? I was thinking it may have something to do with  ViewPortOut not being in xorg.conf but I am totally lost. Some other things I have tried are: run game in virtual desktop (gets rid of error but does not stretch (the game goes to the corner in a tiny box)), compiling wine --without-xrandr (no error message but same outcome as virtual desktop), changing my desktop resolution to that of the game (still get black bars on sides of screen (seems very hackish too as a workaround)).

Additional information: Card is gtx 560m (laptop; no optimus), nvidia driver 331.20-14, wine version 1.7.8, kernel version 3.12.4-1-ck, window manager is openbox (no 3rd party compositor running). Nouveau works fine which makes me think it is an nvidia driver issue (problem is nouveau runs about 10 degrees hotter on my machine or I would just switch to it full time).

Edit: I tried changing metamodes to "1920x1080,1920x1080; 1680x1050,NULL; 1280x1024,NULL; 800x600,NULL; 640x480, NULL;" That didn't help. Also, I found an interesting (maybe related) error in Xorg log: "setversion 1.4 failed" wondering if it means version 1.4 of xrandr.

Last edited by dodo3773 (2014-03-05 19:01:54)

Offline

#2 2014-02-24 16:38:58

longcao
Member
Registered: 2013-10-28
Posts: 15

Re: [WORKAROUND]nvidia 331.20 driver, xrandr 1.4.1, wine, stretch 2D games

Maybe you should try switching DirectDrawRender entry in 'wine regedit' to 'gdi'. There're a few options in the regedit to tune your Wine. Please read this for further information http://wiki.winehq.org/UsefulRegistryKeys
Add new regedit key Direct3D if it doesn't appear.

To change aspect ratio in fullscreen mode using xrandr:

xrandr --set "scaling mode" "None/Center/Full/Full aspect"

For any unusual screen resolution change, type 'xrandr -s 0' to reset your screen.

Offline

#3 2014-02-26 19:20:04

dodo3773
Member
Registered: 2011-03-17
Posts: 820

Re: [WORKAROUND]nvidia 331.20 driver, xrandr 1.4.1, wine, stretch 2D games

Thanks for the tip. I believe I tried something like that and it wasn't working right for some reason. The work around I ended up using was loading a second desktop and changing panning / resolution options from there. My .xinitrc for the second desktop looks like this:

#!/bin/sh
export AUTOSTART=/dev/null
exec openbox &
export DISPLAY=:1
nvidia-settings --assign CurrentMetaMode="DFP-0: 1920x1080 { ViewPortIn=800x600 @800x600, ViewPortOut=1920x1080 @800x600}"
terminator

From there I just set up an alias to call this:

xinit /home/dodo3773/Documents/Scripts/Games/pegglenights.xinitrc -- :1

Offline

#4 2014-03-05 16:41:08

longcao
Member
Registered: 2013-10-28
Posts: 15

Re: [WORKAROUND]nvidia 331.20 driver, xrandr 1.4.1, wine, stretch 2D games

I use a rather simple script:

#!/bin/bash
xrandr -s <your highest 4:3 resolution supported by the program>
<wine execute path>
xrandr -s 0

For example:

#!/bin/bash
xrandr -s 1024x768
env WINEPREFIX="/home/longcao/.wine" wine C:\\windows\\command\\start.exe /Unix /home/longcao/.wine/dosdevices/c:/users/Public/Start\ Menu/Programs/Tropico/Tropico.lnk
xrandr -s 0

Last edited by longcao (2014-04-16 05:56:14)

Offline

#5 2014-03-05 19:01:06

dodo3773
Member
Registered: 2011-03-17
Posts: 820

Re: [WORKAROUND]nvidia 331.20 driver, xrandr 1.4.1, wine, stretch 2D games

This has not been solved. In the case that it is (for example: randr and nvidia get along; come up with a patch to somehow get randr working etc..) I will be sure to mark it as such. I suppose I will mark it as workaround for now. Also, your example wouldn't work for me since it still wouldn't stretch I don't think (it was the pan / zoom options in nvidia driver that did it (I am pretty sure this part has to be done if I remember right)).

Offline

Board footer

Powered by FluxBB