godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
87k stars 19.52k forks source link

Stereo (2-channel) sound output is much quieter than surround (5.1) for 3D sounds. #41666

Open jitspoe opened 3 years ago

jitspoe commented 3 years ago

Godot version: 3.2.2

OS/device including version: Windows 8.1

Issue description: When using stereo (2 channels) settings in my sound driver, 3D sounds are much quieter than with surround mode with headphone output. Note that stereo sounds (such as music) that are not played in 3D are roughly the same volume.

Steps to reproduce: Have some AudioStreamPlayer3D nodes in a scene playing sounds. Set your sound driver settings to use 5.1 surround input with headphone output. Switch to 2 channel input with headphone output and notice the 3D sounds are at like half the volume.

Minimal reproduction project: TestStereoSoundVolume.zip

jitspoe commented 3 years ago

I did mess around with the dot products and such in the engine to get a broader range of angles for just stereo mode, but the overall volume is still much quieter. This can be tweaked simply by adjusting the tightness parameter of _calc_output_vol() in audio_stream_player3d.cpp.

ellenhp commented 2 years ago

I'm going through my backlog. I think this might be a driver bug or intended behavior on the driver's part? I think that a 5.1 signal going into the audio driver with a physical output to stereo might just result in the front right and front left channels being assigned to the two stereo channels. Can you experiment a bit more and determine whether this happens more at specific angles (especially sources behind the camera)?

jitspoe commented 2 years ago

I don't really have sources behind the camera. It's a platformer, so everything is in front. I need to see how this behaves with an actual surround sound setup, but I have some stuff disassembled right now, so I can't test at the moment. Could well be a driver issue. Forgot to mention I was using the HT OMEGA CLARO II sound card, which isn't super common. Curious if it happens with other surround sound setups.

It wouldn't be munch of a problem if it didn't mess with relative levels of 3D stuff vs non-positional audio (like music), but if I balance for surround sound, it's way out of whack for stereo or vice versa.