Jump to content


Photo

Ambient sounds stutter


  • Please log in to reply
64 replies to this topic

#41 -Shin-

-Shin-
  • Guest

Posted 29 September 2012 - 05:50 AM

An interesting discovery I have made, is that the stutter consistently disappears after entering any minor area in the above-mentioned locations, saving there, and loading it.

Stutter consistently re-occurs in the following cases:
1) save-loading while present in the affected area
2) entering the area via worldmap
3) using MoveToArea() console command to get there


Another thing that seems to repeat itself during testing now is that GeN1e's proposed workaround above appears to work by actually disabling certain ambient sounds, which alleviates the problem. Not sure if GeN1e had this outcome as well, but it suggests that it's not a silver bullet fix that suddenly makes the game work with the troublesome sounds, but rather somehow shuts them off.

If it worked differently for GeN1e it may well still be possible to fix this with a simple maneuver. If not, my hypothesis is that the save effect is related to the low-memory/high-memory ambient sound settings somehow.. as, consistently, *some* ambient sounds are missing after loading a minor area save, but not all of them.

#42 Sam.

Sam.
  • Administrator
  • 1335 posts

Posted 29 September 2012 - 02:58 PM

From now on, see Ambient Stutter Analysis instead of me having to fight with the upload manager to accept my files (it will take .xls but not .xlsx) and worry about it resizing my JPEGs (as it seems to do). In particular, see "Stutter vs File Specs for BGT.xlsx". Should be complete now.

"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

--<CHARNAME> to Portalbendarwinden

--------------------

post-10485-0-15080600-1348188745.jpg
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#43 -Shin-

-Shin-
  • Guest

Posted 02 October 2012 - 04:30 PM

AR0516, Planar Prison. AM-Sphincter 1 through 5, AM0516B.WAV

This is the sound from the floor portals in this area. Might be good for testing as it's a small area with only 7 ambients and 3 wav files in total.

Various thoughts:

- Possible that an animation playing in conjunction with an ambient sound causes it? From what has caused stutter so far, fire sources are animated, water is often animated (I think), the floor portals in this area are animated.. not sure about the bubbly pools in the druid grove area, will double check when I get there.

- Very sure that I've done many playthroughs without getting stutter in this many areas, must be something, somewhere that isn't right with it. I had it in my normal BG2 run, but now in BGT it seems a lot more widespread. Memory related? Haven't found any loose unbiffed wav files.

#44 -Shin-

-Shin-
  • Guest

Posted 02 October 2012 - 04:31 PM

Do you guys know if there is any neat way of disabling an animation but keeping the sound it makes? Would be a great test for these portals.

#45 -Shin-

-Shin-
  • Guest

Posted 02 October 2012 - 04:36 PM

Ok, that is not it, the stutter is still there with animations off and sounds on.

#46 -Shin-

-Shin-
  • Guest

Posted 02 October 2012 - 04:43 PM

Exciting times, some kind of breakthrough now in the Planar Prison. If you tick the "ignore radius" flag for the guilty ambients here, the stutter seems to disappear. This makes the sound from those portals sort of loud all over the area, like you were standing on top of a portal, rather than fade out and fade in as you move around.

A new hypothesis is obviously that this volume modulation as the player moves around an area toward and away from the various ambient sources contributes to the stutter. Will have to test it more later on in some other areas.

#47 -Shin-

-Shin-
  • Guest

Posted 02 October 2012 - 04:53 PM

It obviously still doesn't cover it fully as there are other ambients that change volume based on your proximity but don't seem to cause stutter.

#48 Sam.

Sam.
  • Administrator
  • 1335 posts

Posted 02 October 2012 - 05:41 PM

AR0516, Planar Prison. AM-Sphincter 1 through 5, AM0516B.WAV

This is the sound from the floor portals in this area. Might be good for testing as it's a small area with only 7 ambients and 3 wav files in total.

Various thoughts:

- Possible that an animation playing in conjunction with an ambient sound causes it? From what has caused stutter so far, fire sources are animated, water is often animated (I think), the floor portals in this area are animated.. not sure about the bubbly pools in the druid grove area, will double check when I get there.

See Ambient Stutter Analysis for a visual of AR0516 - Planar Prison, as well as another for the same area where the small black circles are the locations of the animations. Spreadsheet also updated.

