README.md 4.6 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

Wim Taymans's avatar
Wim Taymans committed
18 19 20 21 22
The prefered way to install PipeWire is to install it with your
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 29 30 31 32 33 34 35 36 37 38 39 40

## 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
your distríbution has configured things this should just work automatically
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 43 44
* `PIPEWIRE_DEBUG=<level>`         to increase the debug level
* `PIPEWIRE_LOG=<filename>`        to redirect log to filename
* `PIPEWIRE_LATENCY=<num/denom>`   to configure latency
* `PIPEWIRE_NODE=<id>`             to request link to specified node
Wim Taymans's avatar
Wim Taymans committed
45 46 47

### Using tools

Wim Taymans's avatar
Wim Taymans committed
48 49
`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
50
things easier:
51 52

```
Wim Taymans's avatar
Wim Taymans committed
53
$ pw-play /home/wim/data/01.\ Firepower.wav
54 55
```

Wim Taymans's avatar
Wim Taymans committed
56
### Running JACK applications
57

Wim Taymans's avatar
Wim Taymans committed
58 59 60 61 62
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
Wim Taymans's avatar
Wim Taymans committed
63
app to PipeWire, you can use the `pw-jack` script like this:
64 65

```
Wim Taymans's avatar
Wim Taymans committed
66
$ pw-jack <appname>
67 68
```

Wim Taymans's avatar
Wim Taymans committed
69
If you replaced JACK with PipeWire completely, `pw-jack` does not have any
Wim Taymans's avatar
Wim Taymans committed
70 71 72
effect and can be ommited.

### Running PulseAudio applications
73

Wim Taymans's avatar
Wim Taymans committed
74 75 76 77 78
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.

Wim Taymans's avatar
Wim Taymans committed
79
Use the `pw-pulse` script to launch a PulseAudio application on PipeWire, like:
Wim Taymans's avatar
Wim Taymans committed
80 81

```
Wim Taymans's avatar
Wim Taymans committed
82
$ pw-pulse <appname>
Wim Taymans's avatar
Wim Taymans committed
83 84 85 86 87
```

### Running ALSA applications

If the PipeWire alsa module is installed, it can be seen with
88 89

```
Wim Taymans's avatar
Wim Taymans committed
90
$ aplay -L
91
```
Wim Taymans's avatar
Wim Taymans committed
92

Wim Taymans's avatar
Wim Taymans committed
93
Alsa application can then use the `pipewire:` device to use PipeWire
Wim Taymans's avatar
Wim Taymans committed
94 95 96 97
as the audio system.

### Running GStreamer applications

Wim Taymans's avatar
Wim Taymans committed
98 99
PipeWire includes 2 GStreamer elements called `pipewiresrc` and
`pipewiresink`. They can be used in pipelines like this:
Wim Taymans's avatar
Wim Taymans committed
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122

```
$ 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
Wim Taymans's avatar
Wim Taymans committed
123 124
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
Wim Taymans's avatar
Wim Taymans committed
125 126
ports but it is a good start.

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

Wim Taymans's avatar
Wim Taymans committed
129
`pw-dot` can dump a graph of the pipeline, checkout out the help for
Wim Taymans's avatar
Wim Taymans committed
130 131 132
how to do this.

There is a more complicated tools to inspect the state of the server
Wim Taymans's avatar
Wim Taymans committed
133
with `pw-cli`. This tools can be used interactively or it can execute
Wim Taymans's avatar
Wim Taymans committed
134 135 136 137 138 139
single commands like this to get the server information:

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

Wim Taymans's avatar
Wim Taymans committed
140 141 142 143 144 145
## Documentation

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

The autogenerated API docs are [here](https://docs.pipewire.org).

Wim Taymans's avatar
Wim Taymans committed
146 147 148
## Contributing

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

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

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

We adhere to the Contributor Covenant for our [code of conduct](CODE_OF_CONDUCT.md).