bibendovsky / eaxefx

OpenAL EAX Extension
MIT License
57 stars 4 forks source link

Add patch for Doom 3 to scale down volume of all sounds #28

Closed bibendovsky closed 2 years ago

bibendovsky commented 2 years ago

See https://github.com/dhewm/dhewm3/issues/179 for details.

bibendovsky commented 2 years ago

Test build (patcher only). eaxefx_app_patcher-v1.0.1-wip-e0063b46ebe65a8296ada908f40577528b9b19fc.zip

mirh commented 2 years ago

Shouldn't you scale down just guns or whatever makes such a loud ass volume that normalization cuts almost everything else? Or isn't the problem that (certain?) noise "cumulates" too much exponentially?

Kappa971 commented 2 years ago

Thanks @bibendovsky! I'll try it as soon as possible. I might ask what exactly does this fix do? (If it's not too complex to explain). ie how it solves the problem. Just curiosity. Currently on Titanium it is necessary to lower the game volume to -7 dB, while with the Titanium HD in addition to this, I have to lower the volume by another -6 dB, but from the sound card equalizer because if I set the game volume to a value lower than -7 dB, the volume of the weapons overwhelms everything else (I know it's strange and it doesn't make sense, but it behaves like this).

In Prey (and Titanium HD) it seems enough to turn the game volume down to -6 dB (half volume) to avoid clipping in most cases. I haven't tried Quake 4 thoroughly yet, but it shouldn't have any problems because the master volume is set to 0.5 by default (not measured in dB like other ID Tech 4 games), less than half in game menu. Probably in this case the developers have been more careful (I'll confirm this later).

Another useful (last) fix for Doom 3 would be to skip the OpenAL error: Error Unloading data from OpenAL hardware buffer. This error shows up at the end of each level when using OpenAL (but it is irregular, may not be shown or may always be shown), but modifying the executable and skipping the check that causes this error (I'm not a programmer, it's a miracle that I managed to do that), the game works fine. Also, no other ID tech 4 game has this check. This is instead the fix implemented in the source port: https://github.com/dhewm/dhewm3/issues/178

bibendovsky commented 2 years ago

I might ask what exactly does this fix do?

Exactly the same thing as the source port dhewm3 does - scales volume down of all sounds.

Another useful (last) fix for Doom 3 would be to skip the OpenAL error: Error Unloading data from OpenAL hardware buffer.

If OpenAL unable to delete a buffer it means a source which using this buffer is not stopped. This could be a tricky one or impossible to fix.

Kappa971 commented 2 years ago

Exactly the same thing as the source port dhewm3 does - scales volume down of all sounds.

Hope that's enough to avoid having to use the equalizer with the X-Fi Titanium HD, I'll let you know.

If OpenAL unable to delete a buffer it means a source which using this buffer is not stopped. This could be a tricky one or impossible to fix.

It is a "false" error, it happens with X-Fi, Host OpenAL, I think also with OpenAL Soft. As mentioned, it is enough to skip the check (modifying the executable) and the game works fine.

bibendovsky commented 2 years ago

It is a "false" error, it happens with X-Fi, Host OpenAL, I think also with OpenAL Soft. As mentioned, it is enough to skip the check (modifying the executable) and the game works fine.

Are you sure it's a false error? The code deletes the buffer and checks for error. If OpenAL unable to delete the buffer the engine prints an error message. Every level change will "leak" such buffer objects. More buffers leaked, more memory will use the process.

bibendovsky commented 2 years ago

Shouldn't you scale down just guns or whatever makes such a loud ass volume that normalization cuts almost everything else? Or isn't the problem that (certain?) noise "cumulates" too much exponentially?

This sounds more like "modding" not the engine patching.

Kappa971 commented 2 years ago

Are you sure it's a false error? The code deletes the buffer and checks for error. If OpenAL unable to delete the buffer the engine prints an error message. Every level change will "leak" such buffer objects. More buffers leaked, more memory will use the process.

Leaving this check causes the sound to crash at the end of each level. The only way I have found to skip this problem without modifying the executable is: save the game before continuing to the next level, disable EAX, restart Doom 3, reload the level and continue to the next level, re-enable EAX, restart Doom 3 and reload the new level. This is for each level of the game. In the source port I understand that they have transformed the error into a warning (but it is still present, it doesn't crash the sound and allows you to proceed to the next level). I've made sure that the check is avoided by jumping directly to the line of code where the game would have gone if that error wasn't thrown. I don't know how much memory this can waste, but if we're not talking about Gb, it's definitely better than having the error at the end of each level (I think? I don't know, I'm not an expert 😅).

Kappa971 commented 2 years ago

Test build (patcher only). eaxefx_app_patcher-v1.0.1-wip-e0063b46ebe65a8296ada908f40577528b9b19fc.zip

I tried this and I think it could be useful with OpenAL Soft, maybe even with the X-Fi Titanium which now would probably only require s_volume_dB "-1" (I can't test it at the moment), not much with the X-Fi Titanium HD and I explain why: with Titanium HD now s_volume_dB "-7" is sufficient to avoid clipping without having to use the sound card equalizer. The problem, however, is that now with s_volume_dB "-7", some weapons (like the machine gun) becomes very loud (previously it happened with values lower than -7 dB), so I should set s_volume_dB "-1" and the equalizer to -6 dB (so in this case, with the Titanium HD, I would not solve anything). I don't really understand why this game's audio is so weird...

However I think this fix should still be added to the final version of eaxefx_app_patcher. Thanks @bibendovsky

bibendovsky commented 2 years ago

Added an issue #29 for Error Unloading data from OpenAL hardware buffer.

mirh commented 2 years ago

This sounds more like "modding" not the engine patching.

Touching the original assets would, I guess (are there even free tools to do that, though?). But are you sure then this is about them being wrong, rather than the engine having some wrong "adding up more sources" formula?

Because making every sound ⅔ quieter seemed kinda the shoot in the dark, according to the very presumptive comments in the fix.

In the source port I understand that they have transformed the error into a warning (but it is still present, it doesn't crash the sound and allows you to proceed to the next level).

You mean https://github.com/dhewm/dhewm3/pull/184?

I don't really understand why this game's audio is so weird...

..... If you "what u hear" record both cards (with the same system/game/whatever settings), do you hear any difference in loudness levels?

bibendovsky commented 2 years ago

Touching the original assets would, I guess (are there even free tools to do that, though?).

Free tools for audio files?

But are you sure then this is about them being wrong, rather than the engine having some wrong "adding up more sources" formula? Because making every sound ⅔ quieter seemed kinda the shoot in the dark, according to the very presumptive comments in the fix.

Quite possible. The projects are different. Their project uses the source code; it's much easier to add or fix the things. The patcher, on the other hand, uses the raw bytes to patch the existing binary.

Kappa971 commented 2 years ago

The problem with the volume of the weapons is also present with EAX disabled, just lower the volume from the game menu to a lower value than -7 dB, raise the volume of the speakers to compensate and you will notice that, for example, the pistol and the machine gun will be much louder than before, so the level of weapon and ambient/voice sounds is different than s_volume_dB "-7" or "0" (default). Changing the volume shouldn't make some weapons (and other sounds) sound louder than everything else, there's definitely something wrong here.

This fix instead solves the problem with OpenAL Soft (I don't remember what happened with Host OpenAL, but it could also with this one) where, with the default volume of the game, when you shoot, the Windows Mixer or OpenAL Soft temporarily reduces the volume of all sounds. The fix reduces the overall volume of the game but not enough to stumble upon the first problem. With X-Fi it is still necessary to reduce the volume to avoid clipping (I have not tested the X-Fi Titanium, it would probably be enough to reduce the volume by just -1 dB).

The difference between Titanium and Titanium HD is, as already mentioned, that the second needs a lower volume to avoid clipping (I still don't understand why), but the first problem prevents me from being able to insert a value of s_volume_dB under -7 dB, so I use the sound card equalizer to lower the volume by another -6 dB ~(the Windows mixer has no effect, probably because OpenAL hardware bypasses it)~.

EDIT The Windows mixer is actually doing something. Tried with cell phone headphones, set windows mixer to 10% and game volume to max, no clipping. With the Windows mixer at 70% and speakers, there is a reduction in sound distortions in game, I don't know why I didn't notice it before. With this combined with the fix, I no longer notice sound distortions with the Titanium HD with the game set to max volume (without the fix I have to set s_volume_dB "-7" and still notice some clipping). Is there any side effect of decreasing the volume of the Windows mixer (eg loss of quality)?

EDIT2 Anyway I don't want to keep talking about volume combinations to avoid clipping on X-Fi. I've also read that some speakers can create more distortion than others, so it's not that simple. However, the strange volume "management" of Doom 3 remains (you decrease the game volume below a certain threshold, and the weapons "take over" everything else).

What matters is that the source port fix has been ported to vanilla Doom 3, useful with OpenAL Soft (and perhaps also for Host OpenAL).

For the rest, I think the discussion can be closed here.

mirh commented 2 years ago

Free tools for audio files?

Yeah. I have usually had bad experiences with trying to tinker with creative's formats. Though I see I had probably underestimated the openness of doom architecture.

Their project uses the source code; it's much easier to add or fix the things.

Yes, right, sorry. It doesn't make much sense to be first experimenting here, rather than there. Still, something's rotten in denmark.

Changing the volume shouldn't make some weapons (and other sounds) sound louder than everything else, there's definitely something wrong here.

/thread

just lower the volume from the game menu to a lower value than -7 dB, raise the volume of the speakers to compensate and you will notice that

Tried with cell phone headphones, set windows mixer to 10% and game volume to max, no clipping.

Sigh, my brain hurts so hard after reading this.

Is there any side effect of decreasing the volume of the Windows mixer (eg loss of quality)?

AFAIK not since windows vista. Yet, as always, you never know with creative shenanigans in-between (:

What matters is that the source port fix has been ported to vanilla Doom 3, useful with OpenAL Soft (and perhaps also for Host OpenAL).

But it's not really a fix tbh. It works around this maddening issue of "runaway volume" by managing to stay below the tipping point, but the algorithm allowing this disaster is still there eventually.

Kappa971 commented 2 years ago

Sigh, my brain hurts so hard after reading this.

I've been looking for a rational explanation for all this for over a week, and I still can't find it. 😅 I'm thinking that speakers might be inherent in all of this too: I have cheap speakers, maybe the speaker jack input (X-Fi Titanium) and RCA input (Titanium HD) have different sensitivity. I've blamed the Titanium HD so far, but I'm not so sure anymore.

The only certainty is that Doom 3 and Prey, but especially Doom 3, have badly adjusted sounds, the rest are guesses.

AFAIK not since windows vista. Yet, as always, you never know with creative shenanigans in-between (:

As always on the web you will find different and discordant opinions. With audio, the situation is even worse.

But it's not really a fix tbh. It works around this maddening issue of "runaway volume" by managing to stay below the tipping point, but the algorithm allowing this disaster is still there eventually.

Yes, you could say that s_volume_dB "0" with the fix is roughly equivalent to s_volume_dB "-6" without fix. The "broken" mixer of the game is still there, but those who use the game with OpenAL Soft will no longer have problems leaving s_volume_dB "0". "Negative effect" of the fix is that with s_volume_dB "-2", you will already notice the weapon problem (this probably happens because the fix has already significantly lowered the max game volume).

mirh commented 2 years ago

I've blamed the Titanium HD so far, but I'm not so sure anymore.

That's why I asked to try "what u hear". IN THEORY you should get the same results between both cards, if whatever the additional confounding factor is just "the metal". Otherwise may god have mercy of us.

As always on the web you will find different and discordant opinions. With audio, the situation is even worse.

I don't remember ever having people disagreeing on this. Vista has a very competent mixer and there are no longer glitches (even though, duh, I can't really source much either atm.. maybe there's something around here?)

Kappa971 commented 2 years ago

Yes, but then I hear the same distortions in the videos listed in the other discussion (I want to clarify that the sound card isn't broken because even with FLAC music rather noisy, I don't get clipping) and I go back to the beginning. I think I will stop finding an answer to all this, it makes no sense to go on. I will continue with -7dB game volume + EQ -6dB (Doom 3) and Prey at -6db (half game volume), I'm tired of going crazy with these poorly programmed games 😅

mirh commented 2 years ago

Yes, but then I hear the same distortions in the videos listed in the other discussion

Yes of course, but so: is the recorded audio wave different between the two files?

If yes, then drivers or deities are a factor at play here. If no, then it means whatever difference you actually hear in your speakers is just the result of the amplifiers in the HD or something along that.

Kappa971 commented 2 years ago

I'm playing Quake 4 on the X-Fi Titanium HD with the default game volume (0.5) and there is no clipping q4

It seems to me that the volume of Quake 4 is equivalent to Prey at -6db Prey and it makes sense. I don't understand why it's not the Prey default volume.

Doom 3... well, this game is incomprehensible. The volume at -7db is louder than Quake 4 and with the Titanium HD, as we know, it distorts loud sounds. It would be necessary to lower the game volume further, but it isn't possible because the sound of the weapons, as already mentioned, becomes extremely loud (even if the clipping disappears, in most cases). To me this is a BUG and I wouldn't be surprised if it still happens in the source port. To have a volume level similar to Quake 4, in Doom 3 I have to decrease the game volume to -7db and, through the sound card EQ, by another -6db. So in Doom 3, in order to have a volume level similar to quake 4 and that doesn't cause clipping (in most cases), it is necessary to decrease the volume by at least -13db. I think it's a lot (right?), what did the developers have in mind? Raven Software with Quake 4 did a far better job than Id Software with Doom 3. Prey's audio isn't great but it's still better than Doom 3.

Returning to the differences in behavior between X-Fi Titanium and Titanium HD, I still haven't been able to find an explanation that makes sense. I remembered that I had recorded these videos with the Titanium HD (https://github.com/LAGonauta/RetroArch/commit/3d0893a418cc83af9f9ac8c542e7422c8175d8eb#commitcomment-78480425): In the first one (s_volume_dB "0", EQ = -12dB) I remember noticing some distortions in the sound of the shotgun. How is it possible? Does this mean that the sound is already distorted BEFORE it is output from the sound card? So how do two different cards produce different results? It isn't the speakers that distort the sound, they simply reproduce what the sound card gives it, and the sound card gives the speakers the distorted sound that the game gives it. It makes no sense.

mirh commented 2 years ago

So how do two different cards produce different results?

cue drivers

p.s. there's no comment with that link in that thread (in particular between mine at 16:53 CEST and yours at 18:34 CEST of July 13)

Kappa971 commented 2 years ago

cue drivers

I think it's more complex than that...

p.s. there's no comment with that link in that thread (in particular between mine at 16:53 CEST and yours at 18:34 CEST of July 13)

This comment: Immagine 2022-08-04 172138

mirh commented 2 years ago

Ok sorry I feel dumb for having missed it.

Anyhow.. I don't really think there can even be something more complex than drivers. It seems pretty self-evident that Titanium cards have different ones, even if you just check their installer folders (hell the HD doesn't even support windows XP for instance).

Kappa971 commented 2 years ago

Ok sorry I feel dumb for having missed it.

Anyhow.. I don't really think there can even be something more complex than drivers. It seems pretty self-evident that Titanium cards have different ones, even if you just check their installer folders (hell the HD doesn't even support windows XP for instance).

Leaving aside the clipping, which I remind you also happens with X-Fi PCI on Windows XP (we know this thanks to LGR's video, involuntarily) even if to a lesser extent than the Titanium HD, you can do a test with Doom 3 (no EAX needed). Hear the machine gun sound with s_volume_dB "0" (default), s_volume_dB "-7" (reduces clipping with X-Fi Titanium) and s_volume_dB below -7db (for example -13db which would be needed to avoid clipping with the Titanium HD). Do you notice any differences? At -13db you should notice that the machine gun becomes loud, below -7db the volume of the weapons is no longer decreased (or decreases much less than the ambient effects/voices), with the result that everything becomes very quiet (audio logs become whispers) except weapons. If there hadn't been this bug, it would have been enough to decrease the volume in the game menu as in other games.

This bug may still be present in the source port, if the only change that has been made is the reduction of the overall volume of the game (as in eaxefx_app_patcher).

mirh commented 2 years ago

I wasn't trying to argue that doom must be good. But that if you have multiple (confounding) factors, then it's useless to try to figure out all at the same time. So either you try to pin down what's the deal with the titanium HD, or with doom.

And I don't recall you having another "safe and sound" test case where the THD misbehaves, so it seems that you can only meaningfully focus on the game itself. And if you start from that aim.. the different sound card causing more mayhem *before* even the "physical output" sounds like it could only mean driver issues.

We already know indeed that they are special on that front (for whatever reason their internal branch codename is XFRL as opposed to SBXF, even if they should still be using a 20K2 chip), and in fact a lot of breakage already happened in the past exactly because they let applications handle what drivers were originally hacking behind the scenes.

And so it seems pointless to wander elsewhere.. it's not like the game code wasn't public for everyone to see. Though, to be super duper fair even trying an Audigy 2 with ~2005 drivers could still be short of being any definitive "reference".

Kappa971 commented 2 years ago

There is clipping in Prey too, with the X-Fi Titanium to a lesser extent than the Titanium HD (with the Titanium it only happens when you shoot), but here it's enough to decrease the volume from the game menu without running into oddities, as shown above.

The test I asked you to do (because otherwise I look crazy 😅) is not about Titanium HD or clipping (there's nothing more to say about that). Try fiddling/decrease the volume in the Doom 3 game menu and hear what happens. To do this test you don't need an X-Fi and you don't need to enable EAX. Just make sure you have weapons (especially the machine gun).

Kappa971 commented 2 years ago

I took a further test, which may or may not mean anything. I connected the headphones for cell phone to the headphone output of the speakers, adjusting the volume from the speakers. I ran Doom 3 at max volume, and there was almost no distortion in the sound with headphone, instead it is very evident with the speakers, very annoying as mentioned above (I tried two pairs of different speakers, a couple of which were quite expensive, and I have the same result).

So what I think is (but I could be completely wrong): With hardware processed audio (EAX-OpenAL), the Titanium HD is actually amplifying the sound more than it should (also caused by the abuse of reverb... the Titanium HD accentuates all this), this causes distortion in the stereo output going to the speakers. By connecting headphones to the speaker output and adjusting the volume from the speakers, the distortion is reduced, so this makes me think that the sound coming out of the PC is too loud but doesn't come out irreversibly "ruined" (as it could be a digital recording instead).

It would be nice if some audio expert could tell me if I just wrote a bunch of nonsense or if it makes sense.

EDIT I tested Half Life 2 with the game's default volume (very loud) and I don't notice any distortions/clippings, but this with everything that doesn't use EAX and OpenAL. This shows that I don't have a faulty sound card.

EDIT2 Taken from the Creative website: X-Fi Sound Cards Producing Crackling and Popping Sounds During Game Play.pdf scr1

The wonder of hardware-accelerated audio... it seems like every game developer is following their own way back in the days, and Creative certainly made it all the more confusing. Thankfully this is all over today, but sadly these old games will continue to have problems. The hope is that OpenAL Soft, in a few years, will be mature enough to supplant the X-Fi (currently there are some problems with EAX in OpenAL Soft) and put an end to this nightmare.

Kappa971 commented 2 years ago

I recorded Doom 3 audio (Titanium HD, EAX enabled and s_volume_dB "-7") with Audacity. The screenshots show and demonstrate what my ears have always heard: scr1

With "Show clipping": scr2

mirh commented 2 years ago

Funnily enough, they even made a presentation of their super competent effort.

Kappa971 commented 2 years ago

Funnily enough, they even made a presentation of their super competent effort.

Other games also suffer from audible clipping (no need for audacity), for example in GTA 3 by blowing up a car with the rocket launcher, in Mafia 1, in Prey, in Carmageddon TDR 2000 (in the game menu it doesn't even allow to lower the volume of the effects) and probably also others that I will discover later. The solution is to turn down the volume in the game menu. Doom 3 is definitely the worst, it has the audio completely busted due to the high reverb, no game I have tried has as much clipping as Doom 3. The games that work well with the default game volume are for the moment:

  1. FEAR, I tried the benchmark and it seems to work fine
  2. Splinter Cell 1 works well, there is clipping on only two occasions: in a room in the slaughterhouse, a bathroom, if the enemies shoot you from behind a wall, you will feel a slight distortion; and in the Chinese embassy when you blow up the two trucks (this case is strange because it doesn't always happen)
  3. Splinter Cell Pandora Tomorrow works well

I'll try others...

mirh commented 2 years ago

Isn't the point of WUH/Audacity that you can tell whether the clipping exists "at the source" before any "physical process"?

Kappa971 commented 2 years ago

Isn't the point of WUH/Audacity that you can tell whether the clipping exists "at the source" before any "physical process"?

The Windows master volume doesn't affect "what you hear", the microphone volume does. I have no idea which part of the chain "what you hear" takes the audio, I guess before it is processed by the DAC.

bibendovsky commented 2 years ago

Added audio limiter for default sound subsystem.

mirh commented 1 year ago

Exactly the same thing as the source port dhewm3 does - scales volume down of all sounds.

https://github.com/dhewm/dhewm3/issues/326#issuecomment-1366833004 Houston, we have an update

Kappa971 commented 1 year ago

I think the problem here is, that in sound/weapons.sndshd player_machinegun_fire has a volume of 14dB (decibels) defined, while player_chaingun_fire only has a volume of 3dB. The decibels are converted to scalar values with idSoundSystemLocal::dB2Scale( volume ) which basically returns pow(2.0, volume/6.0) - so the "initial volume" (before things like global volume or my "scale down volume hack" from DanielGibson@9261f22 that's mentioned in the post you linked get applied) for player_machinegun_fire is 5.039685 and for player_chaingun_fire it's 1.414214. So theoretically the machinegun should be played at 3.5 times the volume of the chaingun, according to the sound shader.

Without my hack (if the global sound is at its default value of 0db or scalar factor 1.0), those are the values that are then used to set AL_GAIN (OpenAL's per sound-source volume) - or rather, what's actually done is alSourcef( chan->openalSource, AL_GAIN, ( volume ) < ( 1.0f ) ? ( volume ) : ( 1.0f ) );, so those values are clamped to 1.0 (which makes sense, because AL_GAIN only supports values between 0.0 and 1.0). So even though player_machinegun_fire and player_chaingun_fire have pretty different volumes set in the sound shader, in the end volume 1.0 is set as AL_GAIN for both sounds. I didn't check the sourcecode of the old software mixing sound backend, but if it sounds the same as OpenAL in Doom3 1.3.1, it most probably clamps volume to 1.0 as well.

However, when using my hack (which divides the volume by 3), the volume used for AL_GAIN is 0.470933 for the chaingun and 1.678215 (actually clamped to 1.0) for the machinegun. So the machinegun has twice the volume (AL_GAIN) of the chaingun - while before, due to clamping, both used 1.0 for AL_GAIN.

This explains (I think, I'm not so expert to understand exactly what it means) why by lowering the volume in the game menu, some weapons like the machine gun or some sound effects have a louder volume than the rest of the game.

EDIT

dhewm/dhewm3#326 (comment) Houston, we have an update

I've tried the dev build listed here, but it doesn't fix the issue of weapons getting too loud when you turn the game volume down. I'm not even sure if this build is meant to solve the same problem I'm having. Anyway I'm using SetVol with a batch file in Doom 1.3.1 so that I can change the Windows volume automatically (if I want to use EAX with the X-Fi), it's a workaround but it works.

DanielGibson commented 1 year ago

I've tried the dev build listed here, but it doesn't fix the issue of weapons getting too loud when you turn the game volume down.

It doesn't, and it wasn't meant to. I guess I could fix that as well by clamping to 1.0 before applying the "game volume" from the slider.

Note that the main problem here is that the Doom3 game data (sound "shaders") is just broken and the weapons only sound right when played at full volume so their volume gets clamped down so they all end up with the same volume, even though they were defined with very different volumes.

Side-note: Would've been helpful to post that comment in the dhewm3 issue, me seeing it here was unlikely ;)

Kappa971 commented 1 year ago

It doesn't, and it wasn't meant to. I guess I could fix that as well by clamping to 1.0 before applying the "game volume" from the slider.

Note that the main problem here is that the Doom3 game data (sound "shaders") is just broken and the weapons only sound right when played at full volume so their volume gets clamped down so they all end up with the same volume, even though they were defined with very different volumes.

I noticed this due to the fact that with Doom 1.3.1 with EAX and X-Fi Titanium/Titanium HD I have to lower the game volume to avoid clipping, and this led to having the volume of weapons and some effects too high. In all these years no one has ever noticed? 🤔

Side-note: Would've been helpful to post that comment in the dhewm3 issue, me seeing it here was unlikely ;)

Sorry, maybe I should have posted the comment there as well 😁

DanielGibson commented 1 year ago

In all these years no one has ever noticed?

Dhewm3 users have noticed basically this problem, only that apparently OpenAL Soft didn't have clipping but instead seemed to temporarily reduce the overall volume when too many loud sounds are playing at the same time. That's why I added that "hack" of just reducing the volume of all sounds by 1/3 (which effectively is the same as your solution of reducing the "game volume").

And after that people noticed that some weapons now sound less loud than others (though initially I dismissed this because one of the reporters said that it was the same in Doom3 1.3.1, so I assumed that it's normal - maybe they had the "game volume" turned down like you have, I don't know).

I just pushed a fix for this to the same git branch, can you test again? :)

Kappa971 commented 1 year ago

Dhewm3 users have noticed basically this problem, only that apparently OpenAL Soft didn't have clipping but instead seemed to temporarily reduce the overall volume when too many loud sounds are playing at the same time. That's why I added that "hack" of just reducing the volume of all sounds by 1/3 (which effectively is the same as your solution of reducing the "game volume").

And after that people noticed that some weapons now sound less loud than others (though initially I dismissed this because one of the reporters said that it was the same in Doom3 1.3.1, so I assumed that it's normal - maybe they had the "game volume" turned down like you have, I don't know).

I just pushed a fix for this to the same git branch, can you test again? :)

I think this solved the problem, thanks @DanielGibson! I hope @bibendovsky can add this fix also in eaxefx_app_patcher.exe for Doom 3 v1.3.1. I can share the build compiled in Visual Studio 2022, so others can test. I noticed a problem though: cmake in Visual Studio 2022 doesn't correctly detect the CPU architecture, but I don't know if I did something wrong.

DanielGibson commented 1 year ago

I noticed a problem though: cmake in Visual Studio 2022 doesn't correctly detect the CPU architecture

What went wrong, what did the CMake output say?

Kappa971 commented 1 year ago

What went wrong, what did the CMake output say?

Immagine 2022-12-29 182750

DanielGibson commented 1 year ago

Gahh turns out the only thing that makes fucking CMake worse is when Microsoft tries to implement it :rage:

When using standalone CMake that stuff works (but if CMake wasn't as shit as it is all that wouldn't be necessary in the first place)..

I'll try to remember to look into this, thanks for letting me know!

DanielGibson commented 1 year ago

I just pushed a fix for the cmake issue to the same branch

bibendovsky commented 1 year ago

The patcher with new changes was released.