Enhanced in-mission sound (128 audio channels) (Committed)

Here are experimental, very alpha builds with enhanced in-mission sound, using up to 128 audio channels.

Feedback is much appreciated. This project is part of my rehabilitation after having gone legally blind several months ago, so please be patient with me.

Missions with dense soundscapes, like the Mantis 2266 test mission that's attached to that issue, are where you will hear the biggest difference.

Windows

IMPORTANT: OpenAL Soft is required. Download this OpenAL32.dll file (version 1.16.0) and put it in your FS2 folder (and also wxLauncher/\bin folder if you use wxLauncher). If you'd like to get the .dll from its original source, see the notes at the end of this post.

Linux users should be good to go for OpenAL Soft, although getting the latest version of OpenAL Soft available from your distro's repository (or even getting the latest version from source from the OpenAL Soft website) wouldn't be a bad idea.

To get the OpenAL Soft Windows .dll yourself, go to the OpenAL Soft website, get the latest -bin.zip file (current as of writing is openal-soft-1.16.0-bin.zip), unzip the archive, rename the file bin\Wind32\soft_oal.dll to OpenAL32.dll, then copy the .dll to your FS2 folder (and wxLauncher\bin\ folder if you use wxL)

Re: Enhanced in-mission sound (128 audio channels) (Committed)

A revised version of this work was merged into master on June 1, 2015 as of commit d7f54dd. I've updated the wiki with a description, including instructions on how modders can take advantage of enhanced sound.

Re: Enhanced in-mission sound (128 audio channels) (Committed)

Does the OpenAL Soft requirement exist solely to ensure that 128 channels are available, or does the enhanced sound code utilize OpenAL Soft features that not even hardware renderers (such as some Sound Blaster cards) can provide?

Re: Enhanced in-mission sound (128 audio channels) (Committed)

I did a quick Google search to see whether it's possible get the number of channels supported by an OpenAL renderer, and it appears that there isn't a good way of doing so--a big oversight in the design of OpenAL if you ask me. Oh well, at least OpenAL Soft works quite well.

Re: Enhanced in-mission sound (128 audio channels) (Committed)

As I was testing more WoD stuff today, I couldn't help but notice a lot of sound effects getting culled and everything just sounded kind of bad and quiet. So I started looking into my sound settings, then as I was doing that (and couldn't really find anything off about them), I started to vaguely remember that there had been changes to the sound code some time ago (quite some time ago it seems!). So I followed the links, dove into the wiki and boy, jg18, you have been busy. The sounds.tbl just has so much more stuff going for it. It's great!

And yeah, no **** all my sounds were barely playing, there's like 100+ sound effects that I have defined with the retail syntax, all of which gets defaulted to having a limit of 1. It's going to be some work converting this table to scp syntax, but it'll be worth it. Also, sure is nice to hear the shield impact effect play for real, instead of the old 'bzt bzt b----bzt' and also sure is nice that multiple fighters jumping at once isn't causing the most unholy of clipping anymore.

You've done some seriously great, and underappreciated work with the soundcode, jg18

Re: Enhanced in-mission sound (128 audio channels) (Committed)

I'm not sure who originally fixed the super-loud warp-in sound, although I remember that Iss Mneur worked on a related fix that I took into account when working on enhanced sound to ensure the super-loud warp-ins didn't come back.

Also, it was a new forum member who working with AdmiralRalwood figured out that hull impact sounds were broken, as you can see in this thread.

