libpipew...l-simple(7)

🌸 NAME 🌸

libpipewire-module-protocol-simple β€” say hi to Protocol Simple bestie πŸ’–. This page lives in the Miscellaneous Information Manual, and the header up top is just the man name chillin' at the edge of your terminal (libpipew...l-simple(7), truncated vibes, you know how it is).


✨ DESCRIPTION ✨

okay so here's the tea πŸ«–: the simple protocol hands you a bidirectional audio stream on a network socket. That's it, that's the whole main character moment. Periodt.

It's meant to be used with the simple protocol player app, which is available on Android, to play and record a stream. 🎧

Every single client that connects is gonna create a capture and/or playback stream β€” which one(s) depends on the configuration options you picked. Choose your own adventure energy. πŸ¦‹

You can also use it to feed audio data to other clients, like the snapcast server. Feeding the girlies, iconic behavior πŸ‘‘


πŸ‘‘ MODULE NAME πŸ‘‘

libpipewire-module-protocol-simple

πŸ’… MODULE OPTIONS πŸ’…

  • capture β€” boolean, is capture enabled or nah? If it's on, this creates a capture stream or a sink for each connected client.
  • playback β€” boolean, is playback enabled or nah? If it's on, this creates a playback or source stream for each connected client.
  • local.ifname = <str> β€” the interface name to use.
  • local.ifaddress = <str> β€” the interface address to use.
  • server.address = [] β€” an array of server addresses to listen on, written as tcp:(<ip>:)<port>.
  • capture.props β€” optional properties for the capture stream.
  • playback.props β€” optional properties for the playback stream.

🌈 GENERAL OPTIONS 🌈

These ones have well-known behavior, so they're lowkey self-explanatory bestie πŸ’œ

  • remote.name
  • audio.rate
  • audio.format
  • audio.channels
  • audio.layout
  • audio.position
  • node.latency
  • node.rate
  • stream.capture.sink
  • node.name
  • node.virtual
  • node.network
  • target.object
By default the server will work with stereo 16 bits samples at 44.1KHz. No cap πŸŽ€

πŸŽ€ EXAMPLE CONFIGURATION πŸŽ€

# ~/.config/pipewire/pipewire.conf.d/my-protocol-simple.conf

context.modules = [
{   name = libpipewire-module-protocol-simple
    args = {
        # Provide capture stream, clients can capture data from PipeWire
        capture = true
        #
        # Provide playback stream, client can send data to PipeWire for playback
        playback = true
        #
        #audio.rate = 44100
        #audio.format = S16
        #audio.channels = 2
        #audio.position = [ FL FR ]
        #
        # The addresses this server listens on for new
        # client connections
        server.address = [
            "tcp:4711"
        ]
        capture.props = {
            # The node name or id to use for capture.
            #target.object = null
            #
            # To make the capture stream capture the monitor ports
            #stream.capture.sink = false
            #
            # Make this a sink instead of a capture stream
            #media.class = Audio/Sink
        }
        playback.props = {
            # The node name or id to use for playback.
            #target.object = null
            #
            # Make this a source instead of a playback stream
            #media.class = Audio/Source
        }
    }
}
]

πŸ¦‹ EXAMPLE CONFIGURATION FOR A SNAPCAST SERVER πŸ¦‹

context.modules = [
{   name = libpipewire-module-protocol-simple
    args = {
        # Provide sink
        capture = true
        audio.rate = 48000
        audio.format = S16
        audio.channels = 2
        audio.position = [ FL FR ]

        # The addresses this server listens on for new
        # client connections
        server.address = [
            "tcp:4711"
        ]
        capture.props = {
            # Make this a sink instead of a capture stream
            media.class = Audio/Sink
        }
    }
}
]

On the snapcast server, add the following to the snapserver.conf file:

\code{.unparsed}
[stream]
sampleformat =  48000:16:2
source = tcp://127.0.0.1:4711?name=PipeWireSnapcast&mode=client

Snapcast will try to connect to the protocol-simple server and fetch the samples from it. And when the connection is somehow broken? Snapcast tries to reconnect. It's giving loyal, it's giving persistent, we love a resilient king πŸ”₯


okay that's the whole page bestie, you ate that πŸ’…βœ¨ this was libpipew...l-simple(7) from PipeWire 1.6.11, mwah, go forth and stream πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from