Skip to content

arcnmx/wireplumber.rs

Repository files navigation

latest release docs MIT

This crate provides a high-level interface to PipeWire's API via libwireplumber. Explore the crate documentation and the various modules for information on how to start using WirePlumber with Rust.

[dependencies]
wireplumber = { version = "0.1", features = ["v0_4_16"], git = "https://github.com/arcnmx/wireplumber.rs" }

Examples

Some examples are provided that can be built and run via Cargo:

$ cargo run -p wp-examples --bin wpexec -- --help
... snip ...

# try out the default lua example:
$ cargo run -p wp-examples --bin wpexec

# or load the example plugin module:
$ cargo build --workspace --examples &&
  cargo run -p wp-examples --bin wpexec -- --type wireplumber

External

Projects using wireplumber.rs:

  • WirePlumber Scripts is a personal collection of plugins, some previously written as Lua scripts.

Use Cases

This project aims to facilitate the following applications:

  • Enabling Rust to be a viable language for writing session management logic as an alternative to the officially supported Lua scripting engine or GObject C APIs

  • WirePlumber plugins that can augment or expose APIs for Lua configuration scripts to use

  • Stand-alone pipewire clients as an alternative to pipewire-rs

Development

Helper commands are available via cargo wp to facilitate development. Adding ci/bin to your PATH is recommended - the provided direnv shell is set up to do this by default.

  • cargo wp install gir will install the pinned GIR version into ci/bin

    • cargo wp install gir-files for the associated data required by GIR
  • cargo wp gir will update the auto-generated source for the main crate

  • cargo wp sys gir will update the sys bindings source

  • cargo wp todo will display incomplete interfaces (this is just an alias for gir -m not_bound)

  • cargo wp fmt will rustfmt the codebase

GIR Schema

The WirePlumber GIR data is kept in Wp-0.4.gir. A series of fixes must be applied to the upstream XML via the wp-gir-filter script.