Linux

Playing Need for Speed III with Wine

Posted August 29th, 2008 by Maarten

I recently found out that it isn't too difficult getting my favourite racing game, Need for Speed III, to run with Wine.

My current installation is Slackware Linux 12.1 with Wine 1.0 from SlackBuilds.org. My system supports 3D acceleration, so I compiled Wine with OpenGL support (as is the default in the SlackBuild script).

  1. Execute winecfg and set the Windows version to 98. Add your CD-ROM mountpoint to the list of drives in Wine. I used drive letter D.
  2. Mount the Need for Speed CD-ROM or image.
  3. Execute /SETUP/ENGLISH/SETUP.EXE, or choose Spanish if you prefer. Click through the setup options as you would normally. I chose the "full installation" option. There should be no errors during the copying of the files to your hard disk, if there is, try to copy the files manually. There may be an error like Could not get 'HardWareKey' value at the end of the installation, which can be ignored. At this point the game can be run by executing WINEDEBUG=+relay wine nfs3.exe -d3d0 from the directory to which the game was installed. This way the game will also use 3D acceleration, limited to a display size of 800x600. Note: executing wine nfs3.exe will result in the game complaining about corrupted files.
  4. To get the game to use a display size of up to 1152x864, the file d3da.dll needs to be patched and renamed to voodoo2a.dll as is explained by Robert Schuster in the Wine AppDB. This will only work if you have the exact same version of the file. I've attached the full file at the bottom of this page to save you some trouble.
  5. Now the game can be started using WINEDEBUG=+relay wine nfs3.exe -voodoo2. At this point I was able to play the game without major trouble, though it does tend to get stuck after finishing a race sometimes.

Installing Slackware Linux on a Sony Vaio TZ21MN

Posted August 21st, 2008 by Maarten

Since I needed to have my Vaio prepped for use fast, I first installed Kubuntu on it, with which it functioned reasonably well. Now that I have had some more time to figure things out I equipped it with my favourite Linux distribution, Slackware (version 12.1). Because of the choices I make for the installation, the software selections and versions are quite specific. Therefore I will write this guide step by step. In case you want to use other versions of the software (kernel version for instance), you can still use this guide as a reference.


My Sony Vaio.


Basic installation

I kept one 100 megabyte NTFS partition at the start of the hard disk for use of the Instant On software. Read more about this in the Kubuntu guide. The second partition is a Linux swap partition, not specifically because I need swap memory, but for use during the machine's hibernation. I used cfdisk to create a partition of approximately 1050 megabytes for it to be very slightly larger than the total of present memory. Double it if you have 2048 megabytes of RAM. Next I created a system partition of about eight gigabytes of space, and the rest, more than 90 gigabytes, I used to create the /home partition. I installed almost all software including KDE and its translations, since this is my favourite graphical desktop.
Back to contents


Audio

To be able to configure audio and mount storage devices as a regular user, add your user account to the groups audio, plugdev and cdrom. The latter two have nothing to do with audio, but will enable you to use removable media properly. You need to log out and in again to apply the changes. A very convenient way to do this is by using kuser. Start kmix or alsamixer to lower your notebook's volume settings, because the KDE startup sound can be quite loud. Execute alsactl store as root to store the mixer settings.

Edit /etc/modprobe.d/sound as root and append options snd-hda-intel model=hippo. An easy way of editing configuration files in Slackware in a terminal is by using jed, but beware of the backup files it creates. By adding this line to this file which loads your sound module, the correct or at least properly working sound card model will be selected. It will prevent you from having to plug in and out headphones to enable sound from the speakers, as is the case with the default configuration. After having made this change you could reset your mixer settings and you will have to execute alsactl store again to save them. Remove the /etc/asound.state file if you get any errors about non existing mixer settings during startup.
Back to contents


ACPI

Branded Slackware.To enable support for hibernation and CPU frequency scaling (lowering the processor clock rate to save power) you will have to compile a new kernel. I have included a kernel configuration file for the default Slackware 12.1 kernel in case you want to see which options need to be enabled. In it I have selected the correct processor and CPU frequency settings, but have not yet enabled support for hibernation, because you should enter your default resume partition. On all accounts be sure to enable the "ACPI Processor P-States driver" option to enable frequency scaling.

