diff --git a/doc/dox/media/LinuxSoundStack.drawio.svg b/doc/dox/media/LinuxSoundStack.drawio.svg new file mode 100644 index 000000000..0ace8cfbc --- /dev/null +++ b/doc/dox/media/LinuxSoundStack.drawio.svg @@ -0,0 +1,4 @@ + + + +
ALSA
ALSA
PulseAudio
or JACK
PulseAudio...
ALSA API
ALSA API
JACK API
JACK API
PulseAudio API
PulseAudio API
PipeWire
PipeWire
Linux Kernel
Linux Kern...
Application
Application
ALSA
ALSA
Application
Application
Application
Application
ALSA
ALSA
Linux Kernel
Linux Kern...
ALSA
ALSA
Linux Kernel
Linux Kern...
Application
Application
PulseAudio or Jack backend
PulseAudio or Jack backend
PipeWire
PipeWire
Application
Application
Application
Application
Application
Application
Text is not SVG - cannot display
\ No newline at end of file diff --git a/doc/dox/media/SoundMixing.drawio.svg b/doc/dox/media/SoundMixing.drawio.svg new file mode 100644 index 000000000..05d0c16ff --- /dev/null +++ b/doc/dox/media/SoundMixing.drawio.svg @@ -0,0 +1,4 @@ + + + +
Firefox
Firefox
Audacity
Audacity
VLC
VLC
Mixer
Mixer
Mixer
Mixer
L
L
R
R
L
L
R
R
L
L
R
R
L
L
R
R
L
L
R
R
L
L
R
R
L
L
R
R
ALSA
ALSA
PipeWire
PipeWire
Text is not SVG - cannot display
\ No newline at end of file diff --git a/doc/dox/media/SoundStack.svg b/doc/dox/media/SoundStack.svg new file mode 100644 index 000000000..517451bbd --- /dev/null +++ b/doc/dox/media/SoundStack.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + diff --git a/doc/dox/media/pipewire-object-types-relationship.drawio.png b/doc/dox/media/pipewire-object-types-relationship.drawio.png deleted file mode 100644 index adf7e95a8..000000000 Binary files a/doc/dox/media/pipewire-object-types-relationship.drawio.png and /dev/null differ diff --git a/doc/dox/media/pipewire-object-types-relationship.drawio.svg b/doc/dox/media/pipewire-object-types-relationship.drawio.svg new file mode 100644 index 000000000..4d7752f74 --- /dev/null +++ b/doc/dox/media/pipewire-object-types-relationship.drawio.svg @@ -0,0 +1,4 @@ + + + +
Input + output node
Input + output node
Input + output port
Input + output port
PipeWire:Interface:Link
PipeWire:Interface:Link
target.object
target.object
target.object
target.object
PipeWire:Interface:Node
PipeWire:Interface:Node
PipeWire:Interface:Port
PipeWire:Interface:Port
PipeWire:Interface:Client
PipeWire:Interface:Client
PipeWire:Interface:Device
PipeWire:Interface:Device
PipeWire:Interface:Module
PipeWire:Interface:Module
PipeWire:Interface:Profiler
PipeWire:Interface:Profil...
PipeWire:Interface:Metadata
PipeWire:Interface:Metada...
PipeWire:Interface:SecurityContext
PipeWire:Interface:SecurityContext
PipeWire:Interface:Core
PipeWire:Interface:Core
Text is not SVG - cannot display
\ No newline at end of file diff --git a/doc/dox/overview-for-users.md b/doc/dox/overview-for-users.md index 31893225a..281bd8cfb 100644 --- a/doc/dox/overview-for-users.md +++ b/doc/dox/overview-for-users.md @@ -24,7 +24,7 @@ they just use the PulseAudio API provided by PipeWire. Therefore, PulseAudio too ## PipeWire overview -Normally, a system with PipeWire also runs WirePlumber. +Normally, a system with PipeWire also runs **WirePlumber.** **PipeWire** only *provides* the functionality for transporting and transforming audio and video. It is *used* by a session manager. @@ -60,7 +60,7 @@ Some specific properties: Relationships between different object types (`type` property): -![Object type relationship](pipewire-object-types-relationship.drawio.png) +![Object type relationship](pipewire-object-types-relationship.drawio.svg) ```mermaid flowchart LR diff --git a/doc/dox/overview.dox b/doc/dox/overview.dox index 9e2530163..294c05660 100644 --- a/doc/dox/overview.dox +++ b/doc/dox/overview.dox @@ -1,5 +1,38 @@ /** \page page_overview Overview +# The role of PipeWire + +Today’s Linux systems use ALSA (Advanced Linux Sound Architecture) to play and record sound and video. +ALSA is built directly into the Linux Kernel including drivers for sound cards, and applications can use ALSA to play sound. +However, each sound card can only be used by one application at a time – which is one reason why another layer like PipeWire is required: +It mixes multiple audio streams together and sends that to ALSA directly. + +\image html SoundMixing.drawio.svg + +There are a number of popular sound servers for Linux like JACK for low latency or PulseAudio. +PipeWire is the newest one, combining the advantages of its predecessors. + +Applications are programmed to support a certain backend, or sometimes they support more than one. +PipeWire provides API interfaces that look like e.g. ALSA or PulseAudio, so an application only supporting PulseAudio actually works with PipeWire because it looks like PulseAudio to the application. +Therefore, tools like `pavucontrol` *also* work for PipeWire! + +\image html LinuxSoundStack.drawio.svg + +# What do I need? + +Normally, a system with PipeWire also runs **WirePlumber.** + +While **PipeWire** *provides* the functionality for transporting and transforming audio and video, it does not actively react to events like connecting Bluetooth earbuds. +This is the task of the session manager which *uses* PipeWire. + +There is one PipeWire *server* which is used by a number of PipeWire *clients* (the processes that produce/consume multimedia). +PipeWire, as well as WirePlumber, run in *userspace,* so interfacing with them with `systemd` (and `journald` etc.) +happens in *user context* with the `--user` flag, for example +`systemctl --user status pipewire.service` or `journalctl --user -fu wireplumber.service`. + +**WirePlumber** provides [Session Management](https://pipewire.pages.freedesktop.org/wireplumber/design/understanding_session_management.html): It enables new devices when they appear on ALSA, creates and configures nodes, +create links between nodes to route sound from an application to a consumer, etc. + # Concepts ## The PipeWire Server @@ -48,9 +81,9 @@ A recommended pattern that is often used is a single client be a daemon that dea It provides another, higher-level API compared to the PipeWire one, and runs Lua scripts that implement the management logic using the said API. It ships with default scripts and configuration that handle linking policies as well as monitoring and automatic spawning of ALSA, bluez, libcamera and v4l2 devices. The API is available for any process, not only from WirePlumber’s Lua scripts. - -### Node implementation - + +### Node implementation + With the nodes which they implement, clients can send multimedia data into the graph or obtain multimedia data from the graph. A client can create multiple PipeWire nodes. That allows one to create more complex applications;