What issue does your PR resolve?
Describe your PR
Remove outdated code that was left in WASAPI device initialization. In DeviceManager::Rescan(), the input Pa_OpenStream was being called to handle PortMixer, which cdcb2bb18 removed. The stream's result isn't actually used for anything except deciding "totalSources <= 1", which is always true now. Removing the Pa_OpenStream call entirely eliminates the issue. Removing that meant that we no longer needed AddSourcesFromStream, DummyPaStreamCallback, IsInputDeviceAMapperDevice or the WASAPI header, since they were no longer being used, so those were also removed. The dead code was replaced with the functional equivalent of the fallthrough case, which because totalSources <= 1 in all branches is much simpler than the previous code.
IsPlaybackRateSupported and IsCaptureRateSupported within AudioIoBase.cpp may also need to be modified to trust the default OS sample rate (PaDeviceInfo::defaultSampleRate instead of a call to Pa_IsFormatSupported()), as currently the WASAPI code does not have the same kind of guard code as the DirectSound implementation. The TODO within AudioIOBase even anticipates improving the sample rate detection, so it seems that at some point Audacity intended to improve how this works as well.
For now I have only made the one change and would like to see if this single fix (removing the dead code) is enough to address the bug. I was no longer able to reproduce the bug on my machine after implementing this fix, but I would expect to need more people confirming that this new code is working correctly before merge.
Checklist
-
This PR compiles on my machine
-
My contributions are licensed under GPL v2 or later (unless
otherwise exempted). -
All commits have been signed-off to comply with the DCO.
-
I made sure the title of this PR reflects the core meaning of the
issue I am solving. -
I did not make unnecessary changes to the code.
-
I have descriptive commit message(s) that thoroughly cover my
changes.