Experimental GObject Introspection wrapper for PipeWire.
Project description
pipewire-gobject
Experimental GObject/GObject-Introspection binding layer for PipeWire.
This project is a prototype for exposing a safe, high-level, app-facing PipeWire API to Python, GJS, Vala, and other GI consumers. It is not a complete PipeWire binding yet, and it is not a mechanical one-to-one binding of the C API.
The intended direction is a standalone GIR layer for application code that needs PipeWire discovery, metadata, control helpers, and app-owned streams, without implementing WirePlumber-specific session management. WirePlumber's daemon and Lua scripts remain responsible for policy, routing decisions, default-device behavior, and session-manager logic. See docs/rationale.md, docs/community-feedback.md, and docs/roadmap.md for the proposed boundary and roadmap.
Quick Status
| Area | Status |
|---|---|
| Latest preview | 0.3.1, experimental and intended for API feedback. |
| Works today | GIR/typelib generation, PyGObject import, registry/global discovery, metadata helpers, typed global views, read-only node param inspection, limited copied Props updates, app-owned module handles, and F32 capture streams with copied audio blocks. |
| Still maturing | Stream ergonomics, live graph/data-plane tests, confirmed control workflows, real consumer validation, and higher-level app examples. |
| Not in scope | WirePlumber session-manager policy, routing/default-device policy, smart-filter policy, Lua replacement, or raw PipeWire/SPA ownership in bindings. |
Feedback Wanted
The project is looking for early API-shape feedback before more public surface is added:
- whether this boundary is useful for standalone PipeWire GIR bindings;
- whether any part overlaps poorly with WirePlumber's intended public API;
- whether ownership, threading, naming, or GIR annotation choices look problematic for long-term binding consumption;
- which real application workflows should validate the API before it grows.
Documentation Map
README.md: public overview, build instructions, and short examples.docs/rationale.md: canonical project boundary and non-goals.docs/roadmap.md: released milestones and next checkpoints.docs/support-policy.md:0.xAPI, ABI, GIR, dependency, and CI policy.docs/system-dependencies.md: native packages needed for PyPI source builds and runtime imports.docs/community-feedback.md: current community-review questions.docs/api/: extra pages included in the generated API reference.docs/release.md: maintainer release checklist.
Build
meson setup build
meson test -C build --print-errorlogs
Canonical dev container:
docker build -t pipewire-gobject-dev:trixie .
docker run --rm -v "$PWD:/work" -w /work pipewire-gobject-dev:trixie sh -lc '
test -d build || meson setup build
meson compile -C build
meson test -C build --print-errorlogs
ruff check .
'
Required development packages include GLib/GObject, GObject Introspection, and
PipeWire development headers. The minimum supported PipeWire build dependency is
libpipewire-0.3 >= 1.0.2. See
docs/system-dependencies.md for distro package
names.
PyPI Source Package
pipewire-gobject can be installed from PyPI as a source distribution. Pip
builds a local, platform-specific wheel against the system GLib/GIO,
GObject-Introspection, and PipeWire development packages; the project does not
publish portable Linux binary wheels while libgio-2.0 and libpipewire-0.3
remain external runtime dependencies.
python3 -m pip install pipewire-gobject
When using a pip-installed local wheel from a virtual environment, import the
small helper package before loading the GI namespace. It registers the bundled
Pwg-0.1.typelib and libpwg-0.1 search paths with GIRepository:
import pipewire_gobject
import gi
gi.require_version("Pwg", "0.1")
from gi.repository import Pwg
Distro and Flatpak packages that install Pwg-0.1.typelib into the normal
GIRepository search path do not need the helper import.
Support Policy
0.x releases are public previews and may change API or ABI. Pwg-0.1 is the
wrapper API/GIR namespace version; it does not track PipeWire release numbers.
The full policy is in docs/support-policy.md.
Python Smoke Test
After building:
GI_TYPELIB_PATH="$PWD/build" \
LD_LIBRARY_PATH="$PWD/build" \
python3 tests/test_import.py
Expected output:
Pwg import ok
The examples/python/ directory includes small PyGObject examples for registry,
graph summary, client, device, node, port and link listing, node parameter
inspection, default metadata resolution, peak-meter level signals, and copied
audio block delivery.
Minimal peak-meter usage:
import gi
gi.require_version("GLib", "2.0")
gi.require_version("Pwg", "0.1")
from gi.repository import GLib, Pwg
Pwg.init()
loop = GLib.MainLoop()
stream = Pwg.Stream.new_audio_capture(None, True)
def on_level(_stream, peak):
print(f"{peak:.6f}")
stream.connect("level", on_level)
stream.start()
try:
loop.run()
finally:
stream.stop()
API Reference
The generated API reference is built from the installed GIR metadata and the GI annotations in the public headers. It is not committed to the repository. Hosted API reference is published at https://bhack.github.io/pipewire-gobject/.
With gi-docgen installed:
meson compile -C build docs
The HTML output is written to build/api-docs/.
Live PipeWire Smoke Test
With a PipeWire daemon available:
GI_TYPELIB_PATH="$PWD/build" \
LD_LIBRARY_PATH="$PWD/build" \
python3 tests/test_live_pipewire.py
The script prints the wrapper/PipeWire versions and checks core lifecycle, registry discovery, metadata helpers, node inspection, stream start/stop, and the compatibility capture wrapper against a running PipeWire daemon.
License
MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pipewire_gobject-0.3.1.tar.gz.
File metadata
- Download URL: pipewire_gobject-0.3.1.tar.gz
- Upload date:
- Size: 90.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66f7dfbab5eb8958bffc782037bb0e98b94e81fb0fffdf9d0663f70308cba3a6
|
|
| MD5 |
2ffe6b206a9e57b2eb54bd174d6c2b30
|
|
| BLAKE2b-256 |
a1fa892cdd9dbcde29d7d488b8d2265af6b06045393dc17adbc5b7a8561f6ad8
|
Provenance
The following attestation bundles were made for pipewire_gobject-0.3.1.tar.gz:
Publisher:
release.yml on bhack/pipewire-gobject
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pipewire_gobject-0.3.1.tar.gz -
Subject digest:
66f7dfbab5eb8958bffc782037bb0e98b94e81fb0fffdf9d0663f70308cba3a6 - Sigstore transparency entry: 1474156840
- Sigstore integration time:
-
Permalink:
bhack/pipewire-gobject@d4706879ec79379c2b1b58e37c285dcfc6f17dc2 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/bhack
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d4706879ec79379c2b1b58e37c285dcfc6f17dc2 -
Trigger Event:
workflow_dispatch
-
Statement type: