pipewire/README.md

161 lines
4.8 KiB
Markdown
Raw Normal View History

# PipeWire
2020-06-19 13:41:42 +02:00
[PipeWire](https://pipewire.org) is a server and user space API to
deal with multimedia pipelines. This includes:
- Making available sources of video (such as from a capture devices or
application provided streams) and multiplexing this with
clients.
- Accessing sources of video for consumption.
- Generating graphs for audio and video processing.
Nodes in the graph can be implemented as separate processes,
communicating with sockets and exchanging multimedia content using fd
passing.
2020-05-01 20:29:40 +02:00
## Building and installation
2020-08-12 18:10:47 +00:00
The preferred way to install PipeWire is to install it with your
2020-05-01 20:29:40 +02:00
distribution package system. This ensures PipeWire is integrated
into the rest of your system for the best experience.
If you want to build and install PipeWire yourself, refer to
2020-06-11 21:18:32 +02:00
[install](INSTALL.md) for instructions.
2020-05-01 20:29:40 +02:00
## Usage
The most important purpose of PipeWire is to run your favorite apps.
Some application use the native PipeWire API, such as most compositors
(gnome-shell, wayland, ..) to implement screen sharing. These apps will
just work automatically.
Most audio applications can use either ALSA, JACK or PulseAudio as a
backend. PipeWire provides support for all 3 backends. Depending on how
2020-06-22 22:56:54 +00:00
your distribution has configured things this should just work automatically
2020-05-01 20:29:40 +02:00
or with the provided scripts shown below.
PipeWire can use environment variables to control the behaviour of
applications:
2020-06-11 21:18:32 +02:00
* `PIPEWIRE_DEBUG=<level>` to increase the debug level
* `PIPEWIRE_LOG=<filename>` to redirect log to filename
2020-08-02 20:13:29 +02:00
* `PIPEWIRE_LATENCY=<num/denom>` to configure latency as a fraction. 10/1000
configures a 10ms latency. Usually this is
expressed with a denom of the samplerate,
like 256/48000, which uses 256 samples at a
samplerate of 48KHz for a latency of 5.33ms.
2020-06-11 21:18:32 +02:00
* `PIPEWIRE_NODE=<id>` to request link to specified node
2020-05-01 20:29:40 +02:00
### Using tools
2020-06-11 21:18:32 +02:00
`pw-cat` can be used to play and record audio and midi. Use `pw-cat -h` to get
some more help. There are some aliases like `pw-play` and `pw-record` to make
2020-05-01 20:29:40 +02:00
things easier:
```
2020-05-01 20:29:40 +02:00
$ pw-play /home/wim/data/01.\ Firepower.wav
```
2020-05-01 20:29:40 +02:00
### Running JACK applications
2020-05-01 20:29:40 +02:00
Depending on how the system was configured, your can either run PipeWire and
JACK side-by-side or have PipeWire take over the functionality of JACK
completely.
In dual mode, JACK apps will by default use the JACK server. To direct a JACK
2020-06-11 21:18:32 +02:00
app to PipeWire, you can use the `pw-jack` script like this:
```
2020-05-02 08:16:03 +00:00
$ pw-jack <appname>
```
2020-06-11 21:18:32 +02:00
If you replaced JACK with PipeWire completely, `pw-jack` does not have any
2020-08-12 18:10:47 +00:00
effect and can be omitted.
2020-05-01 20:29:40 +02:00
### Running PulseAudio applications
2020-05-01 20:29:40 +02:00
Depending on how the system was configured, your can either run PipeWire and
PulseAudio side-by-side or have PipeWire take over the functionality of
PulseAudio completely. We don't recommend to completely replace PulseAudio
at this point.
2020-06-11 21:18:32 +02:00
Use the `pw-pulse` script to launch a PulseAudio application on PipeWire, like:
2020-05-01 20:29:40 +02:00
```
2020-05-02 08:16:03 +00:00
$ pw-pulse <appname>
2020-05-01 20:29:40 +02:00
```
### Running ALSA applications
If the PipeWire alsa module is installed, it can be seen with
```
2020-05-01 20:29:40 +02:00
$ aplay -L
```
2020-05-01 20:29:40 +02:00
2020-06-11 21:18:32 +02:00
Alsa application can then use the `pipewire:` device to use PipeWire
2020-05-01 20:29:40 +02:00
as the audio system.
### Running GStreamer applications
2020-06-11 21:18:32 +02:00
PipeWire includes 2 GStreamer elements called `pipewiresrc` and
`pipewiresink`. They can be used in pipelines like this:
2020-05-01 20:29:40 +02:00
```
$ gst-launch-1.0 pipewiresrc ! videoconvert ! autovideosink
```
Or to play a beeping sound:
```
$ gst-launch-1.0 audiotestsrc ! pipewiresink
```
PipeWire provides a device monitor as well so that:
```
$ gst-device-monitor-1.0
```
Shows the PipeWire devices and applications like cheese will
automatically use the PipeWire video source when possible.
### Inspecting the PipeWire state
There is currently no native graphical tool to inspect the PipeWire graph
2020-06-11 21:18:32 +02:00
but we recommend to use one of the excellent JACK tools, such as `Carla`,
`catia`, `qjackctl`,... You will not be able to see all features like the video
2020-05-01 20:29:40 +02:00
ports but it is a good start.
2020-06-11 21:18:32 +02:00
`pw-mon` dumps and monitors the state of the PipeWire daemon.
2020-05-01 20:29:40 +02:00
2020-06-11 21:18:32 +02:00
`pw-dot` can dump a graph of the pipeline, checkout out the help for
2020-05-01 20:29:40 +02:00
how to do this.
There is a more complicated tools to inspect the state of the server
2020-06-11 21:18:32 +02:00
with `pw-cli`. This tools can be used interactively or it can execute
2020-05-01 20:29:40 +02:00
single commands like this to get the server information:
```
$ pw-cli info 0
```
2020-06-19 13:41:42 +02:00
## Documentation
Find tutorials and design documentation [here](doc/index.md).
The autogenerated API docs are [here](https://docs.pipewire.org).
2020-06-11 21:18:32 +02:00
## Contributing
PipeWire is Free Software and is developed in the open. It is licensed under
2020-06-12 07:40:28 +02:00
the [MIT license](COPYING).
2020-06-11 21:18:32 +02:00
2020-06-12 07:40:28 +02:00
Contributors are encouraged to submit merge requests or file bugs on
[gitlab](https://gitlab.freedesktop.org/pipewire).
2020-06-11 21:18:32 +02:00
2020-06-12 07:41:52 +02:00
Join us on IRC at #pipewire on [Freenode](https://freenode.net/).
2020-06-11 21:18:32 +02:00
We adhere to the Contributor Covenant for our [code of conduct](CODE_OF_CONDUCT.md).