"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

--<CHARNAME> to Portalbendarwinden

--------------------

post-10485-0-15080600-1348188745.jpg
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#49 -Shin-

-Shin-
  • Guest

Posted 02 October 2012 - 05:55 PM

Thanks Sam. So.. no apparent difference in the spreadsheet between AM0516B (portals) which causes stutter with ignore radius unticked, and AM0516A (anvil) which does not. Looking at the image, it's easy to think that the separating factor is overlap of the same file. I'll test with swapping the portal sounds to that of the anvil tomorrow, and also see if removing/reducing the overlap makes any difference.

#50 -Shin-

-Shin-
  • Guest

Posted 03 October 2012 - 05:27 AM

Ok, another find. When replacing the stutter-causing AM0516B ambient (portal sound) with the problem-free AM0516A (anvil sound) and turning the ignore radius flag off as per the default mode, the stutter seems to disappear. The portals now have the anvil sound, and it changes based on proximity.

So.. this would seem to mean that at least in this case, some property of the file itself is of significance. According to Sam's spreadsheet they are identical in terms of bits, channels etc and only vary in size, with the file causing the problem being smaller.

When exported and played externally, the only obvious difference between them is that the stutter-causing file has a shorter playtime and so the game would have to loop it more often. As some other stutter-causing sounds are about as long as AM0516A though, the play length is unlikely to matter.

Not really sure where to go from here, any ideas?

#51 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 03 October 2012 - 08:36 AM

When exported and played externally, the only obvious difference between them is that the stutter-causing file has a shorter playtime and so the game would have to loop it more often. As some other stutter-causing sounds are about as long as AM0516A though, the play length is unlikely to matter.

Not really sure where to go from here, any ideas?

If you have a sound editing tool that you can edit the file, you could try to loop it inside the file to make it longer and then try that.

Deactivated account. The user today is known as The Imp.


#52 Sam.

Sam.
  • Administrator
  • 1335 posts

Posted 03 October 2012 - 01:58 PM

I have added "AM0516B new WAVCs.rar" to the dropbox. I have rebuilt AM0516B.wav with more compression, less compression, and with the sound duplicated several times to make it longer. Try those and see if you still get the stutter. Note that WAVC compression is lossy.

Also, if you think that one of the file parameters other than Size, Number of Channels, Bits Per Sample, or Sample Rate might be contributing to the stuttering, I can add them to the spreadsheet as well.

In the WAVC Header:
  • WAVC Signature and Version
  • Uncompressed Size
  • Compressed Size
  • Offset to end of WAVC Header
  • Number of Channels
  • Bits Per Sample
  • Sampling Rate (Hz)
  • Unknown (and unused, probably related to compression levels)
Which is followed by the ACM Header:
  • ACM Header
  • Sample Count
  • Number of Channels
  • Sampling Rate (Hz)
  • Levels
And then there is all of the information that can be read/calculated from the uncompressed WAV.

Edited by Sam., 03 October 2012 - 01:59 PM.

"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

--<CHARNAME> to Portalbendarwinden

--------------------

post-10485-0-15080600-1348188745.jpg
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#53 -Shin-

-Shin-
  • Guest

Posted 05 October 2012 - 05:50 AM

Thanks a lot for the work Sam. I tried the three modified wavs now, and they all produce roughly similar amounts of stutter. Could you check if any of those unlisted parameters differ compared to those of AM0516A.WAV?

Thoughts (for Planar Prison):

- Replacing a stutter causing file with a non-stutter causing file removes the stutter. Would seem to have to be either because of a property in the file or the reduction to less total different sounds played within the area.

- Enabling ignore radius for a stutter-causing file removes the stutter. Why? Doesn't seem congruent with the problem being a property of the actual file, but rather how and when it is played.

Will test it with a different non-stutter causing file next to get more indications.

#54 -Shin-

-Shin-
  • Guest

Posted 05 October 2012 - 05:58 AM

Ok, replaced the stutter causing portal sound with a non-stutter causing sound from another area, namely AM1600B1.WAV, a water sound from the Athkatla Docks. This gives the portals a continuous water sound, and causes no stutter.

So this would seem to point to stutter being caused by properties of the actual sound file rather than the number of different sound files played in an area. Can't get this to make sense with thought #2 in the above post.

