Page 1 of 2

audio in linux clips like crazy

Posted: 21 Nov 2006, 21:46
by ExecutorElassus
so, it seems like the audio server in the linux version (which is warzone2100-2.0.5_r1 on my system) is piping sound into the audio server at full blast, and it's clipping and distorting like mad. also, when the game really gets going, the audio slows waaaay down, clipping and stuttering. there's also no music.

i have the sliders for FX and music turned almost to nothing, with no effect on the sound quality. i have ALSA compiled into my kernel with the OSS API built in. is there some way to fix this? it's making the game virtually unplayable.

thanks,
EE

Re: audio in linux clips like crazy

Posted: 22 Nov 2006, 00:47
by DevUrandom
We don't use any "soundserver"... *?*

The game ships without music, so if you don't supply your own, you wont get any. (Will change with 2.1, thanks to MichaelB. :) )
We just utilize OpenAL, so the problem might be a wrongly configured AL... You might want to check in your distros docs how to change that...

That the oilricks have a very disturbing sound is normal, and will hopefully fixed by a good sound creator sometime, but it really shouldn't be as bad as you described... ;)

I really have currently no idea how I could help you. Might be our soundcode is bad... I can add that to the TODO so it appears somewhere on the loooong list of things I want to do in the holidays... Perhaps someone else wants to review our soundcode?

Re: audio in linux clips like crazy

Posted: 22 Nov 2006, 02:57
by ExecutorElassus
no, it's nothing like what seems to be just plain creepy sounding oilricks. this is every sound in the game: speech, FX, buildings, everything. i'll check into the AL software, through; whatever it is, it sounds like the audio processing is seriously overloaded, both in terms of volume and processing load.

thanks,
EE

Re: audio in linux clips like crazy

Posted: 22 Nov 2006, 14:28
by sicanjal
I have issues where it seems Warzone is trying to play too many streams at once on Windoze as well. When there is not much happening, the sound is fine but when there are many structures, units and fights, sometimes the sound window will appear to become "stuck in one place"; repeatedly playing the same sounds until the Intellegence Window is opened/closed, regardless even if the units causing those sounds are doing something else or have been destroyed. For what I assume the same reason, music sometimes does not play when resuming a heavy multiplayer game.

I don't have clipping, I just have no new sounds being able to play and old ones becoming jammed on a loop. I might have a look at the soundcode myself and see if I can find or fix anything with some time.

Re: audio in linux clips like crazy

Posted: 22 Nov 2006, 14:47
by Troman
sicanjal wrote: I have issues where it seems Warzone is trying to play too many streams at once on Windoze as well. When there is not much happening, the sound is fine but when there are many structures, units and fights, sometimes the sound window will appear to become "stuck in one place"; repeatedly playing the same sounds until the Intellegence Window is opened/closed, regardless even if the units causing those sounds are doing something else or have been destroyed. For what I assume the same reason, music sometimes does not play when resuming a heavy multiplayer game.

I don't have clipping, I just have no new sounds being able to play and old ones becoming jammed on a loop. I might have a look at the soundcode myself and see if I can find or fix anything with some time.
I'm experiencing this too, was pausing/unpausing the game to get rid of it. ExecutorElassus and sicanjal, do you play using debug or release compilation? I'm getting a sound-related assert in debug compilation, was wondering if i'm the only one.

Re: audio in linux clips like crazy

Posted: 22 Nov 2006, 17:31
by sicanjal
Troman wrote:ExecutorElassus and sicanjal, do you play using debug or release compilation? I'm getting a sound-related assert in debug compilation, was wondering if i'm the only one.
I'm using a build Watermelon kindly sent me (v14, assuming revision r488), I think it's the release compilation; no sound-related asserts or crashes.

The only exception is that sometimes Warzone will occasionally crash ungracefully (windows reports it) going into the game since I got music to work again, I'm not sure if it is the libaries handling it tripping on some of the MP3s/OGGs I have; now testing to see if it's any specific tracks.

EDIT: I can't reproduce those startup crashes

Re: audio in linux clips like crazy

Posted: 22 Nov 2006, 20:40
by ExecutorElassus
i compiled on linux, without the debug flag, so i'm assuming it's the normal compilation. (of course, running it in "cheat" mode has a "debug somethingorother" message at the bottom).

i don't get the sound sticking on any particular sound; it just slows down during intense gameplay. there is always, however, severe digital clipping (sounds like very high pitched static, like when you rub a sweater and get all that crackly noise). it might be something wrong with my setup in OpanAL, so i'll check into that. (when i referred to a "soundserver," i was thinking in the terms that linux uses: one of our windows environments uses a background program to act as an audio server, routing signals to and from audio devices and programs).

