-
-
Notifications
You must be signed in to change notification settings - Fork 22.4k
Support overriding the number of channels in the AudioDriverPulseAudio buffer #105682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Support overriding the number of channels in the AudioDriverPulseAudio buffer #105682
Conversation
I love the idea, but this PR seems a bit too ad hoc/hack-y. As you mention, its only for PulseAudio, and is pretty limited in its function (e.g. only applies if the PA driver is stereo to begin with). I think something similar, but in the AudioServer class would be a more robust solution. Being able to override the number of channels Godot uses, then mix and match which channels are copied to the driver. It would be driver/OS independent that way. I'll take a crack at it this weekend, or early next week. |
Great, as long as you know what you are doing. Given how difficult it is to get consensus on the most reasoned changes to the audio system, I was trying to make this the most minimal thing possible. Once this was in, then it would be easier to make the case to extend it to other platforms. This feature is only useful for testing, so ought to be in the Editor settings. A much more useful Project setting feature for production environments would be the opposite: Force Godot to only use Stereo Busses. Almost all flat screen developers will have only ever tested and designed for the stereo case, and the whole Godot surround sound system will likely be (a) unknown to them, (b) untested, and (c) of no interest except as a source of bugs they can't reproduce at home. If I had my way I'd make this setting force the output only to the front two speakers no matter what the underlying configuration -- and set it true by default! |
Take a look at: https://github.com/BuzzLord/godot/tree/audio-server-override-channels I think it does everything we want. It overrides the internal Edit: |
So you did know what you were doing! I can't see how I got it into my head that you needed to hack the individual drivers for each platform. Can this also force surround sound back to stereo sound? I'll have to find someone with a surround sound setup who can confirm this. A few thoughts: When you run Godot with
Maybe there should be some We need to help people out with the fact that Godot calls a pair of PulseAudio channels a "channel". Maybe we should call ours "stereo channels"? I was looking forward to testing this by flipping the left-right speakers, but sadly this isn't an option. |
Yep. I can use this to hear the different stereo volume mixing on my surround setup. It's pretty nice.
Good idea. I'll add something to print out the config details. Also, if you haven't played with it (not sure if you built it, or just looked at the code), I made it so you can just change the settings without restarting the editor, and you can see the channels changing in the Audio tab as you change the speaker mode override.
I've struggled with how to phrase things clearly with the channels. I've used "stereo channels", "channel pair", and "stereo channel pair" in the past, but wasn't confident they actually conveyed what I wanted. I think "stereo channels" is probably best, so I'll update my docs to use that.
Yeah, that would be kinda fun, but would take a bit more in-depth configuration and buffer indexing/management to get it working. Not too hard, but I didn't think it would be worth it (at least for now). |
Yes, I compiled and ran it. Make your pull request already, so I can kill this one off and point to it. |
Pull request made: #105934 The build checks seem to be failing due to an old dependency in the build system missing, so hopefully that gets fixed soon. |
This PR (replacing #103655 ) adds the option
audio/driver/override_channels
to force Godot to create up to 8 channels internally even when your output hardware has only the stereo two.This feature makes it possible for godot developers without the necessary surround sound peripheral to reproduce bugs and review fixes to issues that are the result of an unanticipated number of channels, such as: #92532
It also enables game developers who do not have the hardware to test if their sound system code works okay with multiple channel surround sound.
Cons: This only works when running the PulseAudio system, though it could be extended to the other platforms one at a time.
Also, I have heard that it is theoretically possible to achieve this feature by temporarily reconfiguring PulseAudio at the operating system level. However, it's difficult and I haven't worked out how to do it in a way that doesn't mute all the sound. If someone knows the command to do it, please put it here, otherwise I believe this change is a reasonable option.