Fix audio device reopen#4806
Open
fire332 wants to merge 2 commits into
Open
Conversation
This prevents certain devices like some bluetooth headphones from cycling sleep states which causes a long delay between audio clips in a card.
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.
Linked issue (required)
Fixes #4805
Summary / motivation (required)
This eliminates the close & re-open audio device behavior which prevents some negative device-dependent behaviors from occurring. e.g. some bluetooth headphones cycle sleep states which causes a long delay between audio clips in a card; S/PDIF devices like AVRs have the beginning of the audio cut off as it transitions between audio formats.
Steps to reproduce (required, use N/A if not applicable)
Deck Options -> Audio -> Don't play audio automaticallyis OFFHow to test (required)
Checklist (minimum)
./ninja checkor an equivalent relevant check locally.Details
None.
Before / after behavior (optional)
With the fix applied using appropriate bluetooth headphones, there's no longer a few-second long delay between audio clips and no fade-in effect on subsequent audio clips.
Risk / compatibility / migration (optional)
Going through the git blame:
keep-open=noforce mpv --keep-open=no #232: allows theidle_activeproperty to change on playback finish. This is addressed by adding another property observer foreof_reachedthat callsidle_active.gapless-audio=noAudio pause fix #1221: fixes audio cutting off early. It's been 5 years since that PR and I can't re-produce it.Platform-dependent delay is removed.
Due to the nature of this change, the delay between audio clips is almost completely eliminated. The implication is that cards/decks that rely on the natural delay between clips may sound jarring. Decks should not be relying on this delay in the first place, which can vary with OS, drivers, devices, etc. An option to add a delay between auto-played clips can be added for deck authors if this is an issue.
UI evidence (required for visual changes; otherwise N/A)
N/A
Scope