-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Fix audio crackling issues due to incorrect WASAPI buffer size #89283
Conversation
Just tested with a previously problematic project on my Focusrite Scarlett 18i8. Absolutely zero crackling. Fantastic fix!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes seem simple enough, so if users confirm this fixes the issue, this should be good to merge (and I'll cherry-pick it for 4.2.2 and 4.1.4).
Thanks! And congrats for your first merged Godot contribution 🎉 -- and a very significant one at that, this was a major pain point for a lot of users! |
Cherry-picked for 4.2.2. |
Now that this made it into 4.3 dev 5 and this can be tested there, I'm deleting my branch. Thank you everyone for the feedback, and @akien-mga for doing such a quick job reviewing and implementing this. I'm still keeping an eye on this bug and all the other WASAPI related audio issues that may arise, but it looks like nothing but great news so far! |
Hi @sh4nnja, This thread is about the pull request for the audio crackling bug. Since your issue seems unrelated, you should create a new thread for it in https://github.com/godotengine/godot/issues. |
Hopefully, finally fixes #75109.
This is an extremely straightforward fix to an issue that has been plaguing Godot users as well as players for months. Obtaining the current max buffer size and subtracting the current padding size is the recommended standard practice when calculating the max amount of frames to request to
GetBuffer()
. However, Godot was previously using theperiod_frames
value instead, which is significantly smaller and would cause issues such as crackling and slowdowns during audio playback.I have done extensive testing and I am fairly confident in this fix, but this still requires a lot of testing by as many users with as many different audio devices and drivers as possible.