Skip to content

Give loopback nodes a stable media.name - #11

Merged
rikkichy merged 1 commit into
rikkichy:mainfrom
Sharpienero:fix/stable-loopback-media-name
Sep 7, 2026
Merged

Give loopback nodes a stable media.name#11
rikkichy merged 1 commit into
rikkichy:mainfrom
Sharpienero:fix/stable-loopback-media-name

Conversation

@Sharpienero

@Sharpienero Sharpienero commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

_spawn_loopback sets node.name on both sides but not media.name, so pw-loopback falls back to deriving it from its own PID:

openwave_loop_personal_to_hp        media.name='pw-loopback-39482 output'
openwave_loop_personal_to_hp_cap    media.name='pw-loopback-39482 input'

WirePlumber's restore-stream keys on media.name when application.name is 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:

369  total keys
328  pw-loopback-<PID> input/output   (89%)

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.name is already stable and unique per loopback, so this uses it for media.name too. 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.

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.
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.

2 participants