From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH] gnu: home: Add support for home-pipewire-service Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Fri, 02 Jun 2023 23:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63863@debbugs.gnu.org Cc: Brian Cully , ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by submit@debbugs.gnu.org id=B.168574713410089 (code B ref -1); Fri, 02 Jun 2023 23:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Jun 2023 23:05:34 +0000 Received: from localhost ([127.0.0.1]:41012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Dpu-0002cf-2N for submit@debbugs.gnu.org; Fri, 02 Jun 2023 19:05:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:39362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Dpr-0002cW-Hg for submit@debbugs.gnu.org; Fri, 02 Jun 2023 19:05:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5Dpr-0006TH-9y for guix-patches@gnu.org; Fri, 02 Jun 2023 19:05:31 -0400 Received: from coleridge.kublai.com ([166.84.7.167] helo=mail.spork.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5Dpp-0003TB-7q for guix-patches@gnu.org; Fri, 02 Jun 2023 19:05:31 -0400 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 91003D002; Fri, 2 Jun 2023 19:04:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1685747083; bh=trixCC09+EKP+B1IEuTU2r2r64MHz2Kwb7LDrEIjMSQ=; h=From:To:Cc:Subject:Date; b=DP+CIh2SrwIyxVHxaYAeMHLiChTWtVwgJ8AdvFRba4asAaYefsyVgnK4cP35ip3zy mutAeU0wYDDlrg4sYaOgGmq+7vturhDdBXkWNxU4Bkged/hPfNHXMWsoD9QzeraDlo ySyi+I4cBw9+bZi1SS7IMs+ME4kbGKjWoxh7Bp4E= From: Brian Cully Date: Fri, 2 Jun 2023 19:04:27 -0400 Message-Id: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=166.84.7.167; envelope-from=bjc@spork.org; helo=mail.spork.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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), (home-pipewire-shepherd-services), (generate-doc): new procedures. (home-pipewire-service-type): new service type. (home-pipewire-configuration): new struct. * doc/guix.texi (Sound Home Services): document it. --- doc/guix.texi | 34 +++++++++++++++++ gnu/home/services/sound.scm | 74 ++++++++++++++++++++++++++++++++++++- 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 7f8d8d66e9..0b19c9301f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -116,6 +116,7 @@ Copyright @copyright{} 2023 Karl Hallsby@* Copyright @copyright{} 2023 Nathaniel Nicandro@* Copyright @copyright{} 2023 Tanguy Le Carrour@* +Copyright @copyright{} 2023 Brian Cully@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -43563,6 +43564,39 @@ Sound Home Services This is the multicast address used by default by the two services above. @end defvar +@cindex PipeWire, home service + +@uref{https://pipewire.org, PipeWire} provides a low-latency, +graph-based audio and video processing service. In addition to its +native protocol, it can also be used as a replacement for both JACK and +PulseAudio. + +@defvar home-pipewire-service-type +This provides the service definition for @command{pipewire}, which will +run on login. Its value is a @code{home-pipewire-configuration} object. + +To start the service, add it to the @code{service} field of your +@code{home-environment}, such as: + +@lisp +(service home-pipewire-service-type) +@end lisp + +@deftp {Data Type} home-pipewire-configuration +Available @code{home-pipewire-configuration} fields are: + +@table @asis +@item @code{pipewire} (default: @code{pipewire}) (type: file-like) +The PipeWire package to use. + +@item @code{wireplumber} (default: @code{wireplumber}) (type: file-like) +The WirePlumber package to use. + +@item @code{enable-pulseaudio?} (default: @code{#t}) (type: boolean) +Enable PulseAudio replacement. +@end table +@end deftp + @node Mail Home Services @subsection Mail Home Services diff --git a/gnu/home/services/sound.scm b/gnu/home/services/sound.scm index 22c1a99250..94d8bc7482 100644 --- a/gnu/home/services/sound.scm +++ b/gnu/home/services/sound.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Ludovic Courtès +;;; Copyright © 2023 Brian Cully ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,13 +20,77 @@ (define-module (gnu home services sound) #:use-module (gnu home services) #:use-module (gnu home services shepherd) + #:use-module (gnu packages linux) + #:use-module (gnu services configuration) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (ice-9 match) #:export (home-pulseaudio-rtp-sink-service-type home-pulseaudio-rtp-source-service-type - %pulseaudio-rtp-multicast-address)) + %pulseaudio-rtp-multicast-address + + home-pipewire-configuration + home-pipewire-service-type)) + + +;;; +;;; PipeWire support. +;;; +(define-configuration/no-serialization home-pipewire-configuration + (pipewire (file-like pipewire) "The PipeWire package to use.") + (wireplumber (file-like wireplumber) "The WirePlumber package to use.") + (enable-pulseaudio? (boolean #t) "Enable PulseAudio replacement.")) + +(define (home-pipewire-shepherd-service config) + (shepherd-service + (documentation "PipeWire screen and audio sharing.") + (provision '(pipewire)) + (requirement '(dbus)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire")))))) + +(define (home-pipewire-pulseaudio-shepherd-service config) + (shepherd-service + (documentation "Drop-in PulseAudio replacement service for PipeWire.") + (provision '(pipewire-pulseaudio)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire-pulse")))))) + +(define (home-wireplumber-shepherd-service config) + (shepherd-service + (documentation "WirePlumber session management for PipeWire.") + (provision '(wireplumber)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-wireplumber config) + "/bin/wireplumber")))))) + +(define (home-pipewire-shepherd-services config) + (define shepherd-services + (filter + identity + (list home-pipewire-shepherd-service home-wireplumber-shepherd-service + (and (home-pipewire-configuration-enable-pulseaudio? config) + home-pipewire-pulseaudio-shepherd-service)))) + (map (cut <> config) shepherd-services)) + +(define home-pipewire-service-type + (service-type + (name 'pipewire) + (extensions + (list (service-extension home-shepherd-service-type + home-pipewire-shepherd-services))) + (description + "Start essential PipeWire services.") + (default-value (home-pipewire-configuration)))) ;;; @@ -149,3 +214,10 @@ (define home-pulseaudio-rtp-source-service-type "Define a PulseAudio source to receive audio broadcasted over RTP by another PulseAudio instance.") (default-value %pulseaudio-rtp-multicast-address))) + + +;;; +;;; Generate documentation. +;;; +(define (generate-doc) + (configuration->documentation 'home-pipewire-configuration)) base-commit: c11b92a8aae6fe7fad0da8257ec28f5009c37b35 -- 2.40.1 From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH] gnu: home: Add support for home-pipewire-service Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 09 Jun 2023 20:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brian Cully Cc: , 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.168634214528299 (code B ref 63863); Fri, 09 Jun 2023 20:23:02 +0000 Received: (at 63863) by debbugs.gnu.org; 9 Jun 2023 20:22:25 +0000 Received: from localhost ([127.0.0.1]:60981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7icq-0007MN-G0 for submit@debbugs.gnu.org; Fri, 09 Jun 2023 16:22:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q7ico-0007MA-U2 for 63863@debbugs.gnu.org; Fri, 09 Jun 2023 16:22:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7ici-000108-1n; Fri, 09 Jun 2023 16:22:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=xC3LXa7Jh2OjXh/EOr5+1qVHjmx7EiXP3fB8W+GAcOY=; b=ijknHMDfuE3LuiOa9V0S KCqg6f4MhDt+snFNstrDqx6ryaOU38e+0aOfllKrSpLcf5RLKCKyVJho8T7cJxRoteEAQUPow7hGz nH7epkOPxlH/vwRlnFJ97DgeBrRTXzu/1z7PNQ9WBOQe9RzW1wEueGP49hWyyTn2fDuLkqpRJb/4d +kB8AQnKJEfZptpGW7zu+xs91Ykss2gUdujWB8Ac0MLQAeYNrjJAWaCnlygY5ODtAl7PeSFKlaKca vzRJ47ZCnfeaSEVSh1LvNVVYa4j3BFK1yVt0IMmhQRsIOvfbGTjOqiy1A9YdjZ+EnBmpl4R3RARTI GAKpxIzALWI6Ww==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q7ich-00046H-3A; Fri, 09 Jun 2023 16:22:15 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Date: Fri, 09 Jun 2023 22:22:12 +0200 In-Reply-To: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> (Brian Cully's message of "Fri, 2 Jun 2023 19:04:27 -0400") Message-ID: <87o7lov11n.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Brian Cully skribis: > 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-servic= e), > (home-pipewire-shepherd-services), (generate-doc): new procedures. > (home-pipewire-service-type): new service type. > (home-pipewire-configuration): new struct. > * doc/guix.texi (Sound Home Services): document it. [...] > +@cindex PipeWire, home service > + > +@uref{https://pipewire.org, PipeWire} provides a low-latency, > +graph-based audio and video processing service. In addition to its > +native protocol, it can also be used as a replacement for both JACK and > +PulseAudio. Could you explain why a Home service is necessary (I=E2=80=99d expect it to= be started on-demand via D-Bus or similar, like PulseAudio)? Also, please leave two spaces after end-of-sentence periods (this eases navigation in Emacs). > +@table @asis > +@item @code{pipewire} (default: @code{pipewire}) (type: file-like) > +The PipeWire package to use. > + > +@item @code{wireplumber} (default: @code{wireplumber}) (type: file-like) > +The WirePlumber package to use. Could you add a few words saying what each of these packages does, especially the second one. > +@item @code{enable-pulseaudio?} (default: @code{#t}) (type: boolean) > +Enable PulseAudio replacement. Maybe add: =E2=80=9CWhen true, PulseAudio applications will talk to PipeWir= e, which will handle them as if they were ``native'' PipeWire applications.=E2=80=9D (I=E2=80=99m making it up, but you get the idea.) > +;;; PipeWire support. > +;;; > +(define-configuration/no-serialization home-pipewire-configuration Please leave an empty line after the comment. > +(define (home-pipewire-shepherd-service config) > + (shepherd-service > + (documentation "PipeWire screen and audio sharing.") > + (provision '(pipewire)) > + (requirement '(dbus)) > + (start #~(make-forkexec-constructor > + (list #$(file-append > + (home-pipewire-configuration-pipewire config) > + "/bin/pipewire")))))) Please add the =E2=80=98stop=E2=80=99 method or the process will never be s= topped. :-) > + (start #~(make-forkexec-constructor > + (list #$(file-append > + (home-pipewire-configuration-pipewire config) > + "/bin/pipewire-pulse")))))) Same here=E2=80=A6 > + (start #~(make-forkexec-constructor > + (list #$(file-append > + (home-pipewire-configuration-wireplumber config) > + "/bin/wireplumber")))))) =E2=80=A6 and here. > +(define (home-pipewire-shepherd-services config) > + (define shepherd-services > + (filter > + identity > + (list home-pipewire-shepherd-service home-wireplumber-shepherd-serv= ice > + (and (home-pipewire-configuration-enable-pulseaudio? config) > + home-pipewire-pulseaudio-shepherd-service)))) > + (map (cut <> config) shepherd-services)) Rather: (cons* (home-pipewire-shepherd-service config) (home-wireplumber-shepherd-service config) (if =E2=80=A6 (list (home-pipewire-pulseaudio-shepherd-service config)) '())) > + (description > + "Start essential PipeWire services.") Can you add a couple of sentences? That=E2=80=99s useful when running =E2= =80=98guix home search=E2=80=99 or similar. > + > + > +;;; > +;;; Generate documentation. > +;;; > +(define (generate-doc) > + (configuration->documentation 'home-pipewire-configuration)) This is unused, please remove it. Could you send a v2? Thanks! Ludo=E2=80=99. From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH] gnu: home: Add support for home-pipewire-service Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Jun 2023 05:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brian Cully , 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.168654904418986 (code B ref 63863); Mon, 12 Jun 2023 05:51:01 +0000 Received: (at 63863) by debbugs.gnu.org; 12 Jun 2023 05:50:44 +0000 Received: from localhost ([127.0.0.1]:38626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8aRw-0004wA-22 for submit@debbugs.gnu.org; Mon, 12 Jun 2023 01:50:44 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:47981) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8aRu-0004vv-4K for 63863@debbugs.gnu.org; Mon, 12 Jun 2023 01:50:43 -0400 X-GND-Sasl: andrew@trop.in DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1686549035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=UIkdPhjGUbkvPtOf78y8LAUCs3jd5b2z1p9y0soLn/Q=; b=J8A4Douvf+wI9wlhRKU6IepKvdTzt5v2UlzhPv5eBL+n5hCKhV1M3mTagfshWot2N1SBeQ uTc6PrB65CwMgpgMlT0IHT0RNJA7n7eDdRgtR7Cyc1kUt/cMo1DCCEzvUszP7t2aR072p1 N0NNIS5rmJfRXb6I7FNZRNKQQYih+4NzRQEe6zfpqINwhBDsFroGz6Nf4IOJsNhS5/6OUa pZ7faixkG5ghsYI0gvCnJhHm0LWmPqGt0deDr9GGu6fRW/3osRo3DSS1z1/L7gRQDO2cm9 GJSaa935BqmPs4JbGxvOpYLu5/ZtQhpJzmnGfP0CJDzQwtU1MSXcJ2ypamvFgg== X-GND-Sasl: andrew@trop.in Received: by mail.gandi.net (Postfix) with ESMTPSA id 06EBE240004; Mon, 12 Jun 2023 05:50:34 +0000 (UTC) From: Andrew Tropin In-Reply-To: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Date: Mon, 12 Jun 2023 09:50:31 +0400 Message-ID: <87mt15mdp4.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2023-06-02 19:04, Brian Cully via Guix-patches via wrote: > 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-servic= e), > (home-pipewire-shepherd-services), (generate-doc): new procedures. > (home-pipewire-service-type): new service type. > (home-pipewire-configuration): new struct. > * doc/guix.texi (Sound Home Services): document it. > --- > doc/guix.texi | 34 +++++++++++++++++ > gnu/home/services/sound.scm | 74 ++++++++++++++++++++++++++++++++++++- > 2 files changed, 107 insertions(+), 1 deletion(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 7f8d8d66e9..0b19c9301f 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -116,6 +116,7 @@ > Copyright @copyright{} 2023 Karl Hallsby@* > Copyright @copyright{} 2023 Nathaniel Nicandro@* > Copyright @copyright{} 2023 Tanguy Le Carrour@* > +Copyright @copyright{} 2023 Brian Cully@* >=20=20 > Permission is granted to copy, distribute and/or modify this document > under the terms of the GNU Free Documentation License, Version 1.3 or > @@ -43563,6 +43564,39 @@ Sound Home Services > This is the multicast address used by default by the two services above. > @end defvar >=20=20 > +@cindex PipeWire, home service > + > +@uref{https://pipewire.org, PipeWire} provides a low-latency, > +graph-based audio and video processing service. In addition to its > +native protocol, it can also be used as a replacement for both JACK and > +PulseAudio. > + > +@defvar home-pipewire-service-type > +This provides the service definition for @command{pipewire}, which will > +run on login. Its value is a @code{home-pipewire-configuration} object. > + > +To start the service, add it to the @code{service} field of your > +@code{home-environment}, such as: > + > +@lisp > +(service home-pipewire-service-type) > +@end lisp > + > +@deftp {Data Type} home-pipewire-configuration > +Available @code{home-pipewire-configuration} fields are: > + > +@table @asis > +@item @code{pipewire} (default: @code{pipewire}) (type: file-like) > +The PipeWire package to use. > + > +@item @code{wireplumber} (default: @code{wireplumber}) (type: file-like) > +The WirePlumber package to use. > + > +@item @code{enable-pulseaudio?} (default: @code{#t}) (type: boolean) > +Enable PulseAudio replacement. > +@end table > +@end deftp > + > @node Mail Home Services > @subsection Mail Home Services >=20=20=20 > diff --git a/gnu/home/services/sound.scm b/gnu/home/services/sound.scm > index 22c1a99250..94d8bc7482 100644 > --- a/gnu/home/services/sound.scm > +++ b/gnu/home/services/sound.scm > @@ -1,5 +1,6 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright =C2=A9 2023 Ludovic Court=C3=A8s > +;;; Copyright =C2=A9 2023 Brian Cully > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -19,13 +20,77 @@ > (define-module (gnu home services sound) > #:use-module (gnu home services) > #:use-module (gnu home services shepherd) > + #:use-module (gnu packages linux) > + #:use-module (gnu services configuration) > #:use-module (guix records) > #:use-module (guix gexp) > #:use-module (srfi srfi-1) > + #:use-module (srfi srfi-26) > #:use-module (ice-9 match) > #:export (home-pulseaudio-rtp-sink-service-type > home-pulseaudio-rtp-source-service-type > - %pulseaudio-rtp-multicast-address)) > + %pulseaudio-rtp-multicast-address > + > + home-pipewire-configuration > + home-pipewire-service-type)) > + > + > +;;; > +;;; PipeWire support. > +;;; > +(define-configuration/no-serialization home-pipewire-configuration > + (pipewire (file-like pipewire) "The PipeWire package to use.") > + (wireplumber (file-like wireplumber) "The WirePlumber package to use.") > + (enable-pulseaudio? (boolean #t) "Enable PulseAudio replacement.")) > + > +(define (home-pipewire-shepherd-service config) > + (shepherd-service > + (documentation "PipeWire screen and audio sharing.") The description seems a little bit missleading, while PipeWire can do screensharing, it's not only or even primary role. > + (provision '(pipewire)) > + (requirement '(dbus)) > + (start #~(make-forkexec-constructor > + (list #$(file-append > + (home-pipewire-configuration-pipewire config) > + "/bin/pipewire")))))) > + > +(define (home-pipewire-pulseaudio-shepherd-service config) > + (shepherd-service > + (documentation "Drop-in PulseAudio replacement service for PipeWire.") > + (provision '(pipewire-pulseaudio)) > + (requirement '(pipewire)) > + (start #~(make-forkexec-constructor > + (list #$(file-append > + (home-pipewire-configuration-pipewire config) > + "/bin/pipewire-pulse")))))) > + > +(define (home-wireplumber-shepherd-service config) > + (shepherd-service > + (documentation "WirePlumber session management for PipeWire.") > + (provision '(wireplumber)) > + (requirement '(pipewire)) > + (start #~(make-forkexec-constructor > + (list #$(file-append > + (home-pipewire-configuration-wireplumber config) > + "/bin/wireplumber")))))) > + > +(define (home-pipewire-shepherd-services config) > + (define shepherd-services > + (filter > + identity > + (list home-pipewire-shepherd-service home-wireplumber-shepherd-serv= ice > + (and (home-pipewire-configuration-enable-pulseaudio? config) > + home-pipewire-pulseaudio-shepherd-service)))) > + (map (cut <> config) shepherd-services)) > + > +(define home-pipewire-service-type > + (service-type > + (name 'pipewire) > + (extensions > + (list (service-extension home-shepherd-service-type > + home-pipewire-shepherd-services))) > + (description > + "Start essential PipeWire services.") > + (default-value (home-pipewire-configuration)))) >=20=20 > > ;;; > @@ -149,3 +214,10 @@ (define home-pulseaudio-rtp-source-service-type > "Define a PulseAudio source to receive audio broadcasted over RTP by > another PulseAudio instance.") > (default-value %pulseaudio-rtp-multicast-address))) > + > + > +;;; > +;;; Generate documentation. > +;;; > +(define (generate-doc) > + (configuration->documentation 'home-pipewire-configuration)) > > base-commit: c11b92a8aae6fe7fad0da8257ec28f5009c37b35 Hi Brian, Thank you for the patch! You may also want to add pipewire backend for alsa: https://git.sr.ht/~abcdw/rde/tree/525f8c7f25783c6b8fa55f21c8e62237bc0d4a04/= src/rde/features/linux.scm#L100 =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmSGsicACgkQIgjSCVjB 3rClnxAAjAYXIoPx3Eorh6icMEkTOfYTJUQ7eyIgjfzt0hUw6K4tNE6v3A3XqgZh pmvXV/r4LSibZloZkYDZF15/vwaTwqiGQwuRVP38XtLD58BzKWRSBieIwkO0kQZg 4bXpftBgFMC/6+4YR+9R7koMRAZt8hNQyY3AcrAj+6wOjCxdi/unXq5fhAXR7VKS sceeCzKIwzgeWwKbDZ3wp1ncVbgQ+IjNOSjXSyBfrTtYTAAPVxgx4S8BeRWznPPt ldBaMswvTduXeNFxgAHAUBcsQTEV8SFdtnsX66az6woyrf29/i/7636ZGyYe9ZaS bmbCMNlCfSsGutjvrbGfRdC+u59pYHMZ592+jEu21UAAI1Gff/dS4Pc7dfGxoZtG FKMYPOoB+hyGK/Eeo7uNCtoRCVvElhX2ql/6erpPhqruB8zT0xeHNIAJf1KSHxzr a3u96DroKtsTgmB7iEC5L51j/ojGmNohz98DB05CjPyEICGa/MAzUU0Qm25uRnD8 6H0SI1MKPYpq3q85XqXUSrvz54PyT86QycgsdgAeP4NPAskn+7JkpRUSknVBc4gn icYxCogyn9rFVeFsD3Dgr7xnZ9D+DN3TTKPtZYPysFF7cYgVXGNvb8dbPvfeknpI GS8tek+m/dt0TnrjANjMjJ3s7l/2vgLlbfOHVfSIy138kMa/KxE= =cRyd -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH] gnu: home: Add support for home-pipewire-service Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Jun 2023 16:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Andrew Tropin Cc: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.168658654830797 (code B ref 63863); Mon, 12 Jun 2023 16:16:01 +0000 Received: (at 63863) by debbugs.gnu.org; 12 Jun 2023 16:15:48 +0000 Received: from localhost ([127.0.0.1]:40418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8kCq-00080f-Hp for submit@debbugs.gnu.org; Mon, 12 Jun 2023 12:15:48 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:61260 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8kCl-00080T-AL for 63863@debbugs.gnu.org; Mon, 12 Jun 2023 12:15:46 -0400 Received: from psyduck (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 3D644E496; Mon, 12 Jun 2023 12:15:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1686586542; bh=afInvOpZAepnkuOfwfaHAdUo7MMqWLW9qyDaXo8qq60=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=aSRj1lYiKS9QmWr0YYEvKfBLJQuJSkzdCBwCxg20Qllar/XDtwfjFALxv4/Jqrp7b Bl6Rbj3SFMsJDXbJwvWoLoD8c0Fkt5gdYbhV/WmoY/IwflB63OTLIDvN5p4r54cQ2A JtC5IVx5clcz/Qg2M8+pQNtYfUi0TekesQ4ztIjs= References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> <87mt15mdp4.fsf@trop.in> User-agent: mu4e 1.10.2; emacs 29.0.91 From: Brian Cully Date: Mon, 12 Jun 2023 11:56:20 -0400 In-reply-to: <87mt15mdp4.fsf@trop.in> Message-ID: <875y7spsgv.fsf@psyduck.jhoto.kublai.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Andrew Tropin writes: >> +(define (home-pipewire-shepherd-service config) >> + (shepherd-service >> + (documentation "PipeWire screen and audio sharing.") > > The description seems a little bit missleading, while PipeWire=20 > can do > screensharing, it's not only or even primary role. I'm not sure I understand the objection. Would you rather I=20 mention its audio capabilities before screen sharing? Or would=20 something like "PipeWire media processing" seem to suit it better=20 for you? Truth be told, I find succinctly describing PipeWire for this=20 context to be pretty difficult. It does a lot, and it's all pretty=20 abstract. PipeWire is just plumbing for services people actually=20 care about, and I don't think "PipeWire make media worky" is going=20 to fly =F0=9F=98=89. > Thank you for the patch! You may also want to add pipewire=20 > backend for > alsa: > https://git.sr.ht/~abcdw/rde/tree/525f8c7f25783c6b8fa55f21c8e62237bc0d4a0= 4/src/rde/features/linux.scm#L100 Thanks for the pointer. I'll try to dig through the documentation=20 to see what I can do. I find the Linux sound ecosystem to be=20 pretty confusing. For instance: I thought ALSA was the backend=20 that PipeWire used on Linux already, so I don't understand how=20 ALSA can also use PipeWire as a backend. My use for this patch was Wayland-motivated, and everything=20 outside of basic functionality (screen sharing and playing audio=20 from Firefox and MPD) wasn't something I spent much time on =E2=80=94=20 since I really don't know much about it =E2=80=94 in the hopes that we=20 could provide a minimum level of service for people and add better=20 support as people needed it as time went on. -bjc From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH] gnu: home: Add support for home-pipewire-service Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Jun 2023 04:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brian Cully Cc: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.168663117018103 (code B ref 63863); Tue, 13 Jun 2023 04:40:01 +0000 Received: (at 63863) by debbugs.gnu.org; 13 Jun 2023 04:39:30 +0000 Received: from localhost ([127.0.0.1]:41135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8voY-0004hu-4U for submit@debbugs.gnu.org; Tue, 13 Jun 2023 00:39:30 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:61623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8voV-0004hd-F6 for 63863@debbugs.gnu.org; Tue, 13 Jun 2023 00:39:28 -0400 X-GND-Sasl: andrew@trop.in DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1686631160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PBSg55EhLczNMEI0U6vzYpPS8AZlmmJamE1jgTKTEIA=; b=ZTa3cDE0LkAl3355cjoCAWWC0xcQ0+KYR03Tx+G/kRQmLUu1Ejs80Ms1oGBKWhv5V/G+Tb gs7+tEeBaunXLRVLTp5iFvU3txLCLMQ08SMxTVG7+jwt3G0RinkVx5tUXw0X0sU8aPX66M m8mV+8a+ws5eQYjf2PIWsOsrMWuQy6Dm9mXYqFcqfKBy+DWQktROsnshqLHEEVRcrwIgF6 fZSsMyGysstvQYOD5kbZIm36kMGE06JKiHhGwEEEGZpJxWRYc5RUsTkyE4c9quVPEOIhFp IQ0O+Q6PCHGoNLG7oZmXvffjlyF3gy2BMFA8c3nGIoUg42TyoQEDT6e8YknWVg== X-GND-Sasl: andrew@trop.in Received: by mail.gandi.net (Postfix) with ESMTPSA id 265F540003; Tue, 13 Jun 2023 04:39:19 +0000 (UTC) From: Andrew Tropin In-Reply-To: <875y7spsgv.fsf@psyduck.jhoto.kublai.com> References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> <87mt15mdp4.fsf@trop.in> <875y7spsgv.fsf@psyduck.jhoto.kublai.com> Date: Tue, 13 Jun 2023 08:39:16 +0400 Message-ID: <87pm602cy3.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2023-06-12 11:56, Brian Cully wrote: > Andrew Tropin writes: >>> +(define (home-pipewire-shepherd-service config) >>> + (shepherd-service >>> + (documentation "PipeWire screen and audio sharing.") >> >> The description seems a little bit missleading, while PipeWire=20 >> can do >> screensharing, it's not only or even primary role. > > I'm not sure I understand the objection. Would you rather I=20 > mention its audio capabilities before screen sharing? Nope. > Or would something like "PipeWire media processing" seem to suit it > better for you? Yep. > Truth be told, I find succinctly describing PipeWire for this=20 > context to be pretty difficult. It does a lot, and it's all pretty=20 > abstract. PipeWire is just plumbing for services people actually=20 > care about, and I don't think "PipeWire make media worky" is going=20 > to fly =F0=9F=98=89. > "PipeWire make media worky" would work great! :D jk Real-time multimedia capturing, processing and playback or low-latency, graph-based audio and video processing engine or something like that. >> Thank you for the patch! You may also want to add pipewire=20 >> backend for >> alsa: >> https://git.sr.ht/~abcdw/rde/tree/525f8c7f25783c6b8fa55f21c8e62237bc0d4a= 04/src/rde/features/linux.scm#L100 > > Thanks for the pointer. I'll try to dig through the documentation=20 > to see what I can do. I find the Linux sound ecosystem to be=20 > pretty confusing. For instance: I thought ALSA was the backend=20 > that PipeWire used on Linux already, so I don't understand how=20 > ALSA can also use PipeWire as a backend. > > My use for this patch was Wayland-motivated, and everything=20 > outside of basic functionality (screen sharing and playing audio=20 > from Firefox and MPD) wasn't something I spent much time on =E2=80=94=20 > since I really don't know much about it =E2=80=94 in the hopes that we=20 > could provide a minimum level of service for people and add better=20 > support as people needed it as time went on. Yep, we have similiar use cases in rde and configuration mentioned earlier serves them quite well. According to Alsa: I don't have deep knowledge in this area too, but according to my knowledge pipewire can be loaded as a shared library and injected into alsa user-facing API to process requests, so maybe a backend for ALSA-based applications or middleend for ALSA will be more apropriate name for the pipewire role here :) Anyway, without the config above alsamixer doesn't work on my system, probably with some configuration it's possible to make it work, but bypassing pipewire, however I think it would be nice to go full pipewire. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmSH8vQACgkQIgjSCVjB 3rDEhg/+MqNlQalpc8o1sMAhq39h3dx5c/WJv4QwHXMNdCtpJM/yNa+WF9zAtDUL 79w45+zLV4M2ouwA8+1/0mzj0TIeo/PMF4+q20UagGx7AqgwxFzSfuNgh2ZMMWWy RpMI+SaVoqW8xIZBxtVEVQ6liVr3Gseq/m+bdDCAJfbaVGD7mQe131cWpvuYoupf cctLBZYGdAMcg4Z2FFQteukoXSOZIwpHOuAAmPIPxUDtGYf02qBsg3EGbQ/SrZ98 i+ofEE58zKfT5I1r/1oQ8dG1s4KmVnWpkcZdrAieYCx2ybUS+mfNXjjVJf269hrj 4i1NnQ9e7p+UawgmLN2+6JWKu9IUwZDSVOQEGRmw2MxxrU/VqMdCLEU32WyTMgnj 9kwm73ojdA96Xu8mC1ttKB3CUKbe0ni5gY2rFdNlEZTYW85xpbUO85EOBXGY23vq lhamRphabC29+pVNd/E6KrPnvs6kTQjUJP+zHj7wCldqR0y435PSy3Z5qBTfZSbW clDr0iuGT/dDoLuKgY5gbjdpbEAb7Tbp3iTnA563Pp8lqxE0w15pb8pOsm3OyzQG IS7xw64FTcnl/ltkxEA9nxD4z9eQZjgSq5DXjFX0jMJ6MHh2+ZT0IRGCkz15sgzE B1zQ3JDjK5P9Gp+7xXzqwyq99MqbDAa0BVTJCnWMhjzt1m1GuIg= =gLar -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH] gnu: home: Add support for home-pipewire-service Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Jun 2023 14:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Andrew Tropin Cc: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.1686664881406 (code B ref 63863); Tue, 13 Jun 2023 14:02:02 +0000 Received: (at 63863) by debbugs.gnu.org; 13 Jun 2023 14:01:21 +0000 Received: from localhost ([127.0.0.1]:42596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q94aH-00006S-2u for submit@debbugs.gnu.org; Tue, 13 Jun 2023 10:01:21 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:65147 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q94aF-00006K-Bb for 63863@debbugs.gnu.org; Tue, 13 Jun 2023 10:01:20 -0400 Received: from psyduck (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 575FAE599; Tue, 13 Jun 2023 10:01:09 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1686664878; bh=aciJ2SxF/KDSnT8caOh4cY/RLjfuZUb87cMEUTeWh8g=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=FrzZ616+pRoX3a3GNU27SZ50OPkBNpvJ8P8Tzbw9JjrAtZruIN1f59s1leQc45cQ+ hf9npub8XOiduMZKgChYp6P0DzK8PaepqFIJQrfyAHcVrZ8T703Q9Bbfopjw/yeX5V N/9mRcQYQ3gyQUWERy2ScT5tM40oZ2clCW8S444I= References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> <87mt15mdp4.fsf@trop.in> <875y7spsgv.fsf@psyduck.jhoto.kublai.com> <87pm602cy3.fsf@trop.in> User-agent: mu4e 1.10.2; emacs 29.0.91 From: Brian Cully Date: Tue, 13 Jun 2023 08:20:47 -0400 In-reply-to: <87pm602cy3.fsf@trop.in> Message-ID: <87wn07o40w.fsf@psyduck.jhoto.kublai.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Andrew Tropin writes: >> Or would something like "PipeWire media processing" seem to=20 >> suit it >> better for you? > > Yep. Works for me. > Anyway, without the config above alsamixer doesn't work on my=20 > system, > probably with some configuration it's possible to make it work,=20 > but > bypassing pipewire, however I think it would be nice to go full > pipewire. I've just tried using =E2=80=98alsamixer=E2=80=99 from the =E2=80=98alsa-ut= ils=E2=80=99 package=20 this morning, and it works for me without any additional=20 configuration. It shows both =E2=80=98Card=E2=80=99 and =E2=80=98Chip=E2=80= =99 to be =E2=80=98PulseAudio=E2=80=99,=20 and volume control works. Although, that is with PulseAudio=20 emulation enabled. Should the ALSA configuration always be added?=20 Or just if it's enabled in configuration (possibly defaulting #t)? -bjc From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH] gnu: home: Add support for home-pipewire-service Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 14 Jun 2023 09:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brian Cully Cc: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.168673373211154 (code B ref 63863); Wed, 14 Jun 2023 09:09:01 +0000 Received: (at 63863) by debbugs.gnu.org; 14 Jun 2023 09:08:52 +0000 Received: from localhost ([127.0.0.1]:43700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9MUl-0002tp-PZ for submit@debbugs.gnu.org; Wed, 14 Jun 2023 05:08:52 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:37999) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9MUj-0002ta-2N for 63863@debbugs.gnu.org; Wed, 14 Jun 2023 05:08:50 -0400 X-GND-Sasl: andrew@trop.in DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1686733722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=W9/DsArXO91YyTLR22QTkVQPTjEcQNnHeBvxSOxMi8g=; b=F/B9IaEs/Sh2WQWq/5gVEe0bpEdLxlFji3pq3Ufe6hKZ5k9syyM8G6uzKAvtGhVQjMnlyU 1ISUfrgww711KC+NrGPKBro2OTn7TbIf1e3qYW7YbFQ4Yf5QRfXq1qIiGNmIvOMmNtxc67 stDfE22sAMzcgd3jcwCe7Asd3V//9iaxnkBotXqhtIeh1dgLYidt4pl01rsPfzb7Z2nYXF u9j+qNrVa9oO3H1Ru8hM7307TaEhF+s/NB1SAaWLLvERdUmA8393bHcqziNcV46HoHyZe6 mlH0iod7GcxAkJQcllMRPx6DiyAKyaCf5DIOzOG0YcPttmhsez93UOn9tycXgg== X-GND-Sasl: andrew@trop.in Received: by mail.gandi.net (Postfix) with ESMTPSA id DB01C2000F; Wed, 14 Jun 2023 09:08:41 +0000 (UTC) From: Andrew Tropin In-Reply-To: <87wn07o40w.fsf@psyduck.jhoto.kublai.com> References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> <87mt15mdp4.fsf@trop.in> <875y7spsgv.fsf@psyduck.jhoto.kublai.com> <87pm602cy3.fsf@trop.in> <87wn07o40w.fsf@psyduck.jhoto.kublai.com> Date: Wed, 14 Jun 2023 13:08:36 +0400 Message-ID: <875y7qif6z.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2023-06-13 08:20, Brian Cully wrote: > Andrew Tropin writes: >>> Or would something like "PipeWire media processing" seem to=20 >>> suit it >>> better for you? >> >> Yep. > > Works for me. > >> Anyway, without the config above alsamixer doesn't work on my=20 >> system, >> probably with some configuration it's possible to make it work,=20 >> but >> bypassing pipewire, however I think it would be nice to go full >> pipewire. > > I've just tried using =E2=80=98alsamixer=E2=80=99 from the =E2=80=98alsa-= utils=E2=80=99 package=20 > this morning, and it works for me without any additional=20 > configuration. It shows both =E2=80=98Card=E2=80=99 and =E2=80=98Chip=E2= =80=99 to be =E2=80=98PulseAudio=E2=80=99,=20 > and volume control works. Although, that is with PulseAudio=20 > emulation enabled. With config mentioned earlier it shows PipeWire in Card and Chip. > Should the ALSA configuration always be added? Or just if it's > enabled in configuration (possibly defaulting #t)? Yep, I think it should be always added by default. Also, it make sense to disable autospawn of pulseaudio to prevent accidential interference. Like this: https://git.sr.ht/~abcdw/rde/tree/4365d81c0775beb0f623b756423e17275dbb2d00/= src/rde/features/linux.scm#L128 =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmSJg5QACgkQIgjSCVjB 3rBL5Q//b88E4u4RT1v9D2FMzmTgit9ZdSP5kEueTvy30CGHtDYbqO3g5yXOxJNE V+zEYjkMiXHQFEnbaNzRprwKd5H3WUI7S1UKWgrlUKrWIJdGO/TbvEFIrglyJWZT s8OO79TXmfBHDn2TRPXwtCtbwgXCfTapebUciunGTsApumYo9/13e6Lig2YoNOyb 9ZhKD3HiMjI+pbq/lbWz80WPPVdzVvtfKma6dZDC+jGpBRFCWSyhe37VVpR61wxX qGpkuf9DAsJEg2NBybIzpK104WqAmn9k4acJWbUTBj8X4qfCmoRK7im91Z6R/KSe aIojQOuXWJxnOi/LMHdqjkjRXRkjc7obGmq4xPqutiCX1GRfQi7G8CSLehw4/drm V0dtPXZPySugvoRYH7xl0nVIaGYo2gHlkzYwzzxC63vPF2b11G0Z/CnbIgAo600U W2iEYOh7W1ww5+qXWCxPqTI3LGI12ZHMGsyQVChhvjmvHW8OvbkhXPWjMXt5o5of zSBffaFU4TZy4Vvp5vwqnhGkRDdBi/2YHCMzu+/cfwRPXuzgfR5w+hJWbvpY6JI9 ZuFoMcflNeus3s4x0fDh0ilifI0xUZc8klIPyHliNhe5gM6SBNgMUcmgd+Mhz12R DodxX/K+e/Glh6tjE7i2b/vCZREP2BVcReJ/J1YsjtBPP77MOyg= =9DrV -----END PGP SIGNATURE----- --=-=-=-- From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v2] gnu: home: Add support for home-pipewire-service References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> In-Reply-To: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Thu, 15 Jun 2023 13:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63863@debbugs.gnu.org Cc: Brian Cully , ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.168683507917181 (code B ref 63863); Thu, 15 Jun 2023 13:18:01 +0000 Received: (at 63863) by debbugs.gnu.org; 15 Jun 2023 13:17:59 +0000 Received: from localhost ([127.0.0.1]:46440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9mrO-0004T2-Ig for submit@debbugs.gnu.org; Thu, 15 Jun 2023 09:17:59 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:63736 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9mrL-0004St-JY for 63863@debbugs.gnu.org; Thu, 15 Jun 2023 09:17:57 -0400 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id BEFDFE76C; Thu, 15 Jun 2023 09:17:53 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1686835074; bh=KRn/mJjip4CdE66iRv4NI0greoLNEgDHe0XvbhR4RKk=; h=From:To:Cc:Subject:Date; b=lCvcPmbv9EF2jTe/0tNPjooMHU6AEneta0LR9/nr8pDx1nkxv3r96sZfw4JKkZ2Fl kjquJoMQwE8YNxcfnFvN97DCPuhb9r4qz/NFrCNXM2polvLiEaynCuoNPOtpx/57bZ rZeGGHDIJRXveLORjg+R3QnY4jApBoBgMevgeoCw= From: Brian Cully Date: Thu, 15 Jun 2023 09:16:34 -0400 Message-Id: <92a7e4009704b62b5ceddfa3fdd5bd12fb6ef91c.1686834990.git.bjc@spork.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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), (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. --- doc/guix.texi | 47 +++++++++++++++ gnu/home/services/sound.scm | 115 +++++++++++++++++++++++++++++++++++- 2 files changed, 161 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 9232c82b4b..ee50d7a324 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -116,6 +116,7 @@ Copyright @copyright{} 2023 Karl Hallsby@* Copyright @copyright{} 2023 Nathaniel Nicandro@* Copyright @copyright{} 2023 Tanguy Le Carrour@* +Copyright @copyright{} 2023 Brian Cully@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -43635,6 +43636,52 @@ Sound Home Services This is the multicast address used by default by the two services above. @end defvar +@cindex PipeWire, home service + +@uref{https://pipewire.org, PipeWire} provides a low-latency, +graph-based audio and video processing service. In addition to its +native protocol, it can also be used as a replacement for both JACK and +PulseAudio. + +While PipeWire provides the media processing and API, it does not, +directly, know about devices such as sound cards, nor how you might want +to connect applications, hardware, and media processing +filters. Instead, PipeWire relies on a @dfn{session manager} to specify +all these relationships. While you may use any session manager you wish, +for most people the +@url{https://pipewire.pages.freedesktop.org/wireplumber/, WirePlumber} +session manager, a reference implementation provided by the PipeWire +project itself, suffices, and that is the one +@code{home-pipewire-service-type} uses. + +@defvar home-pipewire-service-type +This provides the service definition for @command{pipewire}, which will +run on login. Its value is a @code{home-pipewire-configuration} object. + +To start the service, add it to the @code{service} field of your +@code{home-environment}, such as: + +@lisp +(service home-pipewire-service-type) +@end lisp +@end defvar + +@deftp {Data Type} home-pipewire-configuration +Available @code{home-pipewire-configuration} fields are: + +@table @asis +@item @code{pipewire} (default: @code{pipewire}) (type: file-like) +The PipeWire package to use. + +@item @code{wireplumber} (default: @code{wireplumber}) (type: file-like) +The WirePlumber package to use. + +@item @code{enable-pulseaudio?} (default: @code{#t}) (type: boolean) +When true, enable PipeWire's PulseAudio emulation support, allowing +PulseAudio clients to use PipeWire transparently. +@end table +@end deftp + @node Mail Home Services @subsection Mail Home Services diff --git a/gnu/home/services/sound.scm b/gnu/home/services/sound.scm index 22c1a99250..5463255e8c 100644 --- a/gnu/home/services/sound.scm +++ b/gnu/home/services/sound.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Ludovic Courtès +;;; Copyright © 2023 Brian Cully ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,13 +20,125 @@ (define-module (gnu home services sound) #:use-module (gnu home services) #:use-module (gnu home services shepherd) + #:use-module (gnu home services xdg) + #:use-module (gnu packages linux) + #:use-module (gnu services configuration) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:export (home-pulseaudio-rtp-sink-service-type home-pulseaudio-rtp-source-service-type - %pulseaudio-rtp-multicast-address)) + %pulseaudio-rtp-multicast-address + + home-pipewire-configuration + home-pipewire-service-type)) + + +;;; +;;; PipeWire support. +;;; + +(define-configuration/no-serialization home-pipewire-configuration + (pipewire + (file-like pipewire) + "The PipeWire package to use.") + (wireplumber + (file-like wireplumber) + "The WirePlumber package to use.") + (enable-pulseaudio? + (boolean #t) + "When true, enable PipeWire's PulseAudio emulation support, allowing +PulseAudio clients to use PipeWire transparently.")) + +(define (home-pipewire-shepherd-service config) + (shepherd-service + (documentation "PipeWire media processing.") + (provision '(pipewire)) + (requirement '(dbus)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire")))) + (stop #~(make-kill-destructor)))) + +(define (home-pipewire-pulseaudio-shepherd-service config) + (shepherd-service + (documentation "Drop-in PulseAudio replacement service for PipeWire.") + (provision '(pipewire-pulseaudio)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire-pulse")))) + (stop #~(make-kill-destructor)))) + +(define (home-wireplumber-shepherd-service config) + (shepherd-service + (documentation "WirePlumber session management for PipeWire.") + (provision '(wireplumber)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-wireplumber config) + "/bin/wireplumber")))) + (stop #~(make-kill-destructor)))) + +(define (home-pipewire-shepherd-services config) + (cons* (home-pipewire-shepherd-service config) + (home-wireplumber-shepherd-service config) + (if (home-pipewire-configuration-enable-pulseaudio? config) + (list (home-pipewire-pulseaudio-shepherd-service config)) + '()))) + +(define (home-pipewire-asoundrc config) + (mixed-text-file + "asoundrc" + #~(string-append + "<" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/share/alsa/alsa.conf.d/50-pipewire.conf") + ">\n" + "<" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/share/alsa/alsa.conf.d/99-pipewire-default.conf") + ">\n" + "pcm_type.pipewire {\n" + " lib \"" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/lib/alsa-lib/libasound_module_pcm_pipewire.so") + "\"\n}\n" + "ctl_type.pipewire {\n" + " lib \"" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/lib/alsa-lib/libasound_module_ctl_pipewire.so") + "\"\n}\n"))) + +(define home-pipewire-disable-pulseaudio-auto-start + (plain-file "client.conf" "autospawn = no")) + +(define (home-pipewire-xdg-configuration config) + (cons* `("alsa/asoundrc" ,(home-pipewire-asoundrc config)) + (if (home-pipewire-configuration-enable-pulseaudio? config) + `(("pulse/client.conf" + ,home-pipewire-disable-pulseaudio-auto-start)) + '()))) + +(define home-pipewire-service-type + (service-type + (name 'pipewire) + (extensions + (list (service-extension home-shepherd-service-type + home-pipewire-shepherd-services) + (service-extension home-xdg-configuration-files-service-type + home-pipewire-xdg-configuration))) + (description + "Start essential PipeWire services.") + (default-value (home-pipewire-configuration)))) ;;; base-commit: f74df2ab879fc5457982bbc85b7455a90e82317d -- 2.40.1 From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v2] gnu: home: Add support for home-pipewire-service Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 15 Jun 2023 13:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brian Cully Cc: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.168683543717769 (code B ref 63863); Thu, 15 Jun 2023 13:24:02 +0000 Received: (at 63863) by debbugs.gnu.org; 15 Jun 2023 13:23:57 +0000 Received: from localhost ([127.0.0.1]:46444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9mxA-0004cW-N5 for submit@debbugs.gnu.org; Thu, 15 Jun 2023 09:23:56 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:57917 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9mx9-0004cQ-Sb for 63863@debbugs.gnu.org; Thu, 15 Jun 2023 09:23:56 -0400 Received: from psyduck (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id ACC3EE76D; Thu, 15 Jun 2023 09:23:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1686835435; bh=ZyJ1lkekTYe3ENKihWBX2Tzo1X9qtQOmOwjhqoiXmNU=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=Gt/XOknwwXkCEVzTuuBAQWgY2vtt9xZhvCFq6wElNwEBqG3lTuCLazdqtQweYy4kr 7JySRioxBCYitssOgFS+5/lrFkjvQlmCJRtsMRgkpmVu/GrxMjMEOw1PtgoEyHPPo2 xTIzWr5o5KxNe+RiGzUv8vqqQGz2bTJsslun7uac= References: <92a7e4009704b62b5ceddfa3fdd5bd12fb6ef91c.1686834990.git.bjc@spork.org> User-agent: mu4e 1.10.2; emacs 29.0.91 From: Brian Cully Date: Thu, 15 Jun 2023 09:19:53 -0400 In-reply-to: <92a7e4009704b62b5ceddfa3fdd5bd12fb6ef91c.1686834990.git.bjc@spork.org> Message-ID: <87bkhgeu50.fsf@psyduck.jhoto.kublai.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This address most of the issues, I hope. * I've added a config for ALSA. * I'm disabling autospawn for PulseAudio when =E2=80=98enable-pulseaudio?= =E2=80=99=20 is #t * I've added a paragraph to the documentation explaining=20 WireGuard. * The missing Shepherd =E2=80=98stop=E2=80=99 fields are no longer missing. * I've changed the wording for the Shepherd =E2=80=98pipewire=E2=80=99 serv= ice=20 documentation. * The documentation generation function has been removed. * I've reworded the =E2=80=98enable-pulseaudio?=E2=80=99 configuration fiel= d of=20 =E2=80=98home-pipewire-configuration=E2=80=99. -bjc From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v3] gnu: home: Add support for home-pipewire-service References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> In-Reply-To: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Thu, 15 Jun 2023 13:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63863@debbugs.gnu.org Cc: Brian Cully , ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.168683562618068 (code B ref 63863); Thu, 15 Jun 2023 13:28:01 +0000 Received: (at 63863) by debbugs.gnu.org; 15 Jun 2023 13:27:06 +0000 Received: from localhost ([127.0.0.1]:46449 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9n0D-0004hL-8V for submit@debbugs.gnu.org; Thu, 15 Jun 2023 09:27:06 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:59723 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9n0A-0004hA-Qw for 63863@debbugs.gnu.org; Thu, 15 Jun 2023 09:27:04 -0400 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 96F32E853; Thu, 15 Jun 2023 09:27:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1686835622; bh=/Ikh5cEmV7pjX7cqNN29li9LyQ0cVlcKKb7Ckf52TaY=; h=From:To:Cc:Subject:Date; b=irCGYRXqk2nrQJKCZi95FfCb9csi04GYVgErq3+48vx7/TKKDdyvU7t8dmJ8NQSK1 go+se0Z4TDsDx4da5zgigyw1g/N/zTzvbgC26vJDJfICp/lW1Kz5GkfMaQdiUq/AXg FvCtQ2lpWZO4XSFMMoHJbRf/i73jA4y10IlLJFcM= From: Brian Cully Date: Thu, 15 Jun 2023 09:26:59 -0400 Message-Id: <1f25804bdd4994e607f701a4bad4085cb180bc39.1686835617.git.bjc@spork.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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), (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. --- doc/guix.texi | 46 +++++++++++++++ gnu/home/services/sound.scm | 115 +++++++++++++++++++++++++++++++++++- 2 files changed, 160 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 9232c82b4b..c5e7066a4c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -116,6 +116,7 @@ Copyright @copyright{} 2023 Karl Hallsby@* Copyright @copyright{} 2023 Nathaniel Nicandro@* Copyright @copyright{} 2023 Tanguy Le Carrour@* +Copyright @copyright{} 2023 Brian Cully@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -43635,6 +43636,51 @@ Sound Home Services This is the multicast address used by default by the two services above. @end defvar +@cindex PipeWire, home service + +@uref{https://pipewire.org, PipeWire} provides a low-latency, +graph-based audio and video processing service. In addition to its +native protocol, it can also be used as a replacement for both JACK and +PulseAudio. + +While PipeWire provides the media processing and API, it does not, +directly, know about devices such as sound cards, nor how you might want +to connect applications, hardware, and media processing filters. +Instead, PipeWire relies on a @dfn{session manager} to specify all these +relationships. While you may use any session manager you wish, for most +people the @url{https://pipewire.pages.freedesktop.org/wireplumber/, +WirePlumber} session manager, a reference implementation provided by the +PipeWire project itself, suffices, and that is the one +@code{home-pipewire-service-type} uses. + +@defvar home-pipewire-service-type +This provides the service definition for @command{pipewire}, which will +run on login. Its value is a @code{home-pipewire-configuration} object. + +To start the service, add it to the @code{service} field of your +@code{home-environment}, such as: + +@lisp +(service home-pipewire-service-type) +@end lisp +@end defvar + +@deftp {Data Type} home-pipewire-configuration +Available @code{home-pipewire-configuration} fields are: + +@table @asis +@item @code{pipewire} (default: @code{pipewire}) (type: file-like) +The PipeWire package to use. + +@item @code{wireplumber} (default: @code{wireplumber}) (type: file-like) +The WirePlumber package to use. + +@item @code{enable-pulseaudio?} (default: @code{#t}) (type: boolean) +When true, enable PipeWire's PulseAudio emulation support, allowing +PulseAudio clients to use PipeWire transparently. +@end table +@end deftp + @node Mail Home Services @subsection Mail Home Services diff --git a/gnu/home/services/sound.scm b/gnu/home/services/sound.scm index 22c1a99250..5463255e8c 100644 --- a/gnu/home/services/sound.scm +++ b/gnu/home/services/sound.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Ludovic Courtès +;;; Copyright © 2023 Brian Cully ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,13 +20,125 @@ (define-module (gnu home services sound) #:use-module (gnu home services) #:use-module (gnu home services shepherd) + #:use-module (gnu home services xdg) + #:use-module (gnu packages linux) + #:use-module (gnu services configuration) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:export (home-pulseaudio-rtp-sink-service-type home-pulseaudio-rtp-source-service-type - %pulseaudio-rtp-multicast-address)) + %pulseaudio-rtp-multicast-address + + home-pipewire-configuration + home-pipewire-service-type)) + + +;;; +;;; PipeWire support. +;;; + +(define-configuration/no-serialization home-pipewire-configuration + (pipewire + (file-like pipewire) + "The PipeWire package to use.") + (wireplumber + (file-like wireplumber) + "The WirePlumber package to use.") + (enable-pulseaudio? + (boolean #t) + "When true, enable PipeWire's PulseAudio emulation support, allowing +PulseAudio clients to use PipeWire transparently.")) + +(define (home-pipewire-shepherd-service config) + (shepherd-service + (documentation "PipeWire media processing.") + (provision '(pipewire)) + (requirement '(dbus)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire")))) + (stop #~(make-kill-destructor)))) + +(define (home-pipewire-pulseaudio-shepherd-service config) + (shepherd-service + (documentation "Drop-in PulseAudio replacement service for PipeWire.") + (provision '(pipewire-pulseaudio)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire-pulse")))) + (stop #~(make-kill-destructor)))) + +(define (home-wireplumber-shepherd-service config) + (shepherd-service + (documentation "WirePlumber session management for PipeWire.") + (provision '(wireplumber)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-wireplumber config) + "/bin/wireplumber")))) + (stop #~(make-kill-destructor)))) + +(define (home-pipewire-shepherd-services config) + (cons* (home-pipewire-shepherd-service config) + (home-wireplumber-shepherd-service config) + (if (home-pipewire-configuration-enable-pulseaudio? config) + (list (home-pipewire-pulseaudio-shepherd-service config)) + '()))) + +(define (home-pipewire-asoundrc config) + (mixed-text-file + "asoundrc" + #~(string-append + "<" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/share/alsa/alsa.conf.d/50-pipewire.conf") + ">\n" + "<" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/share/alsa/alsa.conf.d/99-pipewire-default.conf") + ">\n" + "pcm_type.pipewire {\n" + " lib \"" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/lib/alsa-lib/libasound_module_pcm_pipewire.so") + "\"\n}\n" + "ctl_type.pipewire {\n" + " lib \"" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/lib/alsa-lib/libasound_module_ctl_pipewire.so") + "\"\n}\n"))) + +(define home-pipewire-disable-pulseaudio-auto-start + (plain-file "client.conf" "autospawn = no")) + +(define (home-pipewire-xdg-configuration config) + (cons* `("alsa/asoundrc" ,(home-pipewire-asoundrc config)) + (if (home-pipewire-configuration-enable-pulseaudio? config) + `(("pulse/client.conf" + ,home-pipewire-disable-pulseaudio-auto-start)) + '()))) + +(define home-pipewire-service-type + (service-type + (name 'pipewire) + (extensions + (list (service-extension home-shepherd-service-type + home-pipewire-shepherd-services) + (service-extension home-xdg-configuration-files-service-type + home-pipewire-xdg-configuration))) + (description + "Start essential PipeWire services.") + (default-value (home-pipewire-configuration)))) ;;; base-commit: f74df2ab879fc5457982bbc85b7455a90e82317d -- 2.40.1 From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v3] gnu: home: Add support for home-pipewire-service Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 15 Jun 2023 13:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brian Cully Cc: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.168683567218137 (code B ref 63863); Thu, 15 Jun 2023 13:28:02 +0000 Received: (at 63863) by debbugs.gnu.org; 15 Jun 2023 13:27:52 +0000 Received: from localhost ([127.0.0.1]:46452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9n0y-0004iS-BI for submit@debbugs.gnu.org; Thu, 15 Jun 2023 09:27:52 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:56024 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9n0w-0004iL-LS for 63863@debbugs.gnu.org; Thu, 15 Jun 2023 09:27:51 -0400 Received: from psyduck (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 6F305E854; Thu, 15 Jun 2023 09:27:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1686835670; bh=bvlFMERoilrEaruc0B74kSM8g0d1NS2fr2bLEbQwSlo=; h=References:From:To:Cc:Subject:Date:In-reply-to; b=lCiQ8rGD3bSNCyCWYvGRjTiGusuYay+Thqxk9MPwdfJy9M6KPtu8S5vGWaBy2ZJpY EM+oUVW4ribVSKvLaDrAexTYd0JlcKt/Ac7mb8SYPU+yGDhWa1n/81TdBX+2HGFAfG HGphJib8iCscCweA66A7E72jOTU8jLm0Bb6IKGVo= References: <1f25804bdd4994e607f701a4bad4085cb180bc39.1686835617.git.bjc@spork.org> User-agent: mu4e 1.10.2; emacs 29.0.91 From: Brian Cully Date: Thu, 15 Jun 2023 09:27:19 -0400 In-reply-to: <1f25804bdd4994e607f701a4bad4085cb180bc39.1686835617.git.bjc@spork.org> Message-ID: <877cs4etyh.fsf@psyduck.jhoto.kublai.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) The only changes in this version are two spaces after a period. -bjc From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v4 0/1] gnu: home: Add support for home-pipewire-service References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> In-Reply-To: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Tue, 20 Jun 2023 12:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63863@debbugs.gnu.org Cc: Brian Cully , ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.168726489027056 (code B ref 63863); Tue, 20 Jun 2023 12:42:02 +0000 Received: (at 63863) by debbugs.gnu.org; 20 Jun 2023 12:41:30 +0000 Received: from localhost ([127.0.0.1]:58276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBafq-00072K-2C for submit@debbugs.gnu.org; Tue, 20 Jun 2023 08:41:30 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:60642 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBafn-00072B-3U for 63863@debbugs.gnu.org; Tue, 20 Jun 2023 08:41:28 -0400 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 6C907F0D9; Tue, 20 Jun 2023 08:41:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1687264886; bh=FmVCT8DQxo6gFK87NGuDRnotRemDrGyb2DpkhO3MoEA=; h=From:To:Cc:Subject:Date; b=qNALLC5OnmM4UVdZ/2iMlKL0KIVXlDXcYgz3ReiPQlKp9hnC2m6xZLF0kQN+29Wlg CesYpd1v3J0stLBzip7yTdMG0aEKrKSBthNJEcXP0ieISDtpjD81xtoRZp7UQrMmmY c7bs4OVd6npRJRh8eK4JH41RH3jexs7FkMUlBvfE= From: Brian Cully Date: Tue, 20 Jun 2023 08:41:11 -0400 Message-Id: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This patch iteration adds some more documentation. Specifically: 1) Explain why we need the Shepherd to start services, 2) document the Shepherd services started, 3) flesh out the JACK and PulseAudio emulation bits, and, 4) use @subsubheading to separate the PulseAudio RTP stuff from the PipeWire stuff. Regarding point 3, I looked at existing home-service documentation, and used the style found in the shells section of the manual, rather than trying to group everything under the @defvar for the service-type, as is done in other parts (such as desktop services). I did this because the sections in the sound services are more verbose, so I felt it read better with @subsubheading where more disparate topics could be synthesized into a more cohesive narrative structure, leaving @defvar to explain the variables themselves. Also, it meant I wouldn't have to make any major changes to the existing PulseAudio RTP section, which I didn't write, and have only lightly used. Brian Cully (1): gnu: home: Add support for home-pipewire-service doc/guix.texi | 73 +++++++++++++++++++++++ gnu/home/services/sound.scm | 115 +++++++++++++++++++++++++++++++++++- 2 files changed, 187 insertions(+), 1 deletion(-) base-commit: bb09f3ac002a4f34177d42fd3ea0332f4b7fe7a6 -- 2.40.1 From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v4 1/1] gnu: home: Add support for home-pipewire-service Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Tue, 20 Jun 2023 12:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63863@debbugs.gnu.org Cc: Brian Cully , ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.168726489827077 (code B ref 63863); Tue, 20 Jun 2023 12:42:02 +0000 Received: (at 63863) by debbugs.gnu.org; 20 Jun 2023 12:41:38 +0000 Received: from localhost ([127.0.0.1]:58279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBafx-00072e-Bk for submit@debbugs.gnu.org; Tue, 20 Jun 2023 08:41:37 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:54696 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qBaft-00072U-5z for 63863@debbugs.gnu.org; Tue, 20 Jun 2023 08:41:35 -0400 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id F2D01F1AB; Tue, 20 Jun 2023 08:41:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1687264893; bh=/8GxtnpmoezEvdrf6gO6AC/61QeQPwTyqyhnmWRLcF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=o8RINfxbXQZuucq3ccScypNLSJ7Edg2z8P8NLjmHt+94p4e0ZTtRNdBGxTtN34B2g 7Ydc4Yi/BCUDHOF8uKPQdCe5/lRj8lCdeFObvVadZGyscnD6aOeeNL1SEJesXO8d7x FM9rCUOksLdcoaVeGZ6BvihR3/n4T3Tx/8XQXNsY= From: Brian Cully Date: Tue, 20 Jun 2023 08:41:12 -0400 Message-Id: <797ea363e1d7b7f467d0f201b8f8716593eb1bc4.1687264416.git.bjc@spork.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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), (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. --- doc/guix.texi | 73 +++++++++++++++++++++++ gnu/home/services/sound.scm | 115 +++++++++++++++++++++++++++++++++++- 2 files changed, 187 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index c961f706ec..97c3c85d79 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -116,6 +116,7 @@ Copyright @copyright{} 2023 Karl Hallsby@* Copyright @copyright{} 2023 Nathaniel Nicandro@* Copyright @copyright{} 2023 Tanguy Le Carrour@* +Copyright @copyright{} 2023 Brian Cully@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -43678,6 +43679,7 @@ Sound Home Services @cindex PulseAudio, home service @cindex RTP, for PulseAudio +@subsubheading PulseAudio RTP Streaming Services The following services dynamically reconfigure the @uref{https://pulseaudio.org,PulseAudio sound server}: they let you @@ -43765,6 +43767,77 @@ Sound Home Services This is the multicast address used by default by the two services above. @end defvar +@cindex PipeWire, home service +@subsubheading PipeWire Home Service + +@uref{https://pipewire.org, PipeWire} provides a low-latency, +graph-based audio and video processing service. In addition to its +native protocol, it can also be used as a replacement for both JACK and +PulseAudio. + +While PipeWire provides the media processing and API, it does not, +directly, know about devices such as sound cards, nor how you might want +to connect applications, hardware, and media processing filters. +Instead, PipeWire relies on a @dfn{session manager} to specify all these +relationships. While you may use any session manager you wish, for most +people the @url{https://pipewire.pages.freedesktop.org/wireplumber/, +WirePlumber} session manager, a reference implementation provided by the +PipeWire project itself, suffices, and that is the one +@code{home-pipewire-service-type} uses. + +PipeWire can be used as a replacement for PulseAudio by setting +@code{enable-pulseaudio?} to @code{#t} in +@code{home-pipewire-configuration}, so that existing PulseAudio clients +may use it without any further configuration. + +In addition, JACK clients may connect to PipeWire by using the +@command{pw-jack} program, which comes with PipeWire. Simply prefix the +command with @command{pw-jack} when you run it, and audio data should go +through PipeWire: + +@example +pw-jack mpv -ao=jack sound-file.wav +@end example + +For more information on PulseAudio emulation, see +@uref{https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-PulseAudio}, +for JACK, see +@uref{https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-JACK}. + +As PipeWire does not use @code{dbus} to start its services on demand +(as PulseAudio does), @code{home-pipewire-service-type} uses Shepherd +to start services when logged in, provisioning the @code{pipewire}, +@code{wireplumber}, and, if configured, @code{pipewire-pulseaudio} +services. @xref{Shepherd Home Service}. + +@defvar home-pipewire-service-type +This provides the service definition for @command{pipewire}, which will +run on login. Its value is a @code{home-pipewire-configuration} object. + +To start the service, add it to the @code{service} field of your +@code{home-environment}, such as: + +@lisp +(service home-pipewire-service-type) +@end lisp +@end defvar + +@deftp {Data Type} home-pipewire-configuration +Available @code{home-pipewire-configuration} fields are: + +@table @asis +@item @code{pipewire} (default: @code{pipewire}) (type: file-like) +The PipeWire package to use. + +@item @code{wireplumber} (default: @code{wireplumber}) (type: file-like) +The WirePlumber package to use. + +@item @code{enable-pulseaudio?} (default: @code{#t}) (type: boolean) +When true, enable PipeWire's PulseAudio emulation support, allowing +PulseAudio clients to use PipeWire transparently. +@end table +@end deftp + @node Mail Home Services @subsection Mail Home Services diff --git a/gnu/home/services/sound.scm b/gnu/home/services/sound.scm index 22c1a99250..5463255e8c 100644 --- a/gnu/home/services/sound.scm +++ b/gnu/home/services/sound.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Ludovic Courtès +;;; Copyright © 2023 Brian Cully ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,13 +20,125 @@ (define-module (gnu home services sound) #:use-module (gnu home services) #:use-module (gnu home services shepherd) + #:use-module (gnu home services xdg) + #:use-module (gnu packages linux) + #:use-module (gnu services configuration) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:export (home-pulseaudio-rtp-sink-service-type home-pulseaudio-rtp-source-service-type - %pulseaudio-rtp-multicast-address)) + %pulseaudio-rtp-multicast-address + + home-pipewire-configuration + home-pipewire-service-type)) + + +;;; +;;; PipeWire support. +;;; + +(define-configuration/no-serialization home-pipewire-configuration + (pipewire + (file-like pipewire) + "The PipeWire package to use.") + (wireplumber + (file-like wireplumber) + "The WirePlumber package to use.") + (enable-pulseaudio? + (boolean #t) + "When true, enable PipeWire's PulseAudio emulation support, allowing +PulseAudio clients to use PipeWire transparently.")) + +(define (home-pipewire-shepherd-service config) + (shepherd-service + (documentation "PipeWire media processing.") + (provision '(pipewire)) + (requirement '(dbus)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire")))) + (stop #~(make-kill-destructor)))) + +(define (home-pipewire-pulseaudio-shepherd-service config) + (shepherd-service + (documentation "Drop-in PulseAudio replacement service for PipeWire.") + (provision '(pipewire-pulseaudio)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire-pulse")))) + (stop #~(make-kill-destructor)))) + +(define (home-wireplumber-shepherd-service config) + (shepherd-service + (documentation "WirePlumber session management for PipeWire.") + (provision '(wireplumber)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-wireplumber config) + "/bin/wireplumber")))) + (stop #~(make-kill-destructor)))) + +(define (home-pipewire-shepherd-services config) + (cons* (home-pipewire-shepherd-service config) + (home-wireplumber-shepherd-service config) + (if (home-pipewire-configuration-enable-pulseaudio? config) + (list (home-pipewire-pulseaudio-shepherd-service config)) + '()))) + +(define (home-pipewire-asoundrc config) + (mixed-text-file + "asoundrc" + #~(string-append + "<" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/share/alsa/alsa.conf.d/50-pipewire.conf") + ">\n" + "<" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/share/alsa/alsa.conf.d/99-pipewire-default.conf") + ">\n" + "pcm_type.pipewire {\n" + " lib \"" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/lib/alsa-lib/libasound_module_pcm_pipewire.so") + "\"\n}\n" + "ctl_type.pipewire {\n" + " lib \"" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/lib/alsa-lib/libasound_module_ctl_pipewire.so") + "\"\n}\n"))) + +(define home-pipewire-disable-pulseaudio-auto-start + (plain-file "client.conf" "autospawn = no")) + +(define (home-pipewire-xdg-configuration config) + (cons* `("alsa/asoundrc" ,(home-pipewire-asoundrc config)) + (if (home-pipewire-configuration-enable-pulseaudio? config) + `(("pulse/client.conf" + ,home-pipewire-disable-pulseaudio-auto-start)) + '()))) + +(define home-pipewire-service-type + (service-type + (name 'pipewire) + (extensions + (list (service-extension home-shepherd-service-type + home-pipewire-shepherd-services) + (service-extension home-xdg-configuration-files-service-type + home-pipewire-xdg-configuration))) + (description + "Start essential PipeWire services.") + (default-value (home-pipewire-configuration)))) ;;; -- 2.40.1 From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v5 0/1] gnu: home: Add support for home-pipewire-service References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> In-Reply-To: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Sun, 02 Jul 2023 12:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63863@debbugs.gnu.org Cc: Brian Cully , ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.16883015938295 (code B ref 63863); Sun, 02 Jul 2023 12:40:01 +0000 Received: (at 63863) by debbugs.gnu.org; 2 Jul 2023 12:39:53 +0000 Received: from localhost ([127.0.0.1]:59486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFwMq-00029e-Vh for submit@debbugs.gnu.org; Sun, 02 Jul 2023 08:39:53 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:52452 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFwMl-00029S-6T for 63863@debbugs.gnu.org; Sun, 02 Jul 2023 08:39:51 -0400 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 770B31268; Sun, 2 Jul 2023 08:39:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1688301586; bh=jf3voO3E0ZEVyMSxoor6XSaSiB7Kp4FzNnfyXTzPPKY=; h=From:To:Cc:Subject:Date; b=LigYdPNcqOYRuvv/46rJ+M0ZhLkB1gU1AhEodMmtAfjnm7SAbYUDZLSraj82CXJbq XnYk/tFPUhw6W34pl4Xv4NG9E9EbI6+c4+g+bZVkuH9BD2oclunMEUczMRkyrHhKzG 9EJepVcAelPlQJrYPg4PUnYMgj2XkyTq/AtwvnKI= From: Brian Cully Date: Sun, 2 Jul 2023 08:39:40 -0400 Message-Id: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Two sentences were missing a double space after a period. Otherwise this is unchanged from v4. Are there any remaining issues to be addressed, or can this finally be merged? Brian Cully (1): gnu: home: Add support for home-pipewire-service doc/guix.texi | 73 +++++++++++++++++++++++ gnu/home/services/sound.scm | 115 +++++++++++++++++++++++++++++++++++- 2 files changed, 187 insertions(+), 1 deletion(-) base-commit: a919a16898e7219fdd26bdfe33a9959e7156d59d -- 2.40.1 From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v5 1/1] gnu: home: Add support for home-pipewire-service Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Sun, 02 Jul 2023 12:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63863@debbugs.gnu.org Cc: Brian Cully , ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.16883015958304 (code B ref 63863); Sun, 02 Jul 2023 12:40:02 +0000 Received: (at 63863) by debbugs.gnu.org; 2 Jul 2023 12:39:55 +0000 Received: from localhost ([127.0.0.1]:59488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFwMs-00029r-Ge for submit@debbugs.gnu.org; Sun, 02 Jul 2023 08:39:55 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:58149 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qFwMo-00029W-SC for 63863@debbugs.gnu.org; Sun, 02 Jul 2023 08:39:53 -0400 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id A50151381; Sun, 2 Jul 2023 08:39:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1688301590; bh=7mo0HbtJWjnle9cXVaB+20+/jHExQIHLDTjcfdbOyKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=twqduBPfCZP3S6c8bDvQOOBqkGJYPDcDnbEVbad36kM04DYuVwLAIUQJSNn+QGPjC Sr4pMZ0CUJmPnCGWzC8O/zs2O4Uc+WLHrX2cwmfJNWIoovWA0gnLzB4Nv1RptDAczP FZ1rI4omJ5fs7JhTyjjEoMHqVHSUfuTdSi9dpzgs= From: Brian Cully Date: Sun, 2 Jul 2023 08:39:41 -0400 Message-Id: <1023a7ef7f4612d8f7c08c2a4f9a39591263c284.1688301546.git.bjc@spork.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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), (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. --- doc/guix.texi | 73 +++++++++++++++++++++++ gnu/home/services/sound.scm | 115 +++++++++++++++++++++++++++++++++++- 2 files changed, 187 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 853396f776..7a6b7ebc3a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -116,6 +116,7 @@ Copyright @copyright{} 2023 Karl Hallsby@* Copyright @copyright{} 2023 Nathaniel Nicandro@* Copyright @copyright{} 2023 Tanguy Le Carrour@* +Copyright @copyright{} 2023 Brian Cully@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -43742,6 +43743,7 @@ Sound Home Services @cindex PulseAudio, home service @cindex RTP, for PulseAudio +@subsubheading PulseAudio RTP Streaming Services The following services dynamically reconfigure the @uref{https://pulseaudio.org,PulseAudio sound server}: they let you @@ -43829,6 +43831,77 @@ Sound Home Services This is the multicast address used by default by the two services above. @end defvar +@cindex PipeWire, home service +@subsubheading PipeWire Home Service + +@uref{https://pipewire.org, PipeWire} provides a low-latency, +graph-based audio and video processing service. In addition to its +native protocol, it can also be used as a replacement for both JACK and +PulseAudio. + +While PipeWire provides the media processing and API, it does not, +directly, know about devices such as sound cards, nor how you might want +to connect applications, hardware, and media processing filters. +Instead, PipeWire relies on a @dfn{session manager} to specify all these +relationships. While you may use any session manager you wish, for most +people the @url{https://pipewire.pages.freedesktop.org/wireplumber/, +WirePlumber} session manager, a reference implementation provided by the +PipeWire project itself, suffices, and that is the one +@code{home-pipewire-service-type} uses. + +PipeWire can be used as a replacement for PulseAudio by setting +@code{enable-pulseaudio?} to @code{#t} in +@code{home-pipewire-configuration}, so that existing PulseAudio clients +may use it without any further configuration. + +In addition, JACK clients may connect to PipeWire by using the +@command{pw-jack} program, which comes with PipeWire. Simply prefix the +command with @command{pw-jack} when you run it, and audio data should go +through PipeWire: + +@example +pw-jack mpv -ao=jack sound-file.wav +@end example + +For more information on PulseAudio emulation, see +@uref{https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-PulseAudio}, +for JACK, see +@uref{https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-JACK}. + +As PipeWire does not use @code{dbus} to start its services on demand +(as PulseAudio does), @code{home-pipewire-service-type} uses Shepherd +to start services when logged in, provisioning the @code{pipewire}, +@code{wireplumber}, and, if configured, @code{pipewire-pulseaudio} +services. @xref{Shepherd Home Service}. + +@defvar home-pipewire-service-type +This provides the service definition for @command{pipewire}, which will +run on login. Its value is a @code{home-pipewire-configuration} object. + +To start the service, add it to the @code{service} field of your +@code{home-environment}, such as: + +@lisp +(service home-pipewire-service-type) +@end lisp +@end defvar + +@deftp {Data Type} home-pipewire-configuration +Available @code{home-pipewire-configuration} fields are: + +@table @asis +@item @code{pipewire} (default: @code{pipewire}) (type: file-like) +The PipeWire package to use. + +@item @code{wireplumber} (default: @code{wireplumber}) (type: file-like) +The WirePlumber package to use. + +@item @code{enable-pulseaudio?} (default: @code{#t}) (type: boolean) +When true, enable PipeWire's PulseAudio emulation support, allowing +PulseAudio clients to use PipeWire transparently. +@end table +@end deftp + @node Mail Home Services @subsection Mail Home Services diff --git a/gnu/home/services/sound.scm b/gnu/home/services/sound.scm index 22c1a99250..5463255e8c 100644 --- a/gnu/home/services/sound.scm +++ b/gnu/home/services/sound.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Ludovic Courtès +;;; Copyright © 2023 Brian Cully ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,13 +20,125 @@ (define-module (gnu home services sound) #:use-module (gnu home services) #:use-module (gnu home services shepherd) + #:use-module (gnu home services xdg) + #:use-module (gnu packages linux) + #:use-module (gnu services configuration) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:export (home-pulseaudio-rtp-sink-service-type home-pulseaudio-rtp-source-service-type - %pulseaudio-rtp-multicast-address)) + %pulseaudio-rtp-multicast-address + + home-pipewire-configuration + home-pipewire-service-type)) + + +;;; +;;; PipeWire support. +;;; + +(define-configuration/no-serialization home-pipewire-configuration + (pipewire + (file-like pipewire) + "The PipeWire package to use.") + (wireplumber + (file-like wireplumber) + "The WirePlumber package to use.") + (enable-pulseaudio? + (boolean #t) + "When true, enable PipeWire's PulseAudio emulation support, allowing +PulseAudio clients to use PipeWire transparently.")) + +(define (home-pipewire-shepherd-service config) + (shepherd-service + (documentation "PipeWire media processing.") + (provision '(pipewire)) + (requirement '(dbus)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire")))) + (stop #~(make-kill-destructor)))) + +(define (home-pipewire-pulseaudio-shepherd-service config) + (shepherd-service + (documentation "Drop-in PulseAudio replacement service for PipeWire.") + (provision '(pipewire-pulseaudio)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire-pulse")))) + (stop #~(make-kill-destructor)))) + +(define (home-wireplumber-shepherd-service config) + (shepherd-service + (documentation "WirePlumber session management for PipeWire.") + (provision '(wireplumber)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-wireplumber config) + "/bin/wireplumber")))) + (stop #~(make-kill-destructor)))) + +(define (home-pipewire-shepherd-services config) + (cons* (home-pipewire-shepherd-service config) + (home-wireplumber-shepherd-service config) + (if (home-pipewire-configuration-enable-pulseaudio? config) + (list (home-pipewire-pulseaudio-shepherd-service config)) + '()))) + +(define (home-pipewire-asoundrc config) + (mixed-text-file + "asoundrc" + #~(string-append + "<" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/share/alsa/alsa.conf.d/50-pipewire.conf") + ">\n" + "<" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/share/alsa/alsa.conf.d/99-pipewire-default.conf") + ">\n" + "pcm_type.pipewire {\n" + " lib \"" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/lib/alsa-lib/libasound_module_pcm_pipewire.so") + "\"\n}\n" + "ctl_type.pipewire {\n" + " lib \"" + #$(file-append + (home-pipewire-configuration-pipewire config) + "/lib/alsa-lib/libasound_module_ctl_pipewire.so") + "\"\n}\n"))) + +(define home-pipewire-disable-pulseaudio-auto-start + (plain-file "client.conf" "autospawn = no")) + +(define (home-pipewire-xdg-configuration config) + (cons* `("alsa/asoundrc" ,(home-pipewire-asoundrc config)) + (if (home-pipewire-configuration-enable-pulseaudio? config) + `(("pulse/client.conf" + ,home-pipewire-disable-pulseaudio-auto-start)) + '()))) + +(define home-pipewire-service-type + (service-type + (name 'pipewire) + (extensions + (list (service-extension home-shepherd-service-type + home-pipewire-shepherd-services) + (service-extension home-xdg-configuration-files-service-type + home-pipewire-xdg-configuration))) + (description + "Start essential PipeWire services.") + (default-value (home-pipewire-configuration)))) ;;; -- 2.40.1 From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v5 1/1] gnu: home: Add support for home-pipewire-service References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> In-Reply-To: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Resent-From: Tanguy LE CARROUR Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 23 Aug 2023 08:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brian Cully Cc: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.16927791433723 (code B ref 63863); Wed, 23 Aug 2023 08:26:02 +0000 Received: (at 63863) by debbugs.gnu.org; 23 Aug 2023 08:25:43 +0000 Received: from localhost ([127.0.0.1]:32770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYjBP-0000xz-Eh for submit@debbugs.gnu.org; Wed, 23 Aug 2023 04:25:43 -0400 Received: from smtp-190f.mail.infomaniak.ch ([185.125.25.15]:47913) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYjBM-0000xg-Gx for 63863@debbugs.gnu.org; Wed, 23 Aug 2023 04:25:42 -0400 Received: from smtp-2-0000.mail.infomaniak.ch (unknown [10.5.36.107]) by smtp-2-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4RVzmp4RGqzMrHxk; Wed, 23 Aug 2023 08:25:30 +0000 (UTC) Received: from unknown by smtp-2-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4RVzmp0lkbzMppDT; Wed, 23 Aug 2023 10:25:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bioneland.org; s=20230804; t=1692779130; bh=iLRdcQnWPnmsGzgxDzVx97qR2IvvVqwd0T6wepSiLYw=; h=From:Cc:To:Subject:Date:From; b=oz0/ru6xO4jPwo9l1NzFgFXsgIKoxAxs6jSDeJ/H18dwE8NzZfK78y2aygX0oJuop oQF2I301KcV/cnwTWVlvUYqbnbxaN3abvFSZsHpKyfwlWLAH9xYVxx0oyQbnvU4JwM 9EFgRyDKKUZnrzbHAqYhNXHaoQjpMdaFSmLcHNmwEDxRWFtyqaG4ojmp5mey7X2AaO 41WIQ9WJ7wkvcMESf2rIQBBRY8T6+HFO6sLpn/SXr5H+ngWKqnVxRFUsOeT4dspnQK /BcihOYOtaZfpKcBFrwGdIiXyUbXYdfGgW+UeEcEdAInvUGAJqP3O5nQiyleEoE3EC 2NrZ5S9Mtqh8g== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tanguy LE CARROUR Date: Wed, 23 Aug 2023 10:25:29 +0200 Message-ID: <169277912935.12471.14366434028428015342@localhost> User-Agent: alot/0.10 X-Infomaniak-Routing: alpha X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Brian, I came across you patch by chance and, as I had been waiting for a PipeWire home service for a long time, I couldn't resist trying it out! I copied it to my channel, added it to my home configuration, reconfigured and=E2=80=A6 go this message: ``` guix home: error: service 'pipewire' requires 'dbus', which is not provided= by any service ``` I was a little confused, because in the documentation, you wrote "As PipeWire does not use @code{dbus} to start its services on demand". I added it anyway, reconfigured and after rebooting (I currently have a problem with shepherd not being properly reloaded! =F0=9F=98=9E) I can see the new services as being "stopped" in `herd status` output. Are they stopped on purpose? Who is supposed to start them? Sorry, I'm not sure I understand how it's supposed to work. I've tried joining a JitsiMeet conference. The video seems to be working, but my mic=E2=80=98 is marked as "broken". I've had to roll back my home configuration for the time being, but if there are more things I can try to make it work and help your patch being merged, I would be more than happy to try them! Anyway, thanks for you work on this patch! Can't wait for it to be merged. --=20 Tanguy From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v5 1/1] gnu: home: Add support for home-pipewire-service Resent-From: brian Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 23 Aug 2023 18:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Tanguy LE CARROUR Cc: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.169281630727209 (code B ref 63863); Wed, 23 Aug 2023 18:46:02 +0000 Received: (at 63863) by debbugs.gnu.org; 23 Aug 2023 18:45:07 +0000 Received: from localhost ([127.0.0.1]:35199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYsqo-00074l-LA for submit@debbugs.gnu.org; Wed, 23 Aug 2023 14:45:07 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:58585 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYsql-00074Z-RM for 63863@debbugs.gnu.org; Wed, 23 Aug 2023 14:45:05 -0400 Received: from ditto (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 37A941A3C; Wed, 23 Aug 2023 14:44:56 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1692816299; bh=2PzoxvXqIEUjFyNDJYgcw3G9/zMAih+rzEvMNKYeJCY=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=UHLky0yasFwhZ+I/Xk6GaSwmhF85pJZeVulMxQXPg9V5C2/E9vNieCw/wf8vjaO31 20egRiP3Gsi65HHJ6q4x4Wm9n0ozBvAaRtCep/hqjtGFrKqpWrQ5pYTs6vZtYyFvYb flEw2eyHhYMNpaMNGHoD69eqPDV5qgY5m0cY+qro= From: brian In-Reply-To: <169277912935.12471.14366434028428015342@localhost> (Tanguy LE CARROUR's message of "Wed, 23 Aug 2023 10:25:29 +0200") References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> <169277912935.12471.14366434028428015342@localhost> Date: Wed, 23 Aug 2023 14:44:55 -0400 Message-ID: <87sf89bntk.fsf@spork.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Tanguy LE CARROUR writes: > I came across you patch by chance and, as I had been waiting for a > PipeWire home service for a long time, I couldn't resist trying it out! Thanks for helping test it! > I copied it to my channel, added it to my home configuration, > reconfigured and=E2=80=A6 go this message: > > ``` > guix home: error: service 'pipewire' requires 'dbus', which is not provid= ed by any service > ``` > > I was a little confused, because in the documentation, you wrote > "As PipeWire does not use @code{dbus} to start its services on demand". Pipewire does not use dbus to start its services on demand, but it does use it for communication between the pipewire daemon itself and the session manager (typically wireplumber). I guess this is confusing. I'll see if I can explain this better. Although part of me wants to drop the dbus verbiage from the documentation entirely, since it only exists right now to explain things to people who might be migrating from Pulseaudio and used to not needing a Shepherd service. I don't want to write a deep explainer on how DBus is used. It's not the place for that, nor do I even know that much about it. > I added it anyway, reconfigured and after rebooting (I currently have a > problem with shepherd not being properly reloaded! =F0=9F=98=9E) I can see > the new services as being "stopped" in `herd status` output. > Are they stopped on purpose? Who is supposed to start them? The services should all start automatically, but they do all depend on a user-session level dbus daemon running. I see you're using dbus, but are you using it from =E2=80=98home-dbus-service-type=E2=80=99? > Sorry, I'm not sure I understand how it's supposed to work. > I've tried joining a JitsiMeet conference. The video seems to be > working, but my mic=E2=80=98 is marked as "broken". If video sharing under Wayland is working, then I'd say that means Pipewire+Wireguard are working. The mic doesn't work, but can you hear audio through your speakers or headphones? Are your audio devices visible? Are you using Pulseaudio emulation (which I recommend you do)? > Anyway, thanks for you work on this patch! Can't wait for it to be > merged. /me pokes Ludo =F0=9F=98=89 -bjc From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v5 1/1] gnu: home: Add support for home-pipewire-service Resent-From: Tanguy LE CARROUR Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 25 Aug 2023 06:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: brian Cc: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.169294586414409 (code B ref 63863); Fri, 25 Aug 2023 06:45:03 +0000 Received: (at 63863) by debbugs.gnu.org; 25 Aug 2023 06:44:24 +0000 Received: from localhost ([127.0.0.1]:39067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZQYS-0003kK-9k for submit@debbugs.gnu.org; Fri, 25 Aug 2023 02:44:24 -0400 Received: from smtp-42ac.mail.infomaniak.ch ([2001:1600:4:17::42ac]:52385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZQYP-0003k2-2v for 63863@debbugs.gnu.org; Fri, 25 Aug 2023 02:44:22 -0400 Received: from smtp-2-0001.mail.infomaniak.ch (unknown [10.5.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4RX9Qv6m5szMrY8N; Fri, 25 Aug 2023 06:44:07 +0000 (UTC) Received: from unknown by smtp-2-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4RX9Qv2bZnzMppDY; Fri, 25 Aug 2023 08:44:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bioneland.org; s=20230804; t=1692945847; bh=eYaIHbruAhYuIAcPXZL1thafRGl4WSvTpmeZMH0jvBU=; h=References:Subject:From:Cc:To:In-Reply-To:Date:From; b=eesNNVQS8g5GB3lAKpA53iP1svPjLj+ZjOhmdDtC/rTI19+4tgw1Xg5hvpcxs4Iv4 XMzhqd7gQ9hhkKzY3e1VyNhif+ZGJF8hzQrt+84Ya/zGHEwDi49knF3NSX9rNs5uCp WtbI2NBsXtS0JGXjq/RrW65HcYhV+3pjBvdxbSYpQtY9cQaTLZfg/2AUC2NXFAfhjt LsssxIUdG/BTtly7UoTgQeWBRQM2w1JqarIr6U1Vae379/06U+dRorBl6qJg1sypf3 4TrwyTYzgXLE3FyCdim1fDbki31H7Pw1hXZvr9Qv4Osf0ndLk5xQLBA4Mk0UHP7b0I BXMdhYIbMlp9A== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> <169277912935.12471.14366434028428015342@localhost> <87sf89bntk.fsf@spork.org> From: Tanguy LE CARROUR In-Reply-To: <87sf89bntk.fsf@spork.org> Date: Fri, 25 Aug 2023 08:44:06 +0200 Message-ID: <169294584661.1605.10650518560015904738@bioneland.org> User-Agent: alot/0.10 X-Infomaniak-Routing: alpha X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Brian, Quoting brian (2023-08-23 20:44:55) > Tanguy LE CARROUR writes: > > I copied it to my channel, added it to my home configuration, > > reconfigured and=E2=80=A6 go this message: > > > > ``` > > guix home: error: service 'pipewire' requires 'dbus', which is not prov= ided by any service > > ``` > > > > I was a little confused, because in the documentation, you wrote > > "As PipeWire does not use @code{dbus} to start its services on demand". >=20 > Pipewire does not use dbus to start its services on demand, but it does > use it for communication between the pipewire daemon itself and the > session manager (typically wireplumber). >=20 > I guess this is confusing. I'll see if I can explain this > better. Although part of me wants to drop the dbus verbiage from the > documentation entirely, since it only exists right now to explain things > to people who might be migrating from Pulseaudio and used to not needing > a Shepherd service. I don't want to write a deep explainer on how DBus > is used. It's not the place for that, nor do I even know that much about > it. It's a bit confusing, indeed! =E2=80=A6 but I'm easily confused! =F0=9F=98= =85 What would be great would a mechanism to "pull/manage" service dependencies. > > I added it anyway, reconfigured and after rebooting (I currently have a > > problem with shepherd not being properly reloaded! =F0=9F=98=9E) I can = see > > the new services as being "stopped" in `herd status` output. > > Are they stopped on purpose? Who is supposed to start them? >=20 > The services should all start automatically, but they do all depend on > a user-session level dbus daemon running. I see you're using dbus, but > are you using it from =E2=80=98home-dbus-service-type=E2=80=99? Yes, I added it in my home configuration. > > Sorry, I'm not sure I understand how it's supposed to work. > > I've tried joining a JitsiMeet conference. The video seems to be > > working, but my mic=E2=80=98 is marked as "broken". >=20 > If video sharing under Wayland is working, then I'd say that means > Pipewire+Wireguard are working. The mic doesn't work, but can you hear > audio through your speakers or headphones? Are your audio devices > visible? Are you using Pulseaudio emulation (which I recommend you do)? I'll give it another try at the week-end! =F0=9F=A4=9E > > Anyway, thanks for you work on this patch! Can't wait for it to be > > merged. >=20 > /me pokes Ludo =F0=9F=98=89 Poke poke =F0=9F=91=89 --=20 Tanguy From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v5 1/1] gnu: home: Add support for home-pipewire-service References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> In-Reply-To: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Resent-From: taosabella@riseup.net Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 11 Oct 2023 14:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.169703429432512 (code B ref 63863); Wed, 11 Oct 2023 14:25:02 +0000 Received: (at 63863) by debbugs.gnu.org; 11 Oct 2023 14:24:54 +0000 Received: from localhost ([127.0.0.1]:39780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqa8o-0008SC-KK for submit@debbugs.gnu.org; Wed, 11 Oct 2023 10:24:53 -0400 Received: from mx0.riseup.net ([198.252.153.6]:53494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qqXUf-0007lb-1w for 63863@debbugs.gnu.org; Wed, 11 Oct 2023 07:35:14 -0400 Received: from fews01-sea.riseup.net (fews01-sea-pn.riseup.net [10.0.1.109]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx0.riseup.net (Postfix) with ESMTPS id 4S59fY2bY2z9s8R for <63863@debbugs.gnu.org>; Wed, 11 Oct 2023 11:34:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1697024085; bh=A5To4g5c6FxMXFdyX6GcTC+KK1aGIVyXCijUY+ma7Lk=; h=Date:From:To:Subject:From; b=h2btFxt5UPECGIoYtLEaVaAnEN8dz0sGFTRzlBHT6UVvPYwu1vV70E54DBLzngHyq N1T9kaJ5IwnWpIymNvpUSpZb8SYJnoE1UStOp4MUKB3YWPQY3D1tZhRps3bPm4wTDo nQnjZ+0UG2wUv65E51EgqYajNfSbSlctyxdQGXbo= X-Riseup-User-ID: 022AB37838900D293013D55E82B42801FAC878FC5E2E8FAE34F69739212685BE Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews01-sea.riseup.net (Postfix) with ESMTPSA id 4S59fY1Z9WzJmhr for <63863@debbugs.gnu.org>; Wed, 11 Oct 2023 11:34:45 +0000 (UTC) MIME-Version: 1.0 Date: Wed, 11 Oct 2023 11:34:44 +0000 From: taosabella@riseup.net Message-ID: <0bd2f596e130cd8522e74fc6839596a0@riseup.net> Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Mailman-Approved-At: Wed, 11 Oct 2023 10:24:49 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) I've tested this patch and it works perfectly, with all Shepherd services starting after activation and a reboot. Ludovic, are there any other blockers to getting this into Guix proper? From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] (no subject) References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> In-Reply-To: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Resent-From: Jakob Honal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 05 Nov 2023 15:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.169919703323274 (code B ref 63863); Sun, 05 Nov 2023 15:11:01 +0000 Received: (at 63863) by debbugs.gnu.org; 5 Nov 2023 15:10:33 +0000 Received: from localhost ([127.0.0.1]:38002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzell-00063K-5a for submit@debbugs.gnu.org; Sun, 05 Nov 2023 10:10:33 -0500 Received: from mout.gmx.net ([212.227.15.18]:53401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzelj-000636-7E for 63863@debbugs.gnu.org; Sun, 05 Nov 2023 10:10:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1699196988; x=1699801788; i=jakob.honal@gmx.de; bh=/6BL57nL+LJ1jR2LP7kK31aYh90I130qYVY5dNSpvxc=; h=X-UI-Sender-Class:From:To:Date; b=VFTVFJvcHvsaNZBHWxT/MpF9lcG5f3iCb7JDXabg3l2cl90m3qmdQ363PmVUGCc/ efWOVCGok7mfuy6hQXzb+Y68bEkynCzbfTdMH3v9WwpYLQhAdBZVc4o1+MN/BRbiE i2n9anltglb8z6s3Mb/PC4rZRoNVM3+VdSgeOKYCDyBagEhbD93L3nRa2dnJ15N3O TfCOgJpMcIdmfGKKArMuJxbDtIY3QgMFx73/52Oq4Gr2ygpByYJo6V6tx2XXJkAAp K4P84n8zBjV7l+GPe/Z2ww/m3Yg7/QVNSr5NZHPjCQbKQfF/hbJGZZ9ewPINPqxtj WDwGx280xTE3P/H99Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [82.135.82.84] ([82.135.82.84]) by web-mail.gmx.net (3c-app-gmx-bs51.server.lan [172.19.170.104]) (via HTTP); Sun, 5 Nov 2023 16:09:48 +0100 MIME-Version: 1.0 Message-ID: From: Jakob Honal Content-Type: text/html; charset=UTF-8 Date: Sun, 5 Nov 2023 16:09:48 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:COsmd9ZO7dB6CrnC4Hjz3T42w90/tpxID3pU1sm/bZo93cklZsIghN/75TZ57pg/I6nk/ yS+zi9c4mAeRyw8Ry8wbixFopahh4lQh9xbM3E1Tr9DuGdCgGPiL3fXZJ8gu/KaCIy8sa7esUmTk EkECEJ/e0d8viEFuYAqcRD4aE0HiMUn2Yj7J6fmH07EFL78gftle4y02iti9GjfxNvRi6stJglf9 3EIXlsJtrWA8AFvsmpPEMKuVFn65tyAjeTpVpjwRgM4WLaXlu5DxVuwfS23QjhRZA74PUaCeICIr S8= X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:sEZgZp15PhE=;PVXLEg99hdaOSI1ZI5CTVSA8Pki dBRi8aPjRduueHRY0vAAYxU9+2jPsMRVUUpicVGLG10U4u6fz06qH27VRmvoFkVnog+hFzzHG 4/9NguiETXWrZeUcsuOmc5yNrXMjwrWL3/VnTCR2pHwnYc7NK7zHIm0SBsB/lSYLTDhWx33I3 f4srIrFm/JfPABWapL4jOa3t4brUf6aHL6bEsRjtwMM9mY8zX8KezQD7saGK63l4mcEGV90FF Q5FCTNfb56Udb0LVh/w9iAmuYjwyhkVmbMzhAQDgfJ/j7E7ww4UW4Dz15x7KiEVGaVSMJ2UUo 5GFRhGWGCnYJ/+c831B0lfeGVYgUhJyaz5RpjeAe/DsPh6md33ecYWNlzanqSyOnW6Dqbtkif JhezOV9DMS2Bf+aiySx/NnSNb8lapAFSW1/+gbDMKmO4KzVCsxEq7NuRaajkWUxtzuL6pTtTn cXwk79pPDaOCnjcObxilJEsAPvnYihcv0qAPRluqUUV3YTDwExqON0xZ4OGk8Mu9XlE7S0cOz llpnPg1/JyNCLkzRsSuXmJykyFFpyUysv3B9+Bpnm1xgGkp1D1q6VVbcsQXlkTGjx4Kol/PLG ZPgMT3Q8GwXO0kaUITE7w50da4sk6NUXm/JMJzcWbpgl1Wz/h+NKVWfzVhPXfvq6LAox2mY4Z DyWbEGaPRSSrSsI9cXenhw2P9cggNxoYAMqiYZwud9AWC56oXk15FhfLiW6BMAhayR2L2OOUZ mYJxW8pfsp0tQG+chb/cl0zYvfCxv2zkdjTUUm0fqoBZqal0OEfRNWrwJDzJ1XK/hJk/En1+z kzmHNErVazhmLngTVPs0lgWkeAjNBEsMfK8dI3boTSUJM= X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/)
> Ludovic, are there any other blockers to getting this into Guix proper?
Desperately poking Ludo.
 
From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v5 1/1] gnu: home: Add support for home-pipewire-service Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, andrew@trop.in, guix-patches@gnu.org Resent-Date: Sun, 12 Nov 2023 14:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brian Cully Cc: 63863@debbugs.gnu.org, Ludovic =?UTF-8?Q?Court=C3=A8s?= , Andrew Tropin X-Debbugs-Original-Xcc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Andrew Tropin Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.169979859626242 (code B ref 63863); Sun, 12 Nov 2023 14:17:01 +0000 Received: (at 63863) by debbugs.gnu.org; 12 Nov 2023 14:16:36 +0000 Received: from localhost ([127.0.0.1]:55247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2BGN-0006pB-QO for submit@debbugs.gnu.org; Sun, 12 Nov 2023 09:16:36 -0500 Received: from mail.boiledscript.com ([144.168.59.46]:53332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2BGK-0006p0-Ti for 63863@debbugs.gnu.org; Sun, 12 Nov 2023 09:16:34 -0500 Date: Sun, 12 Nov 2023 22:14:20 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1699798357; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r3F8mug0clAR9C1vq2xkk0NEdEdTKD3H3Ndmnrn7b4M=; b=TvHjSc5BhrW8mu0aA1f18My7EPy+uk8NiLPxqfK57exJDFSIaTn9DWOUHhNEouWZGcc+nD i+djoIfpHYxqQmxxd8bc+9e+vLAvPxBdGnmO+ucuSoqSYOlpzECtWuss2vyB56imZoEhQ7 8edVIsoCIbjB9bZrIPoN5T/seTTBeIinZUFgPuG8/z4/5k+pfDgXaiHS23++5fer6ymtUY 4qyqJrY9D5JHqNjqZzmFy9j+cDDhceSWoj214piRGmN89CNuUfZ/roSFrQSiFapaQUoWk7 iEfZ8Izy6rHQdUmdybSNMZP+Usq/gpav8u2LtYdGeRo/bhkYQQaFLbpbpWRcaw== Authentication-Results: mail.boiledscript.com; auth=pass smtp.mailfrom=hako@ultrarare.space Message-ID: <87y1f383er.wl-hako@ultrarare.space> From: Hilton Chain In-Reply-To: <1023a7ef7f4612d8f7c08c2a4f9a39591263c284.1688301546.git.bjc@spork.org> References: <1023a7ef7f4612d8f7c08c2a4f9a39591263c284.1688301546.git.bjc@spork.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Brian, Tested the patch in my setup, it works well :) (Some comments are in and after the quote.) On Sun, 02 Jul 2023 20:39:41 +0800, Brian Cully via Guix-patches via wrote: > > 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-servic= e), > (home-pipewire-shepherd-services) > (home-pipewire-asoundrc), (home-pipewire-xdg-configuration): new procedur= es. > (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. > --- > doc/guix.texi | 73 +++++++++++++++++++++++ > gnu/home/services/sound.scm | 115 +++++++++++++++++++++++++++++++++++- > 2 files changed, 187 insertions(+), 1 deletion(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 853396f776..7a6b7ebc3a 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -116,6 +116,7 @@ > Copyright @copyright{} 2023 Karl Hallsby@* > Copyright @copyright{} 2023 Nathaniel Nicandro@* > Copyright @copyright{} 2023 Tanguy Le Carrour@* > +Copyright @copyright{} 2023 Brian Cully@* > > Permission is granted to copy, distribute and/or modify this document > under the terms of the GNU Free Documentation License, Version 1.3 or > @@ -43742,6 +43743,7 @@ Sound Home Services > > @cindex PulseAudio, home service > @cindex RTP, for PulseAudio > +@subsubheading PulseAudio RTP Streaming Services > > The following services dynamically reconfigure the > @uref{https://pulseaudio.org,PulseAudio sound server}: they let you > @@ -43829,6 +43831,77 @@ Sound Home Services > This is the multicast address used by default by the two services above. > @end defvar > > +@cindex PipeWire, home service > +@subsubheading PipeWire Home Service > + > +@uref{https://pipewire.org, PipeWire} provides a low-latency, > +graph-based audio and video processing service. In addition to its > +native protocol, it can also be used as a replacement for both JACK and > +PulseAudio. > + > +While PipeWire provides the media processing and API, it does not, > +directly, know about devices such as sound cards, nor how you might want > +to connect applications, hardware, and media processing filters. > +Instead, PipeWire relies on a @dfn{session manager} to specify all these > +relationships. While you may use any session manager you wish, for most > +people the @url{https://pipewire.pages.freedesktop.org/wireplumber/, > +WirePlumber} session manager, a reference implementation provided by the > +PipeWire project itself, suffices, and that is the one > +@code{home-pipewire-service-type} uses. > + > +PipeWire can be used as a replacement for PulseAudio by setting > +@code{enable-pulseaudio?} to @code{#t} in > +@code{home-pipewire-configuration}, so that existing PulseAudio clients > +may use it without any further configuration. > + > +In addition, JACK clients may connect to PipeWire by using the > +@command{pw-jack} program, which comes with PipeWire. Simply prefix the > +command with @command{pw-jack} when you run it, and audio data should go > +through PipeWire: > + > +@example > +pw-jack mpv -ao=3Djack sound-file.wav > +@end example > + > +For more information on PulseAudio emulation, see > +@uref{https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-Pu= lseAudio}, > +for JACK, see > +@uref{https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-JA= CK}. > + > +As PipeWire does not use @code{dbus} to start its services on demand > +(as PulseAudio does), @code{home-pipewire-service-type} uses Shepherd > +to start services when logged in, provisioning the @code{pipewire}, > +@code{wireplumber}, and, if configured, @code{pipewire-pulseaudio} > +services. @xref{Shepherd Home Service}. > + > +@defvar home-pipewire-service-type > +This provides the service definition for @command{pipewire}, which will > +run on login. Its value is a @code{home-pipewire-configuration} object. > + > +To start the service, add it to the @code{service} field of your > +@code{home-environment}, such as: > + > +@lisp > +(service home-pipewire-service-type) > +@end lisp > +@end defvar > + > +@deftp {Data Type} home-pipewire-configuration > +Available @code{home-pipewire-configuration} fields are: > + > +@table @asis > +@item @code{pipewire} (default: @code{pipewire}) (type: file-like) > +The PipeWire package to use. > + > +@item @code{wireplumber} (default: @code{wireplumber}) (type: file-like) > +The WirePlumber package to use. > + > +@item @code{enable-pulseaudio?} (default: @code{#t}) (type: boolean) > +When true, enable PipeWire's PulseAudio emulation support, allowing > +PulseAudio clients to use PipeWire transparently. > +@end table > +@end deftp > + > @node Mail Home Services > @subsection Mail Home Services > > diff --git a/gnu/home/services/sound.scm b/gnu/home/services/sound.scm > index 22c1a99250..5463255e8c 100644 > --- a/gnu/home/services/sound.scm > +++ b/gnu/home/services/sound.scm > @@ -1,5 +1,6 @@ > ;;; GNU Guix --- Functional package management for GNU > ;;; Copyright =A9 2023 Ludovic Court=E8s > +;;; Copyright =A9 2023 Brian Cully > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -19,13 +20,125 @@ > (define-module (gnu home services sound) > #:use-module (gnu home services) > #:use-module (gnu home services shepherd) > + #:use-module (gnu home services xdg) > + #:use-module (gnu packages linux) > + #:use-module (gnu services configuration) > #:use-module (guix records) > #:use-module (guix gexp) > #:use-module (srfi srfi-1) > #:use-module (ice-9 match) > #:export (home-pulseaudio-rtp-sink-service-type > home-pulseaudio-rtp-source-service-type > - %pulseaudio-rtp-multicast-address)) > + %pulseaudio-rtp-multicast-address > + > + home-pipewire-configuration > + home-pipewire-service-type)) > + > +=0C > +;;; > +;;; PipeWire support. > +;;; > + > +(define-configuration/no-serialization home-pipewire-configuration > + (pipewire > + (file-like pipewire) > + "The PipeWire package to use.") > + (wireplumber > + (file-like wireplumber) > + "The WirePlumber package to use.") > + (enable-pulseaudio? > + (boolean #t) > + "When true, enable PipeWire's PulseAudio emulation support, allowing > +PulseAudio clients to use PipeWire transparently.")) > + > +(define (home-pipewire-shepherd-service config) > + (shepherd-service > + (documentation "PipeWire media processing.") > + (provision '(pipewire)) > + (requirement '(dbus)) > + (start #~(make-forkexec-constructor > + (list #$(file-append > + (home-pipewire-configuration-pipewire config) > + "/bin/pipewire")))) > + (stop #~(make-kill-destructor)))) > + > +(define (home-pipewire-pulseaudio-shepherd-service config) > + (shepherd-service > + (documentation "Drop-in PulseAudio replacement service for PipeWire.") > + (provision '(pipewire-pulseaudio)) > + (requirement '(pipewire)) > + (start #~(make-forkexec-constructor > + (list #$(file-append > + (home-pipewire-configuration-pipewire config) > + "/bin/pipewire-pulse")))) > + (stop #~(make-kill-destructor)))) > + > +(define (home-wireplumber-shepherd-service config) > + (shepherd-service > + (documentation "WirePlumber session management for PipeWire.") > + (provision '(wireplumber)) > + (requirement '(pipewire)) > + (start #~(make-forkexec-constructor > + (list #$(file-append > + (home-pipewire-configuration-wireplumber config) > + "/bin/wireplumber")))) > + (stop #~(make-kill-destructor)))) > + > +(define (home-pipewire-shepherd-services config) > + (cons* (home-pipewire-shepherd-service config) > + (home-wireplumber-shepherd-service config) > + (if (home-pipewire-configuration-enable-pulseaudio? config) > + (list (home-pipewire-pulseaudio-shepherd-service config)) > + '()))) > + > +(define (home-pipewire-asoundrc config) > + (mixed-text-file > + "asoundrc" > + #~(string-append > + "<" > + #$(file-append > + (home-pipewire-configuration-pipewire config) > + "/share/alsa/alsa.conf.d/50-pipewire.conf") > + ">\n" > + "<" > + #$(file-append > + (home-pipewire-configuration-pipewire config) > + "/share/alsa/alsa.conf.d/99-pipewire-default.conf") > + ">\n" > + "pcm_type.pipewire {\n" > + " lib \"" > + #$(file-append > + (home-pipewire-configuration-pipewire config) > + "/lib/alsa-lib/libasound_module_pcm_pipewire.so") > + "\"\n}\n" > + "ctl_type.pipewire {\n" > + " lib \"" > + #$(file-append > + (home-pipewire-configuration-pipewire config) > + "/lib/alsa-lib/libasound_module_ctl_pipewire.so") > + "\"\n}\n"))) I'd prefer the following: --8<---------------cut here---------------start------------->8--- (define (home-pipewire-asoundrc config) (match-record config (pipewire) (mixed-text-file "asoundrc" "<" pipewire "/share/alsa/alsa.conf.d/50-pipewire.conf>\n" "<" pipewire "/share/alsa/alsa.conf.d/99-pipewire-default.conf>\n" "pcm_type.pipewire {\n" " lib \"" pipewire "/lib/alsa-lib/libasound_module_pcm_pipewire.so\"\= n" "}\n" "ctl_type.pipewire {\n" " lib \"" pipewire "/lib/alsa-lib/libasound_module_ctl_pipewire.so\"\= n" "}\n"))) --8<---------------cut here---------------end--------------->8--- or: --8<---------------cut here---------------start------------->8--- (define (home-pipewire-asoundrc config) (match-record config (pipewire) (mixed-text-file "asoundrc" #~(begin (use-modules (ice-9 format)) (format #f "~ <~a/share/alsa/alsa.conf.d/50-pipewire.conf> <~@*~a/share/alsa/alsa.conf.d/99-pipewire-default.conf> pcm_type.pipewire { lib \"~@*~a/lib/alsa-lib/libasound_module_pcm_pipewire.so\" } ctl_type.pipewire { lib \"~@*~a/lib/alsa-lib/libasound_module_ctl_pipewire.so\" }~%" #$pipewire))))) --8<---------------cut here---------------end--------------->8--- > + > +(define home-pipewire-disable-pulseaudio-auto-start > + (plain-file "client.conf" "autospawn =3D no")) > + > +(define (home-pipewire-xdg-configuration config) > + (cons* `("alsa/asoundrc" ,(home-pipewire-asoundrc config)) > + (if (home-pipewire-configuration-enable-pulseaudio? config) > + `(("pulse/client.conf" > + ,home-pipewire-disable-pulseaudio-auto-start)) > + '()))) > + > +(define home-pipewire-service-type > + (service-type > + (name 'pipewire) > + (extensions > + (list (service-extension home-shepherd-service-type > + home-pipewire-shepherd-services) > + (service-extension home-xdg-configuration-files-service-type > + home-pipewire-xdg-configuration))) > + (description > + "Start essential PipeWire services.") > + (default-value (home-pipewire-configuration)))) > > =0C > ;;; > -- > 2.40.1 One thing to note: the wireplumber package is built with elogind integratio= n, so it fails to start when elogind is not present: --8<---------------cut here---------------start------------->8--- [wireplumber] failed to start systemd logind monitor: -2 (No such file or d= irectory) --8<---------------cut here---------------end--------------->8--- I think we can add a wireplumber variant built with "-Delogind=3Ddisabled" = and maybe mention it in the documentation. Thanks From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v5 1/1] gnu: home: Add support for home-pipewire-service References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> In-Reply-To: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 16 Dec 2023 15:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Hilton Chain Cc: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.170273985613986 (code B ref 63863); Sat, 16 Dec 2023 15:18:02 +0000 Received: (at 63863) by debbugs.gnu.org; 16 Dec 2023 15:17:36 +0000 Received: from localhost ([127.0.0.1]:55739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEWQ4-0003dW-6p for submit@debbugs.gnu.org; Sat, 16 Dec 2023 10:17:36 -0500 Received: from coleridge.kublai.com ([2001:470:30:84:e276:63ff:fe62:3637]:60298 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEWQ0-0003dN-Ue for 63863@debbugs.gnu.org; Sat, 16 Dec 2023 10:17:34 -0500 Received: from smtpclient.apple (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id ADDA5196; Sat, 16 Dec 2023 10:17:31 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1702739851; bh=PpiH5BvG+aWvhQL5InbmYkqWCr+CDGHJDxjh1T0O+wc=; h=From:Subject:Date:Cc:To; b=FCfpQOORlakiNxFaRQ0h8Z20oTw5Q0IDcAKR9lcG/PtI3HJStHc2KJQHxsAEt+JvN 2lgv3UVTJUEg0MLNv+HixzFmvJMcXtT+dBVpwADakG8XLMpCRZfIL4tcATrSLWeI9r EUZg0E/yNr86G3wpB6YlNu1h3hBPj6a3d0fNhXmk= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Brian Cully Mime-Version: 1.0 (1.0) Message-Id: <9E63989C-2927-45B5-B1BF-5C5E8FF1D5C1@spork.org> Date: Sat, 16 Dec 2023 10:17:21 -0500 X-Mailer: iPhone Mail (21B101) X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) =EF=BB=BF Hilton Chain writes: > I'd prefer the following: >=20 > (define (home-pipewire-asoundrc config) > (match-record config > (pipewire) > (mixed-text-file > "asoundrc" > "<" pipewire "/share/alsa/alsa.conf.d/50-pipewire.conf>\n" > "<" pipewire "/share/alsa/alsa.conf.d/99-pipewire-default.conf>\n" > "pcm_type.pipewire {\n" > " lib \"" pipewire "/lib/alsa-lib/libasound_module_pcm_pipewire.so\"\= n" > "}\n" > "ctl_type.pipewire {\n" > " lib \"" pipewire "/lib/alsa-lib/libasound_module_ctl_pipewire.so\"\= n" > "}\n"))) >=20 >=20 > or: >=20 > (define (home-pipewire-asoundrc config) > (match-record config > (pipewire) > (mixed-text-file > "asoundrc" > #~(begin > (use-modules (ice-9 format)) > (format #f "~ > <~a/share/alsa/alsa.conf.d/50-pipewire.conf> > <~@*~a/share/alsa/alsa.conf.d/99-pipewire-default.conf> > pcm_type.pipewire { > lib \"~@*~a/lib/alsa-lib/libasound_module_pcm_pipewire.so\" > } > ctl_type.pipewire { > lib \"~@*~a/lib/alsa-lib/libasound_module_ctl_pipewire.so\" > }~%" #$pipewire))))) I prefer the former to the latter; I often find =E2=80=98format=E2=80=99 str= ings to be pretty confusing, and the documentation doesn't tend to help much= . I know I'm not alone in this, and since this is fairly simple, I'll use th= e straight concatenation, which has the additional benefit of preserving ind= entation. > One thing to note: the wireplumber package is built with elogind integrati= on, so > it fails to start when elogind is not present: >=20 > [wireplumber] failed to start systemd logind monitor: -2 (No such file or d= irectory) >=20 > I think we can add a wireplumber variant built with "-Delogind=3Ddisabled"= and > maybe mention it in the documentation. Sounds reasonable. I don't know how long wireplumber has been able to be bui= lt without systemd stuff, just that I tried running it with seatd/greetd and= it failed. Have you got it working without elogind? I'm not sure when I'll be able to have a look at it, so I'd rather the curre= nt patch go in, and we can add elogind-less variants afterwards. -- -bjc From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v6] gnu: home: Add support for home-pipewire-service References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> In-Reply-To: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Sat, 16 Dec 2023 15:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63863@debbugs.gnu.org Cc: Brian Cully , ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.170274023114665 (code B ref 63863); Sat, 16 Dec 2023 15:24:01 +0000 Received: (at 63863) by debbugs.gnu.org; 16 Dec 2023 15:23:51 +0000 Received: from localhost ([127.0.0.1]:55759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEWW7-0003oT-5M for submit@debbugs.gnu.org; Sat, 16 Dec 2023 10:23:51 -0500 Received: from coleridge.kublai.com ([166.84.7.167]:51556 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEWW2-0003oH-PA for 63863@debbugs.gnu.org; Sat, 16 Dec 2023 10:23:47 -0500 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 89E96D5; Sat, 16 Dec 2023 10:23:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1702740225; bh=RLqEh4TMIb3ld3hfUUyHe7vX/yKBU4n8oQtiWx2dbBM=; h=From:To:Cc:Subject:Date; b=oRbuZkFNcYp0De9DgJ3fK4JHPFw9NBaMnX/IpD1LYrVIQilgrEjqRInC57EzSXJKj vWUVDYjozS4avTcUw46pSVPRChKIIbyghyev7WrgKTvYY0aefHrwIsc2ymNfBbDoqs e9nv6Vt5TsYO1ToF9orOUkhQqZvNSOtvqbbNUv4o= From: Brian Cully Date: Sat, 16 Dec 2023 10:23:37 -0500 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) 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), (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(-) diff --git a/doc/guix.texi b/doc/guix.texi index e61a893af9..90888a514f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -45050,6 +45050,7 @@ Sound Home Services @cindex PulseAudio, home service @cindex RTP, for PulseAudio +@subsubheading PulseAudio RTP Streaming Services The following services dynamically reconfigure the @uref{https://pulseaudio.org,PulseAudio sound server}: they let you @@ -45137,6 +45138,77 @@ Sound Home Services This is the multicast address used by default by the two services above. @end defvar +@cindex PipeWire, home service +@subsubheading PipeWire Home Service + +@uref{https://pipewire.org, PipeWire} provides a low-latency, +graph-based audio and video processing service. In addition to its +native protocol, it can also be used as a replacement for both JACK and +PulseAudio. + +While PipeWire provides the media processing and API, it does not, +directly, know about devices such as sound cards, nor how you might want +to connect applications, hardware, and media processing filters. +Instead, PipeWire relies on a @dfn{session manager} to specify all these +relationships. While you may use any session manager you wish, for most +people the @url{https://pipewire.pages.freedesktop.org/wireplumber/, +WirePlumber} session manager, a reference implementation provided by the +PipeWire project itself, suffices, and that is the one +@code{home-pipewire-service-type} uses. + +PipeWire can be used as a replacement for PulseAudio by setting +@code{enable-pulseaudio?} to @code{#t} in +@code{home-pipewire-configuration}, so that existing PulseAudio clients +may use it without any further configuration. + +In addition, JACK clients may connect to PipeWire by using the +@command{pw-jack} program, which comes with PipeWire. Simply prefix the +command with @command{pw-jack} when you run it, and audio data should go +through PipeWire: + +@example +pw-jack mpv -ao=jack sound-file.wav +@end example + +For more information on PulseAudio emulation, see +@uref{https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-PulseAudio}, +for JACK, see +@uref{https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-JACK}. + +As PipeWire does not use @code{dbus} to start its services on demand +(as PulseAudio does), @code{home-pipewire-service-type} uses Shepherd +to start services when logged in, provisioning the @code{pipewire}, +@code{wireplumber}, and, if configured, @code{pipewire-pulseaudio} +services. @xref{Shepherd Home Service}. + +@defvar home-pipewire-service-type +This provides the service definition for @command{pipewire}, which will +run on login. Its value is a @code{home-pipewire-configuration} object. + +To start the service, add it to the @code{service} field of your +@code{home-environment}, such as: + +@lisp +(service home-pipewire-service-type) +@end lisp +@end defvar + +@deftp {Data Type} home-pipewire-configuration +Available @code{home-pipewire-configuration} fields are: + +@table @asis +@item @code{pipewire} (default: @code{pipewire}) (type: file-like) +The PipeWire package to use. + +@item @code{wireplumber} (default: @code{wireplumber}) (type: file-like) +The WirePlumber package to use. + +@item @code{enable-pulseaudio?} (default: @code{#t}) (type: boolean) +When true, enable PipeWire's PulseAudio emulation support, allowing +PulseAudio clients to use PipeWire transparently. +@end table +@end deftp + @node Mail Home Services @subsection Mail Home Services diff --git a/gnu/home/services/sound.scm b/gnu/home/services/sound.scm index 22c1a99250..313a57305b 100644 --- a/gnu/home/services/sound.scm +++ b/gnu/home/services/sound.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Ludovic Courtès +;;; Copyright © 2023 Brian Cully ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,13 +20,112 @@ (define-module (gnu home services sound) #:use-module (gnu home services) #:use-module (gnu home services shepherd) + #:use-module (gnu home services xdg) + #:use-module (gnu packages linux) + #:use-module (gnu services configuration) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:export (home-pulseaudio-rtp-sink-service-type home-pulseaudio-rtp-source-service-type - %pulseaudio-rtp-multicast-address)) + %pulseaudio-rtp-multicast-address + + home-pipewire-configuration + home-pipewire-service-type)) + + +;;; +;;; PipeWire support. +;;; + +(define-configuration/no-serialization home-pipewire-configuration + (pipewire + (file-like pipewire) + "The PipeWire package to use.") + (wireplumber + (file-like wireplumber) + "The WirePlumber package to use.") + (enable-pulseaudio? + (boolean #t) + "When true, enable PipeWire's PulseAudio emulation support, allowing +PulseAudio clients to use PipeWire transparently.")) + +(define (home-pipewire-shepherd-service config) + (shepherd-service + (documentation "PipeWire media processing.") + (provision '(pipewire)) + (requirement '(dbus)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire")))) + (stop #~(make-kill-destructor)))) + +(define (home-pipewire-pulseaudio-shepherd-service config) + (shepherd-service + (documentation "Drop-in PulseAudio replacement service for PipeWire.") + (provision '(pipewire-pulseaudio)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire-pulse")))) + (stop #~(make-kill-destructor)))) + +(define (home-wireplumber-shepherd-service config) + (shepherd-service + (documentation "WirePlumber session management for PipeWire.") + (provision '(wireplumber)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-wireplumber config) + "/bin/wireplumber")))) + (stop #~(make-kill-destructor)))) + +(define (home-pipewire-shepherd-services config) + (cons* (home-pipewire-shepherd-service config) + (home-wireplumber-shepherd-service config) + (if (home-pipewire-configuration-enable-pulseaudio? config) + (list (home-pipewire-pulseaudio-shepherd-service config)) + '()))) + +(define (home-pipewire-asoundrc config) + (match-record config + (pipewire) + (mixed-text-file + "asoundrc" + "<" pipewire "/share/alsa/alsa.conf.d/50-pipewire.conf>\n" + "<" pipewire "/share/alsa/alsa.conf.d/99-pipewire-default.conf>\n" + "pcm_type.pipewire {\n" + " lib \"" pipewire "/lib/alsa-lib/libasound_module_pcm_pipewire.so\"\n" + "}\n" + "ctl_type.pipewire {\n" + " lib \"" pipewire "/lib/alsa-lib/libasound_module_ctl_pipewire.so\"\n" + "}\n"))) + +(define home-pipewire-disable-pulseaudio-auto-start + (plain-file "client.conf" "autospawn = no")) + +(define (home-pipewire-xdg-configuration config) + (cons* `("alsa/asoundrc" ,(home-pipewire-asoundrc config)) + (if (home-pipewire-configuration-enable-pulseaudio? config) + `(("pulse/client.conf" + ,home-pipewire-disable-pulseaudio-auto-start)) + '()))) + +(define home-pipewire-service-type + (service-type + (name 'pipewire) + (extensions + (list (service-extension home-shepherd-service-type + home-pipewire-shepherd-services) + (service-extension home-xdg-configuration-files-service-type + home-pipewire-xdg-configuration))) + (description + "Start essential PipeWire services.") + (default-value (home-pipewire-configuration)))) ;;; base-commit: d5298c5e334e56a9aabddcb62d312e63135864f6 -- 2.41.0 From unknown Fri Jun 20 07:18:40 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Brian Cully Subject: bug#63863: closed (Re: [bug#63863] [PATCH v6] gnu: home: Add support for home-pipewire-service) Message-ID: References: <871qbh8dni.fsf@gmail.com> <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> X-Gnu-PR-Message: they-closed 63863 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 63863@debbugs.gnu.org Date: Wed, 20 Dec 2023 08:47:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1703062022-9969-1" This is a multi-part message in MIME format... ------------=_1703062022-9969-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #63863: [PATCH] gnu: home: Add support for home-pipewire-service which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 63863@debbugs.gnu.org. --=20 63863: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D63863 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1703062022-9969-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 63863-done) by debbugs.gnu.org; 20 Dec 2023 08:46:39 +0000 Received: from localhost ([127.0.0.1]:38617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFsDu-0002aD-ND for submit@debbugs.gnu.org; Wed, 20 Dec 2023 03:46:39 -0500 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:40131) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFsDs-0002Zz-HI for 63863-done@debbugs.gnu.org; Wed, 20 Dec 2023 03:46:37 -0500 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-50e40b43798so737739e87.0 for <63863-done@debbugs.gnu.org>; Wed, 20 Dec 2023 00:46:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703061987; x=1703666787; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=RlhgpRloZUAeMkm//77U7uKy2Xi82j0m+QJV2Hc59ns=; b=mAKbNbyfaXr8mfKpb8I/mCmAekDZMVCwDC8bqQzU/TdiGJpYOTHrLHXH9lq439EaIO C+mzqrdXOLsDwBjTW979PHa9p6zUpuglQo4jO1EUPzvG0bWNeQnRcbJwp0C5/Q4OWbL7 eVtOfjvhvybRWPpGARW1/nWdRo2nqBxjeiVk/HwaDSU14xG3pdIM3Bc0RFarNKwCrlez J5YCBIMEgLusduoNZP6bC/RL1ygG7UBRs7Jt3kQsM3e3Pbj9RDVLpiPLmMGdK6yXGIGi 5DXr2wQ2b62NebUCI7K1AIr+cvvadT0OeiPuuGM8qeD8QUkkUNSLlh4xLL1o1M6jfdo6 MhUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703061987; x=1703666787; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RlhgpRloZUAeMkm//77U7uKy2Xi82j0m+QJV2Hc59ns=; b=rFnABRENpRYmWKELQeyTDbjj441/SFECGfgLE1rWRygxB1Ve5PzKnimIKoAYB7KACb jojoTRNWQq1ffQ06nu6tDTdCdY5EYT6AvvCkd6L7TBL4ghEQyax2pWGp5oLHCXrkmVHc WS8VgE8olRFDGGTJCtjgYgF2vZRp9AQgNNqNFkgsYBtzzy+L/ASy+72sf8TPi62UYVCG am1n+5slthWUkfoCsI0eeze1oko2IT/I0/E7g39k/ODYZRll0oRWSTOVp2Y/ph2JH1R5 UXmP/+XqPc0pzVdl2hhhT/kUwc7zuDLFattNEfaY2O/9TmiIAKw+Zbw+SDR1dbp46P5g 5rww== X-Gm-Message-State: AOJu0YxyJPAu1wUwYeX0f9G9enzG3lal0uEq4x8PETvotcOg3M0rkxPg Rmp2EvnSRFNJVEi2upr5n1A= X-Google-Smtp-Source: AGHT+IFP38agJcecYR5bGHwTjjZ6tr6cJiWccPtdGZnXh1y2d2raLOCw2bKpgp48AmY+bl9g7cZcpg== X-Received: by 2002:ac2:5b05:0:b0:50e:3107:29e8 with SMTP id v5-20020ac25b05000000b0050e310729e8mr5524610lfn.3.1703061986771; Wed, 20 Dec 2023 00:46:26 -0800 (PST) Received: from localhost ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id e4-20020a056512090400b0050e55fab0eesm22909lft.292.2023.12.20.00.46.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 00:46:26 -0800 (PST) From: Oleg Pykhalov To: Brian Cully Subject: Re: [bug#63863] [PATCH v6] gnu: home: Add support for home-pipewire-service In-Reply-To: (Brian Cully's message of "Sat, 16 Dec 2023 10:23:37 -0500") References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Date: Wed, 20 Dec 2023 11:46:25 +0300 Message-ID: <871qbh8dni.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 63863-done Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 63863-done@debbugs.gnu.org, Tanguy LE CARROUR , Andrew Tropin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Brian, Brian Cully 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-servic= e), The =E2=80=98home-pipewire-pulse-shepherd-service=E2=80=99 procedure is mis= sing. 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 procedur= es. > (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/bd87902da6a2badae096e4679eed= fe9da2e75d79/NEWS#L5573 The patch is tested with the following Guix home configuration: =2D-8<---------------cut here---------------start------------->8--- (service home-dbus-service-type) (service home-pipewire-service-type) =2D-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 =E2=80=98home-pipewire-pulse-shepherd-service=E2=80=99 or removing it from = the commit message, e.g.: =2D-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. =2D-8<---------------cut here---------------end--------------->8--- Brian, could you add the code for =E2=80=98home-pipewire-pulse-shepherd-ser= vice=E2=80=99 if it is required, please? Thanks, Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmWCqeEUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+pxFrw/+JoLSu0ORCQBxWo89bLESCgiDmcvR giTnNgxnjBfuur7nfTinReKCSkkrfUhoFLabGMz9Rr/0guyzTHsB+nIoGab2S8ZU KGD3uru+AgcNmJwABKJZ2S5ULvtjZ79eAKmujpPUMc8HQK16vUPxAnGAahPC0/T1 v3oH+FyuDhGa3Re+IcWDAg6hw+qBCfEBJL6LZaeWmwPEaXbHnpHl7f+sxdUe/yMa WIoKPN3VVTerNbdpIECKuTHYFDAkGjz1tYa2dEEYgJTi+KyM0HIG2ZEz2Lkw9Ah7 Zda7i8WeaIriYYfWO89ys9yxeoBqk9ZWrAJiWoW42/Rt4nQpghcn4dqd7OaUSmjJ ec4bnekFIlZtq6pnyZD03we7B50PB4R4jWVBIgrHEhskUs5PumwbUI9FYZjArDQJ 3rzLAVxPxqxJn4Pv744eO+WMmVW39/ixfvYv2+HAD0sf4LelS6QlJOrxzpc3Tuhc 1GTHbEn4BgsE3XfANyICA1hcK8wT917Osaa2d2SSM5Xk19aGJWT+cWzEDMskaaeu tZqOl7Q/Z6vLOgADNbrLflJxTtWVS7ESJvxXVbqptdSSbHTs6uc/0e5drgXEMpI7 IPMCBj5Gv6YQITkQcOCqnvXNnYTbVHXVIa8p/sHOrS/XjZg/liWsjvkJMgoSZpIu 4sc4ugBRnwd9m1Q= =YXi8 -----END PGP SIGNATURE----- --=-=-=-- ------------=_1703062022-9969-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 Jun 2023 23:05:34 +0000 Received: from localhost ([127.0.0.1]:41012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Dpu-0002cf-2N for submit@debbugs.gnu.org; Fri, 02 Jun 2023 19:05:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:39362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Dpr-0002cW-Hg for submit@debbugs.gnu.org; Fri, 02 Jun 2023 19:05:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5Dpr-0006TH-9y for guix-patches@gnu.org; Fri, 02 Jun 2023 19:05:31 -0400 Received: from coleridge.kublai.com ([166.84.7.167] helo=mail.spork.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5Dpp-0003TB-7q for guix-patches@gnu.org; Fri, 02 Jun 2023 19:05:31 -0400 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 91003D002; Fri, 2 Jun 2023 19:04:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1685747083; bh=trixCC09+EKP+B1IEuTU2r2r64MHz2Kwb7LDrEIjMSQ=; h=From:To:Cc:Subject:Date; b=DP+CIh2SrwIyxVHxaYAeMHLiChTWtVwgJ8AdvFRba4asAaYefsyVgnK4cP35ip3zy mutAeU0wYDDlrg4sYaOgGmq+7vturhDdBXkWNxU4Bkged/hPfNHXMWsoD9QzeraDlo ySyi+I4cBw9+bZi1SS7IMs+ME4kbGKjWoxh7Bp4E= From: Brian Cully To: guix-patches@gnu.org Subject: [PATCH] gnu: home: Add support for home-pipewire-service Date: Fri, 2 Jun 2023 19:04:27 -0400 Message-Id: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Debbugs-Cc: ( , Andrew Tropin , Ludovic Courtès Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=166.84.7.167; envelope-from=bjc@spork.org; helo=mail.spork.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Brian Cully X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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), (home-pipewire-shepherd-services), (generate-doc): new procedures. (home-pipewire-service-type): new service type. (home-pipewire-configuration): new struct. * doc/guix.texi (Sound Home Services): document it. --- doc/guix.texi | 34 +++++++++++++++++ gnu/home/services/sound.scm | 74 ++++++++++++++++++++++++++++++++++++- 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 7f8d8d66e9..0b19c9301f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -116,6 +116,7 @@ Copyright @copyright{} 2023 Karl Hallsby@* Copyright @copyright{} 2023 Nathaniel Nicandro@* Copyright @copyright{} 2023 Tanguy Le Carrour@* +Copyright @copyright{} 2023 Brian Cully@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -43563,6 +43564,39 @@ Sound Home Services This is the multicast address used by default by the two services above. @end defvar +@cindex PipeWire, home service + +@uref{https://pipewire.org, PipeWire} provides a low-latency, +graph-based audio and video processing service. In addition to its +native protocol, it can also be used as a replacement for both JACK and +PulseAudio. + +@defvar home-pipewire-service-type +This provides the service definition for @command{pipewire}, which will +run on login. Its value is a @code{home-pipewire-configuration} object. + +To start the service, add it to the @code{service} field of your +@code{home-environment}, such as: + +@lisp +(service home-pipewire-service-type) +@end lisp + +@deftp {Data Type} home-pipewire-configuration +Available @code{home-pipewire-configuration} fields are: + +@table @asis +@item @code{pipewire} (default: @code{pipewire}) (type: file-like) +The PipeWire package to use. + +@item @code{wireplumber} (default: @code{wireplumber}) (type: file-like) +The WirePlumber package to use. + +@item @code{enable-pulseaudio?} (default: @code{#t}) (type: boolean) +Enable PulseAudio replacement. +@end table +@end deftp + @node Mail Home Services @subsection Mail Home Services diff --git a/gnu/home/services/sound.scm b/gnu/home/services/sound.scm index 22c1a99250..94d8bc7482 100644 --- a/gnu/home/services/sound.scm +++ b/gnu/home/services/sound.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Ludovic Courtès +;;; Copyright © 2023 Brian Cully ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,13 +20,77 @@ (define-module (gnu home services sound) #:use-module (gnu home services) #:use-module (gnu home services shepherd) + #:use-module (gnu packages linux) + #:use-module (gnu services configuration) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (ice-9 match) #:export (home-pulseaudio-rtp-sink-service-type home-pulseaudio-rtp-source-service-type - %pulseaudio-rtp-multicast-address)) + %pulseaudio-rtp-multicast-address + + home-pipewire-configuration + home-pipewire-service-type)) + + +;;; +;;; PipeWire support. +;;; +(define-configuration/no-serialization home-pipewire-configuration + (pipewire (file-like pipewire) "The PipeWire package to use.") + (wireplumber (file-like wireplumber) "The WirePlumber package to use.") + (enable-pulseaudio? (boolean #t) "Enable PulseAudio replacement.")) + +(define (home-pipewire-shepherd-service config) + (shepherd-service + (documentation "PipeWire screen and audio sharing.") + (provision '(pipewire)) + (requirement '(dbus)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire")))))) + +(define (home-pipewire-pulseaudio-shepherd-service config) + (shepherd-service + (documentation "Drop-in PulseAudio replacement service for PipeWire.") + (provision '(pipewire-pulseaudio)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire-pulse")))))) + +(define (home-wireplumber-shepherd-service config) + (shepherd-service + (documentation "WirePlumber session management for PipeWire.") + (provision '(wireplumber)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-wireplumber config) + "/bin/wireplumber")))))) + +(define (home-pipewire-shepherd-services config) + (define shepherd-services + (filter + identity + (list home-pipewire-shepherd-service home-wireplumber-shepherd-service + (and (home-pipewire-configuration-enable-pulseaudio? config) + home-pipewire-pulseaudio-shepherd-service)))) + (map (cut <> config) shepherd-services)) + +(define home-pipewire-service-type + (service-type + (name 'pipewire) + (extensions + (list (service-extension home-shepherd-service-type + home-pipewire-shepherd-services))) + (description + "Start essential PipeWire services.") + (default-value (home-pipewire-configuration)))) ;;; @@ -149,3 +214,10 @@ (define home-pulseaudio-rtp-source-service-type "Define a PulseAudio source to receive audio broadcasted over RTP by another PulseAudio instance.") (default-value %pulseaudio-rtp-multicast-address))) + + +;;; +;;; Generate documentation. +;;; +(define (generate-doc) + (configuration->documentation 'home-pipewire-configuration)) base-commit: c11b92a8aae6fe7fad0da8257ec28f5009c37b35 -- 2.40.1 ------------=_1703062022-9969-1-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 20 03:51:46 2023 Received: (at control) by debbugs.gnu.org; 20 Dec 2023 08:51:46 +0000 Received: from localhost ([127.0.0.1]:38628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFsIr-0002o2-Tl for submit@debbugs.gnu.org; Wed, 20 Dec 2023 03:51:46 -0500 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]:40047) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFsIq-0002np-G9 for control@debbugs.gnu.org; Wed, 20 Dec 2023 03:51:45 -0500 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2cc73761da8so6663041fa.0 for ; Wed, 20 Dec 2023 00:51:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703062295; x=1703667095; darn=debbugs.gnu.org; h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=7FnUlVTyX22NqsVy3Brr2Y2dqe9Y/UvXrzrWI8DDldw=; b=iuheFnRT/1rwnBFUg5ACE1XChLl1SZtPBNFWFUkUmoCHOrdGU7B3f39bKiTPJ7MJJk ICJmAULJb7v3TmSlAGNCJn7GMgwbZp6owjg4KpiaefnDO3fB2/h0Q9930xKowlQ/Do+b tENi+6kmcjCQlwwBCZkEfFiv4PwmBiGdQfTKBtMsxLu7w/GsmR9GvlRAnmyUTHqE94I4 i3h/J7sQh9uvaMq1EHl2Cya4cjyfXx77rr0WdHmaquGlwbxWZNJvSNCQcpJFgfAZTUSV xicMiKkOgn0N5bs4ThuArcvYMAWMfHohMNPOYtpv0pCxGmn/Dnc/yINVE0qmHSwJ3Ql3 94kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703062295; x=1703667095; h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7FnUlVTyX22NqsVy3Brr2Y2dqe9Y/UvXrzrWI8DDldw=; b=cs6D9wM1eeDZrLYcD0nWBAhzhzcyLAT5+qf2Twm3IG95Kx2woukB0xVBYO95/NKmC5 ub08Zvelqm5ocNzSStTMKEFN8u9QHqiRoxWzB2cygHEmeoXTz4eU7oUmCi7KC4ZXevVO CvZCxvl65aH3AvbVoeR4oSYZCzX6GyyweRack05aurvo1J4gaFuf5pwpzXnQQPk8cES9 aK802ZLClTD3RiY1U1tj/HGJ+oQ6w2s4sYwV+xGFCpPmzffv8O1KlEuTsHIqXChGubHG YBV9oZo+/Uzt9gwPZ8WSoj3NUqjMWEvqbo5JO5SKUDBsp9mPmIGB9ytjAInvH4jxcCJn SmXQ== X-Gm-Message-State: AOJu0Yx1Urh4QKc2tJ/iVcGs8BdG8swC1BLoMJEGISQ+3QvFVESBTLqS RMNng/LsmNsVe6QJe9U6NTnbozkfljI= X-Google-Smtp-Source: AGHT+IGde0TaCz028O87/s4IfD4DrWVC+2tkpHTyd7rdn2y08jdH0R4kOEh/5ig7HgbcA2ilEroLQw== X-Received: by 2002:a2e:a685:0:b0:2cc:699f:3237 with SMTP id q5-20020a2ea685000000b002cc699f3237mr4672384lje.5.1703062294925; Wed, 20 Dec 2023 00:51:34 -0800 (PST) Received: from localhost ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id p9-20020a2ea4c9000000b002cc646d5abcsm1351567ljm.1.2023.12.20.00.51.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 00:51:34 -0800 (PST) Date: Wed, 20 Dec 2023 11:51:34 +0300 Message-ID: <4ddae0af29c2331e032430d9c9df708f@gmail.com> To: control@debbugs.gnu.org From: Oleg Pykhalov Subject: control message for bug #63863 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) reopen 63863 tags 63863 - fixed patch quit From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 20 03:55:49 2023 Received: (at control) by debbugs.gnu.org; 20 Dec 2023 08:55:49 +0000 Received: from localhost ([127.0.0.1]:38633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFsMn-0002uP-FE for submit@debbugs.gnu.org; Wed, 20 Dec 2023 03:55:49 -0500 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]:39026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rFsMl-0002uB-OM for control@debbugs.gnu.org; Wed, 20 Dec 2023 03:55:48 -0500 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2cc9131dabcso558201fa.0 for ; Wed, 20 Dec 2023 00:55:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703062538; x=1703667338; darn=debbugs.gnu.org; h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=KXHQYTKc6WfYh4F9W1U4QhOEDg+K4MR5mbI5DLzfA9M=; b=MHjxNXdR2E4gerMWNeIhS4mLVvl+xYPgdOmB6lGBOHh1HzQjilk5vTWprIn1f5Soom wZK3/bxl6uq5Pr0h/V0isvKMRKjfOl3AaHoKtv0dA6+TYfxSxnMeJmY6pVvONsBmMze7 BVYKTUFMcVef2A6LjB8DQ0z+TjjwA16Yi9o6lBDbn8RA7BhzZTFcEkpsB14C0w3kwgyH cADBZSHELwxB3DZUMScBTqQjviz0Z4XomXQ0ItJc1cMOCAPkbBpwRzvNxGYPxGDXueKG E0OUCMJGNHv8IY+IF+lQep6lcq2d7Gq3QYXQltOJitz5I0d6pwgOvVC2QUBtez0J2XE1 SPbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703062538; x=1703667338; h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KXHQYTKc6WfYh4F9W1U4QhOEDg+K4MR5mbI5DLzfA9M=; b=YtwoLW+9IzKtrCWzkEtcRJuTlfiAVpFdEHSLJ+UiiLypco6ByKP97VWKEjYq0jP8OK v6PrC2uFNxraQCPR8R3oQAALo1JQ8eXdqxtJoOxwadr/oDWlgE3f8tyDt6Fwm0kxltlW iLGGZ7pRwRIGdczkQqZ6FUq0wl9Za9EX3tS/GY5o3fLBI/23Id9kVbvxpUVqBFHQnGgp p0hqKsWEqz2wFxrguXnLJ1MKVOuEjRhTb7HFY8uIvTB9+rheo1PmR3hrd1joYbudYGkH s7ph9SBAYvEtU0cZXJf62xeO6cSQ+uoO7BDEsXpRMsTDe6bpU9AHwXRAruPNBNXnaqic jj6A== X-Gm-Message-State: AOJu0YxIHPwRowm2LY0sUslIQ3tb3zoSNEcGzk/eUWcnOyHwGEDB7b9T tQywWCTFqDrh9fhcvYs/I1umdaOhsPc= X-Google-Smtp-Source: AGHT+IFZxZVZ77W1vD7yaIo3J/vRj68oD9mYex09cccCTIOKF02SjJgI6ELzRpzaUWtuS0d5j2Qjbw== X-Received: by 2002:a2e:8889:0:b0:2cc:916c:e328 with SMTP id k9-20020a2e8889000000b002cc916ce328mr484369lji.4.1703062537672; Wed, 20 Dec 2023 00:55:37 -0800 (PST) Received: from localhost ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id y38-20020a05651c222600b002cc7abaa98asm663800ljq.64.2023.12.20.00.55.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 00:55:37 -0800 (PST) Date: Wed, 20 Dec 2023 11:55:37 +0300 Message-ID: <5b2d6ca138a1f4329f66a49271bb0f92@gmail.com> To: control@debbugs.gnu.org From: Oleg Pykhalov Subject: control message for bug #63863 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 63863 + patch quit From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] [PATCH v7] gnu: home: Add support for home-pipewire-service References: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> In-Reply-To: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: , guix-patches@gnu.org Resent-Date: Fri, 22 Dec 2023 15:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63863@debbugs.gnu.org Cc: Brian Cully , ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-Xcc: ( , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.17032585366168 (code B ref 63863); Fri, 22 Dec 2023 15:23:01 +0000 Received: (at 63863) by debbugs.gnu.org; 22 Dec 2023 15:22:16 +0000 Received: from localhost ([127.0.0.1]:47615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGhLr-0001bQ-U2 for submit@debbugs.gnu.org; Fri, 22 Dec 2023 10:22:16 -0500 Received: from coleridge.kublai.com ([166.84.7.167]:56339 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGhLo-0001bE-Ph for 63863@debbugs.gnu.org; Fri, 22 Dec 2023 10:22:14 -0500 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 5FED917CB; Fri, 22 Dec 2023 10:22:07 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1703258527; bh=LAtE3dl10OQrIYdFvh8cqZwRVWug4pHQsVkgodj1ZGI=; h=From:To:Cc:Subject:Date; b=TjBMWhyAbPNQ9o6lgAgPO8BI+B5T5cUgW8CqLfjqyYEybXmIPy/sPNvgvilfB9/dK rrZv+4t8ydF8nm1zW1pzGHk+WzeO7M/Wo9JKtNKthRvygB6UjUOwUf9Ep+Dn+3d2O+ cPV6tMPLO+h4PvCuHMO2SI08McLtq37gCtcsYel0= From: Brian Cully Date: Fri, 22 Dec 2023 10:22:01 -0500 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) 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-pulseaudio-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. Change-Id: I99e0ae860de91d459c3c554ec5503bf35f785a2a --- doc/guix.texi | 72 +++++++++++++++++++++++++ gnu/home/services/sound.scm | 102 +++++++++++++++++++++++++++++++++++- 2 files changed, 173 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index e61a893af9..90888a514f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -45050,6 +45050,7 @@ Sound Home Services @cindex PulseAudio, home service @cindex RTP, for PulseAudio +@subsubheading PulseAudio RTP Streaming Services The following services dynamically reconfigure the @uref{https://pulseaudio.org,PulseAudio sound server}: they let you @@ -45137,6 +45138,77 @@ Sound Home Services This is the multicast address used by default by the two services above. @end defvar +@cindex PipeWire, home service +@subsubheading PipeWire Home Service + +@uref{https://pipewire.org, PipeWire} provides a low-latency, +graph-based audio and video processing service. In addition to its +native protocol, it can also be used as a replacement for both JACK and +PulseAudio. + +While PipeWire provides the media processing and API, it does not, +directly, know about devices such as sound cards, nor how you might want +to connect applications, hardware, and media processing filters. +Instead, PipeWire relies on a @dfn{session manager} to specify all these +relationships. While you may use any session manager you wish, for most +people the @url{https://pipewire.pages.freedesktop.org/wireplumber/, +WirePlumber} session manager, a reference implementation provided by the +PipeWire project itself, suffices, and that is the one +@code{home-pipewire-service-type} uses. + +PipeWire can be used as a replacement for PulseAudio by setting +@code{enable-pulseaudio?} to @code{#t} in +@code{home-pipewire-configuration}, so that existing PulseAudio clients +may use it without any further configuration. + +In addition, JACK clients may connect to PipeWire by using the +@command{pw-jack} program, which comes with PipeWire. Simply prefix the +command with @command{pw-jack} when you run it, and audio data should go +through PipeWire: + +@example +pw-jack mpv -ao=jack sound-file.wav +@end example + +For more information on PulseAudio emulation, see +@uref{https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-PulseAudio}, +for JACK, see +@uref{https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Config-JACK}. + +As PipeWire does not use @code{dbus} to start its services on demand +(as PulseAudio does), @code{home-pipewire-service-type} uses Shepherd +to start services when logged in, provisioning the @code{pipewire}, +@code{wireplumber}, and, if configured, @code{pipewire-pulseaudio} +services. @xref{Shepherd Home Service}. + +@defvar home-pipewire-service-type +This provides the service definition for @command{pipewire}, which will +run on login. Its value is a @code{home-pipewire-configuration} object. + +To start the service, add it to the @code{service} field of your +@code{home-environment}, such as: + +@lisp +(service home-pipewire-service-type) +@end lisp +@end defvar + +@deftp {Data Type} home-pipewire-configuration +Available @code{home-pipewire-configuration} fields are: + +@table @asis +@item @code{pipewire} (default: @code{pipewire}) (type: file-like) +The PipeWire package to use. + +@item @code{wireplumber} (default: @code{wireplumber}) (type: file-like) +The WirePlumber package to use. + +@item @code{enable-pulseaudio?} (default: @code{#t}) (type: boolean) +When true, enable PipeWire's PulseAudio emulation support, allowing +PulseAudio clients to use PipeWire transparently. +@end table +@end deftp + @node Mail Home Services @subsection Mail Home Services diff --git a/gnu/home/services/sound.scm b/gnu/home/services/sound.scm index 22c1a99250..313a57305b 100644 --- a/gnu/home/services/sound.scm +++ b/gnu/home/services/sound.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Ludovic Courtès +;;; Copyright © 2023 Brian Cully ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,13 +20,112 @@ (define-module (gnu home services sound) #:use-module (gnu home services) #:use-module (gnu home services shepherd) + #:use-module (gnu home services xdg) + #:use-module (gnu packages linux) + #:use-module (gnu services configuration) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) #:use-module (ice-9 match) #:export (home-pulseaudio-rtp-sink-service-type home-pulseaudio-rtp-source-service-type - %pulseaudio-rtp-multicast-address)) + %pulseaudio-rtp-multicast-address + + home-pipewire-configuration + home-pipewire-service-type)) + + +;;; +;;; PipeWire support. +;;; + +(define-configuration/no-serialization home-pipewire-configuration + (pipewire + (file-like pipewire) + "The PipeWire package to use.") + (wireplumber + (file-like wireplumber) + "The WirePlumber package to use.") + (enable-pulseaudio? + (boolean #t) + "When true, enable PipeWire's PulseAudio emulation support, allowing +PulseAudio clients to use PipeWire transparently.")) + +(define (home-pipewire-shepherd-service config) + (shepherd-service + (documentation "PipeWire media processing.") + (provision '(pipewire)) + (requirement '(dbus)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire")))) + (stop #~(make-kill-destructor)))) + +(define (home-pipewire-pulseaudio-shepherd-service config) + (shepherd-service + (documentation "Drop-in PulseAudio replacement service for PipeWire.") + (provision '(pipewire-pulseaudio)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire-pulse")))) + (stop #~(make-kill-destructor)))) + +(define (home-wireplumber-shepherd-service config) + (shepherd-service + (documentation "WirePlumber session management for PipeWire.") + (provision '(wireplumber)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-wireplumber config) + "/bin/wireplumber")))) + (stop #~(make-kill-destructor)))) + +(define (home-pipewire-shepherd-services config) + (cons* (home-pipewire-shepherd-service config) + (home-wireplumber-shepherd-service config) + (if (home-pipewire-configuration-enable-pulseaudio? config) + (list (home-pipewire-pulseaudio-shepherd-service config)) + '()))) + +(define (home-pipewire-asoundrc config) + (match-record config + (pipewire) + (mixed-text-file + "asoundrc" + "<" pipewire "/share/alsa/alsa.conf.d/50-pipewire.conf>\n" + "<" pipewire "/share/alsa/alsa.conf.d/99-pipewire-default.conf>\n" + "pcm_type.pipewire {\n" + " lib \"" pipewire "/lib/alsa-lib/libasound_module_pcm_pipewire.so\"\n" + "}\n" + "ctl_type.pipewire {\n" + " lib \"" pipewire "/lib/alsa-lib/libasound_module_ctl_pipewire.so\"\n" + "}\n"))) + +(define home-pipewire-disable-pulseaudio-auto-start + (plain-file "client.conf" "autospawn = no")) + +(define (home-pipewire-xdg-configuration config) + (cons* `("alsa/asoundrc" ,(home-pipewire-asoundrc config)) + (if (home-pipewire-configuration-enable-pulseaudio? config) + `(("pulse/client.conf" + ,home-pipewire-disable-pulseaudio-auto-start)) + '()))) + +(define home-pipewire-service-type + (service-type + (name 'pipewire) + (extensions + (list (service-extension home-shepherd-service-type + home-pipewire-shepherd-services) + (service-extension home-xdg-configuration-files-service-type + home-pipewire-xdg-configuration))) + (description + "Start essential PipeWire services.") + (default-value (home-pipewire-configuration)))) ;;; base-commit: d5298c5e334e56a9aabddcb62d312e63135864f6 -- 2.41.0 From unknown Fri Jun 20 07:18:40 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#63863] closed (Re: [bug#63863] [PATCH v6] gnu: home: Add support for home-pipewire-service) Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 22 Dec 2023 15:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63863 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63863@debbugs.gnu.org Received: via spool by 63863-submit@debbugs.gnu.org id=B63863.17032586526386 (code B ref 63863); Fri, 22 Dec 2023 15:25:02 +0000 Received: (at 63863) by debbugs.gnu.org; 22 Dec 2023 15:24:12 +0000 Received: from localhost ([127.0.0.1]:47619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGhNj-0001ew-QI for submit@debbugs.gnu.org; Fri, 22 Dec 2023 10:24:12 -0500 Received: from coleridge.kublai.com ([2001:470:30:84:e276:63ff:fe62:3637]:53322 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rGhNg-0001en-LH for 63863@debbugs.gnu.org; Fri, 22 Dec 2023 10:24:10 -0500 Received: from psyduck (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 864BE1727 for <63863@debbugs.gnu.org>; Fri, 22 Dec 2023 10:24:03 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1703258643; bh=iVhG8N2jaTcdWhln+dwUz+asK2VvOQL8tafDNKpnN34=; h=References:From:To:Subject:Date:In-reply-to; b=cjUL6zu3gh+UUChOda8trrz4/boHL5dRTHVRLmS82f93LHHvMbuKk4fQ98EL7/TFk 7dVGiZTllFUVkWv484ZiT+HQNggjZSEdqPuywY9gon1uYxQHmQM1aLIU0rOlNdyEHA 53TDayJ+BO2A8XychrzB+UsZU7HShq7PkjJsSMOM= References: <871qbh8dni.fsf@gmail.com> <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> User-agent: mu4e 1.10.8; emacs 29.1 From: Brian Cully Date: Fri, 22 Dec 2023 10:22:11 -0500 In-reply-to: Message-ID: <8734vumfak.fsf@spork.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.9 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) help-debbugs@gnu.org (GNU bug Tracking System) writes: > Your bug report > > #63863: [PATCH] gnu: home: Add support for home-pipewire-service > > which was filed against the guix-patches package, has been=20 > closed. Was this intentional? > The =E2=80=98home-pipewire-pulse-shepherd-service=E2=80=99 procedure is=20 > missing. Do you > have a code for this procedure or should it be removed from the=20 > commit > message? The PipeWire service seems to work without it. I'd renamed it to =E2=80=98home-pulseaudio-shepherd-service=E2=80=99 and fo= rgot to=20 update the commit message; v7 will have it fixed. -bjc From unknown Fri Jun 20 07:18:40 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Brian Cully Subject: bug#63863: closed (Re: [bug#63863] closed (Re: [bug#63863] [PATCH v6] gnu: home: Add support for home-pipewire-service)) Message-ID: References: <87bkad3yui.fsf@gmail.com> <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> X-Gnu-PR-Message: they-closed 63863 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 63863@debbugs.gnu.org Date: Tue, 26 Dec 2023 12:59:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1703595542-5846-1" This is a multi-part message in MIME format... ------------=_1703595542-5846-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #63863: [PATCH] gnu: home: Add support for home-pipewire-service which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 63863@debbugs.gnu.org. --=20 63863: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D63863 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1703595542-5846-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 63863-done) by debbugs.gnu.org; 26 Dec 2023 12:58:14 +0000 Received: from localhost ([127.0.0.1]:56084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rI70f-0001VG-Uc for submit@debbugs.gnu.org; Tue, 26 Dec 2023 07:58:14 -0500 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]:37963) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rI70e-0001V3-7z for 63863-done@debbugs.gnu.org; Tue, 26 Dec 2023 07:58:12 -0500 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-50e7a0d07a0so163101e87.0 for <63863-done@debbugs.gnu.org>; Tue, 26 Dec 2023 04:58:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703595479; x=1704200279; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=7U+3eyX9Skcb0X5VNSt0bDnPrEbj+KvKMGvbdsiSSAA=; b=jepCBJbySjivxVcfIrag0J1vR1CAgr31ezxVzuWVd8dZakvL0UMC8ulEZT8gohJHCE 0t21YNcxf04oAP2cBvEykh/o8cCLcAfvLcQ94pRHfLfgygFIoQpnq3PQ2qcGNHWCLSlM uZRI8EwBQZ9tEO+2uWyoNn3NN+BUmmVxglg0Zpgbjdg7KvRgVDSqD9V3sxvI4POcnZZ6 +Jao8aIoS1yWRUPsooPpiCQazolkA6rUMC3KZehoXhGYkR5olQq0PfLUcSjigmgZwrxd HaTuYuQT5ie0U/21OdtQrNW6B4AKHBd6GXpzsae8aC2BUrXY3Kp5eOMUKHcU9v4Jr4Nq 5Q+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703595479; x=1704200279; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7U+3eyX9Skcb0X5VNSt0bDnPrEbj+KvKMGvbdsiSSAA=; b=GIh8t1Md6K/g53ZOKOb6Stfq7u0cRWvma94UZG+z9sgEUDihfreS3jmG+RFx/yhmKh QVF8VmhRZppOSKc6RxuVo54QE+AXa1MJNjz2UWxVBTfxzOK6hqaYds53zemBkgwO1PDE 3dvKFZcSj5t5o897rROcMANANU/1/8/SFvGv4gyY8LZozyD0TmiRHzmpISbYZH0Rizaz D0lm4PW6NLCzvWp9pFRIYYnXXs1pNle+fiEjoucRnsx04Sntq0N5POigXuV4D2MgDrcQ fpl+Md4n+uC/jo6ctjvYz0W+d9WUjyq3WyIqH2KrIqEFmo824sciZCYeagCW5DYjb1jJ Uf8w== X-Gm-Message-State: AOJu0Yz3iZwCpwnpQllGdXos8Wopjg1qH4kq3L39gdAVas93LbXDHtV2 UvHi7QmI6LVWM+gpB/cOue+pnBzf7uY= X-Google-Smtp-Source: AGHT+IGMj+I/1WwB2wQcgz86/9iys4VtZoQNL/nztXuJ2crk6QDnyiAThU6SAm+GrY3LtzEYT67iJA== X-Received: by 2002:a05:6512:3c98:b0:50e:76a4:f593 with SMTP id h24-20020a0565123c9800b0050e76a4f593mr3630578lfv.5.1703595478797; Tue, 26 Dec 2023 04:57:58 -0800 (PST) Received: from localhost ([88.201.161.72]) by smtp.gmail.com with ESMTPSA id eo17-20020a056512481100b0050e7bf6cc3bsm563328lfb.263.2023.12.26.04.57.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Dec 2023 04:57:58 -0800 (PST) From: Oleg Pykhalov To: Brian Cully Subject: Re: [bug#63863] closed (Re: [bug#63863] [PATCH v6] gnu: home: Add support for home-pipewire-service) In-Reply-To: <8734vumfak.fsf@spork.org> (Brian Cully's message of "Fri, 22 Dec 2023 10:22:11 -0500") References: <871qbh8dni.fsf@gmail.com> <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> <8734vumfak.fsf@spork.org> Date: Tue, 26 Dec 2023 15:57:57 +0300 Message-ID: <87bkad3yui.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 63863-done Cc: 63863-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Brian Cully writes: > help-debbugs@gnu.org (GNU bug Tracking System) writes: > >> Your bug report >> >> #63863: [PATCH] gnu: home: Add support for home-pipewire-service >> >> which was filed against the guix-patches package, has been closed. > > Was this intentional? It was accidental, apologies. I reopened the issue right after closing. >> The =E2=80=98home-pipewire-pulse-shepherd-service=E2=80=99 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. > > I'd renamed it to =E2=80=98home-pulseaudio-shepherd-service=E2=80=99 and = forgot to update the > commit message; v7 will have it fixed. Pushed to master as afdbf7f271529573397474fdb8f1c9d00dceba37, following the Guix convention style with a neatly formatted commit message. Thanks, Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmWKzdUUHGdvLndpZ3Vz dEBnbWFpbC5jb20ACgkQFn+OpQAa+pxB9w/+IxZc5eao/QAAiRq482keuBBNUPzu u/wLnGUlEoJvx4uz+DBSlUcLl99uKRla8i7gKBcgL3e5pbmQjdTE1ouzPqZszyJ8 wjvvMvxwC2OkRXUviB2rZXFqGouPi68HzdvnxrBBavNif8tRdMCE8MGxSU3/xjIZ wnRc3VsHeaPxGIqQbPgFTRWjtqDOMzEjZm3/VzAvCFlskfy0K/SSfaMnseu9TKf7 MS7esot5s9DyMerrqFJi3Zqi5kcmaCa4ok4fAXGavnY5Fk50PFundKahAsN3LRVi jCfyQ4VnmWJl7Ojq+cvQtT5gf5qSnOCvOZthBEFUMZUQlzl6lvAv40Q6qA1qRNGf a41pI1WVCp4nMpioAO4OvSIRn/xzOp7WLmDxgpiIxEgIrIE92U4QiH5DY7dgkX2Y 0Kik0VOTeZzjoLVd5JMPnArXk5RDLJsDK+YhSu+GM91HwBErFZy5kw+1OQ65OXA6 JJGmWdVf56xFnDxDckhlHN/7QYGfUUmbcBcoRCZtQT5lm2hS8yzNdAhyPuKqPoxB YLkRZf/2AMTJw6wAMRwnUNT/lvt/xvNHFbb7fxvbqlMOmfyPDXT5V2rBrZsLvT0c H0krfA+ci3YiPSSH9tW84nFOs15R6/gQfBRRMhimwVbSUyN6L62zGV30SHtoWQlt EPdx//U9cWk+z7U= =4VWq -----END PGP SIGNATURE----- --=-=-=-- ------------=_1703595542-5846-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 Jun 2023 23:05:34 +0000 Received: from localhost ([127.0.0.1]:41012 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Dpu-0002cf-2N for submit@debbugs.gnu.org; Fri, 02 Jun 2023 19:05:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:39362) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5Dpr-0002cW-Hg for submit@debbugs.gnu.org; Fri, 02 Jun 2023 19:05:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5Dpr-0006TH-9y for guix-patches@gnu.org; Fri, 02 Jun 2023 19:05:31 -0400 Received: from coleridge.kublai.com ([166.84.7.167] helo=mail.spork.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q5Dpp-0003TB-7q for guix-patches@gnu.org; Fri, 02 Jun 2023 19:05:31 -0400 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 91003D002; Fri, 2 Jun 2023 19:04:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1685747083; bh=trixCC09+EKP+B1IEuTU2r2r64MHz2Kwb7LDrEIjMSQ=; h=From:To:Cc:Subject:Date; b=DP+CIh2SrwIyxVHxaYAeMHLiChTWtVwgJ8AdvFRba4asAaYefsyVgnK4cP35ip3zy mutAeU0wYDDlrg4sYaOgGmq+7vturhDdBXkWNxU4Bkged/hPfNHXMWsoD9QzeraDlo ySyi+I4cBw9+bZi1SS7IMs+ME4kbGKjWoxh7Bp4E= From: Brian Cully To: guix-patches@gnu.org Subject: [PATCH] gnu: home: Add support for home-pipewire-service Date: Fri, 2 Jun 2023 19:04:27 -0400 Message-Id: <13252a733171e18f4d39d0185ddf3e8e3c06bc15.1685747062.git.bjc@spork.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Debbugs-Cc: ( , Andrew Tropin , Ludovic Courtès Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=166.84.7.167; envelope-from=bjc@spork.org; helo=mail.spork.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit Cc: Brian Cully X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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), (home-pipewire-shepherd-services), (generate-doc): new procedures. (home-pipewire-service-type): new service type. (home-pipewire-configuration): new struct. * doc/guix.texi (Sound Home Services): document it. --- doc/guix.texi | 34 +++++++++++++++++ gnu/home/services/sound.scm | 74 ++++++++++++++++++++++++++++++++++++- 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 7f8d8d66e9..0b19c9301f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -116,6 +116,7 @@ Copyright @copyright{} 2023 Karl Hallsby@* Copyright @copyright{} 2023 Nathaniel Nicandro@* Copyright @copyright{} 2023 Tanguy Le Carrour@* +Copyright @copyright{} 2023 Brian Cully@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -43563,6 +43564,39 @@ Sound Home Services This is the multicast address used by default by the two services above. @end defvar +@cindex PipeWire, home service + +@uref{https://pipewire.org, PipeWire} provides a low-latency, +graph-based audio and video processing service. In addition to its +native protocol, it can also be used as a replacement for both JACK and +PulseAudio. + +@defvar home-pipewire-service-type +This provides the service definition for @command{pipewire}, which will +run on login. Its value is a @code{home-pipewire-configuration} object. + +To start the service, add it to the @code{service} field of your +@code{home-environment}, such as: + +@lisp +(service home-pipewire-service-type) +@end lisp + +@deftp {Data Type} home-pipewire-configuration +Available @code{home-pipewire-configuration} fields are: + +@table @asis +@item @code{pipewire} (default: @code{pipewire}) (type: file-like) +The PipeWire package to use. + +@item @code{wireplumber} (default: @code{wireplumber}) (type: file-like) +The WirePlumber package to use. + +@item @code{enable-pulseaudio?} (default: @code{#t}) (type: boolean) +Enable PulseAudio replacement. +@end table +@end deftp + @node Mail Home Services @subsection Mail Home Services diff --git a/gnu/home/services/sound.scm b/gnu/home/services/sound.scm index 22c1a99250..94d8bc7482 100644 --- a/gnu/home/services/sound.scm +++ b/gnu/home/services/sound.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2023 Ludovic Courtès +;;; Copyright © 2023 Brian Cully ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,13 +20,77 @@ (define-module (gnu home services sound) #:use-module (gnu home services) #:use-module (gnu home services shepherd) + #:use-module (gnu packages linux) + #:use-module (gnu services configuration) #:use-module (guix records) #:use-module (guix gexp) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (ice-9 match) #:export (home-pulseaudio-rtp-sink-service-type home-pulseaudio-rtp-source-service-type - %pulseaudio-rtp-multicast-address)) + %pulseaudio-rtp-multicast-address + + home-pipewire-configuration + home-pipewire-service-type)) + + +;;; +;;; PipeWire support. +;;; +(define-configuration/no-serialization home-pipewire-configuration + (pipewire (file-like pipewire) "The PipeWire package to use.") + (wireplumber (file-like wireplumber) "The WirePlumber package to use.") + (enable-pulseaudio? (boolean #t) "Enable PulseAudio replacement.")) + +(define (home-pipewire-shepherd-service config) + (shepherd-service + (documentation "PipeWire screen and audio sharing.") + (provision '(pipewire)) + (requirement '(dbus)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire")))))) + +(define (home-pipewire-pulseaudio-shepherd-service config) + (shepherd-service + (documentation "Drop-in PulseAudio replacement service for PipeWire.") + (provision '(pipewire-pulseaudio)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-pipewire config) + "/bin/pipewire-pulse")))))) + +(define (home-wireplumber-shepherd-service config) + (shepherd-service + (documentation "WirePlumber session management for PipeWire.") + (provision '(wireplumber)) + (requirement '(pipewire)) + (start #~(make-forkexec-constructor + (list #$(file-append + (home-pipewire-configuration-wireplumber config) + "/bin/wireplumber")))))) + +(define (home-pipewire-shepherd-services config) + (define shepherd-services + (filter + identity + (list home-pipewire-shepherd-service home-wireplumber-shepherd-service + (and (home-pipewire-configuration-enable-pulseaudio? config) + home-pipewire-pulseaudio-shepherd-service)))) + (map (cut <> config) shepherd-services)) + +(define home-pipewire-service-type + (service-type + (name 'pipewire) + (extensions + (list (service-extension home-shepherd-service-type + home-pipewire-shepherd-services))) + (description + "Start essential PipeWire services.") + (default-value (home-pipewire-configuration)))) ;;; @@ -149,3 +214,10 @@ (define home-pulseaudio-rtp-source-service-type "Define a PulseAudio source to receive audio broadcasted over RTP by another PulseAudio instance.") (default-value %pulseaudio-rtp-multicast-address))) + + +;;; +;;; Generate documentation. +;;; +(define (generate-doc) + (configuration->documentation 'home-pipewire-configuration)) base-commit: c11b92a8aae6fe7fad0da8257ec28f5009c37b35 -- 2.40.1 ------------=_1703595542-5846-1--