3D audio in GZDoom?

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
JackOfOwls63
Posts: 8
Joined: Sun Sep 17, 2023 5:40 am
Operating System Version (Optional): Windows 10

3D audio in GZDoom?

Post by JackOfOwls63 »

Will be getting a pair of JBL cans this week that support DTS Headphone:X 2.0 and wanted to know if there's a mod or hack for GZDoom that allows 3D audio. Doom I/II seems made since the beginning for positional audio with those wonderful monster sounds you'd hear so you knew they were nearby but couldn't exactly pinpoint due to crude stereo effects.
User avatar
Hellser
Global Moderator
Posts: 2730
Joined: Sun Jun 25, 2006 4:43 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11/Manjaro
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Citadel Station

Re: 3D audio in GZDoom?

Post by Hellser »

GZDoom already supports 3D audio support (2.0, 5.1, 7.1). Now, if it will play nice with the DTS Headphone:X 2.0, that's another question in it of itself. If the spatial audio program does things correctly, it should make a new device that GZDoom should detect and automatically set for 5.1/7.1. But you are taking those audio streams and having it ran through a software to emulate 7.1 surround sound on a 2.0 (stereo) headphone. So your mileage may vary.
JackOfOwls63
Posts: 8
Joined: Sun Sep 17, 2023 5:40 am
Operating System Version (Optional): Windows 10

Re: 3D audio in GZDoom?

Post by JackOfOwls63 »

Just tried Doom II in latest GZDoom with my new JBL Quantum cans and DTS:X enabled (using JBL's software) and either it didn't work or the results are just disappointing. Nothing distinguishable from regular stereo. Will be trying the remastered Resident Evil 2 which has native DST:X 3D audio to check to make sure it's working. Maybe my expectations for 3D positional audio are unrealistic.
Professor Hastig
Posts: 255
Joined: Mon Jan 09, 2023 2:02 am
Graphics Processor: nVidia (Modern GZDoom)

Re: 3D audio in GZDoom?

Post by Professor Hastig »

Trust me, it does work, but you have to check what OpenAL thinks of your hardware.
User avatar
Chris
Posts: 2954
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: 3D audio in GZDoom?

Post by Chris »

Yes, it depends on how Windows is reporting the device configuration through the normal WASAPI interfaces. If it's reported as 5.1 or 7.1, it'll be a 5.1 or 7.1 mix, or if it's reported as stereo, it'll be a stereo mix (unless its form factor is reported as headphones or headset, then it'll default to an HRTF mix, which can be toggled on or off in the audio options). Notably, OpenAL doesn't currently use the spatial audio extensions for WASAPI, which apps can use to provide a 7.1(.4(.4)) mix and have Windows Sonic or Dolby Atmos downmix it to headphones or whatever, instead relying either on its own HRTF mixer for headphones, or a virtual surround device on the system for 5.1/7.1 downmixing. It's been under consideration to use the spatial audio extensions for WASAPI, though I'm not quite sure how I want to do it (e.g. when to use it instead of normal output mixing, since there's not much point to making a full 7.1.4.4 mix if it'll just be downmixed to 5.1, which OpenAL can output natively, or for people who prefer OpenAL's HRTF over Sonic or Atmos or whatever).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49183
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: 3D audio in GZDoom?

Post by Graf Zahl »

I just repeat what I said in the past about similar things: This kind of decision making should be the application's business, not the library's.
Normal users want to have the ability to set this within the application's sound settings to try out what sounds best for them.
User avatar
Chris
Posts: 2954
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: 3D audio in GZDoom?

Post by Chris »

Graf Zahl wrote: Tue Sep 19, 2023 2:08 pm I just repeat what I said in the past about similar things: This kind of decision making should be the application's business, not the library's.
Normal users want to have the ability to set this within the application's sound settings to try out what sounds best for them.
Yes, it would include something like a context creation/device reset flag to specify on/off/auto. Ideally it would have a good out-of-the-box default detection, but with an option the app can use to explicitly set.

Return to “General”