Sound Buffer/Sound Stuttering

Started by Calin Leafshade, Sun 11/10/2009 22:59:21

Previous topic - Next topic

Calin Leafshade

I use a simple PlaySound() command when changing from certain rooms (the sound of a door opening)

And it seems that on my laptop the sound stutters and plays twice. Im fairly sure it didnt do it on my desktop but i have a sound blaster audigy in that.. Is this a problem for cards with smaller buffers? I.e onboard stuff.. and if so how can i fix it?

Gilbert

Hmmm. Did you play the sound and change the room immediately afterwards?
It may be because of the loading of the new room that causes the stuttering in slower systems.
Try to Wait() for a few frames after playing the sound and see if that fixes anything in the laptop.

GarageGothic

What format are your sounds effects saved in? OGG files seem to produce less stuttering than MP3 files in my experience. Also, you can try to increase the amount of memory available for the game under Advanced Settings in winsetup.exe.

Calin Leafshade

Yes the sound file is played immediately before room change.
Using Wait() does help but only if i wait for the entire sound file to be played.. and since its about a second and a half i'd rather not delay the player to that extent.

My files are all in OGG format since i favour an open format if possible and i think the memory allowance is only for the sprite cache isnt it? so it shouldnt really help but i'll give it a go.

From a processor perspective there is no reason why it shouldnt handle it. Its a 2.4ghz core 2 duo laptop which is actually the same as the desktop. The only thing that i think may cause problems is the onboard sound chip.

Gilbert

Actually apart from sound card latency, there're several things that may (i.e. I'm not sure of it) affect the performance, like access speed of the harddrive and the graphic card (right, since during room changes the whole screen is redrawn and we all know that laptops often come with limited onboard chips; you may also try setting up your game for DX5 if it's currently using D3D9 or vice versa and see if that makes a difference).

Calin Leafshade

Graphics card is an Nvidia 6800. I very much doubt thats the cause.. and the game is already running in Dx5 due to the snow/rain plugin.

Harddrive access time is a possibility. Is there any way to cache sound files in advanced? Since this sound file is use very often it would be a good candidate for caching.

Pumaman

This is most likely due to the room not loading quickly enough to update the sound card buffer, what resolution are your rooms?

Calin Leafshade


Pumaman

Hmm, that shouldn't cause a problem. Which screen transition are you using?

Calin Leafshade


Pumaman

Ok thanks, I'll see if I can reproduce any problems with this.

xenogia

Sorry for bringing up this old thread, but I'm getting sound stutters at 640x400 with the same problem.  And this on a quad core q8200 with a gtx 275 :(

Calin Leafshade

It's still a problem as far as I'm aware.

I'm convinced its an issue with the way AGS deals with sound card buffers since performance of the computer seems to be irrelevant but the sound card is vital.

for example, mccarthy stutters on my 2.4ghz dual core laptop with a nvidia 6800 graphics card but doesnt stutter on a 2ghz desktop with onboard graphics with a sound blaster audigy.

The laptop out performs the desktop on everything except the sound card.

AGD2

This happens to me also during room changes, but only with the DX5 driver. The Direct3D one works fine.  I have an Nvidia GTX 295 video card and an Intel Core i7 920 CPU.

Seems like it could have something to do with DX5 being slower to draw graphics to the screen, while simultaneously being compounded by the process of the room loading.

xenogia

Actually my game runs in DX9 by default, but I resolved the issue.  I use the hardware mixer and it completely removes the problem.  Interesting hey :)

Pumaman

Interesting. You shouldn't be getting problems like this, but if we can find a game that reliably reproduces the problem on several computers, I can investigate it and try to find a solution.

xenogia

Hey CJ, do you want me to PM you a url of the game I'm working on so you can see the stutters?

Pumaman

If the stutters are reliably reproducable, that would be useful yes please.

Calin Leafshade

McCarthy also regularly stutters (i.e every room change) on my laptop or any PC with a cheapo sound card if thats helpful


xenogia

I'd have to agree with Calin on that one also, McCarthy stutters for me during room changes, where my game stutters in a room occasionally.

SMF spam blocked by CleanTalk