wine don't handle hard coded resolutions & refresh rates

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Nate Homier

wine don't handle hard coded resolutions & refresh rates

Post by Nate Homier »

I'm trying to play Silent Hunter 3 using 0.9.57. I get my wine from the
wine Ubuntu repository and I use Ubuntu 7.10. Silent Hunter 3 uses a
hard coded resolution and refresh rate of 1024x768x32bit@50Hz. But I
have an 1680x1050x24bit@60Hz monitor. I use the nvidia-glx-new version
100.14.19+2.6.22.4-14.10. There is a patch available from the Silent
Hunter 3 page, but it is for source code and I don't want to go that
route. Also it seems to me to be an improper route to go, a single
patch just for a specific game. I would like to see wine deal better
with hard coded windows crap in general rather than patches for a
specific game. I really like this game allot and if you can help me get
it going that would be great. But please no patches for me, just send
them upstream. I have included 1 log message based on this command.

env WINEPREFIX="/home/nate/.silenthunter" WINEDEBUG=trace+x11settings
wine "C:\Program Files\Ubisoft\SilentHunterIII\sh3.exe"
2>/home/nate/silenthunter.log

Email breaks last line.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: silenthunter.log.gz
Type: application/x-gzip
Size: 4307 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-us ... chment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3261 bytes
Desc: S/MIME Cryptographic Signature
Url : http://www.winehq.org/pipermail/wine-us ... t-0001.bin
Jim
Level 2
Level 2
Posts: 48
Joined: Mon Feb 25, 2008 6:09 pm

Re: wine don't handle hard coded resolutions & refresh r

Post by Jim »

Nate Homier wrote: Silent Hunter 3 uses a
hard coded resolution and refresh rate of 1024x768x32bit@50Hz. But I
have an 1680x1050x24bit@60Hz monitor.
I once had a similar problem with Need For Speed Hot Pursuit 2. The game's menu screen is hard coded for 800x600. As I understand it, Wine uses the xrandr extension to change resolutions.

Playing around with the xrandr command line tool, I found that randr was reporting some resolution+refresh rate combinations that didn't work with my monitor. The trick is getting randr to either not report the modes that don't work or to get it to report the ones that do work earlier in the list of modes reported.

I don't know that randr+Wine necessarily respects an application's requested refresh rate. You just have to make randr return a mode that works before one that doesn't. At least that's what I remember concluding.

