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; dated Wed, 1 Nov 2023 10:17:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.
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: Wed, 1 Nov 2023 10:30:02 UTC

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