Skip to content

Improve xrun recovery by retuning#92

Merged
dagargo merged 7 commits intomasterfrom
feat-add-xrun-recovery
Dec 14, 2025
Merged

Improve xrun recovery by retuning#92
dagargo merged 7 commits intomasterfrom
feat-add-xrun-recovery

Conversation

@dagargo
Copy link
Owner

@dagargo dagargo commented Dec 14, 2025

The retuning implementation processes the audio instead of resetting the resampler, which was causing a dropout of the audio for about 7 s.

Additionally, retuning is also run when out-of-range resampling ratios are detected, which was shutting down the whole device.

See #90 for more details.

As printing too much might lead to xruns, ratios can be printed on
level 2 more safely.
The idea is to increase the loop filter bandwidth to adapt faster to
possible changes in the ratio.
No reset of the resampler is needed with this.
The idea is having a state to do exactly the same as with the tune state
with the addition of audio processing. This might create audio artifacts,
specially when the xrun comes with big fluctuations in time measurements,
but avoids a complete resetting of the resampler, which skips the audio
processing for as long as 7 s.
It is possible to use 6 blocks by adding a delay after the control transfer.
Without this, devices crash occasionally.
There is a scenario in which the ratios are outside reasonable values
and maximum and minimum values are used. In this cases, retuning the
resampler will ensure the lowest latencies.
@dagargo dagargo added this to the 2.2 milestone Dec 14, 2025
@dagargo dagargo self-assigned this Dec 14, 2025
@dagargo dagargo changed the title Feat add xrun recovery Improve xrun recovery by retuning Dec 14, 2025
@dagargo dagargo merged commit 1b55156 into master Dec 14, 2025
1 check passed
@dagargo dagargo deleted the feat-add-xrun-recovery branch December 14, 2025 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant