| Summary: | [Patch] [WinRT] Call PrepDevice during SDL_OpenAudioDevice, not on the audio thread | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Ethan Lee <flibitijibibo> |
| Component: | audio | Assignee: | Ethan Lee <flibitijibibo> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | All | ||
| OS: | Windows 10 | ||
| Attachments: |
Patch to fix WASAPI device init for WinRT
Patch to fix WASAPI device init for WinRT [v2] Patch to fix WASAPI device init for WinRT [v3] |
||
Created attachment 3305 [details]
Patch to fix WASAPI device init for WinRT [v2]
Patch has been updated to use the 'isrecovery' parameter from WASAPI_ActivateDevice. This is necessary for supporting multichannel audio when the requested channel count does not match the device's native channel count.
This code will spin forever if ActivateCompleted() fails. Can you update the patch to handle that case? Created attachment 3311 [details]
Patch to fix WASAPI device init for WinRT [v3]
Patch has been updated to do all of the ActivateResult work on the main thread. This should prevent infinite spinning and is probably safer in other ways as well. Tested on Xbone and Windows 10.
Looks good, thanks! https://hg.libsdl.org/SDL/rev/09e314140a28 |
Created attachment 3277 [details] Patch to fix WASAPI device init for WinRT Attached is a patch that fixes a whole bunch of WASAPI WinRT bugs at once. All it does is move PrepDevice away from the thread and into the ActivateDevice routine, waiting until the async call is complete to do so. It's not the most pleasant thing in the world but the bugs that happen if we _don't_ do this are significantly worse.