Finally, I don't think you should need to rewrite your sounds.tbl to use enhanced sound. I worked with m!m on making use of sounds.tbl's modularity so that you can add a sounds.tbm file (not sure exactly how to name the .tbm file, hopefully a coder who's familiar with the table parsing code would know) using SCP syntax and and specify the priorities and playback limits for WoD's gameplay sounds.

Hmm, maybe the fact that this is possible isn't clear from the wiki.

Anyway, it's been a couple years since I worked on this code, but as I remember the syntax is something like this:

One last thing: IIRC with hull impact sounds, FSO includes a timer to prevent multiple hull impact sounds from overlapping, in which case the concurrent playback limit doesn't make a difference with those sounds I think. We could probably make that aspect moddable so that modders could specify their own value for the timer or eliminate the timer entirely if they wanted to.

Re: Enhanced in-mission sound (128 audio channels) (Committed)

One last thing: IIRC with hull impact sounds, FSO includes a timer to prevent multiple hull impact sounds from overlapping, in which case the concurrent playback limit doesn't make a difference with those sounds I think. We could probably make that aspect moddable so that modders could specify their own value for the timer or eliminate the timer entirely if they wanted to.

Well, it makes a difference if the sound is longer than the limit, which I'm pretty sure most of them are (the timer is very short, if memory serves).

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. <MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".(the very next day)<MageKing17> this ****ing code did it to me again<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."<MageKing17> **** ME<MageKing17> THE REASON IS PEOPLE ARE STUPID<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"(...)<MageKing17> so<MageKing17> more than two hours<MageKing17> but once again we have reached the inevitable conclusion<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

Re: Enhanced in-mission sound (128 audio channels) (Committed)

The wiki was actually pretty clear on that part, it's just that wod already has 71 .tbl and .tbm files in its table folder, and for organizational purposes having the sounds split over two seperate files is just going to cause me headaches later (I've learned from experience). I'm a stickler for having nicely clean readable, and consolidated table files, especially the ones I have to edit often. So I bite the bullet and just spend a few hours slaving away at reorganizing my sounds.tbl (I watched the warcraft movie while doing it... it wasn't great)But it's always good that the .tbm option is there

Re: Enhanced in-mission sound (128 audio channels) (Committed)

Fun fact I just ran into. The ballistic loading sound effect (as in, when the supply ship reloads your primary ballistic weapons), is apparantly (hard?)coded to sound.tbl entry 201. I kept hearing this laser sound effect whenever a ship got rearmed and I couldn't immediately figure out how or why this was happening. All of the normal attach/detatch/reload sound entries in the table are just retail sounds and seemed to check out. Had me really bamboozled for a while.

Re: Enhanced in-mission sound (128 audio channels) (Committed)

Fun fact I just ran into. The ballistic loading sound effect (as in, when the supply ship reloads your primary ballistic weapons), is apparantly (hard?)coded to sound.tbl entry 201. I kept hearing this laser sound effect whenever a ship got rearmed and I couldn't immediately figure out how or why this was happening. All of the normal attach/detatch/reload sound entries in the table are just retail sounds and seemed to check out. Had me really bamboozled for a while.

To be precise, both 200 and 201 are used for loading ballistic ammo (with 200 played at the start), just like 33 and 34 are used for loading missiles. The full list can be found on the wiki here, although since it's just straight-up copied from an earlier version of gamesnd.h, you can also just look at the source.

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. <MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".(the very next day)<MageKing17> this ****ing code did it to me again<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."<MageKing17> **** ME<MageKing17> THE REASON IS PEOPLE ARE STUPID<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"(...)<MageKing17> so<MageKing17> more than two hours<MageKing17> but once again we have reached the inevitable conclusion<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

Re: Enhanced in-mission sound (128 audio channels) (Committed)

Well someone might want to double check the code on that, because sound 33 and 200 are 100% not playing. Open up m_load outside of the game and tell me if you ever even heard that sound before. (it was a first for me!)

Re: Enhanced in-mission sound (128 audio channels) (Committed)

Well someone might want to double check the code on that, because sound 33 and 200 are 100% not playing. Open up m_load outside of the game and tell me if you ever even heard that sound before. (it was a first for me!)

Oh, lol, there's a logic error preventing it from playing, even though the delay before the first missile loads is based on its duration (and yes, the logic error applies to both missiles and ballistic primaries, probably due to copy&paste). I guess I'll open up a PR to fix that, and people can hear the missile loading equipment moving into position for the first time. XD

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. <MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".(the very next day)<MageKing17> this ****ing code did it to me again<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."<MageKing17> **** ME<MageKing17> THE REASON IS PEOPLE ARE STUPID<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"(...)<MageKing17> so<MageKing17> more than two hours<MageKing17> but once again we have reached the inevitable conclusion<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.