• Announcements

    • HEAVY265

      Attention Soldiers Operation Fury Needs you!   02/20/2020

      Attention All Soldiers, Operation Fury needs you.  You need to choose a side and sign up.  
      For more intel on Operation Fury Please click HERE Please go to Special Event Forum (here), And sign up for allied or axis.
      This will be a CRS Lead event on both sides.  Xoom will be heading up the axis side and Heavy265 will be heading up the Allied side. This will be for bragging rights.
      Why are we asking players to sign up you ask. We are trying for a role play experience.   We want this to be a true realistic event.  
      So get up and sign up and let's make this the best event ever!!!!!!!!!!
      Give me your war cry, grrrrrrrrrrrrr
      Heavy265 **out**
Sign in to follow this  
Followers 0
AHWULF

NAILED - Sound bug on Leopard (partially...)

17 posts in this topic

I finally figured out the sound issue with Leopard after a long long long long series of trying to piece together the pattern.

The bug you hear is that sounds seem to be too loud and close to you, even where they are really far away.

The problem exists in both Tiger and Leopard versions of openal (and Core Audio). However, the difference is that the Tiger version is just slow enough that you don't hear it. Leopard sped up enough to where the problem is audible.

The issue happens when a sound channel is reused too close to the previous usage, such as when you fire a cannon, there is a trail sound right afterwards. In my usage, I use a stack which means that the previous channel is immediately reused for the next sound. If it happens too close to the end of the previous usage, even though I have stopped it, the underlying apple openal code isn't done closing the previous usage yet. Now somehow this will subtly mess up the next usage of the channel and continue to be messed up until the channel is completely cleaned up.

I discovered the secret with a Vicki, where I could fire the main gun (and its trail) stop and then fire again etc. If I timed it right, even shot after the first would be wrong. If I waited just a bit more between shots, it was fine.

The solution was to use a data structure that save completed channels to one end and got new ones out the other end thus ensure each channel had "time" to rest before being reused.

Fighting in Verviers last night (big fight) sure sounded better.

I checked the change in for beta. I will of course test more to make sure there isn't ANOTHER problem I couldn't hear due to the first.

Share this post


Link to post
Share on other sites

Argh, clearly there is another bug as well, as I feared. Now its mostly better but some sounds still come out too loud when you are moving. Different ones. Argh this code hates me.

Share this post


Link to post
Share on other sites

I did a little audit of the sounds during a battle in Boom.

The values the game has for the near and far distance values for each sound don't make a lot of sense in many cases. The problem is that on the mac the bad ones are exaggerated under the current openal settings. I am experimenting with different openal settings to see if I can make it more consistent until the Rats have time to audit all the values.

The worst culprit is called small-far-explosion, which always sounds right by your ear sometimes but is supposed to be quiet and far.

I think the major "bug" is fixed but the tweaking of openal will continue some more. Tonight in Boom (lots of booms!) I tried some changes and man was it loud and wild. Not sure if its better but it sure sounded more exciting.

Share this post


Link to post
Share on other sites

I now have buzzard access so I can test without dying all the time. I think I see how the sounds need tweaking in a future version of the client, some are quite wrongly set up. I think I can tweak a few of the worst ones in the mac client before beta is over.

Share this post


Link to post
Share on other sites

It's interesting I have found out that when a sound in openal is started, the previous gain used in that channel is "ramped" up/down from where the previous usage was. This supposedly creates the pop in any sound whose gain is different to start.

I still don't understand why it happens more when you move (I now in my code don't share your personal sounds with the 3d sounds anymore but it still happens.

One person suggested in a post that one could do the gain calculations yourself and avoid the ramping so I might consider that.

It's clear there were always three problems, one I fixed, and the second I now understand and the third is caused by the somewhat random design of the game sound's parameters (the near and far distances) which will be audited maybe for 1.31.

Openal clearly sucks in many ways...

Share this post


Link to post
Share on other sites

