Home > Gaming, Software Related > How I got CS Working with Wine on Linux

How I got CS Working with Wine on Linux

I finally installed wine, following much the same procedure as documented here. Then I installed CS. There were no problems installing either of them. I could run Steam, but I couldn’t get any graphics showing, i.e. latest news images, and so on. That didn’t matter too much. However, I couldn’t run CS.

The short version of how I fixed it is just below. If these steps don’t work for you, the longer version further below may contain something useful.

In Wine’s Registry I imported the following by saving it to a “file.reg” then importing it with “wine regedit file.reg”. This seemed to stop Steam from hanging on me when games were installing.

“UseGLSL”=”enabled”

In winecfg:

1. Under Graphics, I turned off “pixel shading” and I checked “Allow DirectX apps to stop the mouse leaving the window” & “Allow the window manager to control the windows”

2. Under Audio, “Hardware Acceleration” is set to Emulation and the OSS Driver box is ticked. I’ve also checked “Driver Emulation,” although I don’t think this matters much.

3. Under Applications, I set “Windows Version” to either Vista or XP.

In Steam:

1. I entered the following into CS Source’s Launch Options: -dxlevel 90

There might be more to my success, such as getting rid of the “libjack” error (as specified below), but I don’t think so. As it stands, everything is working, except that the graphics are not as good as in Windows. I’ll keep working on that.



The long version
of what I did to get CS working is as follows.

First of all, when I ran CS, I only got a black screen.

I tried all the recommended fixes for this at http://appdb.winehq.org/appview.php?iVersionId=3731

Turning off pixel shading got me past the black screen issue.

====================

But I still couldn’t run the game. It’d load and then crash. I tried the recommended commands.

This gets into the game but it crashes after a few seconds

cd ~/.wine/drive_c/Program\ Files/Steam && WINEDEBUG=-all wine steam -applaunch 240

Then i tried the menu link, which is pretty much the same. It crashed at the point the game screen should come up.

env WINEPREFIX=”/home/stephen/.wine” wine “C:\Program Files\Steam\steam.exe” -applaunch 240

====================

I read that it might be a sound problem and I should list conficting sound devices with this:

lsof /dev/snd/pcm* /dev/dsp

Nothing found.

====================

I read that the game launch setting of -dx_level 70 would work. I tried that and other dx levels. They had no effect. Later I would find another reference to these levels that says to set them using this: -dxlevel 70. That was some time later, though. I’ll get to that.

====================

Then I found this post:

On some systems non-root users can’t set negative nice values by default. This privileges problem could probably have some light shed on it by saying what platform/shell you’re running.

In the meantime, if you aren’t going to remove that restriction before your next gaming sesh, you can run the program and then change the priority from elsewhere by running the process as the desired user, then using:

renice -10

as root. With judicious scripting you could achieve the same effect as the sudo given above – ie for tonight’s gaming you could probably get away with using this in your steam script and running it as an ordinary user:

WINEDEBUG=”-all” wine Steam.exe $* & su -c “renice -20 -p `pidof wine`”

which, assuming your system likes that (you might want sudo), would require you entering your root pass immediately upon running it, but use no root privs for the program itself.

So I followed it using this. It gets into the game but it crashes after a few seconds and I can’t enter the su password.

WINEDEBUG=”-all” wine Steam.exe $* -applaunch 240 & su -c “renice -20 -p `pidof wine`”

I try running the su “renice” command separately after running wine so I could enter the password. Others use a nice command, but I get a nice parameters error or else permission denied. Running “renice” didn’t do anything.

====================

I took off driver emulation in winecfg’s Audio and that gave me the longest game play ever, around 10 seconds. Everything was very fast, impressive, until then.

====================

I noticed a libjack error and so I made a link to the already installed version:

root@server1: /usr/lib ~: ls -al | grep libjack
lrwxrwxrwx 1 root root 4 2007-02-05 18:36 libjack0.100.0 -> jack
lrwxrwxrwx 1 root root 25 2007-02-05 18:36 libjack-0.100.0.so.0 -> libjack-0.100.0.so.0.0.23
-rw-r–r– 1 root root 78192 2007-01-13 00:58 libjack-0.100.0.so.0.0.23

root@server1: /usr/lib ~: ln -sf /usr/lib/libjack-0.100.0.so.0 /usr/lib/libjack.so

It didn’t do anything except get rid of the error.

====================

I came across this site with a how-to and followed its advice on starting the game.

WINEDEBUG=”fixme-all” wine Steam

Steam worked but the game didn’t launch at all.

====================

Then I suddenly remembered that I might need Cheating-Death to be running in case that was why my game play was being cut short. I downloaded that and installed it.

This time the game crashed just after the player model selection.

====================

It could be Steam causing it . . . some guy said. Yeah, right, thanks.

====================

The guys on this site had similar problems to me: http://bugs.winehq.org/show_bug.cgi?id=7698
Apparently what was happing was a “[Bug 7698] Counter-Strike:Source crashes after a while”

I tried some of their suggestions:

Running under winver 98 mode (set in winecfg) I got the longest playtime ever. However, key commands don’t work, so I can’t move. When I get shot the game crashes with a runtime error message popping up.

Anyway, support for winver 98 will finished at the end of June, 07.

I tried another suggestion, running with -nosound.

WINEDEBUG=-all wine steam -applaunch 240 -nosound

This gave me no sound, but again I couldn’t move during the game and it crashed as well.

====================

Other suggestions I tried were to run with different screen resolutions. I set these in the winecfg graphics section.

Well, everything crashed and left my Linux screen at a tiny resolution

====================

Earlier, I had put -applaunch 240 in the game launch options as well as -dxlevel 80, but forgot about them because they didn’t seem to have any effect.

Then when I played around with winver and tried windows vista, things seemed to start working. The CS resolution was still set to -dxlevel 80 or something but I could easily change that via the games video options. I adjusted the screen to 1280×1024 LCD and Normal (4:3) and it worked. CS just keep running–no crashes at any stage. The graphics were a little basic but the thing is, it kept running. The only problem was that I had no keyboard control.

To got that when I enabled “Allow the window manager to control the windows”

Everything appears to be working fine. Everything in fact is faster then in Windows. I just need to get better graphics and it’s goodbye booting into Windows.

====================

Some things I haven’ t tried yet that might improve the graphics are these:

Run regedit and go to: HKCU -> Software -> Wine -> Direct3D

Set the OffscreenRenderingMode key to the value “fbo”, “backbuffer” and “pbo” in
turn, trying the game in each mode.

Categories: Gaming, Software Related Tags:
  1. No comments yet.
  1. No trackbacks yet.