Repository navigation
wasapi: recover when default endpoint polling finds no device - #320
Conversation
|
Could you also address the related recovery gap in Microsoft documents The wrapper in Authored by Codex on behalf of @hajimehoshi. |
|
Addressed in A private regression extracts the actual wrapper and recovery classifier and substitutes only the native syscall. DEVICE_INVALIDATED and RESOURCES_INVALIDATED fail recognition before the change and pass afterward under race; success, non-transient activation errors and unrelated HRESULT fallback are also checked. Internal package race tests, the other vet analyzers, and Windows 386/amd64/arm64 builds passed. The known baseline Darwin unsafe.Pointer / Windows unkeyed GUID vet diagnostics are unchanged. These are synthetic wrapper tests and cross-builds; native Windows playback or device removal was not run. All nine exact-head upstream checks passed (https://github.com/ebitengine/oto/actions/runs/38772217608), as did all nine fork checks (https://github.com/kumagi/oto/actions/runs/38772205409). |
What issue is this addressing?
None
What type of issue is this addressing?
bug
What this PR does | solves
Treat _E_NOTFOUND during default-endpoint polling as a device-switch condition, entering the existing bounded restart path instead of making the context permanently unusable. Existing HRESULT classification is unchanged: the current wrapper also aliases other Win32 errors to _E_NOTFOUND; fixing that classification is separate.
Validation: An actual-method private harness fails to reach restart on the original code and succeeds after the change under race. It covers wrapped endpoint errors, unchanged and changed IDs, interface release and unrelated fatal errors. COM/native calls are substituted.
Native macOS arm64 internal race tests and build passed. Windows 386/amd64/arm64 builds passed (compile only). Internal vet and other analyzers passed; full vet retains unchanged baseline Darwin unsafe.Pointer and Windows unkeyed GUID diagnostics. Native Windows playback, reconnect and recovery were not run. Independent review found no blocking issue.
Activation recovery follow-up:
IMMDevice::Activatepreserves audio-client HRESULT identity so invalidation during bounded reacquisition reaches the existing retry classifier. Private actual-wrapper old/fixed tests pass under race after the correction; native Windows device removal remains untested.