User:Sam/PipeWire changes


 * PipeWire needs a session manager
 * Before 0.3.49, PipeWire used (now split-out, but we don't package it) pipewire-media-session.
 * As of 0.3.49, PipeWire will use.
 * WirePlumber will take over both audio and video needs for PipeWire once setup.

Most discussions about how to move forward are currently happening in #gentoo-desktop on IRC between leio, sam, and i-garrison. Help is welcome!
 * pipewire-media-session didn't do this (why again? it's been so long! TODO)
 * pipewire parts required for alsa audio can be made optional if needed
 * this may help if there is a need to have alsa-only audio while allowing screencast via pipewire
 * in fact, upstream meson.build has 'alsa' feature with auto-detection enabled, but this is not expressed in pipewire ebuild via IUSE alsa
 * instead, pipewire ebuild unconditionally depends on alsa-lib to make 'alsa' auto-detection succeed

OpenRC

 * OpenRC users are forcefully migrated if using an XDG-compliant desktop environment because of the autostart script installed to which will run.
 * If PipeWire is pulled in as a dependency (like e.g. with GNOME, which needs it for screencasting), their audio is taken over by PW too.
 * Problem: It is not easy for OpenRC users to disable this at all!

systemd

 * The situation here is quite manual. Users are prompted to use to handle enabling/disabling PipeWire, WirePlumber, and PulseAudio's daemon. It works pretty well other than the manual aspect.
 * We don't have the same "takeover" problem as OpenRC.
 * Problem: We have no way for users to have things "just work". We can investigate systemd presets to try solve this. But it's less urgent than the OpenRC situation where there's no choice.

Solutions (or towards them...)

 * leio together with i-garrison (a Gentoo contributor and PulseAudio developer) have split the PulseAudio package into two:
 * This has helped a lot with simplifying the picture for users and making it easier for users to choose between PulseAudio and PipeWire, at least to a degree.
 * i-garrison has started working on a way to selectively enable pipewire audio parts and for users to express exactly which audio server they want, as a proof of concept: https://github.com/gentoo/gentoo/pull/25502
 * We need to figure out what this will look like in terms of USE flags, package names, documentation.
 * We need to make it easy for users to know how to choose PipeWire, PulseAudio, or JACK for their audio needs.
 * Is it required to have "no sound server" option? like in "plain alsa only" but still with screencast over pipewire
 * We should also explain somewhere that using PulseAudio via libpulse is the most common way of actually using PipeWire, given very little uses PipeWire's own APIs.
 * Problem: PipeWire (or WirePlumber?) doesn't cleanly support "disabling audio mode". If it did, we could make life a lot easier.
 * PipeWire provides loadable modules which are only used if WirePlumber configuration enables them
 * It is WirePlumber configuration which effectively enables "audio mode" by default. This is because configuration files provided by upstream and installed by wireplumber ebuild have the following entries: alsa_monitor.enabled = true and bluez_monitor.enabled=true
 * First commit in https://github.com/gentoo/gentoo/pull/25502 patches installed WirePlumber configuration to disable both alsa and bluez effectively disabling "audio mode" and second commit shows how to selectively enable either alsa or bluez or both.
 * It is WirePlumber configuration which effectively enables "audio mode" by default. This is because configuration files provided by upstream and installed by wireplumber ebuild have the following entries: alsa_monitor.enabled = true and bluez_monitor.enabled=true
 * First commit in https://github.com/gentoo/gentoo/pull/25502 patches installed WirePlumber configuration to disable both alsa and bluez effectively disabling "audio mode" and second commit shows how to selectively enable either alsa or bluez or both.

Bugs to chew on and read

 * (includes details of the pipewire-media-session -> wireplumber issues)