Subject: Re: [bug#63863] [PATCH v6] gnu: home: Add support for home-pipewire-service
From: Oleg Pykhalov <[email-masked]>
To: Brian Cully <[email-masked]>
Cc: Ludovic Courtès <[email-masked]>, [email-masked], Tanguy LE CARROUR <[email-masked]>, Andrew Tropin <[email-masked]>
Date: Wed, 20 Dec 2023 11:46:25 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Brian,

Brian Cully <[email-masked]> writes:

> This adds a set of home shepherd services which will start the required
> services for a functional pipewire setup.
>
> * gnu/home/services/sound.scm (home-pipewire-shepherd-service),
> (home-pipewire-pulse-shepherd-service), (home-wireplumber-shepherd-service),

The ‘home-pipewire-pulse-shepherd-service’ procedure is missing. Do you
have a code for this procedure or should it be removed from the commit
message?  The PipeWire service seems to work without it.

> (home-pipewire-shepherd-services)
> (home-pipewire-asoundrc), (home-pipewire-xdg-configuration): new procedures.
> (home-pipewire-service-type): new service type.
> (home-pipewire-configuration): new struct.
> (home-pipewire-disable-pulseaudio-auto-start): new variable.
> * doc/guix.texi (Sound Home Services): document it.
>
> Change-Id: I99e0ae860de91d459c3c554ec5503bf35f785a2a
> ---
>  doc/guix.texi               |  72 +++++++++++++++++++++++++
>  gnu/home/services/sound.scm | 102 +++++++++++++++++++++++++++++++++++-
>  2 files changed, 173 insertions(+), 1 deletion(-)
> ...
> base-commit: d5298c5e334e56a9aabddcb62d312e63135864f6

This is the third implementation of a PipeWire related home services
which I've found on the Internet. In the end all of them are the same
except variable naming. Also I've looked how NixOS and Gentoo GNU/Linux
distributions use PipeWire. Running it is a home service is the
recommended way by the upstream (user's systemd units are recommended by
the upstream to be correct) [1].

[1]: https://github.com/PipeWire/pipewire/blob/bd87902da6a2badae096e4679eedfe9da2e75d79/NEWS#L5573

The patch is tested with the following Guix home configuration:
--8<---------------cut here---------------start------------->8---
    (service home-dbus-service-type)
    (service home-pipewire-service-type)
--8<---------------cut here---------------end--------------->8---

The sound from speakers and microphone work.

Also I've packaged obs-pipewire-audio-capture package which works with
current PipeWire implementation.

I think we could merge the patch after getting
‘home-pipewire-pulse-shepherd-service’ or removing it from the commit
message, e.g.:
--8<---------------cut here---------------start------------->8---
gnu: home: Add home-pipewire service.

This adds a set of home Shepherd services which will start the required
services for a functional PipeWire setup

* gnu/home/services/sound.scm
(home-pipewire-shepherd-service, home-wireplumber-shepherd-service,
home-pipewire-shepherd-services, home-pipewire-asoundrc,
home-pipewire-xdg-configuration): New procedures.
(home-pipewire-service-type): New service type.
(home-pipewire-configuration): New struct.
(home-pipewire-disable-pulseaudio-auto-start): New variable.
* doc/guix.texi (Sound Home Services): Document it.
--8<---------------cut here---------------end--------------->8---

Brian, could you add the code for ‘home-pipewire-pulse-shepherd-service’
if it is required, please?

Thanks,
Oleg.