You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 17, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 17, 2022. It is now read-only.
Sound patch which should vastly help our sound issues. #770
In a nutshell, if we can't hear the sound, then we kill it (correctly this time).
This is NOT the source manager version!
When you use the cheat 'showsamples', it will show 3 things in the top corner of the screen.
"Que" is used to show how many samples are pending. (think 'unit lost', or "Structure completed" or things of that nature.)
"lst" is used to show how many samples are waiting to be played.
"Act" is used to show how many samples are actually playing right now.
Before, lst would be huge, since we didn't really kill off the samples correctly, and we were under the impression this had to do with sources. That was incorrect, at least partly.
We still can run out of sources, however, the frequency of this happening is vastly improved. (When the new Source manager is done, this will help people that are limited to 16 or 32 voices or less.)
Since lst had a ton of samples in it, the game thought it was a duplicate sample, and didn't add it to the act list. That is why people would lose sound, and then they would hit ESC to improve the issue.
Remaining items, some samples are stereo, which means, those use up 2 openAL sources. (Speaking of this, can someone run a utility to tell us which samples are stereo, and which are mono? I know most are mono, so just listing the stereo ones is fine. All the .ogg files in data\base\audio*)
The music is almost always stereo, and it uses 2 more sources for that as well.
The orientation is ... quirky. It seems we don't really calculate which way the player is facing, or should I say, we don't calculate it correctly. check :
If you are located at the top of the map versus the bottom, then it seems the channels are flipped when you go in/out range of things.
I didn't have time to check the cause of this, other than noticing this, both before my modifications, and after them.
I was thinking this would make a nice patch for both 2.2.2 and trunk.
Issue migrated from trac:770 at 2022-04-15 19:04:13 -0700
Had a look at soundPatchNSM2.patch - you have some distracting whitespace changes in that. In sound_SetObjectPosition you could do "if (!psSample) return;" to prevent some of that. The changes in track.h/tracklib.h seem completely unnecessary.
Then in some places you add "f" to float constants, but in other places you add them without "f". And is a comparison to 0.0 really useful (since floats can have some precision problems)? Especially when you test for the volume to not play samples, a very small value like 0.00001 seems better to me.
Remaining items, some samples are stereo, which means, those use up 2 openAL sources. (Speaking of this, can someone run a utility to tell us which samples are stereo, and which are mono? I know most are mono, so just listing the stereo ones is fine. All the .ogg files in data\base\audio*)
looks like the only stereo file is \data\base\audio\sfx\explons\richet2.ogg
Had a look at soundPatchNSM2.patch - you have some distracting whitespace changes in that. In sound_SetObjectPosition you could do "if (!psSample) return;" to prevent some of that. The changes in track.h/tracklib.h seem completely unnecessary.
Then in some places you add "f" to float constants, but in other places you add them without "f". And is a comparison to 0.0 really useful (since floats can have some precision problems)? Especially when you test for the volume to not play samples, a very small value like 0.00001 seems better to me.
For the whiespace changes, most of the patch is from a bigger patch, and I didn't have time to fix everything correctly.
For the lack of "f" on floating point stuff, I just forgot. As for the 0.0f vs 0.00001f not really sure there would be much of a difference there.
(In [8010]) Commit the cleaned up version of Buginator's sound patch. Closes #770.
This fixes the removal of unused sources, which didn't work correctly before.
The number of sources is still not limited, but the number of sounds used
concurrently is much lower now.
(In [8012]) Commit the cleaned up version of Buginator's sound patch. Closes #770.
This fixes the removal of unused sources, which didn't work correctly before.
The number of sources is still not limited, but the number of sounds used
concurrently is much lower now.
Remaining items, some samples are stereo, which means, those use up 2 openAL sources. (Speaking of this, can someone run a utility to tell us which samples are stereo, and which are mono? I know most are mono, so just listing the stereo ones is fine. All the .ogg files in data\base\audio*)
looks like the only stereo file is \data\base\audio\sfx\explons\richet2.ogg
Activity
wzdev-ci commentedon Jul 31, 2009
Buginator uploaded file
soundPatchNSM.patch(12.0 KiB)wzdev-ci commentedon Jul 31, 2009
Buginator commented
Forgot to mention, soundPatchNSM2.patch is the one where I query openAL for what it thinks is available.
For those that are testing, please attach the crash dump file, after you do --crash on the command line.
Thanks!
wzdev-ci commentedon Jul 31, 2009
stiv uploaded file
warzone2100.gdmp-WvpLOo(11.1 KiB)--crash
wzdev-ci commentedon Jul 31, 2009
Buginator uploaded file
soundPatchNSM-trunk.patch(12.0 KiB)wzdev-ci commentedon Jul 31, 2009
Buginator commented
Note, the trunk patch is no different than 2.2. You could have used the same file...
BTW, I tested a 8p autogame with warcam on units to track sounds. Works for me. :)
wzdev-ci commentedon Aug 1, 2009
cybersphinx commented
Had a look at soundPatchNSM2.patch - you have some distracting whitespace changes in that. In sound_SetObjectPosition you could do "if (!psSample) return;" to prevent some of that. The changes in track.h/tracklib.h seem completely unnecessary.
Then in some places you add "f" to float constants, but in other places you add them without "f". And is a comparison to 0.0 really useful (since floats can have some precision problems)? Especially when you test for the volume to not play samples, a very small value like 0.00001 seems better to me.
wzdev-ci commentedon Aug 1, 2009
i-NoD commented
Replying to [#770 Buginator]:
looks like the only stereo file is \data\base\audio\sfx\explons\richet2.ogg
wzdev-ci commentedon Aug 2, 2009
Buginator commented
Replying to Warzone2100/old-trac-import#770 (comment:3):
For the whiespace changes, most of the patch is from a bigger patch, and I didn't have time to fix everything correctly.
For the lack of "f" on floating point stuff, I just forgot. As for the 0.0f vs 0.00001f not really sure there would be much of a difference there.
Uploading a newer version.
wzdev-ci commentedon Aug 2, 2009
Buginator uploaded file
soundPatchNSM2a.patch(13.5 KiB)wzdev-ci commentedon Aug 5, 2009
anonymous commented
Thanx! This werks very well!!!!
wzdev-ci commentedon Aug 13, 2009
cybersphinx uploaded file
soundPatchNSM2a-cleanup.patch(10.4 KiB)Same as soundPatchNSM2a.patch, just removed unnecessary whitespace changes and fixed the codingstyle.
wzdev-ci commentedon Aug 13, 2009
cybersphinx uploaded file
soundPatch-addon-0.001-cutoff.patch(1.6 KiB)Based on my previous patch, change "if (gain == 0.0) don't play" to if (gain < 0.001) don't play" to a
wzdev-ci commentedon Aug 16, 2009
the_cybersphinx changed status from
newtoclosedwzdev-ci commentedon Aug 16, 2009
the_cybersphinx set resolution to
fixedwzdev-ci commentedon Aug 16, 2009
the_cybersphinx commented
(In [8010]) Commit the cleaned up version of Buginator's sound patch. Closes #770.
This fixes the removal of unused sources, which didn't work correctly before.
The number of sources is still not limited, but the number of sounds used
concurrently is much lower now.
wzdev-ci commentedon Aug 16, 2009
the_cybersphinx commented
(In [8012]) Commit the cleaned up version of Buginator's sound patch. Closes #770.
This fixes the removal of unused sources, which didn't work correctly before.
The number of sources is still not limited, but the number of sounds used
concurrently is much lower now.
wzdev-ci commentedon Aug 21, 2009
Buginator commented
Erm, I forgot to add the patch for the sound looping fix. Will commit shortly.
wzdev-ci commentedon Aug 21, 2009
Buginator commented
Fixed in [8026]
wzdev-ci commentedon Aug 21, 2009
Buginator commented
Replying to Warzone2100/old-trac-import#770 (comment:4):
Ok, thanks for checking!