Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Wine and Silent Hill 2: irregular framerate
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gamers & Players
View previous topic :: View next topic  
Author Message
VanFanel
Apprentice
Apprentice


Joined: 19 Feb 2007
Posts: 161

PostPosted: Sat Jan 09, 2010 5:26 pm    Post subject: [SOLVED] Wine and Silent Hill 2: irregular framerate Reply with quote

Hello there guys

I'm using Wine 1.1.35 on Gentoo (2.6.30-r5), with and Nvidia 9400 (binary nvidia drivers, version 185) and ALSA sound (no PA, etc).

The problem is that Silent Hill 2 seems to have a very irregular framerate: videos are jerky and realtime graphics framerate seems very irregular, not the expected constant 30FPS this game has.

I've tried updating Wine, as you can see, without any difference. Also tried different WINE modes (win98, xp, vista...) but no success.
I'm using a 60HZ video mode, of course.

I see no strange output message on the console, either.
It just seems to list the files that are being read, etc.

Any ideas of what's happening here? Is it a known behaviour?

regards


Last edited by VanFanel on Mon Jan 11, 2010 9:52 am; edited 1 time in total
Back to top
View user's profile Send private message
Hyper_Eye
Guru
Guru


Joined: 17 Aug 2003
Posts: 462
Location: Huntsville, AL.

PostPosted: Sun Jan 10, 2010 2:53 am    Post subject: Reply with quote

I previously played this game in Wine with all options enabled with a wireless XBox 360 controller and it all worked great. With recent versions of Wine it is not working near as well. It completely crashes my desktop sometimes and it almost never exits correctly. I would recommend trying a version of Wine a few versions back for Silent Hill 2.
_________________
Gentoo Gaming Videos
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Jan 10, 2010 4:51 am    Post subject: Reply with quote

To reduce stutter, try:

Turn off flipping: nvidia-settings -a AllowFlipping=0
I've also seen having flipping on make Quake 4 crash intermittently, weirdly - turning flipping off fixed the instability.

Use the BFS scheduler (the pf patchset is convenient for this), because BFS showed the default scheduler to be lousy.
Back to top
View user's profile Send private message
VanFanel
Apprentice
Apprentice


Joined: 19 Feb 2007
Posts: 161

PostPosted: Sun Jan 10, 2010 2:16 pm    Post subject: Reply with quote

@Hyper_eye: I tried 1.1.29 and it behaves the same. But thanks for the suggestion. Performance regressions aren't unheard on WINE anyway :)

@PaulBredbury: I'm using an nvidia driver prior to the version mentioned in nvnews. but I've tried disabling the page flipping anyway. It didn't make a difference tough. But I believe scheduler is involved: I've tried running
Code:

nice -15 wine sh2pc.exe

and slutter is less noticeable. It's a very obvious difference, but I believe the game can run perfectly stable in my system (it's a core2duo with nvidia 9400 graphics).

The strange thing is that, even if I run it with nice -15, it gets a nice value of 15, not -15. I find it runs better with a nice value of 15..but it's supposed to have less priority that way! What's going on here? It just puzzles me...
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Jan 10, 2010 2:52 pm    Post subject: Reply with quote

Wine runs more than 1 process. Run the game, then press Alt-Ctrl-F1 and run "ps ax" and see the processes. Be sure that you're "renice"-ing the correct game process.

You're still running a lousy scheduler, and playing with "nice" won't fix that - you'll just have a slight variation of lousy scheduler behaviour. What you should do, first, is fix your scheduler.
Back to top
View user's profile Send private message
VanFanel
Apprentice
Apprentice


Joined: 19 Feb 2007
Posts: 161

PostPosted: Sun Jan 10, 2010 5:12 pm    Post subject: Reply with quote

Well, I'm now on the 2.26.32-p4 ZEN-SOURCES kernel, with BFS active.
What are your recommendations now? I've tried renice-ing to -10 the sh2pc.exe process, the wineservice.exe process, etc...but all I get is sluttering sound...
regards
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Jan 10, 2010 5:32 pm    Post subject: Reply with quote

Run "winecfg" and try changing the audio settings, preferring straight ALSA rather than OSS (which would go through ALSA's emulation of OSS).

Wine's audio code is not perfect :(

Don't renice to a more extreme value than -4. IIRC, some kernel processes run at -10, and I don't see the point of interfering with them.

Investigate setting up a custom ~/.asoundrc which specifies a better pcm.default for your soundcard - google for your soundcard model.
Back to top
View user's profile Send private message
VanFanel
Apprentice
Apprentice


Joined: 19 Feb 2007
Posts: 161

PostPosted: Sun Jan 10, 2010 5:41 pm    Post subject: Reply with quote

I'm almost there, and learning a lot in the process, Paul. True Gentoo style :D
Well, I've made the game run on just one of the cores, with
Code:

schedtool -a 0x1 -e wine lotro.exe


...and now the game runs almost perfect, without any sound problems. Yes, the BFS makes a great difference, indeed.
That indicates core switching isn't something this game likes.
Could I run EVERYTHING associated with this app and the WINE support it uses on that same core, while runnig X on the other? How could I archieve that if it makes some sense?

thanks!!
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Jan 10, 2010 6:01 pm    Post subject: Reply with quote

I doubt it'll make a difference, but you could try e.g.:

taskset -p 0x2 $(pidof X)

To put xorg on the 2nd CPU.
Back to top
View user's profile Send private message
Hyper_Eye
Guru
Guru


Joined: 17 Aug 2003
Posts: 462
Location: Huntsville, AL.

PostPosted: Sun Jan 10, 2010 10:02 pm    Post subject: Reply with quote

You have the 3d sound virtualization option disabled in the game right? That option made the game quite choppy for me. I was able to enable shadows, high res textures, noise effect (if you like this), complex fog, advanced filters, and lens flare. None of those options made a noticeable performance difference. The 3d virtualization option made the game quite choppy.
_________________
Gentoo Gaming Videos
Back to top
View user's profile Send private message
VanFanel
Apprentice
Apprentice


Joined: 19 Feb 2007
Posts: 161

PostPosted: Mon Jan 11, 2010 9:52 am    Post subject: Reply with quote

@Hyper_eye & Paul, dear "brothers in Gentoo", I've the game running perfectly now: impecable framerate, perfect sound, and with every setting on: complex fog, shadows, noise effect, and hi-res textures.

and now for the stupid solution:

$ cat /proc/cpuinfo | grep processor
(this reported just one core! hmm....)

..so I compiled the kernel with ACPI suport, wich I had disabled time ago, and voilá, two cores recognized.
No need for nice, renice or schedtool: two cores and the GREAT BFS made it possible.

Extra info:
Code:

kernel: ZEN sources 2.26.34-p4 with BrainFucker Scheduler AND ACPI.
Nvidia drivers version 185.xx.xx
WINE version: 1.1.29 (last stable version in the main emerge branch as of 10/01/2010)
Got sure both cores accounted for with cat /proc/cpuinfo | grep processor


Thanks, guys! I am a bit wisher now,too :)
Back to top
View user's profile Send private message
Hyper_Eye
Guru
Guru


Joined: 17 Aug 2003
Posts: 462
Location: Huntsville, AL.

PostPosted: Mon Jan 11, 2010 6:26 pm    Post subject: Reply with quote

I'm glad you got it working. Silent Hill 2 is one of my favorite Silent Hill games and the PC version looks really good with a high resolution. I recommend hooking in a gamepad as that makes the game play even better. I use a wireless XBox 360 controller (I have also used a wired one without issues.) Any good gamepad should do.
_________________
Gentoo Gaming Videos
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gamers & Players All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum