GNU bug report logs - #66877
[WIP PATCH 1/1] gnu: home: services: Add home-pipewire.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Sughosha <sughosha@HIDDEN>; Keywords: patch; merged with #66876; Done: Sergey Trofimov <sarg@HIDDEN>; Maintainer for guix-patches is guix-patches@HIDDEN.
bug closed, send any further explanations to 66877 <at> debbugs.gnu.org and Sughosha <sughosha@HIDDEN> Request was from Sergey Trofimov <sarg@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 66877 <at> debbugs.gnu.org:


Received: (at 66877) by debbugs.gnu.org; 1 Nov 2023 18:35:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 01 14:35:33 2023
Received: from localhost ([127.0.0.1]:52559 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qyG3t-00044C-Fw
	for submit <at> debbugs.gnu.org; Wed, 01 Nov 2023 14:35:33 -0400
Received: from mx.kolabnow.com ([212.103.80.154]:38786)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <chris@HIDDEN>) id 1qyG3n-00043s-8I
 for 66877 <at> debbugs.gnu.org; Wed, 01 Nov 2023 14:35:27 -0400
Received: from localhost (unknown [127.0.0.1])
 by mx.kolabnow.com (Postfix) with ESMTP id D38B83023387
 for <66877 <at> debbugs.gnu.org>; Wed,  1 Nov 2023 19:34:41 +0100 (CET)
Authentication-Results: ext-mx-out013.mykolab.com (amavis);
 dkim=pass (4096-bit key) reason="pass (just generated, assumed good)"
 header.d=kolabnow.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h=
 content-disposition:content-type:content-type:mime-version
 :message-id:subject:subject:from:from:date:date:received
 :received:received; s=dkim20160331; t=1698863677; x=1700678078;
 bh=aWvq9au1etPVEPegzUQ5AFLR9Ps6yTOR9P3fODHhg2Y=; b=jD9wliBs7eQa
 A0YxOoMMEdaZuVW+HsNDk30CeyDD25CbT8sUXvItTODvknUPAXZLYUNUHa471JVB
 UW1PLNSXpn/vTOPhyn0mbvRPh74t20qqEdhz6fd/ZjqiIRGJogLI+p5T+7N5bmP3
 55kcuMD3PyRz0YTQO1qmITvYfhJn5y1uO7M/s09U90Q3qnfqFvj2s69S22Cq6DWy
 KN6m6NGA5/nbmoImaX43InpdR65iiQBKmU4Iux5vu4Dz0fVxqC1ifYgKJiUfVqnr
 h8b3b13U4ZsZP6jvG3ale4FpPEuAXAnv5zvuKldbjYW8WPKK1ki7ExxrYZQYacUQ
 l13fInYXXmY9s19X7LzjD1L1tUaRGS5j/nDVx2kI2gY8RzoFQG5uIGxTWCXBYfZu
 bkkZ0okZGDxR0ysQJ3kkM7VseiaIA3/xTQ8+8OuYF5BlVbufdkjv8ek+76YLI5Zt
 w44EaVXlWl1JvpbKktkU5XbgOMBZKiv+ffMeb6kYOf1jgSFFav+4BAICRg2FQ2WA
 qN8VJHABmw7/wJ+64qft9JfbfMZXcvETMR9QsS7N9cc4OElwCut/Sa20CIPEMp+1
 PYQI2PFRu1f9InC5fL9ZAaaeA0sYeTE9moZL/o7xrFIjoED7ulOv6TNqA3NoRjYB
 5voGH0t/GInuyFGpix0V4sYFfUKB1v0=
