There doesn't seem to be ANY public documentation on the pipewire API protocol. There's just docs for the C bindings, but lack of protocol documentation is a bit worrying, since none of us can write tools that talk to the server. A LOT of documentation pages are literally empty (just a title an nothing else). This includes the documentation for the native protocol, in case you wanted to write your own client: https://docs.pipewire.org/page_module_protocol_native.html
Apparently, reverse engineering the client/server implementations is the way to go right now.
I never really got good with pactl or the various other interfaces, so while it's great that Pipewire is compatible with them, I was also hoping that Pipewire would mean I never needed to get comfortable with them.
If I have any criticism of Pipewire, it's that as someone who is not really interested in learning all of the quirks and weirdness of the old systems and would happily never really learn those systems except for older compatibility reasons, it's slightly weird to be running Pipewire and have all the tutorials that I've run into around it still start with, "let's learn some Pulseaudio commands".
pw-dump | jq '
(
.[] |
select(.type == "PipeWire:Interface:Metadata") |
(.metadata // [])[] |
select(.key == "default.audio.sink") |
.value.name
) as $default_sink_node_name |
.[] |
select(.info.props["node.name"] == $default_sink_node_name) as $default_sink_node |
.
'BTW, you may consider using `Cow<'a, str>` instead of `&'a str` for the deserialized fields. For JSON strings that have escapes, serde can't deserialize them into a `&'a str`, so the whole deserialization will fail. `Cow<'a, str>` still works with `#[serde(borrow)]` in that strings that can be deserialized in-place will be the `Borrowed(&'a str)` variant, and only strings that can't will be `Owned(String)` (there's a special borrow-specific deserializer of Cow inside serde to achieve this).