Audio buffer stuttering when changing rooms

Started by themaninthehat, Thu 04/09/2014 02:58:35

Previous topic - Next topic

themaninthehat

Hi,

I'm having issues with audio stuttering when changing rooms. I've found several threads that lead me to believe there's an issue with this for games with high resolutions (which is my case), but I couldn't find any solution that works for me, so here I am.

My game resolution es 1920 x 1080, is that what is causing the problem? I know I can avoid the stuttering but using WAV files, but they are some long, background sound files, so that increases the game size too much.

Is there any way around this? I really wouldn't want to use a lower resolution. I've tried both Direct3D 9 and DirectDraw 5 modes, tried MP3 and OGG formats for the audio files, and also changing the room transitions to "Instant" , but alas, none of these makes any difference.

Thanks for your help!

Mandle

Have you tried running the game on a computer with faster performance? I'm just asking because I have had similar audio issues with AGS games on my crappy home computer, but when I ran them on the faster computer at work the audio performed perfectly.

Just a thought though. I'm sure no expert :)

Snarky

Quote from: themaninthehat on Thu 04/09/2014 02:58:35
Is there any way around this? I really wouldn't want to use a lower resolution. I've tried both Direct3D 9 and DirectDraw 5 modes, tried MP3 and OGG formats for the audio files, and also changing the room transitions to "Instant" , but alas, none of these makes any difference.

If you've tried all of those things, I'm afraid you're probably out of luck. It is an old AGS problem to which I don't think there's any other solution. Which engine version are you running, though? I seem to remember there were some efforts to address this problem in some branch of the engine (the Alan v. Drake one, maybe?), though I'm not sure how successful they were and they might not support 1920x1080.

AGS wasn't really made for such high resolutions, and you may run into technical issues such as this.

themaninthehat

#3
@Mandle, I'm running the game in a pretty good computer, where I usually run very demanding, current games at high settings. I've also tested this on a couple different mid-high end PCs with the same results, so I don't think that's the issue. Thanks for the suggestion though!

@Snarky, I'm using AGS 3.3.0 + Custom Resolution Build (from this thread).  Interestingly, in the Custom Resolution Build thread, they discuss several problem but nobody seems to mention the issue  with sound stuttering when using high res rooms. I will take a look now at that engine branch you mentioned.

If anyone else has any ideas they would be greatly appreciated!

m0ds

#4
Well on our latest game at 1024x768, music stutters like a bitch on every room change. Odd that the resolution would affect the audio stream... But yeah it certainly happens and we certainly notice it. The game itself is very undemanding, but perhaps simply loading a room in that res is more than the engine prefers to handle. I dunno :) There may be a workaround? The best workaround I can remember is simply not to use looping music tracks for higher res games, use music cues instead. Then by the time the player leaves the room, there's generally only ambient sound playing. Of course, this isn't a perfect solution for all projects, but one practical way to kind of avoid the problem. If there's a known cause, it might also be possible to derive a new workaround. And all that said I remember fairly smooth room changes + audio in Cat Lady (800x600) but would need to doublecheck to see if that was fluke or a particular setup that stopped it happening (or just that it's a lower res than our latest game and your game).

Crimson Wizard

#5
Quote from: Mods on Tue 09/09/2014 01:57:08Odd that the resolution would affect the audio stream...
More resolution - more graphic data to load.
In AGS the music is processed synchroniously by default, and updated between certain steps, but if there's a particular delay between them, it may lag.
WAVs may be played differently, by system library that has its own asynchronous process, this would explain why they don't have this problem. OGGs and MP3s require to be "polled" by application.

There is an asynchronious audio feature since 3.3.0, but we found it is not yet fully stable. It did not cause extensive problems on Windows (strangely ;)), but on other ports - firstly mobile ones, and on some Linux builds too - it sometimes makes game crash.
To enable async audio in 3.3.0+ game, open acsetup.cfg file and put "threaded=1" line under "[sound]" category.

m0ds

#6
Interesting! Thanks CW, will give that a try :)

Edit: That works really well :) No stuttering... and no crashes.... yet! ;)

themaninthehat

Thank you very much Crimson Wizard, that seems to work like a charm so far! I'm not planning to port my game to any other OS, so if I don't get any crashes, I'll definitely use this.

I had already redone the game on a lower resolution, which take a good bit of time...but I'm glad to be able to use a higher resolution again!

It would be great to have this implemented in future versions of AGS. I think having fully functional high resolutions would make a huge difference in terms of potential.

Thank you again, I will report back to say how this worked after more testing.

:)

Crimson Wizard

Quote from: themaninthehat on Wed 10/09/2014 20:13:37
It would be great to have this implemented in future versions of AGS. I think having fully functional high resolutions would make a huge difference in terms of potential.
It's nearly there ;); I had to rewrite some stuff, because the Custom Resolutions build actually broke some things (nobody noticed probably because they are not used often). Now doing some final tests before adding it to new beta we are making.

SMF spam blocked by CleanTalk