Backport "Merge PR #5648: FIX(client): Prevent endless loop when disconnecting PipeWire stream" to 1.4.x#5651
Merged
Krzmbrzl merged 1 commit intomumble-voip:1.4.xfrom May 8, 2022
Conversation
Since version 0.3.51, PipeWire has support for buffers with a size of 0
being passed in the process callback. More specifically, this feature
was added in commit 96286fb8b11658a0fdaa61194504a3f9541b25e6 ("resample:
use a -1 buffer size to drain") in PipeWire [1].
Unfortunately, this causes an endless loop, because we try to destroy
the PipeWire stream, but it keeps waiting for the node to be completely
drained, which now never happens because it keeps calling
processCallback() where we feed buffers with a size of 0 to it.
To fix this problem, we do not longer pass 0-size buffers to PipeWire.
Instead we now push silence, if we don't have any data available. This
is what PipeWire prefers anyway, the process callback wants a buffer to
be filled. If we don't do that, the node will stay in
SPA_STATUS_NEED_DATA state and even if we ignore the obvious endless
loop error, this can cause other problems.
For example above mentioned commit was fixed in PipeWire with
32e957345d63a6d6e3d223057d764ff661f5d101 ("audioadapter: don't loop
forever") [2], which is better than the endless loop but still
preventable.
So in order to avoid unnecessary xruns, we push silence instead of empty
buffers.
Fixes mumble-voip#5647
[1] https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/96286fb8b11658a0fdaa61194504a3f9541b25e7
[2] https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/32e957345d63a6d6e3d223057d764ff661f5d101
(cherry picked from commit f244b13)
Contributor
|
Out of interest, when can we expect the first bugfix release in the 1.4 series? The initial 1.4 release is already half a year in the past, so now might be the best moment. If you decide to do the bugfix release, feel free to ping me one day prior. I can update the GTA 5 positional audio plugin again, so that we finally have a release where the plugin is not already outdated again. |
Member
Author
|
The reason you see all these backport PRs is that my plan is exactly to create a new 1.4 release. When exactly it will ship, I can't tell as that will depend on how much time I find and when. But the goal is to release it somewhat soon-ish. |
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.
Backport
This will backport the following commits from
masterto1.4.x:Questions ?
Please refer to the Backport tool documentation