Full-volume monster sounds are not normalized

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
phantombeta
Posts: 2182
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Full-volume monster sounds are not normalized

Post by phantombeta »

For some reason, full volume monster sounds are not getting normalized anymore. They end up horribly loud and clipping. 3D sounds get normalized just fine, however.
Reverting to an older OpenAL32.dll build from a previous release fixes it. (and using the DLL from 4.4.2 with that previous release carries the issue over to it)
(I don't do the sound code, so I have no idea if this is an OpenAL Soft bug or a breaking API change that needs to be accounted for by GZDoom.)

Steps to reproduce:
  • Start GZDoom with NUTS.
  • Start the game.
  • Do "kill monsters".
Extremely loud Spider Mastermind and Cyberdemon death sounds should now be playing absurdly loudly due to overlapping with no normalization.

[Edit]

Excuse me

Image
What the fuck.
(Pay attention to where the "Max volume" slider thingy is)
Last edited by phantombeta on Mon Oct 26, 2020 5:10 am, edited 3 times in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49245
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Full-volume monster sounds are not normalized

Post by Graf Zahl »

The way you describe it sounds like an OpenAL bug.

Paging Chris...
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Full-volume monster sounds are not normalized

Post by Nash »

I suppose it's fair to warn that anyone reading this and wants to repro this, please turn your volume down or suffer hearing and/or equipment damage... :D
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49245
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Full-volume monster sounds are not normalized

Post by Graf Zahl »

I'll surely ship the upcoming releases with the old DLL unless this gets fixed first.
User avatar
sinisterseed
Posts: 1349
Joined: Tue Nov 05, 2019 6:48 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Full-volume monster sounds are not normalized

Post by sinisterseed »

Good grief lol. That's one way to ignore sound settings...

It seems newer versions of OpenAL don't play well with GZDoom at all. This is not the first time I'm seeing reports related to the newer .dlls here. Well, at least Raze survives this, at least for now. I don't recall seeing similar behavior there.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49245
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Full-volume monster sounds are not normalized

Post by Graf Zahl »

That's because you cannot trigger this edge case easily there. Since it's the same sound system, if you were able to you'd get the same effect.
This is not the first time I'm seeing reports related to the newer .dlls here.
Same here. I have seen some reports of sounds musbehaving, too.
User avatar
sinisterseed
Posts: 1349
Joined: Tue Nov 05, 2019 6:48 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Full-volume monster sounds are not normalized

Post by sinisterseed »

Na, I have an idea actually.

Spawn 100 Rippers in SW and kill them all. That should answer the question. But do we even have a "kill monsters" equivalent there, let alone a way to spawn enemies?
User avatar
Rachael
Posts: 13964
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Full-volume monster sounds are not normalized

Post by Rachael »

We'd have to make one but ultimately all you'd have to do with it (maybe, I think?) is iterate through each sprite, check if it's a monster and has health, and set it to 0. Build games usually don't have as solid of a concept of states and flags as Doom does, so changing a creature's health might be enough to kill or revive them.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49245
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Full-volume monster sounds are not normalized

Post by Graf Zahl »

In Duke that is correct. Its entire state management is 100% code with no data tables at all. The other games are far more robust with their state management.
User avatar
Chris
Posts: 2978
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Full-volume monster sounds are not normalized

Post by Chris »

OpenAL Soft doesn't do anything special with regards to the volume for local/"full-volume" or 3D sounds, other than the usual distance attenuation for 3D sounds. It uses the volume it's given as the base, they all get mixed into a floating-point buffer with the appropriate filters in place, then prior to writing to the system device, optionally applies a compressor/limiter to reduce the volume around samples outside of the -1...+1 range that would otherwise need to be clipped.

At least Windows seems to have its own limiter too -- something other people have previously complained about around here, loud sounds being compressed before OpenAL Soft even got its limiter, because it didn't pre-clip out-of-range floating point samples before giving them to the system. Since OpenAL Soft got its limiter, the logic for when it would enable it by default has been tweaked, to try to be more sensible. Some versions would always have it on by default, while more recent versions would have it off for floating point sample output by default, in case the system wants do its own processing with the full range samples. What is the old version of OpenAL Soft that works, and the newer one that has the issue (snd_status in the console should say)?

Windows, accepting floating point samples, would have it off by default in newer versions. I guess its possible Windows' built-in limiter is itself limited in how much it can compress the output (whereas OpenAL Soft's limiter shouldn't have a problem at least up to +60dBFS, or 1000x linear amplitude; but even then it might still keep up, I'm not completely sure). A user can of course forcefully enable/disable it themselves with the config file or the alsoft-config utility. It can also be controlled by the app using the ALC_SOFT_output_limiter extension. Basically adding

Code: Select all

        attribs.Push(ALC_OUTPUT_LIMITER_SOFT);
        attribs.Push(ALC_TRUE /* or ALC_FALSE or ALC_DONT_CARE_SOFT */);
to the context creation attributes during device init when the extension is supported. Might need to update alext.h for the definitions.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3200
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Full-volume monster sounds are not normalized

Post by drfrag »

GZDoom 4.4.2 used 1.20.1 and 4.3.3 used 1.19.1. So you mean it's a windows problem and must be addressed in GZDoom itself?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49245
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Full-volume monster sounds are not normalized

Post by Graf Zahl »

I added these instructions as described, but how can I test this without endangering my sound hardware? I normally keep the volume slider at 0.25 to match the output I am getting when watching movies so full 1.0 would already kill my system. All I can say that killing monsters on Nuts is extremely loud at a volume setting of 0.01 and due to the low overall settings I use the limiter probably never kicks in.
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Full-volume monster sounds are not normalized

Post by Nash »

Gradually spawn in cyberdemons with a console command and simultaneously "kill monsters" them until the volume buildup starts to pile up?
User avatar
Rachael
Posts: 13964
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Full-volume monster sounds are not normalized

Post by Rachael »

Windows has a hidden recording device called "Stereo Mix" - when opening the sound control panel you must specifically ask it to show disabled devices. It must also be enabled, afterward. (recap: Sound Control Panel (mmsys.cpl), Show hidden devices, enable Stereo Mix device)

What you can do is leave a recorder running (audacity) using this device, then unplug your speakers, and it should allow you to see what happens (visually) without endangering your sound hardware.
User avatar
drfrag
Vintage GZDoom Developer
Posts: 3200
Joined: Fri Apr 23, 2004 3:51 am
Location: Spain
Contact:

Re: Full-volume monster sounds are not normalized

Post by drfrag »

I'd say just kill yourself surrounded by some monsters and resurrect.
Post Reply

Return to “Closed Bugs [GZDoom]”