Author Topic: Enhanced in-mission sound (128 audio channels) (Committed)  (Read 10641 times)

0 Members and 1 Guest are viewing this topic.

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
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.

Download FSO builds for Windows.

Linux

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.

Patch for Linux and others interested is attached to this post.

OS X

See this thread for OS X builds with OpenAL Soft.


Special thanks to niffiwan for doing some preliminary testing.



Optional notes:

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)

EDIT: Forgot to attach the patch.

EDIT 2: I used trunk revision 11162.

EDIT 3: Updated title to indicate work has been merged.

« Last Edit: June 17, 2015, 06:27:01 pm by jg18 »

 

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
Re: Enhanced in-mission sound (128 audio channels) (Committed)
:bump:

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.

http://www.hard-light.net/wiki/index.php/Enhanced_sound

Enhanced sound is enabled by default if you are using OpenAL Soft. The wiki article describes how to get OpenAL Soft for anyone interested.

I am still working on OpenAL Soft support for OS X.

EDIT: Fixed title.
« Last Edit: June 09, 2015, 02:48:27 am by jg18 »

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

 

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
Re: Enhanced in-mission sound (128 audio channels) (Committed)
Thanks!

Updated OP with link to thread with OpenAL Soft test builds for OS X.

 

Offline Yarn

  • 210
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?
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
Re: Enhanced in-mission sound (128 audio channels) (Committed)
It's primarily to ensure that 128 channels are available, although in theory, enhanced sound could make use of OpenAL soft's other features.

 

Offline Yarn

  • 210
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.
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
Re: Enhanced in-mission sound (128 audio channels) (Committed)
Yeah, it really is unfortunate and I have no idea why they did things that way. Ah well, as you said, OpenAL Soft works pretty well at least.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Enhanced in-mission sound (128 audio channels) (Committed)
Warning: this topic has not been posted in for at least 30 days.
Hah

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  :yes:
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
Re: Enhanced in-mission sound (128 audio channels) (Committed)
Thank you, Spoon. :)

Although to give credit where due:

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. :doubt:

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

Code: [Select]
$Name: +nocreate <soundHandleName>
    +Filename: <same> (including the <>)
    +Priority: <priorityGoesHere>
    +Limit: <limitGoesHere>

The <same> tells FSO to use the same filename that is used for the sound in the underlying sounds.tbl file. That way you don't have to specify the filename again.

Example:
Code: [Select]
$Name: +nocreate 6
    +Filename: <same>
    +Priority: Medium-High
    +Limit: 5

Hope that helps.


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.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
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).
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<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.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
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  :yes:
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
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.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
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.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<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.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
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!)
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
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
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<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.

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Enhanced in-mission sound (128 audio channels) (Committed)
Hah, nice, another silly bug squashed  :D
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them