X-Virus-Scanned: amavis at mykolab.com
X-Spam-Flag: NO
X-Spam-Score: -0.999
X-Spam-Level: 
X-Spam-Status: No, score=-0.999 tagged_above=-10 required=5
 tests=[ALL_TRUSTED=-1, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mx.kolabnow.com ([127.0.0.1])
 by localhost (ext-mx-out013.mykolab.com [127.0.0.1]) (amavis, port 10024)
 with ESMTP id 9r_IFUmhjWxG for <66877 <at> debbugs.gnu.org>;
 Wed,  1 Nov 2023 19:34:37 +0100 (CET)
Received: from int-mx011.mykolab.com (unknown [10.9.13.11])
 by mx.kolabnow.com (Postfix) with ESMTPS id E44CF300D3C6
 for <66877 <at> debbugs.gnu.org>; Wed,  1 Nov 2023 19:34:35 +0100 (CET)
Received: from ext-subm010.mykolab.com (unknown [10.9.6.10])
 by int-mx011.mykolab.com (Postfix) with ESMTPS id BFE3F3149E86
 for <66877 <at> debbugs.gnu.org>; Wed,  1 Nov 2023 19:34:35 +0100 (CET)
Date: Wed, 1 Nov 2023 11:33:46 -0700
From: chris <chris@HIDDEN>
To: 66877 <at> debbugs.gnu.org
Subject: [WIP PATCH 1/1] gnu: home: services: Add home-pipewire.
Message-ID: <ZUKaCkFIb-E6SGCC@guix-xps>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 66877
Cc: chris@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hello, I would like to share my experience that using pipewire without dbus on guix is practical: and so, it would be great if the home-pipewire-service could be used without dbus. Having said that, only a minority of people use dbus-free systems so feel free to ignore me and I do not want to block this patch.

In case it is useful, here is pipewire is used sans dbus. Guix home is configured to write the pipewire and three wireplumber config files, as described at this link https://wiki.alpinelinux.org/wiki/PipeWire#Configuration 

.config/pipewire/pipewire.conf
.config/wireplumber/wireplumber.conf
.config/wireplumber/main.lua.d/80-disable-dbus.lua
.config/wireplumber/bluetooth.lua.d/80-disable-logind.lua

When pipewire and wireplumber are installed with those files in place, start pipewire and wireplumber sequentially to get working sound. I use this in my .config/sway/config (possibly this is copy-pasted from unmatched-paren)
```
exec_always killall -wqr "(pipewire|wireplumber)" \
  || sleep 1 && ((pipewire &); sleep 2 && (wireplumber &))
```




Information forwarded to guix-patches@HIDDEN:
bug#66877; Package guix-patches. Full text available.
Merged 66876 66877. Request was from Sughosha <sughosha@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 1 Nov 2023 10:16:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 01 06:16:50 2023
Received: from localhost ([127.0.0.1]:49997 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qy8HK-0000SK-7y
	for submit <at> debbugs.gnu.org; Wed, 01 Nov 2023 06:16:50 -0400
Received: from lists.gnu.org ([2001:470:142::17]:44776)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sughosha@HIDDEN>) id 1qy8HH-0000Ry-VN
 for submit <at> debbugs.gnu.org; Wed, 01 Nov 2023 06:16:49 -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 <sughosha@HIDDEN>)
 id 1qy8Ge-00064f-5p
 for guix-patches@HIDDEN; Wed, 01 Nov 2023 06:16:08 -0400
Received: from layka.disroot.org ([178.21.23.139])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sughosha@HIDDEN>)
 id 1qy8Ga-0003Iu-7U
 for guix-patches@HIDDEN; Wed, 01 Nov 2023 06:16:07 -0400
Received: from localhost (localhost [127.0.0.1])
 by disroot.org (Postfix) with ESMTP id 849E044F7A;
 Wed,  1 Nov 2023 11:16:02 +0100 (CET)
X-Virus-Scanned: SPAM Filter at disroot.org
Received: from layka.disroot.org ([127.0.0.1])
 by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 80vwfpc-Ayqp; Wed,  1 Nov 2023 11:16:01 +0100 (CET)
From: Sughosha <sughosha@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail;
 t=1698833761; bh=NP8RCb/WeBuT+/hqLXttHPObS9KIf12OrHScqgMpIu0=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References;
 b=VsYUCioSEvpBFifaqTFHEFA5/cPvxVWXbYXc40QDf15fp2OLKQnnvd+EEphx1Nrq+
 II+58KAj+eHv63//4tQgZqmTsuIdXdom3NSffwTvEvqBTEZ6RihdL3obxUvoUYSUOl
 czzf3hfqXegfw7HVggES3RQnqBiKX9Qd477zb0y0SAP7qZ1mi/XRfgmrl8uk+P+e/G
 vTTXjdiEvQm4qvS+RGWEP7maFipjYEGs0p9+JVLfN74VUNj84VsdyZ8BEz/qdyR3dJ
 /D4Ge5vSu92M7Nm2rhaNqFGOcye9aCDnIq0iYWUe+9+5EfwVwCnKQXetDAx/yQ8swj
 j50eIRwkd0dLQ==