Hibernate
Once your modified kernel is running you will be able to activate hibernation by executing echo disk > /sys/power/state as root. Chmod this file 646 (possibly automatically at boot time) to do the same as a regular user. I added an entry to the KDE menu and bound it to a key combination to enable hibernation by pressing certain keys. The shell script below which is then executed works well for me. The sleep intervals are needed to prevent the notebook from entering sleep mode right after having woken up. The dcop command starts the KDE screensaver right before the notebook starts saving its memory to disk, so after starting up again it will be password protected. After having stored the memory on the swap partition and having shut down in about 30 seconds, the machine can revert to a fully operational state again in about 45 seconds.


#!/bin/sh
if [ ! -e ~/.sleepenabled ]; then
touch ~/.sleepenabled
dcop kdesktop KScreensaverIface lock
sleep 2
echo disk > /sys/power/state
sleep 2
rm ~/.sleepenabled
fi

Back to contents


Wireless network

Because I have a negative experience using the iwlwifi drivers (non-working WPA support at school), I installed the ipw3945 drivers, which in turn require a kernel version earlier than the 2.6.24 kernel (I am currently using 2.6.23.17). Installing this driver requires following these steps:

  • Compile and install the ieee80211 subsystem. I used the default options (aka pressing the enter key a couple of times).
  • Compile and install the IPW driver. I had to use the IEEE80211_IGNORE_DUPLICATE=y option to make it compile, probably because I installed ieee80211 manually.
  • Copy the regulatory daemon to /sbin.
  • Make /etc/rc.d/rc.M execute /sbin/ipw3945d by adding a line near the network initialisation (the starting of rc.inet1). This way the daemon will be started at boot.
  • Copy the microcode to /lib/firmware.

Back to contents


Video and Compiz

Edit the /etc/X11/xorg.conf file and add the video mode 1366x768 to set the proper resolution. Change the Driver setting in the videocard aka Device section from vesa to intel for proper acceleration.

The core Compiz package is already installed by default. I recommend installing additions and Compiz Fusion from SlackBuilds.org. To start Compiz when starting KDE, create a shell script containing the following, make it executable and place it in ~/.kde/env (create that directory if necessary):


#!/bin/sh
KDEWM=$HOME/.kde/startcompiz.sh
export KDEWM

The startcompiz.sh file contains the following:

#!/bin/sh
LIBGL_ALWAYS_INDIRECT=true compiz --replace --indirect-rendering ccp

You may not need the parts about indirect rendering, but Compiz wouldn't run without that on my notebook. Be sure to start kde-window-decorator somehow to have window decorations. It's convenient to start the programs you need to have started and save your KDE session (see KDE session management in kcontrol, KDE components, session manager).
Back to contents


Touchpad

To get the touchpad to scroll by using the right side of the pad, installation of the synaptics touchpad driver is needed. There also needs to be some special configuration in xorg.conf to make the pad work properly. Below are mine, I set my touchpad sensitivity reasonably high so I won't have to move my fingers a lot.


Section "InputDevice"
Identifier "Touchpad"
Driver "synaptics"
Option "Protocol" "auto-dev"
Option "Device" "/dev/psaux"
Option "SHMConfig" "true"
Option "MaxSpeed" "1"
Option "MinSpeed" "0.6"
Option "AccelFactor" "0.05"
Option "LeftEdge" "100"
Option "RightEdge" "900"
Option "TopEdge" "76"
Option "BottomEdge" "680"
Option "MaxTapTime" "180"
EndSection

Back to contents


Webcam

The R5u870 webcam driver seems to work quite well at this point. Simply compiling and installing it as root will do the trick.
Back to contents

Installing Slackware Linux on a Shuttle XPC

Posted August 16th, 2008 by Maarten

Shuttle XPC containing Slackware Linux

It shouldn't be necessary to write an installation guide for a Shuttle XPC since they are made to support Linux kernels. I got a SN68PTG5 (Glamor Series) model, which comes with an AMD processor and an NVidia card (GeForce 7050 PV / NVIDIA nForce 630a which has HDMI/DVI output), a SATA disk drive and plenty of memory. I'm writing this down here anyway to inform anyone who might be interested in buying it, that it works fine with Linux. I installed Slackware Linux 12.1 and a recompiled version of the default 2.6.24.5 kernel on it. I used the proprietary NVidia drivers, version 173.14.12.