#55 aqrit

aqrit
  • Member
  • 132 posts

Posted 06 October 2012 - 10:27 PM

Have you tried playing with the config?
Environmental Audio=0
NT Smooth Sound=1
Automated Speed Adjustment=0

Does this occur on a clean-installation?
What are you system specs?

#56 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 07 October 2012 - 03:25 AM

...

Erhm, a little background here for those who have not read the whole of the topic, it's mostly notice-able with heavily modified games, because there's other stuff working too, but this is one major problem sources, evident by disabling the ambient sounds(#4.2) removing a lot of the lag on specifies areas etc... but that's not the actual cure, the cure we try to get is to get rid of it's source.
Thus none of those questions have anything to do with solving this...

Deactivated account. The user today is known as The Imp.


#57 aqrit

aqrit
  • Member
  • 132 posts

Posted 07 October 2012 - 07:09 AM

Erhm,

Environmental Audio
Activating this option will use EAX and A3D effects for
reverberation and sound positioning.

on by default, obviouly that could not possibly have anything to do with this problem.

If you are playing Baldur's Gate 2 in Windows NT and you are having
problems with the sound, put the following in the [Program Options]
section:

NT Smooth Sound=1

This option will switch the priority of the sound processing thread
to match the main game thread, resolving the problem.


another option that could not possibly help.
The most common cause of audio stutter is when the audio thread doesn't read the data in fast enough.

Automated Speed Adjustment, system specs, and clean install questions all have to do with performance.


also, STFU if you have nothing useful to addd.
Delete that 1-page long sig you have because it is obnoxious.
and debbugging questions should always start by covering the basics.



#58 Jarno Mikkola

Jarno Mikkola

    The Imp in his pink raincoat.

  • Member
  • 10911 posts

Posted 07 October 2012 - 07:40 AM

Automated Speed Adjustment, system specs, and clean install questions all have to do with performance.

Yeah, normally they would...

and debbugging questions should always start by covering the basics.

... but this isn't a thread about an insulated incident, there's a lot of this in the megamodified game, well the BGT-Weidu games that the first post talks about... as there's already one way to correct the problem, mentioned in my previous post, turning off the ambient sounds... so we aren't actually debugging GeN1e's problem, but the problem that can be found if we isolate the factor within the files which causes the files not being able to be read correctly with 2012 computers that have 5 to 10 times more performance than 2001's. It's like you didn't read the context of the whole thread... yeah.

#59 Sam.

Sam.
  • Administrator
  • 1335 posts

Posted 07 October 2012 - 11:51 AM

Could you check if any of those unlisted parameters differ compared to those of AM0516A.WAV?

See the new tab of the Excel spreadsheet. Additionally, neither file seems to have any clipping. That's pretty much all I've got unless you want to get into something like frequency spectrum analysis or calculating the beats :P .

"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

--<CHARNAME> to Portalbendarwinden

--------------------

post-10485-0-15080600-1348188745.jpg
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#60 -Shin-

-Shin-
  • Guest

Posted 09 October 2012 - 08:54 AM

Thanks again Sam. Hmm.. can't identify anything in particular that would seem to stand out. Do you know how the "ignore radius" toggle affects a file or the playing of it? I would imagine this to be the reason why the main, background ambients never seem to cause stutter - but there's been no consistent evidence to whether it's due to the distance-related volume modulation going away or some other unidentified reason. Will try to do some more testing with it later on.

@aqrit: Thanks for the input. I have environmental audio turned off (off by default on Win7 unless you get a program to specifically turn it on), but tried I tried Environmental Audio=0 as well as NT Smooth Sound=1 and Automated Speed Adjustment=0 without noticing any difference. Like Jarno Mikkola points out this issue has been around for awhile and I would be extremely surprised if there was a "did you make sure the power cord is plugged in?"-type of solution that would solve it, but at this point I'm willing to try anything.

I've also tried the 'Low Mem Sounds' variables, but like Jarno mentions they work by disabling the sounds involved (as well as other ambients which do not cause stutter).

Also, I'm playing on 64-bit Win7, GeForce GTX 570, Intel i7-2600K and 8GB of RAM. The sound card is a Creative SB X-Fi, and I have also tried switching to the onboard sound with no effect.