It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
Hello everyone,

I stumbled across a fix for the annoying static sound popping up all the time. This fix has been tested on OS X using Wine 1.7.27, but it should work anywhere since the cause of the problem is within the game itself.

The problem
The latests official patch for the game, which is often called the "Windows 2000 and XP patch" introduced a bug where occasionally static sound can be heard.

The solution
Since the source of the problem lies within the game code itself I can't fix the source, but the symptoms can be fixed. We will modify the sound files themselves to play nicely in the engine. The solution is from this comment from the Wine bug tracker:
https://bugs.winehq.org/show_bug.cgi?id=30811#c6

We will use a shell script to modify all sound files for us in one go. I don't know batch scripting, so this will only work on Unix, but if someone can port the code for me I'll update the post.

Skills needed
You must be able to write a script and call it from the command-line interface and you should be able to use a package manager or install binaries yourself. Understanding shell scripts is helpful but not required.

Tools needed:
- Terminal/Shell
- SoX (Sound eXchange), can be installed from a package manager (I use MacPorts) or download the binaries from their site
http://sox.sourceforge.net

Save the following as a shell script inside you Alpha Centauri folder. The name doesn't matter, but I used "fix_music.sh"
#!/bin/sh
DIR0=fx;
DIR1="$DIR0.org";
DIR2="$DIR0.mod";

# If the new directory does not exist rename the existing one
if [ ! -d "$DIR1" ]
then
mv -v "$DIR0" "$DIR1"
fi

# If the modded directory does not exist create it, otherwise delete its contents
if [ ! -d "$DIR2" ]
then
mkdir "$DIR2"
else
rm -v "$DIR2"/*
fi

# Save the modded originals in the mod folder
for FILES in $DIR1/*.wav
do
FILE="`echo $FILES|rev|cut -d '/' -f 1|rev`"
sox "$DIR1/$FILE" --norm=-1 "$DIR2/$FILE" pad 0.1 2.4 rate -v 22050 dither
done

# Copy over any unmodified file
cp -nv "$DIR1"/* "$DIR2"

# Symlink the mod folder to appear as the original folder
if [ ! -L "$DIR0" ]
then
ln -sv "$DIR2" "$DIR0"
fi
Now we need to give execution permissions to this file. In your terminal move to the directory containing the script and type
chmod +x fix_sound.sh
Finally run the script using
./fix_sound.sh
You should have two new folders now: fx.org contains the original sound files for backup and fx.mod contains the modded sound files. The fx folder no longer exists, instead there is a symlink to fx.mod in its place.
Does this, or updating to Wine 1.7.27, fix the audio delay?

I remember when I was experimenting with various engines and settings that I ended up deciding that the default engine seemed to have the lowest audio latency. Have you done any similar experimenting? Also, when you updated to the new engine, did you also update the wrapper to the latest version of Wineskin?

Apart from the static and the latency, the only other problem I know of is that in any resolution above 800x600, the text in some boxes doesn't fit. I only notice it in the box that shows terrain details, which is also the build queue box when selecting a base. Basically, the eighth queue spot falls off the text box, while one bottommost terrain detail (I think the elevation) is mostly covered by the frame of the box.

The game is entirely playable, but the constant audio latency and badly fitted text boxes are still irritating.
avatar
StarTroop: ...
I had that problem with Wine 1.7.27 as well. As I pointed out, the problem is in the game itself, there is nothing one could do except create a Wine patch for this one specific game, which would be overkill.
Sorry for this HUGE necro but I am experiencing this same issue of audio crackling on SMAC on my Ubuntu 20.04 and on my steam deck with SteamOS. Tried with everything already, even with this "fix" with applies some dithering etc. No luck. Does anyone else also experience the same problem on Linux?

Thank you in advance
Post edited June 04, 2022 by charliesheen
avatar
charliesheen: Sorry for this HUGE necro but I am experiencing this same issue of audio crackling on SMAC on my Ubuntu 20.04 and on my steam deck with SteamOS. Tried with everything already, even with this "fix" with applies some dithering etc. No luck. Does anyone else also experience the same problem on Linux?

Thank you in advance
use the native port
Sadly I've never managed to make that work and I prefer to have all the community fixes instead. Too bad the sound crackling is a bit annoying, I know that some people managed to fix that but they "never" shared the solution.... (it has to do something with ALSA)

edit 11/06. The easy "fix" is to just mute the "music" channel and listen to your own ambient sounds/music such as vangelis, blade runner or any space-mood OST.. The rest works perfect
Post edited June 11, 2022 by charliesheen
avatar
StarTroop: Apart from the static and the latency, the only other problem I know of is that in any resolution above 800x600, the text in some boxes doesn't fit. I only notice it in the box that shows terrain details, which is also the build queue box when selecting a base. Basically, the eighth queue spot falls off the text box, while one bottommost terrain detail (I think the elevation) is mostly covered by the frame of the box.

The game is entirely playable, but the constant audio latency and badly fitted text boxes are still irritating.
winetricks corefonts and/or Scient's mod (or mods based on Scient which are all the most popular ones) and/or PRACX (mod for widescreen monitors). The mods change font that the game uses (still similar in appearance) and corefonts just add proper font in your wineprefix in case you will not be using any mods.
Post edited July 28, 2023 by Kaguya-hime
Just reinstalled SMAX and found that there are no sound distortion. The only thing that I did was enabling software mixing. Game is patched with Scient's patch from 2019 and PRACX. In Alpha Centauri.Ini eax=1 ds3d=1 (not sure if that helps, my Realtek doesn't support surround sound). And I definitely have heard sound distortion before with Yitzi's mod and PRACX and even used script from OP-post with moderate success to make it less of an issue.

Have you tried enabling softare mixing? By default on unix-like systems it is turned off. That means your soundcard will never mix with anything else and adding another sources of sound for purposes like HRTF or in-game voice comms will be troublesome. Most people have in-board audio and that is usually realtek, so no hardware mixing.
Read this topic for reference and how to do testing.
https://wiki.flightgear.org/Linux_software_audio_mixing_with_FlightGear
The easiest config to enable soft.mixing below.
https://wiki.gentoo.org/wiki/ALSA#Sound_card_only_available_for_one_application

Don't forget to set audio output "Default" in winecfg afterwards.

Copypaste of guide above for future backup:
FILE ~/.asoundrc

pcm.dmixed {
type asym
playback.pcm {
type dmix
ipc_key 5678293
ipc_perm 0660
ipc_gid audio

slave {
channels 2 # Make 6 or 5.1 channel
pcm {
format S16_LE # S32_LE
rate 48000 # Can also be 44100
type hw
card 1 # Your card
device 7 # Your device
subdevice 0 # Important?
}

period_size 1024
buffer_size 8192
}

bindings {
0 0
1 1
# Uncomment below if using 6 channel
# 2 2
# 3 3
# 4 4
# 5 5
}
}
capture.pcm "hw:0"
}

pcm.!default {
type plug
slave.pcm "dmixed"
}
Post edited July 28, 2023 by Kaguya-hime