SDL_AUDIODRIVER=pulse ufo
Nothing has changed. Game is still using alsa. Sound crackling.
All right, sorry to raise an old thread but I found a solution to this same problem. I solved this over a year or two ago but after a reinstall I forgot the solution... so after a few hours of meditation and tinkering I'm writing the solution down here.
sudo aptitude install libsdl1.2debian-pulseaudio
After you've installed that package "
Simple DirectMedia Layer (with X11 and PulseAudio options)", start up
UFO:AI and you will notice the sound is much better (You will see in the log that
pulse is used instead of
alsa); but the sound is still somewhat cracky. Within UFO:AI, change the
Audio Sample Rate option from 44100 to 48000; you will notice the sound is less cracky, and plays slightly slower.
To eliminate the crackiness, we need to set
PulseAudio to operate internally at a sample rate of 48000 Hz. To do this, edit /etc/pulse/daemon.conf
sudo vim /etc/pulse/daemon.conf
Then look for this line:
; default-sample-rate = 44100
And add this line below it:
default-sample-rate = 48000
No need to restart anything!
export SDL_AUDIODRIVER=pulse then start up
UFO:AI to hear crystal clear sound while using
PulseAudio!
SDL_AUDIODRIVER=pulse ufo
I think the crackly noise thing has effected me since the 2.2.1 release, all the way up to the current revision (31875); I'm fairly sure it has to do with the relationship between
PulseAudio and the
Simple DirectMedia Layer Library; it isn't a
UFO:AI bug. I suppose a bug report could be filled if the related
UFO:AI deb's don't have
libsdl1.2debian-pulseaudio as a dependency; but that might have pulse as a dependency and some people don't want that.
Edit: Hmmm... still an occasional tiny glitch in the audio...