Give loopback nodes a stable media.name - #11
Merged
rikkichy merged 1 commit intoSep 7, 2026
Conversation
pw-loopback derives media.name from its own PID when nothing sets it, so the nodes come up as "pw-loopback-39482 input" and "pw-loopback-39482 output". WirePlumber's restore-stream keys on media.name when application.name is absent, which is the case here, so every loopback the mixer spawns writes two entries under a name that can never match again. On this machine that is 328 of the 369 keys in stream-properties, all of them dead. It also means restore has never applied to these nodes, since the key is new on every spawn. node.name is already stable and unique per loopback, so use it for media.name as well.
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.
_spawn_loopbacksetsnode.nameon both sides but notmedia.name, so pw-loopback falls back to deriving it from its own PID:WirePlumber's restore-stream keys on
media.namewhenapplication.nameis absent, which is the case for these nodes. The PID is different on every spawn, so each loopback the mixer creates writes two permanent entries under a name that will never match anything again.On my machine that accounts for 328 of the 369 keys in
~/.local/state/wireplumber/stream-properties, all dead:It grows by two per loopback per start, so it is unbounded over the life of the install. The second effect is quieter: restore-stream has never actually applied to these nodes, because the key it saves under is new every time.
node.nameis already stable and unique per loopback, so this uses it formedia.nametoo. Verified that pw-loopback accepts the property and that the resulting nodes come up with the intended name rather than the PID-derived default.Independent of #10, though both touch
_spawn_loopback, so whichever lands second may need a trivial rebase.