summaryrefslogtreecommitdiff
path: root/pipewire/README.md
blob: 5f6477522c6070789ebd545e79656a148eef70ab (plain)
    1 contrib/pipewire how to
    2 ====================
    3 
    4 ## Breaking changes
    5 
    6 Since pipewire 0.3.39, the default „example“ session manager was outsourced to be it's own subproject.
    7 Right now, you have two choices: the example `media-session` or `wireplumber`.
    8 This port does not decide for you, instead it builds with none and you are free to choose yours.
    9 
   10 Note that you **need to choose**. Without a session manager, your audio and video setup **will stop working**!
   11 
   12 ## Intro
   13 `pipewire` is a modern multimedia server. Quoting gentoo wiki, it's strenghts are:
   14 >  -  Minimal latency capture/playback of audio and video
   15 >  -  Real-time multimedia processing
   16 >  -  Multi-process architecture allowing multimedia content sharing between applications
   17 >  -  Seamless support for PulseAudio, JACK, ALSA, and GStreamer
   18 >  -  applications sandboxing support with Flatpak
   19 
   20 Getting `pipewire` to run is relatively easy on `CRUX`. This is a simple guide and relies on further reading upon official and unofficial resources.
   21 
   22 This might also be considered a WIP entry. You can help by sharing your experiences and thoughts.
   23 
   24 ## Prerequisites
   25   - working kernel with alsa audio
   26   - `opt/alsa-utils` will be installed by default as a dependency and needs to be configured by the user
   27   - currently, pipewires default config makes use of `opt/alsa-ucm-conf`, consider installing that alongside the default dependency `opt/alsa-utils`
   28   - pipewire requires a session-manager to run to operate correctly. You can choose between `contrib/media-session` and `contrib/wireplumber` freely.
   29 
   30 ### Optional prerequisites
   31   - pipewire needs pulseaudio to be built with xorg-libxtst around to have the pulseaudio portal available
   32     - `prt-get depinst xorg-libxtst && prt-get update -fr pulseaudio`
   33   - `contrib/rtkit` and a realtime compatible kernel to help with latency, add your user to `rtkit group` to be able to make use of it
   34     - [an stackoverflow question on the topic](https://stackoverflow.com/questions/817059/what-is-preemption-what-is-a-preemtible-kernel-what-is-it-good-for)
   35     - [Real-Time Linux collaborative project](https://wiki.linuxfoundation.org/realtime/start)
   36     - [Arch wiki](https://wiki.archlinux.org/index.php/Realtime_kernel_patchset)
   37     - [linuxaudio.org wiki](https://wiki.linuxaudio.org/wiki/system_configuration#the_kernel)
   38   - please look at `contrib/pipewire/Pkgfile` for further optional dependencies listed and rebuild the package after installing new optional dependencies
   39 
   40 ## Running pipewire
   41 `pipewire` will always leverage `alsa`, so you should configure that first. Use `alsactl store` to store those settings, and configure `/etc/rc.conf` to start `/etc/rc.d/alsa` by default. While you are in `rc.conf`, make sure you start `/etc/rc.d/dbus` too, if you haven't already.
   42 
   43 Resources:
   44   - [Official ALSA wiki](https://alsa-project.org/wiki/Main_Page)
   45   - [Gentoo wiki](https://wiki.gentoo.org/wiki/ALSA)
   46   - [Arch wiki](https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture)
   47 
   48 Currently, pipewires default config format might always change, so it is advised to keep an eye on `rejmerge` to keep your configs updated.
   49 The default config can be copied from `/usr/share/pipewire` to `/etc/pipewire` to be modified. The configuration of `/etc/pipewire` can be copied over to `$XDG_CONFIG_HOME/pipewire`, which should most likely point you to `$HOME/config/pipewire`. There you will need to enable a session manager and optionally enable pulseaudio support for example.
   50 
   51 With your configuration in place you need to run `/usr/bin/pipewire` from a users shell or script (for example I have this in my `i3` config: `exec "/usr/bin/pipewire"`), just make sure that whatever session you are running will be executed as a `dbus-user-session` too (for example from my `~/.xinitrc`: `exec dbus-run-session -- i3`).
   52 
   53 You can verify your running pipewire session by examining the output of `pw-dump`.
   54 
   55 ## Running pipewire-pulse as a pulseaudio-server
   56 If you are a `pulseaudio`-user, make sure it won't autostart with your session. For `pipewire` to handle `pulse-clients`, you will need to run `/usr/bin/pipewire-pulse` as well. Verify that it is working with `pactl info` which should now report: `Server Name: PulseAudio (on PipeWire 0.3.22)`. Now you can use tools like `contrib/pavucontrol` or `contrib/ncpamixer` to control your typical sources and sink settings, ports like `opt/firefox-bin` and whatever else uses `pulseaudio` should work ootb for you too.
   57 
   58 ## Running jack applications through pipewire
   59 to be expanded
   60 
   61 ## Debbuging pipewire
   62 You can run pipewire like that from a terminal: `PIPEWIRE_DEBUG=3 pipewire`
   63 
   64 # Further configuration and fine-tuning
   65 To help configuring, consider reading through the following resources alongside the extensive comments in the default config:
   66  - [Official pipewire wiki](https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/home)
   67  - [Advanced Configuration notes by jasker5183 (pipewire dev)](https://gitlab.freedesktop.org/jasker5183/test/-/blob/master/Advanced%20Configuration.md)
   68  - [Arch wiki](https://wiki.archlinux.org/index.php/PipeWire)
   69  - [Gentoo wiki](https://wiki.gentoo.org/wiki/PipeWire)
   70 
   71 # tl;dr
   72 > „I don't have any time to read up on stuff myself, tell me what I need to do right now to get this hot mess!“ -some user
   73 
   74  - optional: `prt-get depinst xorg-libxtst pulseaudio` et al, see Pkgfile
   75  - install `prt-get depinst pipewire`
   76  - install a session manager, you don't need both!
   77    - `prt-get depinst media-session` or `prt-get depinst wireplumber`
   78  - make changes to your config per usual
   79  - execute while starting your X11/Wayland-Session: `/usr/bin/pipewire`
   80  - optional: execute in addition to have pulseaudio-server support: `/usr/bin/pipewire-pulse`
   81 
   82 // vim:filetype=markdow
   83 // End of file

Generated by cgit