I added my sound changes to the source, it will make the next build in beta. It's still not 100% but the final fix requires getting around an openal "feature" I have to be clever.

Share this post


Link to post
Share on other sites

In the 1.30 beta, some things are better, some are worse.

Bullet hits at a distance are a little worse in that they almost always sound right next to you... but this does vary. I need to check it out a little more.

Flak explosions (at max range) have a loud crack and static, then fade to normal sound... but after a lot of shots it seems to sound normal. But then the next volley goes back to being real loud again.

1 thing that is positively fixed is the "slient MGs" bug. It used to be I could tap fire a couple times and sometimes no sound would play while it would be firing. It happened pretty much any time I made a short burst. Now I can click the mouse like it's going to explode and the MG never goes silent.

Share this post


Link to post
Share on other sites

Yea the silent thingee was 1 of the 3 issues. Most of the other issues only happen when you make a sound (ie move), then the next sound or so has the fade effect from too loud. Thus you move (loud stuff) move (loud stuff) stop (loud stuff then everything's fine again) until you move again.

The thing is stupid openal is adjusting the gain (volume) as a ramp effect, but is using the wrong value to start with. B17 will have a few more tweaks, but the major thing is still that stupid ramping "feature".

Share this post


Link to post
Share on other sites

Now that you know exactly what it is, did you think of asking apple? I mean before it would have been hard for them to help you not knowing what the real problem was, but they might know of a way to change the settings, work around it or send an instruction in code to say "don't do auto ramp-up".

Share this post


Link to post
Share on other sites

Don't have an apple developer plan for OSX, just iPhone. But I do have the source, even though it sucks worse than the game :-). THe problem is fixing it without being able to change their source (don't want to ship it embedded).

You might check out b17 when it comes out next week. I think it's different sounding, maybe better, but my ears are too involved in this to tell for sure. b16 is not the same sounding to me at all.

Share this post


Link to post
Share on other sites

OK NOW I understand the underlying issue more clearly. The problem is that although I separated the 2d (you) and 3d (everything else) sounds completely, it didn't seem to help (b17) the odd sound starting issue when you are moving.

In Openal Leopard their code when you start playing a sound looks for and grabs a free Core Audio bus, sets it up, and starts playing. I had thought each openal "source" object was a dedicated bus, but it isn't really. Thus the prior usage of that bus with a 2d sound somehow poisons the next use of that bus for a 3d sound. So trying to keep them separate is useless, I have to find some other way. ARGH!

Share this post


Link to post
Share on other sites

OK - new angle that might fix this. I am trying to remove all 2D sounds and replace them with localized 3d sounds. Not sure how much work this is but my first test seemed to fix the bad sounds (which I expected) although the local sounds (you) were way too quiet. It fits with the understanding I have now. Just need to figure out how to make all (you) sounds sound correctly now. Then maybe this @#$@#$ bug will be ded.

Share this post


Link to post
Share on other sites

SO basically you are saying 2D and 3D sounds don't mix well with openAL, so the best workaround is to make all sounds either 2D or all 3D? Well it seems to me like that shouldn't be too difficult since all the sounds the player makes should be centered on him anyway. Good luck.

Share this post


Link to post
Share on other sites

No its actually more complicated than that. In the mac port of openal, when you pick and channel to play in, the implementation picks a random Core Audio (the mac sound code) channel to reuse. If it was previously relative to the player (ie 2d) then for the first few packets the sound is relative to where the previous use was (ie your head) then quickly switches to where it should be (probably elsewhere). Somehow the timing is slightly off. My current mix is still not right although different. It's not openal so much as the Apple version (I have the source and its FUGLY). I wish we could pay for the one I mentioned above.

Share this post


Link to post
Share on other sites

OK, I have found a combo of settings than sound pretty good, I will try to update the source for b21 with them, assuming I don't find anything oddball this weekend.

Share this post


Link to post
Share on other sites
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.