To: guix-patches@HIDDEN
Subject: [WIP PATCH 1/1] gnu: home: services: Add home-pipewire.
Date: Wed,  1 Nov 2023 11:14:42 +0100
Message-ID: <d2c4964c80599cc20fd981dc76827e52d45d40ea.1698833388.git.sughosha@HIDDEN>
In-Reply-To: <cover.1698833388.git.sughosha@HIDDEN>
References: <cover.1698833388.git.sughosha@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: ( <paren@HIDDEN>, Andrew Tropin <andrew@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=178.21.23.139; envelope-from=sughosha@HIDDEN;
 helo=layka.disroot.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: 0.9 (/)
X-Debbugs-Envelope-To: submit
Cc: Sughosha <sughosha@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

From: Sughosha <sughosha@HIDDEN>

* gnu/home/services/sound.scm (home-pipewire-service-type):
New variable.
---
 gnu/home/services/sound.scm | 90 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 89 insertions(+), 1 deletion(-)

diff --git a/gnu/home/services/sound.scm b/gnu/home/services/sound.scm
index 22c1a99250..16bfe92f2f 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 <ludo@HIDDEN>
+;;; Copyright © 2023 Sughosha <sughosha@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -18,14 +19,20 @@
 
 (define-module (gnu home services sound)
   #:use-module (gnu home services)
+  #:use-module (gnu home services desktop)
   #:use-module (gnu home services shepherd)
+  #:use-module (gnu packages linux)
+  #:use-module (gnu packages pulseaudio)
+  #:use-module (guix packages)
   #: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-service-type))
 
 
 ;;;
@@ -149,3 +156,84 @@ (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)))
+
+;;;
+;;; PipeWire support.
+;;;
+
+(define (home-pipewire-files-service config)
+  `((".asoundrc"
+     ,(mixed-text-file
+       "asoundrc"
+       #~(string-append
+          "<"
+          #$(file-append
+             pipewire
+             "/share/alsa/alsa.conf.d/50-pipewire.conf")
+          ">\n<"
+          #$(file-append
+             pipewire
+             "/share/alsa/alsa.conf.d/99-pipewire-default.conf")
+          ">\n"
+          "
+pcm_type.pipewire {
+  lib " #$(file-append
+           pipewire
+           "/lib/alsa-lib/libasound_module_pcm_pipewire.so") "
+}
+
+ctl_type.pipewire {
+  lib " #$(file-append
+           pipewire
+           "/lib/alsa-lib/libasound_module_ctl_pipewire.so") "
+}\n
+defaults.pcm.card 2\n
+defaults.ctl.card 2")))))
+
+(define (home-pipewire-shepherd-service config)
+  (list
+   (shepherd-service
+    (requirement '(dbus))
+    (provision '(pipewire))
+    (stop  #~(make-kill-destructor))
+    (start #~(make-forkexec-constructor
+              (list #$(file-append pipewire "/bin/pipewire")))))
+   (shepherd-service
+    (requirement '(pipewire))
+    (provision '(wireplumber))
+    (stop  #~(make-kill-destructor))
+    (start #~(make-forkexec-constructor
+              (list #$(file-append wireplumber "/bin/wireplumber")))))
+   #;
+   (shepherd-service
+    (requirement '(pipewire))
+    (provision '(pipewire-media-session))
+    (stop  #~(make-kill-destructor))
+    (start #~(make-forkexec-constructor
+              (list
+               #$(file-append
+                  pipewire-media-session
+                  "/bin/pipewire-media-session")
+               "-c"
+               #$(file-append
+                  pipewire-media-session
+                  "/share/pipewire/media-session.d/media-session.conf")))))
+   (shepherd-service
+    (requirement '(pipewire))
+    (provision '(pipewire-pulse))
+    (stop  #~(make-kill-destructor))
+    (start #~(make-forkexec-constructor
+              (list #$(file-append pipewire "/bin/pipewire-pulse")))))))
+
+(define home-pipewire-service-type
+  (service-type
+   (name 'home-pipewire)
+   (extensions
+    (list (service-extension home-files-service-type
+                             home-pipewire-files-service)
+          (service-extension home-shepherd-service-type
+                             home-pipewire-shepherd-service)
+          (service-extension home-profile-service-type
+                             (const (list pipewire pulseaudio)))))
+   (default-value '())
+   (description "Configure PipeWire sound support.")))
-- 
2.41.0





Acknowledgement sent to Sughosha <sughosha@HIDDEN>:
New bug report received and forwarded. Copy sent to , guix-patches@HIDDEN. Full text available.
Report forwarded to , guix-patches@HIDDEN:
bug#66877; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 7 Mar 2025 07:00:03 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.