At first I gave KDE 4.1 (Slackware packages by Robby Workman) a go. It looked really pretty, had some interesting new functionality, but I decided to skip it for now because a number of my favourite packages of KDE programs weren't available for KDE 4 yet. There were also a number of strange bugs, such as empty message dialogues (blame may lie with one of the following: the Slackware packages, the NVidia drivers or this KDE 4 release). I had hoped to use the new 3D effect enriched KDE 4 desktop, which worked for the most part. But as is known, some of the NVidia cards don't work well with KDE 4 at the moment. Other XPC models which contain Intel graphics cards probably function properly, since their drivers are released licensed as open source. The only thing I noticed was some occasional flickering of certain bars (those of minimised windows in the taskbar or WM buttons on the top-right corner of windows), but this was another factor which made me go with an alternative for now.

My alternative was the default KDE 3.5.9 release which comes with Slackware 12.1, enhanced with Compiz Fusion, which at the moment still outdoes KDE 4's 3D effects greatly. View a short demo below (flickering is only present in the recording).

Please Download Flash player to view this video.

Linux video editing... is quite possible

So, you're a Linux user and you want to process some footage, be it of your mom's birthday or perhaps your own humble video project. You don't want to resort to Windows (or obviously a Mac for that matter) which are supposedly (and probably) easier platforms to edit video.

Give it a shot with your Linux system first. I've no experience capturing video from a digital camera yet, but that should be possible with Kino. I have a simple digital photo camera which can record videos in XVID/MP3 format, or so KDE tells me. I took some random shots with it over the years that I have all saved, so I figured I might experiment with these recordings for a bit, since I plan to do more video editing in the future to process old VHS tapes to digital storage.

Avidemux

The first program I tried was Avidemux. This program allowed me to cut up, stick together and apply certain visual changes to videos. One feature I needed Avidemux for was the altering of the frames per second. The first editing program that I used got into trouble when video samples had a frame rate that wasn't exactly 25 per second. Avidemux can also alter the image by adding filters. These filters can do things like resize the image, add colours to it, blur the image, sharpen the image, add scan lines to it, add subtitles or even add a whirl effect to the video. The most useful application of Avidemux is perhaps the possibility to convert a video to another video (and audio) format.

The Open Movie Editor

Another interesting program is the Open Movie Editor. This software is designed to be an editor rather than a conversion utility. It allows for quick and simple placing of video samples on a time line, while cutting them up or arranging them into a proper sequence. Audio tracks can be added in the same manner. Transitions between scenes (i.e. inserted video files or cut up samples) can be achieved very easily by letting two scenes overlap for a number of seconds. By doing this the overlap becomes visible in the timeline and when the video is played the one part of video is automatically faded into the other. I had some trouble finding an audio and video codec that would actually save the video sequence to a file that was properly readable. The probable cause of this is that I used a precompiled version and not too many codecs were installed or detected the right way by the Movie Editor.

Kdenlive

Because of this I tried another editor, named Kdenlive. I finally settled on this one because

  1. it exports videos properly, providing many audio and video codecs
  2. sports a couple of effects/ transition types by default
  3. is a KDE application and is therefore graphically integrated and translated into Dutch (I like consistency)

The only disadvantage in my case was that for some yet unexplained reason Kdenlive would crash every now and then, but saving the project regularly takes care of that. This is probably again because of the fact that I used a pre-compiled version. I know it's not a good excuse but everyone deserves to be lazy every now and then. Usually I compile software myself, but because I'm now using Kubuntu on a laptop in stead of my usual Slackware set up this makes it very tempting to apt-get everything.

The results

I've uploaded two of my experiments to this website, so anyone reading this can admire or ignore the results of my video editing adventure. The first video shows some of the (very bad quality and out of focus) material which I recorded with my photo camera while moving, using transitions and some other effects. Eventually I used Kdenlive for this, but I achieved about the same using the Open Movie Editor.

Please Download Flash player to view this video.

The second one (also made with Kdenlive) is a recording of people walking down a shopping street. It's been slowed down, a "charcoal" effect has been applied to it, and the beginning and ending of the video demonstrate the blur effect.

Please Download Flash player to view this video.

I have probably missed out on a lot of alternatives, but these are the tools I've chosen to use for now, and Kdenlive does the job quite nicely. Finally I've taken some screenshots of the three programs that I tried: