LIBPIPEWIRE-MODULE-LINK-FACTORY(7)

okay bestie, welcome to the Link Factory page, straight out of the Miscellaneous Information Manual (the name's libpipewire-module-link-factory, and the manual section is 7, iykyk). sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

libpipewire-module-link-factory β€” Link Factory, but make it iconic πŸ’…


🌸 DESCRIPTION 🌸

So the whole serve of this module? It lets clients create links between ports. That's it, that's the vibe. πŸ¦‹

This module creates a new factory. Clients that can see the factory can use the factory name (link-factory) to create brand new link objects with pw_core_create_object(). And plot twist β€” you can also make objects in the config file. versatile queen πŸ‘‘

An object of the PW_TYPE_INTERFACE_Link will be created, and a proxy to it will be returned. cute little proxy handoff 🫢

And listen: when you pass an argument to the create_object call, a whole set of properties controls what ports will be linked. that's where the magic happens, no cap.


πŸŽ€ MODULE NAME πŸŽ€

libpipewire-module-link-factory

(it's giving "the name is literally right there" πŸ’€)


πŸ’… MODULE OPTIONS πŸ’…

  • allow.link.passive β€” if the link.passive property is allowed. Default is false. By default, the core will decide when a link is passive based on the properties of the node and ports. so the core is the main character here and you're just vibing πŸ’œ

🌈 PROPERTIES FOR THE CREATE_OBJECT CALL 🌈

okay this is the part you actually need, so pay attention bestie, I'm not repeating myself πŸ”₯

  • link.output.node β€” the output node to use. This can be the node object.id, node.name, node.nick, node.description or object.path of a node. When the property is not given or NULL, the output port should be specified. πŸ‘€
  • link.output.port β€” the output port to link. This can be a port object.id, port.name, port.alias or object.path. If an output node is specified, the port must belong to the node. Finding a port in a node using the port.id is deprecated and may lead to unexpected results when the port.id also matches an object.id. 🚩 And if no output port is given, an output node must be specified and a random (unlinked) port will be used from the node. surprise port, but make it functional ✨
  • link.input.node β€” the input node to use. This can be the node object.id, node.name, node.nick, node.description or object.path of a node. When the property is not given or NULL, the input port should be specified. πŸ”
  • link.input.port β€” the input port to link. This can be a port object.id, port.name, port.alias or object.path. If an input node is specified, the port must belong to the node. Finding a port in a node using the port.id is deprecated and may lead to unexpected results when the port.id also matches an object.id. πŸ™ˆ If no input port is given, an input node must be specified and a random (unlinked) port will be used from the node. her again 😭
  • object.linger β€” keep the link around even when the client that created it is gone. she does not leave when the party ends, she is the party πŸ‘‘
  • link.passive β€” the link is passive, meaning that it will not keep nodes busy. By default this property is ignored and the node and port properties are used to determine the passive state of the link. so default = ignored, the node and port props are running the show πŸ’«

⭐ EXAMPLE CONFIGURATION ⭐

The module is usually added to the config file of the main pipewire daemon. standard behaviour, no notes 🧚

context.modules = [
{ name = libpipewire-link-factory
  args = {
      #allow.link.passive = false
  }
}
]

πŸ¦‹ CONFIG OVERRIDE πŸ¦‹

A module.link-factory.args config section can be added to override the module arguments. glow up your module args, queen πŸ’…

# ~/.config/pipewire/pipewire.conf.d/my-link-factory-args.conf

module.link-factory.args = {
    #allow.link.passive = false
}

πŸ‘‘ CONFIG OBJECTS πŸ‘‘

To create an object from the factory, you've got options bestie: use the pw_core_create_object() method, or make an object in the context.objects section, like this:

context.objects = [
{ factory = link-factory
    args = {
        link.output.node = system
        link.output.port = capture_2
        link.input.node  = my-mic
        link.input.port  = input_FR
    }
}
⚠️ Note that this only works when the ports that need to be linked are available at the time the config file is parsed. if they're not there yet? she simply cannot, and it will not work. timing is everything fr fr 😭

🌸 SEE ALSO 🌸

  • pw-link: a tool to manage port links (your bestie for wrangling ports, periodt πŸ’–)

and that's the whole page bestie!! this was written for PipeWire 1.6.11 πŸŽ€ β€” yes, that's the version and the source in the footer, consider it my lil sign-off. go forth and link those ports, you absolute legend πŸ’œβœ¨πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from