In the end (I don't remember all the details), I ended up adding a ModeLine to my /etc/X11/xorg.conf

I hope something I wrote made sense and is of some use.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: wine don't handle hard coded resolutions & refresh r

Post by vitamin »

Jim wrote:As I understand it, Wine uses the xrandr extension to change resolutions.
Or XVidMode if xrandr is disabled via registry. Or virtual desktop mode.
Jim wrote:In the end (I don't remember all the details), I ended up adding a ModeLine to my /etc/X11/xorg.conf
Right no matter what you use (XRandr, XVidMode or virtual desktop) you still have to have the required resolution(s) configured in xorg.conf
Wine does not nor will in the future scale picture. It's not a virtual machine - it does not have such a low level control over things.
Nate Homier

wine don't handle hard coded resolutions & refresh rates

Post by Nate Homier »

vitamin wrote:
Jim wrote:
As I understand it, Wine uses the xrandr extension to change resolutions.
Or XVidMode if xrandr is disabled via registry. Or virtual desktop mode.


Jim wrote:
In the end (I don't remember all the details), I ended up adding a ModeLine to my /etc/X11/xorg.conf
Right no matter what you use (XRandr, XVidMode or virtual desktop) you still have to have the required resolution(s) configured in xorg.conf
Wine does not nor will in the future scale picture. It's not a virtual machine - it does not have such a low level control over things.
I think I get it. So I added the modeline:
Modeline "1024x768@50" 51.85 1024 1056 1248 1280 768 784 791 807

But it still don't work. Running winedebug gives:
trace:x11settings:X11DRV_ChangeDisplaySettingsEx width=1024 height=768
bpp=32 freq=50 (XRandR)
err:x11settings:X11DRV_ChangeDisplaySettingsEx No matching mode found
1024x768x32 @50! (XRandR)

My monitor/xorg can not do 1024x768x32@50, so am I out of luck or what.
I'm guessing I have to pick up a second monitor. :(

My xorg.conf
Section "Device"
Identifier "nVidia Corporation NV43 [GeForce 6600 GT]"
Driver "nvidia"
Busid "PCI:1:0:0"
Option "AddARGBVisuals" "True"
Option "AddARGBGLXVisuals" "True"
Option "NoLogo" "True"
EndSection

Section "Monitor"
Identifier "SyncMaster"
Option "DPMS"
Modeline "1024x768@50" 51.85 1024 1056 1248 1280 768 784 791 807
EndSection

Section "Screen"
Identifier "Default Screen"
Device "nVidia Corporation NV43 [GeForce 6600 GT]"
Monitor "SyncMaster"
Defaultdepth 24
SubSection "Display"
Modes "1680x1050" "1280x1024" "1280x960" "1024x768@50"
EndSubSection
EndSection
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3261 bytes
Desc: S/MIME Cryptographic Signature
Url : http://www.winehq.org/pipermail/wine-us ... chment.bin
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: wine don't handle hard coded resolutions & refresh r

Post by vitamin »

Nate Homier wrote:I think I get it. So I added the modeline:
Modeline "1024x768@50" 51.85 1024 1056 1248 1280 768 784 791 807

But it still don't work. Running winedebug gives:
trace:x11settings:X11DRV_ChangeDisplaySettingsEx width=1024 height=768
bpp=32 freq=50 (XRandR)
err:x11settings:X11DRV_ChangeDisplaySettingsEx No matching mode found
1024x768x32 @50! (XRandR)
Does it show that mode when you running "xrandr"? Have you ... restarted X?
Nate Homier

wine don't handle hard coded resolutions & refresh rates

Post by Nate Homier »

vitamin wrote:
Nate Homier wrote:
I think I get it. So I added the modeline:
Modeline "1024x768@50" 51.85 1024 1056 1248 1280 768 784 791 807

But it still don't work. Running winedebug gives:
trace:x11settings:X11DRV_ChangeDisplaySettingsEx width=1024 height=768
bpp=32 freq=50 (XRandR)
err:x11settings:X11DRV_ChangeDisplaySettingsEx No matching mode found
1024x768x32 @50! (XRandR)
Does it show that mode when you running "xrandr"? Have you ... restarted X?
No it does not show that mode. I did restart x.
Screen 0: minimum 320 x 240, current 1680 x 1050, maximum 1680 x 1050
default connected 1680x1050+0+0 0mm x 0mm
1680x1050 50.0*
1280x1024 51.0 56.0
1280x960 52.0
1600x1024 53.0
1440x900 54.0
1400x1050 55.0
1280x800 57.0
1280x768 58.0
1152x864 59.0
1024x768 60.0 61.0 62.0
960x600 63.0
840x525 64.0
832x624 65.0
800x600 66.0 67.0 68.0 69.0 70.0 71.0
800x512 72.0
720x450 73.0
640x512 74.0 75.0
640x480 76.0 77.0 78.0 79.0
640x400 80.0
640x384 81.0
576x432 82.0
512x384 83.0 84.0 85.0
416x312 86.0
400x300 87.0 88.0 89.0 90.0
320x240 91.0 92.0 93.0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3261 bytes
Desc: S/MIME Cryptographic Signature
Url : http://www.winehq.org/pipermail/wine-us ... chment.bin
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: wine don't handle hard coded resolutions & refresh r

Post by vitamin »

Nate Homier wrote:No it does not show that mode. I did restart x.
Then you need to contact your distro support. There is nothing Wine can do here.
Nate Homier

wine don't handle hard coded resolutions & refresh rates

Post by Nate Homier »

vitamin wrote:
Nate Homier wrote:
No it does not show that mode. I did restart x.
Then you need to contact your distro support. There is nothing Wine can do here.
Well thanks for your help anyways, I appreciate it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3261 bytes
Desc: S/MIME Cryptographic Signature
Url : http://www.winehq.org/pipermail/wine-us ... chment.bin
ossguy
Newbie
Newbie
Posts: 1
Joined: Tue Apr 01, 2008 11:40 pm

Re: wine don't handle hard coded resolutions & refresh r

Post by ossguy »

Nate Homier wrote: ...
Screen 0: minimum 320 x 240, current 1680 x 1050, maximum 1680 x 1050
default connected 1680x1050+0+0 0mm x 0mm
1680x1050 50.0*
...
1024x768 60.0 61.0 62.0
960x600 63.0
840x525 64.0
832x624 65.0
800x600 66.0 67.0 68.0 69.0 70.0 71.0
...
This suggests that you have Dynamic TwinView enabled, which causes xrandr to report the refresh rate as a unique identifier representing a particular display mode rather than the actual refresh rate that is used for that display mode. More details on Dynamic TwinView are available in Chapter 13 of the Nvidia driver README.

I also had Dynamic TwinView cause problems for me, but in a different way. I was trying to play a 640x480 game, but the first 640x480 mode listed by xrandr caused the bottom sixth of the screen to be cut off. The second mode stretched 640x480 to fit the screen, but Wine would not select it because it defaults to the first available mode.

To resolve this, I added a feature to Wine that allows you to force a particular refresh rate even if the application specifies a refresh rate of its own. This would probably be useful for your situation. Full details for how to use the feature are available in the third paragraph of my blog post. Essentially it requires you to upgrade to Wine 0.9.58 and add a registry entry specifying the refresh rate you want to use. The refresh rate you specify should be the refresh rate as listed by xrandr, not the real refresh rate.

Let me know if you have any questions about that. I hope it helps.
Locked