Game lags when playing sound

Started by InCreator, Mon 27/12/2004 23:43:29

Previous topic - Next topic

InCreator

Well, problem lies in sounds. Sounds lag!
Like if character has footstep sounds added to his walking animation, game stops for about 1/4 second to play each sound.

I know it's not related to AGS version, different games compiled with different versions do this.
Now, I know that this isn't mainly AGS problem, but should be connected to my computer somehow.Ã,  It's just strange because it didn't exist before.

Now, as far as I remember, the major changes I made - and so which could be "guilty" in this are:

* Switched from DirectX 9.0b to 9.0c
* Replaced Geforce 440MMX 64M card with GeForce 5700LE 128MB

All other things are like they were before problem, for any case I list my hardware setup:

* 1,8Ghz Athlon XP 2200+
* 256MB RAM
* C-Media AC-97 compatible onboard audio
* the video card & DirectX I named before
* Windows XP professional

So system requirements can't be too low for DX9.0c.
I personally suspect DirectX. New version incompatible with soundcard maybe? Or AGS with DX? But other games (non-AGS) play sound normally...

Does anyone have any ideas or suggestions about this?


strazer

Haven't you installed SP2 recently? Was this before or after the problems started?

InCreator

No sp2 problem here. Problem existed few days before that.
After all, I can't imagine SP2 affecting AGS any way.

strazer

Have you tried playing around with the game setups? Audio output and the like?
Also, try closing programs in the background, virus scanners and the like, just to be sure.

Just trying to rule a few things out before CJ gets here. ;)

Proskrito


InCreator

#5
About this footstep lag...

- it won't be better if game is windowed
- it won't disappear is swithing between "default directx sound device" and "default wave output"
- it WILL disappear if "no sound" is set from setup
- it is not affected by DirectSound acceleration. I tried all levels, from "no acceleration" to "full acceleration", also testing both DX sound device and default waveout device. Lag was there.

This is quite weird.
Why only AGS? With WAV sounds?

Other games use wave format too. And many have sounds packed into resource file too. They don't lag!

strazer

Actually sound effects are packed into the exe file.

Thanks for providing such a detailed analysis.
Does it only happen to wave format files?

Pumaman

Does it seem to lag and wait for the sound to finish playing, or is it a 1/4 second lag before the sound actually starts playing?

InCreator

I'll call frames with assigned sound as a "sound frames"...

Character reaches sound frame, lags, then both sound plays and animation continues. So next frame is drawn along with sound. It's quite short moment, very hard to measure. But I'd say that lag is even longer than 1/4th a second. maybe half a second or a bit more.
Anyway, enough to ruin a walk.

I tried with 22Khz and even 11Khz (both 8 and 16-bit) wav's, lag still stays. PCM signed 8-bit stereo was exactly like 44KHz/16-bit. No change there.

I also tried to

- changing between anti-glide/not AG
...without antiglide, character moves very fast even with walkspeed 3, anim speed 6, delay 0 for each frame (in view editor) and AGS won't play footstep in each loop somehow. Though it should!
-  changing between not/uniform walkspeed - no change there

:(



Pumaman

Well, before playing the sound AGS has to load it into memory, so it's possible that if you had a very slow hard disk or were playing the game over a network, you might notice a slight pause ... but it sounds like your computer is quite modern so that shouldn't be an issue.

I'm not really sure what to make of this ... has anyone else experienced a similar problem?

InCreator

Well, I finally found the source of the problem, though I'm still helpless with the games made by other people, such as Apprentice 2, etc.

The sound itsself. I tried to assign different sound to footsteps and some did not lag at all.
Yet, some others do and they are same length and format/quality.

It's just paranormal.
But at least I can continue work on my game.


Pumaman

Strange ... what file format are you using for the sounds? WAV, MP3 or OGG? Does trying one of the others make any difference?

SMF spam blocked by CleanTalk