README.md 5.95 KB
Newer Older
1 2
# PipeWire

Wim Taymans's avatar
Wim Taymans committed
3 4
[PipeWire](https://pipewire.org) is a server and user space API to
deal with multimedia pipelines. This includes:
5 6 7 8 9 10 11 12 13 14 15

  - 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.

Wim Taymans's avatar
Wim Taymans committed
16
## Building and installation
17

Felix Yan's avatar
Felix Yan committed
18
The preferred way to install PipeWire is to install it with your
Wim Taymans's avatar
Wim Taymans committed
19 20 21 22
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
Wim Taymans's avatar
Wim Taymans committed
23
[install](INSTALL.md) for instructions.
Wim Taymans's avatar
Wim Taymans committed
24 25 26 27 28

## Usage

The most important purpose of PipeWire is to run your favorite apps.

29 30 31
Some applications use the native PipeWire API, such as most compositors
(gnome-shell, wayland, ...) to implement screen sharing. These apps will
just work automatically.
Wim Taymans's avatar
Wim Taymans committed
32 33 34

Most audio applications can use either ALSA, JACK or PulseAudio as a
backend. PipeWire provides support for all 3 backends. Depending on how
Jordan Christiansen's avatar
Jordan Christiansen committed
35
your distribution has configured things this should just work automatically
Wim Taymans's avatar
Wim Taymans committed
36 37 38 39 40
or with the provided scripts shown below.

PipeWire can use environment variables to control the behaviour of
applications:

Wim Taymans's avatar
Wim Taymans committed
41 42
* `PIPEWIRE_DEBUG=<level>`         to increase the debug level
* `PIPEWIRE_LOG=<filename>`        to redirect log to filename
43 44
* `PIPEWIRE_LATENCY=<num/denom>`   to configure latency as a fraction. 10/1000
                                   configures a 10ms latency. Usually this is
Wim Taymans's avatar
Wim Taymans committed
45
				   expressed as a fraction of the samplerate,
46 47
				   like 256/48000, which uses 256 samples at a
				   samplerate of 48KHz for a latency of 5.33ms.
Wim Taymans's avatar
Wim Taymans committed
48
* `PIPEWIRE_NODE=<id>`             to request a link to the specified node
Wim Taymans's avatar
Wim Taymans committed
49 50 51

### Using tools

Wim Taymans's avatar
Wim Taymans committed
52 53
`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
Wim Taymans's avatar
Wim Taymans committed
54
things easier:
55 56

```
Wim Taymans's avatar
Wim Taymans committed
57
$ pw-play /home/wim/data/01.\ Firepower.wav
58 59
```

Wim Taymans's avatar
Wim Taymans committed
60
### Running JACK applications
61

62
Depending on how the system was configured, you can either run PipeWire and
Wim Taymans's avatar
Wim Taymans committed
63 64 65 66
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
Wim Taymans's avatar
Wim Taymans committed
67
app to PipeWire, you can use the `pw-jack` script like this:
68 69

```
Wim Taymans's avatar
Wim Taymans committed
70
$ pw-jack <appname>
71 72
```

Wim Taymans's avatar
Wim Taymans committed
73
If you replaced JACK with PipeWire completely, `pw-jack` does not have any
Felix Yan's avatar
Felix Yan committed
74
effect and can be omitted.
Wim Taymans's avatar
Wim Taymans committed
75

76 77 78 79 80 81 82 83 84 85 86
JACK applications will automatically use the buffer-size choosen by the
server. You can force a maximum buffer size (latency) by setting the
`PIPEWIRE_LATENCY` environment variable like so:

```
PIPEWIRE_LATENCY=128/48000 jack_simple_client
```
Requests the `jack_simple_client` to run with a buffer of 128 or
less samples.


Wim Taymans's avatar
Wim Taymans committed
87
### Running PulseAudio applications
88

Wim Taymans's avatar
Wim Taymans committed
89
PipeWire can run a PulseAudio compatible replacement server. You can't
90
use both servers at the same time. Usually your package manager will
Wim Taymans's avatar
Wim Taymans committed
91 92 93
make the server conflict so that you can only install one or the
other.

94 95
PulseAudio applications still use the regular PulseAudio client
libraries and you don't need to do anything else than change the
Wim Taymans's avatar
Wim Taymans committed
96
server implementation.
Wim Taymans's avatar
Wim Taymans committed
97

Wim Taymans's avatar
Wim Taymans committed
98 99
A successful swap of the server can be verified by checking the
output of
Wim Taymans's avatar
Wim Taymans committed
100 101

```
Wim Taymans's avatar
Wim Taymans committed
102 103 104 105 106 107 108
pactl info
```
It should include the string:
```
...
Server Name: PulseAudio (on PipeWire 0.3.x)
...
Wim Taymans's avatar
Wim Taymans committed
109 110
```

111 112 113 114
You can use pavucontrol to change profiles and ports, change volumes
or redirect streams, just like with PulseAudio.


Wim Taymans's avatar
Wim Taymans committed
115 116 117
### Running ALSA applications

If the PipeWire alsa module is installed, it can be seen with
118 119

```
Wim Taymans's avatar
Wim Taymans committed
120
$ aplay -L
121
```
Wim Taymans's avatar
Wim Taymans committed
122

123
ALSA applications can then use the `pipewire:` device to use PipeWire
Wim Taymans's avatar
Wim Taymans committed
124 125 126 127
as the audio system.

### Running GStreamer applications

Wim Taymans's avatar
Wim Taymans committed
128
PipeWire includes 2 GStreamer elements called `pipewiresrc` and
Wim Taymans's avatar
Wim Taymans committed
129
`pipewiresink`. They can be used in pipelines such as this:
Wim Taymans's avatar
Wim Taymans committed
130 131 132 133 134 135 136 137 138 139 140

```
$ gst-launch-1.0 pipewiresrc ! videoconvert ! autovideosink
```

Or to play a beeping sound:

```
$ gst-launch-1.0 audiotestsrc ! pipewiresink
```

141
PipeWire provides a device monitor as well so that
Wim Taymans's avatar
Wim Taymans committed
142 143 144 145 146

```
$ gst-device-monitor-1.0
```

147
shows the PipeWire devices and applications like cheese will
Wim Taymans's avatar
Wim Taymans committed
148 149 150 151 152
automatically use the PipeWire video source when possible.

### Inspecting the PipeWire state

There is currently no native graphical tool to inspect the PipeWire graph
Wim Taymans's avatar
Wim Taymans committed
153
but we recommend to use one of the excellent JACK tools, such as `Carla`,
154 155
`catia`, `qjackctl`, ...
You will not be able to see all features like the video
Wim Taymans's avatar
Wim Taymans committed
156 157
ports but it is a good start.

Wim Taymans's avatar
Wim Taymans committed
158
`pw-mon` dumps and monitors the state of the PipeWire daemon.
Wim Taymans's avatar
Wim Taymans committed
159

Wim Taymans's avatar
Wim Taymans committed
160
`pw-dot` can dump a graph of the pipeline, check out the help for
Wim Taymans's avatar
Wim Taymans committed
161 162
how to do this.

163 164 165 166 167 168 169 170
`pw-top` monitors the real-time status of the graph. This is handy to
find out what clients are running and how much DSP resources they
use.

`pw-dump` dumps the state of the PipeWire daemon in JSON format. This
can be used to find out the properties and parameters of the objects
in the PipeWire daemon.

Wim Taymans's avatar
Wim Taymans committed
171
There is a more complicated tool to inspect the state of the server
Wim Taymans's avatar
Wim Taymans committed
172
with `pw-cli`. This tools can be used interactively or it can execute
Wim Taymans's avatar
Wim Taymans committed
173 174 175 176 177 178
single commands like this to get the server information:

```
$ pw-cli info 0
```

Wim Taymans's avatar
Wim Taymans committed
179 180 181 182
## Documentation

Find tutorials and design documentation [here](doc/index.md).

Wim Taymans's avatar
Wim Taymans committed
183
The (incomplete) autogenerated API docs are [here](https://docs.pipewire.org).
Wim Taymans's avatar
Wim Taymans committed
184

jasker5183's avatar
jasker5183 committed
185 186
The Wiki can be found [here](https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/home)

Wim Taymans's avatar
Wim Taymans committed
187 188 189
## Contributing

PipeWire is Free Software and is developed in the open. It is licensed under
Wim Taymans's avatar
Wim Taymans committed
190
the [MIT license](COPYING).
Wim Taymans's avatar
Wim Taymans committed
191

Wim Taymans's avatar
Wim Taymans committed
192 193
Contributors are encouraged to submit merge requests or file bugs on
[gitlab](https://gitlab.freedesktop.org/pipewire).
Wim Taymans's avatar
Wim Taymans committed
194

Wim Taymans's avatar
Wim Taymans committed
195
Join us on IRC at #pipewire on [Freenode](https://freenode.net/).
Wim Taymans's avatar
Wim Taymans committed
196 197

We adhere to the Contributor Covenant for our [code of conduct](CODE_OF_CONDUCT.md).
Wim Taymans's avatar
Wim Taymans committed
198 199

[Donate using Liberapay](https://liberapay.com/PipeWire/donate).