fix: fallback to next audio format if stream build fails#1083
Closed
givizager-boop wants to merge 1 commit intocjpais:mainfrom
Closed
fix: fallback to next audio format if stream build fails#1083givizager-boop wants to merge 1 commit intocjpais:mainfrom
givizager-boop wants to merge 1 commit intocjpais:mainfrom
Conversation
On some devices (e.g. Synaptics HD Audio), build_input_stream fails with 0x80070057 on F32 even though the device claims to support it. Replace single-try logic with a retry loop over all supported formats sorted by preference (F32 → I16 → I32 → others). On failure logs a warning and tries the next format. - get_preferred_config → get_configs_by_preference returning Vec - Loop with sample_tx.clone() per attempt - First successful build_stream wins
Author
|
Hi! Could you trigger the \ workflow for this PR? The fix addresses a real issue with Synaptics audio devices on Windows where \ fails silently on F32 format. I can't build locally because the project has a dependency issue between \ and \ — \ is forward-declared as opaque in the bundled whisper.cpp header, causing compile errors. A test build from CI would let me verify the fix works. Thanks! |
7 tasks
Owner
|
Closing in favor of #1084, we can discuss further there if you would like! |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On some devices (e.g. Synaptics audio controllers),
build_input_streamfails with error0x80070057when using F32 format, even though the device reports it as supported. The old code picked the best format once and gave up on failure.Fix
Replace single-try logic with a retry loop that tries all supported formats in preference order (F32 → I16 → I32 → others). On failure, logs a warning and tries the next format.
get_preferred_config→get_configs_by_preferencereturning sortedVecsample_txfor each attemptbuild_streamwinsTested on