i'll report back if i find anything; i suspect, given that nobody else seems to be having exactly this problem, that this is particular to the way the linux sound architecture is working in my setup.

i'll let you know.

cheers,
EE

Re: audio in linux clips like crazy

Posted: 11 Dec 2006, 06:04
by kage
this kind of thing is very common when you're not using vendor-supplied audio drivers, which is almost always the case in a foss operating system like linux: don't worry, foss audio drivers are almost always as good, and sometimes better than the vendor supplied ones.

when you hear that kind of static or distortion, it almost always is indicative that your sound card is being given audio signals that have way too high an amplitude to be correctly handled. 100% digital-processing sound cards don't have these issues typically, but then, very few cards use 100% digital signal processing.

in most cases, the reason the amplitude is too high is because the pcm volume is too high -- you can correct this by going into alsamixer (or whatever you use), and reducing the pcm volume until you stop hearing distortions: this is usually around 75% pcm volume, and roughly corresponds to getting out of the "red" area in alsamixer.

pcm volume can be an annoyance since a lot of programs, such as mplayer, use that by default -- if you can, try to set those programs over to using "master volume" or something other than pcm.

the reason you usually don't hear these problems with proprietary drivers is because they gone through and tested each model of card to find the maximum pcm volume that is able to achieve "clean" audio, and hard-code that in, but if you never let pcm audio go above the maximum limit you've determined, it should sound perfectly fine.

and generally speaking, openal is very clean, efficient, and stable -- most audio problems, unless it has to do with 3d processing, don't lie there.

Re: audio in linux clips like crazy

Posted: 11 Dec 2006, 15:30
by ExecutorElassus
hey kage, thanks for your reply.

unfortunately, i really don't think it's a porblem with PCM, for several reasons:

1) i use audacious with pcm, with no problems
2) pcm is set at 75% in alsamixer
3) the sound *also* slows down during intense gameplay, so it's not just a levels problem.

anyway, thanks for the tip.

EE

Re: audio in linux clips like crazy

Posted: 12 Dec 2006, 00:00
by kage
damn. sorry that didn't work, executor... 9/10 out of 10 that's the problem.

okay, so you're saying that warzone is the only program that has this problem?

Re: audio in linux clips like crazy

Posted: 12 Dec 2006, 15:20
by ExecutorElassus
okay, so you're saying that warzone is the only program that has this problem?
yup. of course, i think warzone is the only program using openAL, so my suspicion is that there's something wrong with that. bbut i could be wrong. at any rate, i don't think it's my alsa setup.

thanks, though. can you suggest ways i might try to debug further?

EE

Re: audio in linux clips like crazy

Posted: 13 Dec 2006, 03:28
by kage
i've never had to try to tweak openal before, so i wouldn't be much help there, but it is possible that openal is trying to hook into oss, which is bad if your oss implementation isn't anything more than a compatibility layer to alsa. what you might try is to make sure the oss support in your kernel is only a module, and then rmmod that module (thus disabling true oss support). then, if you haven't already done so, install the alsa wrappers for oss: i don't know what these are called in most distros, but in debian, and probably any debian derivatives, it is the package named "alsa-oss". these wrappers are usually more clean that true oss support, since oss support for later cards isn't always great, and in almost all cases, it is no worse than true oss support, and has the benefit of allowing you to run oss applications in conjunction with alsa applications (as opposed to alsa preventing oss from working, or one oss program from locking the sound card).

what all the above means is that i'm thinking it may be that alsa support for your card is good, but oss support might be lacking, and perhaps openal is hooking into oss. i really do have no idea how exactly openal interfaces with the card, except that afaik it doesn't have seperate drivers for each card, and thus would have to use a standard interface such as alsa.

Re: audio in linux clips like crazy

Posted: 13 Dec 2006, 12:12
by DevUrandom
You could also try an openalrc like this one:

Code: Select all

# Contains user settings for OpenAL
# Goes in ~/.openalrc

# Use ALSA (also valid: sdl, native)
(define devices '(alsa))

# Four speaker surround with ALSA
(define speaker-num 4)
(define alsa-out-device "plug:surround40:0")

Re: audio in linux clips like crazy

Posted: 13 Dec 2006, 14:42
by kage
well, at least i wasn't trying to look smart...

Re: audio in linux clips like crazy

Posted: 16 Dec 2006, 05:27
by ExecutorElassus
You could also try an openalrc like this one:
holy crap! that's the first time the sound effects haven't sounded like TOTAL ass. i could actually understand what the woman was saying.

of course, it was still slow and choppy, but that was because i was running a compile in the background, eating all my cpu.

i'll try again when i get some free cpu time.

but jeez, it's all ready so much better.

thanks, devU!