-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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 driver wasapi audio input handling #75628
base: master
Are you sure you want to change the base?
Fix audio driver wasapi audio input handling #75628
Conversation
Added cleanup of audio input_device on input_stop()
is this PR need tests before to be merge? |
Unfortunately I don't think there aren't very many consistent audio contributors who run Windows so historically WASAPI driver changes have been hard to review. So yeah, it would be good if a few people could provide before and after test results in as many different configurations as possible (different mix rates at the operating system level if possible, ideally different kinds of input/output devices like integrated and usb sound cards). Also for my benefit since I can't test this personally it would be really wonderful there was a more detailed description of the change in the PR description, and details about why you implemented things in the way that you did. Ideally also links to documentation when relevant. My hesitation comes mostly from the fact that there are already WASAPI driver bugs that only affect a very small percentage of users, and I don't think anybody knows what's causing them or how to fix them. I don't want to create more bugs like that. @MJacred I saw you commented on the issue this fixes. If this issue is affecting you it might be good to take a look :) I should also say that I'm too nervous about approving WASAPI driver changes to make a final call and I'm probably going to ask that Juan review it if people provide positive test results and I decide things make sense after cross-referencing all the changes with MSDN. I know that's going to be a lot of work but I want to be pretty sure it's ready before asking him for a review. |
Its been a while since this PR was opened so I need a little time to assess everything but I`ll be checking if this is still needed/relevant/correct asf... EDIT: @ellenhp i found the unittests and got them running aswell. If there is a way to make certain tests build and run ONLY on windows and if there is a way to force the tests to use the WASAPI driver then I will add them until then i will read up on the "scons" build system since I have been mainly using CMake and dont know alot about the former. |
default_input_device_changed = false; | ||
} | ||
// If we're using the Default input device and it changed finish it so we'll re-init the input device | ||
if (ad->audio_input.device_name == "Default" && default_input_device_changed) { |
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.
if (ad->audio_input.device_name == "Default" && default_input_device_changed) { | |
if (default_input_device_changed && ad->audio_input.device_name == "Default") { |
Cheaper condition first
if (err != OK) { | ||
ERR_PRINT("WASAPI: finish_input_device error"); | ||
} | ||
bool reinitDevice = false; |
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.
bool reinitDevice = false; | |
bool reinit_device = false; |
Use snake_case
@ellenhp: Thanks for thinking of me! Though I only commented there because I knew that Godot 3 was affected as well due to me maintaining the Audio Issue Tracker and I'm currently not affected by this |
I Relinquish control, sadly i have no idea anymore :( |
@AThousandShips is your code modification need tests? |
What are you asking? |
Sorry, I read a bit fast the code block above, I understood you wrote this code |
I made suggestions, I didn't write the original code, it's not my code |
Related to this issue: #75603