From unknown Sat Jun 21 17:33:56 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#53676 <53676@debbugs.gnu.org> To: bug#53676 <53676@debbugs.gnu.org> Subject: Status: [PATCH 0/5] *** PulseAudio service improvements *** Reply-To: bug#53676 <53676@debbugs.gnu.org> Date: Sun, 22 Jun 2025 00:33:56 +0000 retitle 53676 [PATCH 0/5] *** PulseAudio service improvements *** reassign 53676 guix-patches submitter 53676 Maxim Cournoyer severity 53676 normal tag 53676 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 23:14:09 2022 Received: (at submit) by debbugs.gnu.org; 1 Feb 2022 04:14:09 +0000 Received: from localhost ([127.0.0.1]:41418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkYT-0003FJ-Ka for submit@debbugs.gnu.org; Mon, 31 Jan 2022 23:14:09 -0500 Received: from lists.gnu.org ([209.51.188.17]:33678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkYR-0003FB-QK for submit@debbugs.gnu.org; Mon, 31 Jan 2022 23:14:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEkYR-0008FW-MC for guix-patches@gnu.org; Mon, 31 Jan 2022 23:14:07 -0500 Received: from [2607:f8b0:4864:20::833] (port=34688 helo=mail-qt1-x833.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nEkYQ-0005Ok-4t for guix-patches@gnu.org; Mon, 31 Jan 2022 23:14:07 -0500 Received: by mail-qt1-x833.google.com with SMTP id h25so12522465qtm.1 for ; Mon, 31 Jan 2022 20:14:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=G+4DSDAAP1uCDUWt/yCu5c7dXCc4NFxOCBOckvyO2xQ=; b=h9I/MqGmJmqx0+7TksDEB8kODTlgBuSgT4VcFVxu4y7ma4G+ADXBjLdSRdsksfYLQe Jf92uMrac+30yn02CY5a4z+2YNQxaPZXESNafcKkEGjx3U8Qd77t4q7bF3S4j2n4APK9 6jg19UVBhDVsVwp0PDQSMiOyhEIrh26miY1d5v8fpxv5EtPoC2E+vxL4AN+V9nBNgCvr oxQ8OUiV7pM+Gkw24a3N55CIHbz+XupJM83ECHico/SFvhsOrUloVvcMKAsVnbEohQ6R YgMUrTRiz8DogeOg5Lz0ZuVdDSXCjvVdDzBmltixauwKSi/IlL8WhEpXuJ32nUJ8kJD7 A36Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=G+4DSDAAP1uCDUWt/yCu5c7dXCc4NFxOCBOckvyO2xQ=; b=C7FpCk1peTkonOy5d8wxH9BV+7Q0qbkUf3sNEYwz5PP4k/5CbBRecXZdf5VyxRu6TC kMVd90AGp4MpNOHB2zXgo4kMtJXq5KmBkJ+IylGRTCsV4C2aiaxHOcZvVm2fXFRM8qo/ oPvOzK+InWVwGG0OywDirs6BgM/p6f/V3TNcNhCMxEoXqo3ksbhwEc3HNKMHLmZVNZ7W Z96a3FhUMfHml/Mj1QbWlnDY8crc/JtK0lpKMkHv/3ktowZF05RhLAK/5MV/3OaqyQZp Gl3PbvMIJbQMSuWqaRxEbIQi+BM1AvLPlGA85gQdenr0TJxy2H+G0D9rMkSGGxikZQpw bTrg== X-Gm-Message-State: AOAM530A34UNiMFwxDKQVSkB404xWiPUlMx/IP063JIjft/3LF8Kypcy LSjWSCgZqMNTRzP4NCTNyoKuT1b5Jjc= X-Google-Smtp-Source: ABdhPJztfM7Ae3RFj4pVRwR7RoGaLuIWI3+P0rgs+33EWp8uB+DCUXhhXOrS7/QHPdZY9uWMwVqTjw== X-Received: by 2002:ac8:4e94:: with SMTP id 20mr1046828qtp.529.1643688844937; Mon, 31 Jan 2022 20:14:04 -0800 (PST) Received: from localhost.localdomain (dsl-10-141-111.b2b2c.ca. [72.10.141.111]) by smtp.gmail.com with ESMTPSA id 139sm9219154qkf.32.2022.01.31.20.14.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 20:14:04 -0800 (PST) From: Maxim Cournoyer To: guix-patches@gnu.org Subject: [PATCH 0/5] *** PulseAudio service improvements *** Date: Mon, 31 Jan 2022 23:13:52 -0500 Message-Id: <20220201041352.14528-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::833 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qt1-x833.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello Guix, This small series adds an easy way to drop PulseAudio configuration scripts to /etc/pulse/default.pa.d. It also lifts the need to reboot the machine to have a new PulseAudio configuration active. Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.51.188.17 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [209.51.188.17 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (maxim.cournoyer[at]gmail.com) 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 1.3 SPOOFED_FREEMAIL No description available. 1.5 SPOOF_GMAIL_MID From Gmail but it doesn't seem to be... X-Debbugs-Envelope-To: submit Cc: Maxim Cournoyer 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 (--) Hello Guix, This small series adds an easy way to drop PulseAudio configuration scripts to /etc/pulse/default.pa.d. It also lifts the need to reboot the machine to have a new PulseAudio configuration active. Maxim Cournoyer (5): doc: Fix typo. services/sound: Normalize pulseaudio-configuration accessor names. gnu: pulseaudio: Graft to adjust configuration. services: pulseaudio: Add an extra-script-files configuration field. services: pulseaudio: Deploy the configuration files to /etc/pulse. doc/guix.texi | 29 +++++++++++++++++++++- gnu/packages/pulseaudio.scm | 18 ++++++++++++++ gnu/services/sound.scm | 49 ++++++++++++++++++++++++++++--------- 3 files changed, 84 insertions(+), 12 deletions(-) -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 23:19:47 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 04:19:47 +0000 Received: from localhost ([127.0.0.1]:41433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkdv-0003PI-1o for submit@debbugs.gnu.org; Mon, 31 Jan 2022 23:19:47 -0500 Received: from mail-qv1-f45.google.com ([209.85.219.45]:37697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkdt-0003P0-DK for 53676@debbugs.gnu.org; Mon, 31 Jan 2022 23:19:45 -0500 Received: by mail-qv1-f45.google.com with SMTP id g13so14938312qvw.4 for <53676@debbugs.gnu.org>; Mon, 31 Jan 2022 20:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mcCQP4btN41Zyg3tsKTULl7vbIE4n/w+BCAsJUeV+h4=; b=CDYjenfCtR3RwB2mN+2cSewEzdexk9Rr1hvoZy3KaLM+HrSxB4GKCX0t6hN/nHQ5b2 ek64TBFA6Iqd+aMVsO4RmVZEqeyVNguIPGhIJYfnVhUtMLU2y9uak3jhGdT/K10zu1Wp KwhaQZixSa5FL83Ec1UZoIhQvRIyM5kjL2NZYUbA2UtuhOq1V4jyS2SG7WIeBSNCi0K7 EfjnLYLsgLJ6GBYKlVtZOoEfD8IHo41idC8lGhH1GYIpXmAqu1UZtX827FonO+EAi17a sXWxT19n4NILCTM/N5MxFn4RDKRNx184/UjciL61j8BI7L0yL37mFSd3MbZBODONTHVM 2Y2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mcCQP4btN41Zyg3tsKTULl7vbIE4n/w+BCAsJUeV+h4=; b=isRE9vy4pllFslhBpHlvH38EJMrjdUz9lqb6ohjNDUBQmooxmoGxY4GeMbZLOS7hW3 WdstQ43GlJaleIa3cFp3ctLjIK9Cz3i9DsHZtVA9EDetHSL4gFyKy4zck/cNhzdvzVax DtEMrxhaYf9X/6x+qLQn1Z1mKE45xCi0RK5dMBTIFqZ1af3PvubCfMICpe7reT1+QQMl Z1NqoWB096y2ikUCUsCRchEjxl4XpjXcff+7Mo8z6ycsupuazwvZcZrbfpnuKElJOHFA /OjY4D3iFQP4/IoIth5Z8Fj5IANSfbMlSONQzwYgOc6qIIU6mUTjI49rJfUJWeT214qr CLdQ== X-Gm-Message-State: AOAM533kd3mRkclfozSpwX3OqfXxkHA6QYKmzwW6q+OWvnmaXcYtQhgD WqXPVGiqKgb3u41MYSlYNDyeFb7o5Ko= X-Google-Smtp-Source: ABdhPJx96nTgrWLO2a+joaPvrhxUA4SaH6VA9i5b7ajO6bwJzMdFU7pQkqgN1OuQW5J2xLr/p7TaJQ== X-Received: by 2002:a05:6214:500d:: with SMTP id jo13mr21004822qvb.21.1643689179889; Mon, 31 Jan 2022 20:19:39 -0800 (PST) Received: from localhost.localdomain (dsl-10-141-111.b2b2c.ca. [72.10.141.111]) by smtp.gmail.com with ESMTPSA id a8sm9192439qti.71.2022.01.31.20.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 20:19:39 -0800 (PST) From: Maxim Cournoyer To: 53676@debbugs.gnu.org Subject: [PATCH 1/5] doc: Fix typo. Date: Mon, 31 Jan 2022 23:19:29 -0500 Message-Id: <20220201041933.16603-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Maxim Cournoyer 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 (-) * doc/guix.texi (Sound Services): Fix typo. --- doc/guix.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index 94f8e5e481..a002670030 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -21382,7 +21382,7 @@ Data type representing the configuration for @code{pulseaudio-service}. @table @asis @item @code{client-conf} (default: @code{'()}) List of settings to set in @file{client.conf}. -Accepts a list of strings or a symbol-value pairs. A string will be +Accepts a list of strings or symbol-value pairs. A string will be inserted as-is with a newline added. A pair will be formatted as ``key = value'', again with a newline added. -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 23:19:53 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 04:19:53 +0000 Received: from localhost ([127.0.0.1]:41436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEke1-0003Pc-8f for submit@debbugs.gnu.org; Mon, 31 Jan 2022 23:19:53 -0500 Received: from mail-qv1-f46.google.com ([209.85.219.46]:34632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkdz-0003PG-9d for 53676@debbugs.gnu.org; Mon, 31 Jan 2022 23:19:51 -0500 Received: by mail-qv1-f46.google.com with SMTP id a7so14952326qvl.1 for <53676@debbugs.gnu.org>; Mon, 31 Jan 2022 20:19:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/Bbt6n4RLhKlGNJ/zQf9pSJEJb4lfi4jWF6edaVk5Ts=; b=j7nFr9r26RJV7bcmDKqcBE6rC9loNDHjzmwhXNqnOAiNbXDHLhygFtGxuD7zQBxrAL j7WgFLj62pZ6jOsmW/2vUl8m4Ddyqd8a2EJbPI/odAsXft+ZWCz0cT7uD4CC0Hylxle+ TR6U9YxE+kXqgny5y6YuQB40fSce26gHUhDnV/sHuZZmtkavsi6P4B6Wxc1V9cWvzDFU KrGNAA8nOgnk+7Ivb21sNUEwRxalTbP2h8SqDRhP/IDMBikTY5Bx32zY9bmv4Yc9nWBU 6Wq60Ga2f2zMfaSEMsgkO/vTYIHutorgCg33ZDWCvMRAkh2kkT/oA0wb1crto47vKSya MN1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/Bbt6n4RLhKlGNJ/zQf9pSJEJb4lfi4jWF6edaVk5Ts=; b=iSpJb9kgY//53Ur+P3jS+Y9rUUFEr700KXuitVnJ6ELMb/yt+vZcARD3lZYr1q4kbh veg6lF2zkdqteW7IRAk2MnB+w+aenYMFfeUeHWz5xuOT21It8aIF9BbIvYXU6mthAUA2 vy07UADGPZS+xVBooF1+2zNQvEL+dK7EEu0lC+BGr5SMzcuG6ujUmzmwOfiLrh/1Mmgo 5BaFt6un940YsvNQ40sgWWdbXs+yV9RPEnw3ay5LliZsZWNn32JaD5hIHJLRL53i8AFb Bk5rRP0gGaW+s8/XmgIiw+ay5vNNrY12perzugzwQHVIJrFRRKggXr03rzeyIF/RxZi1 Vpmg== X-Gm-Message-State: AOAM530wza3sHLousd+nk00xGZcvAo4FwCu/I3dBAN5wD80mcVccLK8U LNAoTqzqYPCZqzPXviwufsZ+ZLqhM5M= X-Google-Smtp-Source: ABdhPJyH2lQGItY5fGK91imHyjkHYu7IkLpvi6jS/KNbo7nfZP8EIGFWSs2um7gF9REPlGyae8tFHw== X-Received: by 2002:ad4:5c68:: with SMTP id i8mr21443532qvh.89.1643689185679; Mon, 31 Jan 2022 20:19:45 -0800 (PST) Received: from localhost.localdomain (dsl-10-141-111.b2b2c.ca. [72.10.141.111]) by smtp.gmail.com with ESMTPSA id a8sm9192439qti.71.2022.01.31.20.19.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 20:19:45 -0800 (PST) From: Maxim Cournoyer To: 53676@debbugs.gnu.org Subject: [PATCH 2/5] services/sound: Normalize pulseaudio-configuration accessor names. Date: Mon, 31 Jan 2022 23:19:30 -0500 Message-Id: <20220201041933.16603-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220201041933.16603-1-maxim.cournoyer@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Maxim Cournoyer 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 (-) * gnu/services/sound.scm (): Adjust getter names to match convention. --- gnu/services/sound.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index 7beca35ffe..19eccfc860 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2020 Oleg Pykhalov ;;; Copyright © 2020 Liliana Marie Prikler ;;; Copyright © 2020 Marius Bakke +;;; Copyright © 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -115,16 +116,16 @@ (define alsa-service-type (define-record-type* pulseaudio-configuration make-pulseaudio-configuration pulseaudio-configuration? - (client-conf pulseaudio-client-conf + (client-conf pulseaudio-configuration-client-conf (default '())) - (daemon-conf pulseaudio-daemon-conf + (daemon-conf pulseaudio-configuration-daemon-conf ;; Flat volumes may cause unpleasant experiences to users ;; when applications inadvertently max out the system volume ;; (see e.g. ). (default '((flat-volumes . no)))) - (script-file pulseaudio-script-file + (script-file pulseaudio-configuration-script-file (default (file-append pulseaudio "/etc/pulse/default.pa"))) - (system-script-file pulseaudio-system-script-file + (system-script-file pulseaudio-configuration-system-script-file (default (file-append pulseaudio "/etc/pulse/system.pa")))) -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 23:20:02 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 04:20:02 +0000 Received: from localhost ([127.0.0.1]:41441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEke9-0003QN-MF for submit@debbugs.gnu.org; Mon, 31 Jan 2022 23:20:02 -0500 Received: from mail-qk1-f180.google.com ([209.85.222.180]:36809) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEke8-0003Pp-EQ for 53676@debbugs.gnu.org; Mon, 31 Jan 2022 23:20:00 -0500 Received: by mail-qk1-f180.google.com with SMTP id g145so14090652qke.3 for <53676@debbugs.gnu.org>; Mon, 31 Jan 2022 20:20:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wdgF4obgpFzijrLVT0OHwpFKxQR0gx93KMQ7tbVNPw8=; b=VmO7ln14zn9pRJyIGptCy/dndLNxSYs/yLMLZcSqAT6U7yEa56TXRPmaInZOR8bHBy InCm+IiqZwb017j04KaRwx+aWVZC5SrnKPxpwXe3vA/CQCMi8DsyNC7qbWjdg88KB/Zh aSXYv9Ywg3AUlEcLX+KAyqP6VZ4ZYXEgL82LP7WtSejfiMNxZSVffRKE7o8NUD0bWJl7 90lWHbrp9YlrwTNtYL+7tHv/Puf+LiMxuvMQRFTYpFLe7SlLpIEyKiHC8L4b/FOGoX8l n5Od4vgDzwnBJWMdX8d4jpj+vipGwvpYoKDJ8t0EXdON8jeAZth6mBKsYh2B9+sTvBQO 5/5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wdgF4obgpFzijrLVT0OHwpFKxQR0gx93KMQ7tbVNPw8=; b=2o31P82maNUaQMW7dMxQZorCX32O3IuCMiiFxjTM0Kph4NQtRX07GeXTAxU2Mwo5Sv orxC+rqszHX40oq0yt9co/y76vvxPy6Zr6DQAzfcpn3NZPIgTX0GazAXav3LdH6WMpoa qOM8DOOAQLNfi7bc9OJKa/V/NOSJLnezdHfq5BSrNvLe+JVoX9/q5rmwX5B1d6CdG3Eq AOwb+Rp7b5T69Q7QB06KEot2VRuDtrej4GK+lXtBVfdvx0Nw57x9Ly6utlJcvjToo4x8 qYJcA9jzRXcwCxVlqn1dPNXtG24Rls2mzAyfZ5RXcKLIJZx8R7L/sBmPUniI8+4p0MIq LTlw== X-Gm-Message-State: AOAM530/yyU0F83qCbdprm8gi3u4JjBzjxh1U1EmMfUecx5FVZ6Jh+Ax 8HyCE/e/RaSc7Woy5/s0r75Nk7jJXyM= X-Google-Smtp-Source: ABdhPJywjPjx+pzBD2URYlavD+ZMWhRMhuiJN3FYMPP58QUOPNuyF7FkEDVNHF5EBF6iVuVXU4VnpQ== X-Received: by 2002:a37:6791:: with SMTP id b139mr15244894qkc.765.1643689194839; Mon, 31 Jan 2022 20:19:54 -0800 (PST) Received: from localhost.localdomain (dsl-10-141-111.b2b2c.ca. [72.10.141.111]) by smtp.gmail.com with ESMTPSA id a8sm9192439qti.71.2022.01.31.20.19.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 20:19:54 -0800 (PST) From: Maxim Cournoyer To: 53676@debbugs.gnu.org Subject: [PATCH 3/5] gnu: pulseaudio: Graft to adjust configuration. Date: Mon, 31 Jan 2022 23:19:31 -0500 Message-Id: <20220201041933.16603-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220201041933.16603-1-maxim.cournoyer@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Maxim Cournoyer 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 (-) * gnu/packages/pulseaudio.scm (pulseaudio/fixed): New variable. (pulseaudio)[replacement]: Graft package with it. --- gnu/packages/pulseaudio.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gnu/packages/pulseaudio.scm b/gnu/packages/pulseaudio.scm index fe028b5202..f529717ee1 100644 --- a/gnu/packages/pulseaudio.scm +++ b/gnu/packages/pulseaudio.scm @@ -178,6 +178,7 @@ (define-public libsamplerate (define-public pulseaudio (package (name "pulseaudio") + (replacement pulseaudio/fixed) (version "15.0") (source (origin (method url-fetch) @@ -269,6 +270,23 @@ (define-public pulseaudio ;; 'LICENSE' for details. (license l:gpl2+))) +(define pulseaudio/fixed + (package + (inherit pulseaudio) + (arguments + (substitute-keyword-arguments (package-arguments pulseaudio) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'customize-default-script + (lambda _ + (call-with-port + (open-file "src/daemon/default.pa.in" "a") + (lambda (port) + (format port "~%\ +### Include extra script files configured via the pulseaudio-service-type. +.nofail +.include /etc/pulse/default.pa.d~%"))))))))))) + (define-public pavucontrol (package (name "pavucontrol") -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 23:20:09 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 04:20:09 +0000 Received: from localhost ([127.0.0.1]:41448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkeH-0003RG-2Y for submit@debbugs.gnu.org; Mon, 31 Jan 2022 23:20:09 -0500 Received: from mail-qk1-f170.google.com ([209.85.222.170]:40497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkeA-0003Pw-UA for 53676@debbugs.gnu.org; Mon, 31 Jan 2022 23:20:04 -0500 Received: by mail-qk1-f170.google.com with SMTP id o25so14087617qkj.7 for <53676@debbugs.gnu.org>; Mon, 31 Jan 2022 20:20:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=A85CY8mxBoZfFcgwbkuf9MlS6T51uhQ10luPAjoKQWU=; b=dquLpMiT9mDy+00dmvn1/hUIm2f3Vdp6qcQugJ9gm+EhalQCXEplwTr1S1tD9pUHXq Wl4qEBNLli1ploWUuYGb8gAvCHlPxLtlIoOT72JMEcBxpOpM4mm4M370fle7hpQD0Z2Y glECS0k3cNH2EMpjovUCK4UreCbs8QBNjv/+8bsFUasds31p0HuC8zabu8fXWg7EA+7q nYb9SwyFCybnfIs0ZBiQe+XP+hqCkty9Xci+3u2SSfyeRmHRzAdwiM1lVDiqkZqNjNMX Gw4ziw9deh/ZdTcWy78JvXNZNTZowCSM+Sj/OhXjOJEa31vHkUMb7V9HoiAwkcct3y2g yhNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A85CY8mxBoZfFcgwbkuf9MlS6T51uhQ10luPAjoKQWU=; b=hq1fRc/yYo4ZWDga3j0y2eWpk1JrcclvkYkBV5XgN6bfopnBiS9C9JoONL9MyZyJ6i RZWSc2TcDduqpkqV6LU6qcYjSaJoId4CPDRdECuPmWy9BU3cLlovRRF9zKcFkioCNyp2 lVzk9JFQjHSaQd/VoNlhBM8UlajBG9DrpJvc7unz4pQEAchyMnqclu3J9fyZS5BsFwsl 4JJcLFXG8V6uGlpImXFiWOifRMtMBI/dMdQbrOfoFDeJBJLfn+KKgIB2UOviISdUbpbQ 9hRPcpX/e+aDQdAgrz852YlzC9rW/3qoTRj0JuiVh+P4wUcRyFrowhKPZShFLw2mZNRd 9XFg== X-Gm-Message-State: AOAM531lz3WCwSwheRJ9pflaTrllbn1z5Xhm8oIq99RqMz8298k43Vbu g68kHYNS7IhEu4sNFENKCiz+5INpuJ4= X-Google-Smtp-Source: ABdhPJyAxjtBqmb7upEF8ca79VB18KuIp60DkDQeVGVRTTqUr6L7jP15DyHbBXEQGmfmY8zFRgrwjQ== X-Received: by 2002:a05:620a:24c9:: with SMTP id m9mr15376253qkn.125.1643689197300; Mon, 31 Jan 2022 20:19:57 -0800 (PST) Received: from localhost.localdomain (dsl-10-141-111.b2b2c.ca. [72.10.141.111]) by smtp.gmail.com with ESMTPSA id a8sm9192439qti.71.2022.01.31.20.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 20:19:56 -0800 (PST) From: Maxim Cournoyer To: 53676@debbugs.gnu.org Subject: [PATCH 4/5] services: pulseaudio: Add an extra-script-files configuration field. Date: Mon, 31 Jan 2022 23:19:32 -0500 Message-Id: <20220201041933.16603-4-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220201041933.16603-1-maxim.cournoyer@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Maxim Cournoyer 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 (-) * gnu/services/sound.scm () [extra-script-files]: Add field. (extra-script-files->file-union): Add procedure. (pulseaudio-etc): Use it. * doc/guix.texi: Document it. --- doc/guix.texi | 27 +++++++++++++++++++++++++++ gnu/services/sound.scm | 19 +++++++++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index a002670030..2f8df03461 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -21393,9 +21393,36 @@ List of settings to set in @file{daemon.conf}, formatted just like @item @code{script-file} (default: @code{(file-append pulseaudio "/etc/pulse/default.pa")}) Script file to use as @file{default.pa}. +@item @code{extra-script-files} (default: @code{'())}) +A list of file-like objects defining extra PulseAudio scripts to run at +the initialization of the @command{pulseaudio} daemon. For a reference +of the available commands, refer to @command{man pulse-cli-syntax}. + @item @code{system-script-file} (default: @code{(file-append pulseaudio "/etc/pulse/system.pa")}) Script file to use as @file{system.pa}. @end table + +The example below sets the default PulseAudio card profile, the default +sink and the default source to use for a old SoundBlaster Audigy sound +card: +@lisp +(pulseaudio-configuration + (extra-script-files + (list (plain-file "configure-audigy-card" + (string-append "\ +set-card-profile alsa_card.pci-0000_01_01.0 \ + output:analog-surround-40+input:analog-mono +set-default-source alsa_input.pci-0000_01_01.0.analog-mono +set-default-sink alsa_output.pci-0000_01_01.0.analog-surround-40\n"))))) +@end lisp + +Note that @code{pulseaudio-service-type} is part of +@code{%desktop-services}; if your operating system declaration was +derived from one of the desktop templates, you'll want to adjust the +above example to modify the existing @code{pulseaudio-service-type} via +@code{modify-services} (@pxref{Service Reference, +@code{modify-services}}), instead of defining a new one. + @end deftp @deffn {Scheme Variable} ladspa-service-type diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index 19eccfc860..f529188a7c 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -34,6 +34,7 @@ (define-module (gnu services sound) #:use-module (gnu packages linux) #:use-module (gnu packages pulseaudio) #:use-module (ice-9 match) + #:use-module (srfi srfi-1) #:export (alsa-configuration alsa-service-type @@ -125,6 +126,8 @@ (define-record-type* (default '((flat-volumes . no)))) (script-file pulseaudio-configuration-script-file (default (file-append pulseaudio "/etc/pulse/default.pa"))) + (extra-script-files pulseaudio-configuration-extra-script-files + (default '())) (system-script-file pulseaudio-configuration-system-script-file (default (file-append pulseaudio "/etc/pulse/system.pa")))) @@ -145,14 +148,26 @@ (define pulseaudio-environment ("PULSE_CLIENTCONFIG" . ,(apply mixed-text-file "client.conf" (map pulseaudio-conf-entry client-conf))))))) +(define (extra-script-files->file-union extra-script-files) + "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE-UNION. +Each file is named \"snippet-n.pa\", where N is their 1-offset index." + (let ((labels (map (lambda (n) (format #f "snippet-~a.pa" n)) + (iota (length extra-script-files) 1)))) + (file-union "default.pa.d" (zip labels extra-script-files)))) + (define pulseaudio-etc (match-lambda - (($ _ _ default-script-file system-script-file) + (($ _ _ default-script-file extra-script-files + system-script-file) `(("pulse" ,(file-union "pulse" `(("default.pa" ,default-script-file) - ("system.pa" ,system-script-file)))))))) + ("system.pa" ,system-script-file) + ,@(if (null? extra-script-files) + '() + `(("default.pa.d" ,(extra-script-files->file-union + extra-script-files))))))))))) (define pulseaudio-service-type (service-type -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 23:20:10 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 04:20:10 +0000 Received: from localhost ([127.0.0.1]:41450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkeH-0003RI-KM for submit@debbugs.gnu.org; Mon, 31 Jan 2022 23:20:10 -0500 Received: from mail-qt1-f172.google.com ([209.85.160.172]:41912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkeD-0003Pz-FQ for 53676@debbugs.gnu.org; Mon, 31 Jan 2022 23:20:06 -0500 Received: by mail-qt1-f172.google.com with SMTP id y8so13425511qtn.8 for <53676@debbugs.gnu.org>; Mon, 31 Jan 2022 20:20:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ug4kgRT5rrjNr38XTxLR+siYJ8RJZYvplq7ERpjY9yg=; b=XJgZtJpND91echpeUN9/u+PcZJsiyZmCQTp1n6guRiO5r0nAgjo5yxi4V/nqTMSq14 5sTpPKFHueSiVv2/gc7rXngZ91HEmaICot74tVsG0mgPJmjS0ePajPD2jJzTnW3sY+I7 bDBnsxg+HxminlqnmT//ugoHNHFCyso5ALaDJGUL/k7ajwrXvC11UIqdd73JRnI/jqOD V+cAdktr8Rxmlpc06AwAXOuOcV709pS9/fbTtytCQMAIY5lPJcnqoG5/yH6iXUKoj1Bj YJt9CfiJtMisR7JKehFHfBUAkaA5gM7U2azH8bHt4CU9XNrBYZJlejqPGe5IQljSRcIE V+RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ug4kgRT5rrjNr38XTxLR+siYJ8RJZYvplq7ERpjY9yg=; b=7irxC7mZPVfgYlFzu98ILK4zLl84O7zudhUs6NdC+wHx1aI16o0UFPRYTVMWOSzeYJ yowN4QzHKEQwy+VC9b9wkXq5d9ZtLrtLjofiKeK32sncgqA22GjyGZGFGR/gR/qCOboj e4IAlqKWFwLq7A6cmaqUu6PNzWDJdGLtWCpTVcao+CBlogGjTqvM0kwMoJem7YZy5sGV PGyO8u3w9qq+AjpzDInSyDHeiPQvbqGhDUnKjEW/JnRAqxsWsjQYnp7MKI5Af9zuApJJ t2QcN6qu+/4oV0rcA3VhY4twWwq3G0yH6wAomihhxZMFxYxHZNUoHNaqBFMVjE59Tzn4 pK3w== X-Gm-Message-State: AOAM533qyPp8ToQ6MJnxSTA8s2l1k23NJDqP+U5nTwAftqco+bP3+ItC i/FlDwz7X2cklAiD+GUmZW8EHchkwZ0= X-Google-Smtp-Source: ABdhPJxjLzkf6nzOGMDPcPONY44cXizAWcgv+wcag8GJsQF1ZHscuLW5Pv1kfWA7gztN7K37w4ZYJQ== X-Received: by 2002:ac8:5cd2:: with SMTP id s18mr17347068qta.558.1643689199880; Mon, 31 Jan 2022 20:19:59 -0800 (PST) Received: from localhost.localdomain (dsl-10-141-111.b2b2c.ca. [72.10.141.111]) by smtp.gmail.com with ESMTPSA id a8sm9192439qti.71.2022.01.31.20.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 20:19:59 -0800 (PST) From: Maxim Cournoyer To: 53676@debbugs.gnu.org Subject: [PATCH 5/5] services: pulseaudio: Deploy the configuration files to /etc/pulse. Date: Mon, 31 Jan 2022 23:19:33 -0500 Message-Id: <20220201041933.16603-5-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220201041933.16603-1-maxim.cournoyer@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Maxim Cournoyer 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 (-) * gnu/services/sound.scm (pulseaudio-environment) [PULSE_CONFIG, PULSE_CLIENTCONFIG]: Use fix locations, and move logic to... (pulseaudio-etc): ... this service extension. Guard against producing empty files. --- gnu/services/sound.scm | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index f529188a7c..0877788f06 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -142,11 +142,11 @@ (define (pulseaudio-conf-entry arg) (define pulseaudio-environment (match-lambda (($ client-conf daemon-conf default-script-file) - `(("PULSE_CONFIG" . ,(apply mixed-text-file "daemon.conf" - "default-script-file = " default-script-file "\n" - (map pulseaudio-conf-entry daemon-conf))) - ("PULSE_CLIENTCONFIG" . ,(apply mixed-text-file "client.conf" - (map pulseaudio-conf-entry client-conf))))))) + ;; These config files kept at a fixed location, so that the following + ;; environment values are stable and do not require the user to reboot to + ;; effect their PulseAudio configuration changes. + '(("PULSE_CONFIG" . "/etc/pulse/daemon.conf") + ("PULSE_CLIENTCONFIG" . "/etc/pulse/client.conf"))))) (define (extra-script-files->file-union extra-script-files) "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE-UNION. @@ -157,8 +157,8 @@ (define (extra-script-files->file-union extra-script-files) (define pulseaudio-etc (match-lambda - (($ _ _ default-script-file extra-script-files - system-script-file) + (($ client-conf daemon-conf default-script-file + extra-script-files system-script-file) `(("pulse" ,(file-union "pulse" @@ -167,7 +167,18 @@ (define pulseaudio-etc ,@(if (null? extra-script-files) '() `(("default.pa.d" ,(extra-script-files->file-union - extra-script-files))))))))))) + extra-script-files)))) + ,@(if (null? daemon-conf) + '() + `(("daemon.conf" + ,(apply mixed-text-file "daemon.conf" + "default-script-file = " default-script-file "\n" + (map pulseaudio-conf-entry daemon-conf))))) + ,@(if (null? client-conf) + '() + `(("client.conf" + ,(apply mixed-text-file "client.conf" + (map pulseaudio-conf-entry client-conf)))))))))))) (define pulseaudio-service-type (service-type -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 23:25:04 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 04:25:04 +0000 Received: from localhost ([127.0.0.1]:41456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkj2-0003Zr-HK for submit@debbugs.gnu.org; Mon, 31 Jan 2022 23:25:04 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:35303) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkj0-0003ZF-Bl for 53676@debbugs.gnu.org; Mon, 31 Jan 2022 23:25:03 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 34ACF5C01AA; Mon, 31 Jan 2022 23:24:56 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 31 Jan 2022 23:24:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=mesmtp; bh=0OqHHnnXSOJ6RIuHlpXwj2PNfiJ zxmGjIQoiZxWEjqs=; b=noj472OsGnox0DAFabKFnHFDzlVflYvjeI9e+lyv+Vj XhNsiT8DocjUmHzIdWX0meJLstoP6kQ7oaJfipsPrCLZSMQPANAu/Y26FlOqPWXs 0+AiHV1MQ3hixL8v1ZE2N4oiFG7NFQILCY4BfMG7mJrX51A4Z6VwBD5jVQraM81s = DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=0OqHHnnXSOJ6RIuHl pXwj2PNfiJzxmGjIQoiZxWEjqs=; b=DjGoAqx4vD7KO5e9623nUZHJ+Pha8WK5n +778KQ1FtBbso6rKfab3OjwbgAp7ckINFzi9NG7XROxMaYNvbRy5n32mTj/Ze/fF h25ldSPluGF56w54m/MwShJeWxIm2x3VgXzW/7wv+sM1gx0iTnywGO5/NvkMvToe VwMvdZCWbwNbzwyQz8OHpJGGQFn5xcAoNQsAnhU8JTd8xWhdf4ZzSbvHEPwG9z+l NuvTktWiuiD38ElkewVFzGO6i8ciYMRYHJhdJxmVNo45Hq3HnEkUGPKrT5M1xose hS2Xd/c9Ohh0MuH78IY2BrqsVpdqSLGiinHIlTk0jiJvIVNuHin4w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrgedvgdejudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepnfgvohcuhfgr mhhulhgrrhhiuceolhgvohesfhgrmhhulhgrrhhirdhnrghmvgeqnecuggftrfgrthhtvg hrnhepudelffekfeduheehgffhteevtdejleeuieevhfeijeffhfethfdtieetteejhffh necuffhomhgrihhnpehthihpohdrshgvrhhvihgtvghsnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomheplhgvohesfhgrmhhulhgrrhhirdhnrghm vg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 Jan 2022 23:24:55 -0500 (EST) Date: Mon, 31 Jan 2022 23:24:53 -0500 From: Leo Famulari To: Maxim Cournoyer Subject: Re: [bug#53676] [PATCH 0/5] *** PulseAudio service improvements *** Message-ID: References: <20220201041352.14528-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220201041352.14528-1-maxim.cournoyer@gmail.com> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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.7 (-) On Mon, Jan 31, 2022 at 11:13:52PM -0500, Maxim Cournoyer wrote: > This small series adds an easy way to drop PulseAudio configuration scripts to > /etc/pulse/default.pa.d. It also lifts the need to reboot the machine to have > a new PulseAudio configuration active. Nice! That will be a great improvement. > Maxim Cournoyer (5): > doc: Fix typo. > services/sound: Normalize pulseaudio-configuration accessor names. > gnu: pulseaudio: Graft to adjust configuration. > services: pulseaudio: Add an extra-script-files configuration field. > services: pulseaudio: Deploy the configuration files to /etc/pulse. I don't think we should use grafts for anything besides fixing very serious bugs, although they are definitely useful to demonstrate new features in a patch series. Pulseaudio only has ~1700 dependents. We can easily handle it on a "new-features" branch or similar. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 14:43:36 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 19:43:36 +0000 Received: from localhost ([127.0.0.1]:44183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEz3w-0000rA-4A for submit@debbugs.gnu.org; Tue, 01 Feb 2022 14:43:36 -0500 Received: from mail-ej1-f66.google.com ([209.85.218.66]:36396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEz3t-0000qt-Th for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 14:43:34 -0500 Received: by mail-ej1-f66.google.com with SMTP id s13so57660210ejy.3 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 11:43:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=MTf7gbuty6X5M3ilweMMqM1EeXBRwQgwgXg023hTpo4=; b=dMeAe87B5boS0oXWiVmwVjxQWva4Kx0hY05kHI/z2yKPBI56D+urVBt9MtJw1SKMpV xcePlEtxYDZSbCPVB81ATV5zIdvvHmk9X9Zx5SJsYEWwJK083tErmdLXreeSMtW761q5 KyB/3yS+yR6bWsy3ULfT0YoH1/vFlp/5JeHm+bD89Jgdun/vA6Ioxit+XgpK3jb2UmLT ciu9FO2wVhn3TDrmfdGAuNnEHTs+pCq6HgkMaqC//T+FB0VzoZ82RDtZFcRRtgPGgW+M BaPZyZlEOIax2Jsw03yZOCJa9KMclunL9AHckrEShYIQqIetbLvG4tjuqmAtJyyoWrAe JUvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=MTf7gbuty6X5M3ilweMMqM1EeXBRwQgwgXg023hTpo4=; b=nfMv0MxUOicXuN6ENIxDCeuGHpCg9eVDADWn9L4/X2cBgHq5X3ETdcYn9/i5g/+wuB 0XNNoa7qkJLHHpWVC7lQqD3CDneZWljICWjdwXiHyE1x+tnYfMCUi/vLUjNftjYIios6 fO0pgVS7FaFO6tQE6QB8+EH9t5VsZ/heKTtKFIbOxCLU2wfvAhedssGtAszEnKFJLAmc k9xpbKWvArW/79gcjkpf4tb2X1LwKk14rpCYMbjwuBIWReXTZM5yYGRXEbO5vgfMWa7K mSNPKQeYvqcFisVMfBpVE+hiu+JjdZ1vIfqq+LNvBhmpIntoAAXigXDjqtciMQMPkt9k oxAQ== X-Gm-Message-State: AOAM531PzmR8CE/4EjuuWhIE5rtmwhjU1QNPh/zEdmA9QxUKNdwowqGZ HcigM7MtJAQ8l2ZuL7em364= X-Google-Smtp-Source: ABdhPJx8XuCRtVUtOpTJ9GLvSWQc9ur6sBOcHDvAdh2m4KmP8F5pdSKGOx+JfbEaKszG61SdOds7tQ== X-Received: by 2002:a17:907:7e85:: with SMTP id qb5mr22422444ejc.557.1643744608010; Tue, 01 Feb 2022 11:43:28 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id m22sm19654073eds.30.2022.02.01.11.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 11:43:27 -0800 (PST) Message-ID: Subject: Re: [PATCH 5/5] services: pulseaudio: Deploy the configuration files to /etc/pulse. From: Liliana Marie Prikler To: Maxim Cournoyer , 53676@debbugs.gnu.org Date: Tue, 01 Feb 2022 20:43:26 +0100 In-Reply-To: <20220201041933.16603-5-maxim.cournoyer@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-5-maxim.cournoyer@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 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, Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: > * gnu/services/sound.scm (pulseaudio-environment) > [PULSE_CONFIG, PULSE_CLIENTCONFIG]: Use fix locations, and move logic > to... > (pulseaudio-etc): ... this service extension.  Guard against producing > empty files. This patch reproduces (more or less) the initial layout we had for pulseaudio-service-type.  However, that layout has been reported to not work with some sandboxes. I tried tracking down a specific bug, but could only gather . > Due to a bug with webkit sandboxing, we no longer put daemon.conf > into /etc/pulse (my bad), but rather set PULSE_CONFIG to directly > point to it. In other words, we should check whether Epiphany still plays sound properly with this patch applied. Cheers From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 14:45:57 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 19:45:57 +0000 Received: from localhost ([127.0.0.1]:44191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEz6C-0000vT-P3 for submit@debbugs.gnu.org; Tue, 01 Feb 2022 14:45:56 -0500 Received: from mail-ej1-f68.google.com ([209.85.218.68]:33370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEz6B-0000vG-8u for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 14:45:55 -0500 Received: by mail-ej1-f68.google.com with SMTP id jx6so57929650ejb.0 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 11:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=kOVcByVhZOgWYS8yI0iESsjC3kFSnpFL25ZtZKbcatA=; b=Q89Onh1lGKL36IHDEASxMMei4u6GtXqCJf8DSx6u8N+bd9EALMRViTsAl3WMgf9E8R rjtAnoiupq9GFiJR9GDvYopbQPOIsGy2lAbDF+GeO0s0VFy4uDzaBJXh6ZuC6tPmxNws tk87GzslxUXBvhzkI678M9CEnBSiSlO9JLRb0Ba5RGNVJ3qBriLfxGER0hRPGYCJ81qi BYwDDfRVieILuXcTOJNKuJ/RuDpOwQgXYetMDrGnpHjkvXuoJNIE0rYTz1bbJNmRuV8O GsomXzae2RkS2jEKDJAJ84aBdLiSm5H48qQlkepp6DlYBl0n4R+4ArAVp8I4mCd1KyRK 17KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=kOVcByVhZOgWYS8yI0iESsjC3kFSnpFL25ZtZKbcatA=; b=D3YK/GGiNLsuHm+4ABLQnPYW5sKKME3cKVlIXvVhLiursimusKp7Oo2LtHmOHsw/6B mlkH0iYmUObhsDj7VFM9I4Kz4cxt8FkiPqHFGKzsqxYq5N5ppVWjHW1PFDYXpraMQyWC T37Y3SpFE1ZRiaLLHgOP/7/arJVcuFQ8UMJKTl9b91avlmI46Vm4qbUzAJ1j3ZjcK0D9 QjmEosolzC+W+cnynj0O/v3b6WCub4Ni9HoYDMGn/WnaR/dqksRW97w4YvG1zeqCQRgm uvlxqTYLEwac2/oOUDwV0D3IWPusTFsjpkb+NIlUEH855CrG4QE1010pexHx+b7+sC35 Tz+g== X-Gm-Message-State: AOAM531NKcPYOEasle2YwO9aqKkSeG/CyCiUbpTJ0MRVwjTfn5yDaznP v3GYNTB5lTWTdghyvNxerrO4RgosXw0= X-Google-Smtp-Source: ABdhPJzRvFkU954PAXQ6mhNa5/6IUsqYuyNAb09XtUUib/QmY7YQdJ3iqq4i4Lkk0nKORH7FtTvpaA== X-Received: by 2002:a17:906:478b:: with SMTP id cw11mr22830852ejc.35.1643744749529; Tue, 01 Feb 2022 11:45:49 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id z6sm15153016ejd.35.2022.02.01.11.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 11:45:49 -0800 (PST) Message-ID: <693cc82d449395853247c7fbf1b44d0a3c979c87.camel@gmail.com> Subject: Re: [PATCH 3/5] gnu: pulseaudio: Graft to adjust configuration. From: Liliana Marie Prikler To: Maxim Cournoyer , 53676@debbugs.gnu.org Date: Tue, 01 Feb 2022 20:45:48 +0100 In-Reply-To: <20220201041933.16603-3-maxim.cournoyer@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-3-maxim.cournoyer@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 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 (-) Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: > * gnu/packages/pulseaudio.scm (pulseaudio/fixed): New variable. > (pulseaudio)[replacement]: Graft package with it. > --- >  gnu/packages/pulseaudio.scm | 18 ++++++++++++++++++ >  1 file changed, 18 insertions(+) > > diff --git a/gnu/packages/pulseaudio.scm > b/gnu/packages/pulseaudio.scm > index fe028b5202..f529717ee1 100644 > --- a/gnu/packages/pulseaudio.scm > +++ b/gnu/packages/pulseaudio.scm > @@ -178,6 +178,7 @@ (define-public libsamplerate >  (define-public pulseaudio >    (package >      (name "pulseaudio") > +    (replacement pulseaudio/fixed) >      (version "15.0") >      (source (origin >               (method url-fetch) > @@ -269,6 +270,23 @@ (define-public pulseaudio >      ;; 'LICENSE' for details. >      (license l:gpl2+))) >   > +(define pulseaudio/fixed > +  (package > +    (inherit pulseaudio) > +    (arguments > +     (substitute-keyword-arguments (package-arguments pulseaudio) > +       ((#:phases phases) > +        `(modify-phases ,phases > +           (add-after 'unpack 'customize-default-script > +             (lambda _ > +               (call-with-port > +                (open-file "src/daemon/default.pa.in" "a") > +                (lambda (port) > +                  (format port "~%\ > +### Include extra script files configured via the pulseaudio- > service-type. > +.nofail > +.include /etc/pulse/default.pa.d~%"))))))))))) > + Note that there should be a .fail afterwards.   As Leo pointed out, we shouldn't do too many "feature grafts", so instead it might be worth moving this part to pulseaudio-service-type in some way, no? From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 14:49:07 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 19:49:07 +0000 Received: from localhost ([127.0.0.1]:44195 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEz9H-00010g-8I for submit@debbugs.gnu.org; Tue, 01 Feb 2022 14:49:07 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:34561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEz9F-000106-7X for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 14:49:05 -0500 Received: by mail-ed1-f68.google.com with SMTP id r10so36942544edt.1 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 11:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=yoOhgiUUIftVOmd+Pq1aDgl3BuoZwaG0G+3wielFklU=; b=D4gFmTeqv9kkNV/CvmKrH4jq8fIUDm7nKgbarwdnVCbhk7rQoYVcOpJBQwBtT9U5Zz pBvd/FnbnCIketWnLJRol1WPQItkAj4tluXy0dWnc1FIRlf1kAMhR8Qp7RX/z0ahNoUk H0H6IKXFrjRs4S8kuSs+PeZDHuRTLuNcAbS8Y6lEjf3mzoGg3HJ8RtyLPe4r8gZP9lGC 3JQYnLsVDD0WLzUOql3OXc4VX8Pp0Vxkn+hxRWGO5da3DWWjTtNBHwXHlvZBqSo0jnuh zBMMpEW4LEvgUh1z7YT6kyhxV/gCA3Xq9zRaS8XLW5lMPyqDVmpTJ7oZzuU1IEZxQ/AJ QEnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=yoOhgiUUIftVOmd+Pq1aDgl3BuoZwaG0G+3wielFklU=; b=Cf5fYbcFuVI57RLdKAO6NCd5iRz2wg4koHiNg8r+rC2efVhlue2ZBdWDQXPbUPOEtd FGlUp1QgTFqsShKUT+opx5MhItNfEoTD/i312pjGH/7z7QgbGgc/tXNA/rsThuW1l87e RIPOXlR+4X8iCL7DsKbw8fLGDZ/vsEMXiM2LNbCmUUO9Q7dqFHeP9gFpNCe/xADw9rn0 kWNvher0JaRmB0Z7VhzT6jGF42lPjgocjHHlZsUZjvsh3et2Zli7bh1XQNc77L6n5EIF KLkKal+qnI1yckjEd68u/79cn7jpN4m417UgdQmpF7Icx6FwxznIOGMQjPz/98lClEnk vcDg== X-Gm-Message-State: AOAM532neUmj/7JU3yfkr697cRJn+P6qBGftola5z7iA5Ue6Y+zhwlt3 PJFMXT7r55CqzB0wQSMLvAk= X-Google-Smtp-Source: ABdhPJzODSaoLHI00U906Gjjr8MTzvj9BuQj3AnhtbMM3/EJdvOx9+7aq4/ByM2m1pFjxxjemdv7sg== X-Received: by 2002:a05:6402:b3b:: with SMTP id bo27mr19037098edb.76.1643744939331; Tue, 01 Feb 2022 11:48:59 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id d2sm14896351ejw.70.2022.02.01.11.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 11:48:58 -0800 (PST) Message-ID: <9dfb26ef7c3e30baf1eba3334c2b9b5c593be76d.camel@gmail.com> Subject: Re: [PATCH 2/5] services/sound: Normalize pulseaudio-configuration accessor names. From: Liliana Marie Prikler To: Maxim Cournoyer , 53676@debbugs.gnu.org Date: Tue, 01 Feb 2022 20:48:57 +0100 In-Reply-To: <20220201041933.16603-2-maxim.cournoyer@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-2-maxim.cournoyer@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 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 (-) Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: > * gnu/services/sound.scm (): Adjust getter > names to match convention. > --- >  gnu/services/sound.scm | 9 +++++---- >  1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm > index 7beca35ffe..19eccfc860 100644 > --- a/gnu/services/sound.scm > +++ b/gnu/services/sound.scm > @@ -2,6 +2,7 @@ >  ;;; Copyright © 2018, 2020 Oleg Pykhalov >  ;;; Copyright © 2020 Liliana Marie Prikler > >  ;;; Copyright © 2020 Marius Bakke > +;;; Copyright © 2022 Maxim Cournoyer >  ;;; >  ;;; This file is part of GNU Guix. >  ;;; > @@ -115,16 +116,16 @@ (define alsa-service-type >  (define-record-type* >    pulseaudio-configuration make-pulseaudio-configuration >    pulseaudio-configuration? > -  (client-conf pulseaudio-client-conf > +  (client-conf pulseaudio-configuration-client-conf >                 (default '())) > -  (daemon-conf pulseaudio-daemon-conf > +  (daemon-conf pulseaudio-configuration-daemon-conf >                 ;; Flat volumes may cause unpleasant experiences to > users >                 ;; when applications inadvertently max out the system > volume >                 ;; (see e.g. ). >                 (default '((flat-volumes . no)))) > -  (script-file pulseaudio-script-file > +  (script-file pulseaudio-configuration-script-file >                 (default (file-append pulseaudio > "/etc/pulse/default.pa"))) > -  (system-script-file pulseaudio-system-script-file > +  (system-script-file pulseaudio-configuration-system-script-file >                        (default >                          (file-append pulseaudio > "/etc/pulse/system.pa")))) I don't see calling code adjusted anywhere. Is this because we only use match to access this records fields? On a related note, would it make sense to port this over to (define- configuration)? From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 14:49:28 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 19:49:28 +0000 Received: from localhost ([127.0.0.1]:44198 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEz9c-00011I-Jg for submit@debbugs.gnu.org; Tue, 01 Feb 2022 14:49:28 -0500 Received: from mail-ej1-f65.google.com ([209.85.218.65]:33786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEz9b-000116-Kt for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 14:49:27 -0500 Received: by mail-ej1-f65.google.com with SMTP id jx6so57958209ejb.0 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 11:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=L5dvrtIZ182PailnuuAhSdSlg1jS2mLm38LJyPQQfMI=; b=OYrZ9mD+LWQ2B7jXfjYv/Zo1QevhmljNfN3/wx3un/X1beKzpuBU/3YusFpBG9CrUv uF8FLOCvNlNDckaMydFm4X9RibyPbfWGtHPn5wzz/dDdq5AqqFIVVIK42e0iCsFn4rfW 475kipHhZzVaMBIXwbZ2zr5sft2/lyqEgHvwbY+IlK8T+Wt3LXy+mGrOuCWrEToORDa0 y70NQpIelX6uN81woRfBvnmtVaFiwGljvGf/b2VNapqGC2cSZx4DEOl2blIcrO/790cd OyNypPPVpjSRxyhBIJ1PeL7HTvoQDJJNI/Tykgd9uNXjHMP6reHngSK9uSAUHRO5VPVU klKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=L5dvrtIZ182PailnuuAhSdSlg1jS2mLm38LJyPQQfMI=; b=CVCOkOX0iGUkhqNWz6hu0lC+De+W83DoAdbDvIYHFeonH4lmJ82ts99RpTewR/+tjN Nl23yWfA0kKcVKO2CTCAGmDBLwCH8Q0LecNWh02hvQSwByaOravoBWv9jBY6pzv2lMk6 717e5DM0oGeGcv/MgV5RQ+B/K6HCNFFuwZKdWihBHkBCjiDrNuVVVyV2V0N0OJNxzTxp r+J7YaISmG++YYT3GrR6sJyg4zPFLl8nCSv2zv5G6qFgMG6ctg7vCyQl7hx4Bjn53Lz1 LxuAWBA6UrZlq8N6OLQJVZmuS6AZg2Fgd8cb11XPvoIO8XZhd8tyF1c0rDAs7I62Fw8w vWIQ== X-Gm-Message-State: AOAM531Cye6EiTiTkf9ktbZXKu/qA09U/pbw2QetQBKfvH0+BUZtux9u Wc6ZXTFj5cpNTro++h0DGAk= X-Google-Smtp-Source: ABdhPJwueIJXv6fbmFebnJO2LQJycFnHYuUI2SVrkz49IqsZIUzbVrvobnPuZ1+hRoO5gi/iDqtLGQ== X-Received: by 2002:a17:907:2849:: with SMTP id el9mr22524672ejc.201.1643744962037; Tue, 01 Feb 2022 11:49:22 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id dk3sm19867417edb.33.2022.02.01.11.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 11:49:21 -0800 (PST) Message-ID: <096863dbfe5c610c4f7a2278dd251cd6dd895ef1.camel@gmail.com> Subject: Re: [PATCH 1/5] doc: Fix typo. From: Liliana Marie Prikler To: Maxim Cournoyer , 53676@debbugs.gnu.org Date: Tue, 01 Feb 2022 20:49:20 +0100 In-Reply-To: <20220201041933.16603-1-maxim.cournoyer@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: > * doc/guix.texi (Sound Services): Fix typo. > --- >  doc/guix.texi | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > dif [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, https://senderscore.org/blocklistlookup/ [209.85.218.65 listed in bl.score.senderscore.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liliana.prikler[at]gmail.com) 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.218.65 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 53676 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.3 (/) Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: > * doc/guix.texi (Sound Services): Fix typo. > --- >  doc/guix.texi | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 94f8e5e481..a002670030 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -21382,7 +21382,7 @@ Data type representing the configuration for > @code{pulseaudio-service}. >  @table @asis >  @item @code{client-conf} (default: @code{'()}) >  List of settings to set in @file{client.conf}. > -Accepts a list of strings or a symbol-value pairs.  A string will be > +Accepts a list of strings or symbol-value pairs.  A string will be >  inserted as-is with a newline added.  A pair will be formatted as >  ``key = value'', again with a newline added. LGTM. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 14:56:38 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 19:56:38 +0000 Received: from localhost ([127.0.0.1]:44208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEzGX-0001ET-Kw for submit@debbugs.gnu.org; Tue, 01 Feb 2022 14:56:38 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:46897) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEzGV-0001EG-Ee for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 14:56:36 -0500 Received: by mail-ed1-f65.google.com with SMTP id m11so36733073edi.13 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 11:56:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=ene8wyLAejHBso8IBNBosNG7YA9oZLLX4Hve6jrk2tg=; b=VS0bOcKCN9SAq1VkTq3IJyzQSBYg1s8/lJErxrQllLAAV+7nHrwKOLuXHIKh+3bZC5 P9XOq/1yXsFX21CawI+bc/ynCRENkUH6ZjVDrnWXvEtlWReYw2w7LU1GZeKhPDvqTllc AsYZxVYHdqjoLaDy3mpVnKm1AunMc/vIQBJADyQscWLblgg6omYRkWBHx9lL6h1HoqNu IoNDbMbsMMkZCu4JCaq7M5+wCDFCMjg5+mVYDarUBaaA2Oi8BujGcvUFNZm5IedootzK H6Xz2tDZ42YhyjuuwCYAMfPYnCWxRYB+yNAM2u5iqHEFILcijR/IvPBbw0bC+PrNNNoP ynpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=ene8wyLAejHBso8IBNBosNG7YA9oZLLX4Hve6jrk2tg=; b=URmmyPPJlQF1i7TXtVgTnwT2VK4JNSupXXWFcNggK441gK1ukQVPZCccC1dCmklzXJ oluuar0OfwRPYdlwzBC91KnlHiAGbMelE87rCoUCl5+5ZTX4KFfoQ+Eq/OiMgBXhxf24 R5tmXWsGWa5DeBOkrU2fySEkRwLu/6FVsSpZkoBQk2dLkBGFva6iKtmHuT1oYrkMBa0l cs+1XmP2C3+9P+HFz2K73bz0yTiBvxCvKaG+6/yTZVz9H2jy6bSQ/zYMF2wEtwJjC3UE RbzyXANO7Tj4nkKUqsJTsAhrNiOta07CFxZ/T+RytJbJ/onXLCxg4mAwbxJLOcNRmXPj v4xA== X-Gm-Message-State: AOAM531+HREbu2K2nCjDCqxYKZrjeLa7T0fRrd3MkpnRphgCxMrKdxhh Jj4WkREZLekSPe1s3I+sqxs= X-Google-Smtp-Source: ABdhPJzbwinXU8LUjX63MyiUoUstYFe5Nf7JF66AIfwiwpfUlMwRVz9+VsGyvE4Ej+IMzwg0eI8KUw== X-Received: by 2002:a05:6402:3450:: with SMTP id l16mr26943948edc.225.1643745389490; Tue, 01 Feb 2022 11:56:29 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id u18sm14886940eje.37.2022.02.01.11.56.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 11:56:29 -0800 (PST) Message-ID: <97111754acacc576aec4eb55889a32474fe71f95.camel@gmail.com> Subject: Re: [PATCH 4/5] services: pulseaudio: Add an extra-script-files configuration field. From: Liliana Marie Prikler To: Maxim Cournoyer , 53676@debbugs.gnu.org Date: Tue, 01 Feb 2022 20:56:28 +0100 In-Reply-To: <20220201041933.16603-4-maxim.cournoyer@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-4-maxim.cournoyer@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 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, Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: > * gnu/services/sound.scm () > [extra-script-files]: Add field. > (extra-script-files->file-union): Add procedure. > (pulseaudio-etc): Use it. > * doc/guix.texi: Document it. > --- >  doc/guix.texi          | 27 +++++++++++++++++++++++++++ >  gnu/services/sound.scm | 19 +++++++++++++++++-- >  2 files changed, 44 insertions(+), 2 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index a002670030..2f8df03461 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -21393,9 +21393,36 @@ List of settings to set in > @file{daemon.conf}, formatted just like >  @item @code{script-file} (default: @code{(file-append pulseaudio > "/etc/pulse/default.pa")}) >  Script file to use as @file{default.pa}. >   > +@item @code{extra-script-files} (default: @code{'())}) > +A list of file-like objects defining extra PulseAudio scripts to run > at > +the initialization of the @command{pulseaudio} daemon.  For a > reference > +of the available commands, refer to @command{man pulse-cli-syntax}. > + >  @item @code{system-script-file} (default: @code{(file-append > pulseaudio "/etc/pulse/system.pa")}) >  Script file to use as @file{system.pa}. >  @end table > + > +The example below sets the default PulseAudio card profile, the > default > +sink and the default source to use for a old SoundBlaster Audigy > sound > +card: > +@lisp > +(pulseaudio-configuration > + (extra-script-files > +  (list (plain-file "configure-audigy-card" > +                    (string-append "\ > +set-card-profile alsa_card.pci-0000_01_01.0 \ > +  output:analog-surround-40+input:analog-mono > +set-default-source alsa_input.pci-0000_01_01.0.analog-mono > +set-default-sink alsa_output.pci-0000_01_01.0.analog-surround- > 40\n"))))) > +@end lisp > + > +Note that @code{pulseaudio-service-type} is part of > +@code{%desktop-services}; if your operating system declaration was > +derived from one of the desktop templates, you'll want to adjust the > +above example to modify the existing @code{pulseaudio-service-type} > via > +@code{modify-services} (@pxref{Service Reference, > +@code{modify-services}}), instead of defining a new one. > + >  @end deftp >   >  @deffn {Scheme Variable} ladspa-service-type > diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm > index 19eccfc860..f529188a7c 100644 > --- a/gnu/services/sound.scm > +++ b/gnu/services/sound.scm > @@ -34,6 +34,7 @@ (define-module (gnu services sound) >    #:use-module (gnu packages linux) >    #:use-module (gnu packages pulseaudio) >    #:use-module (ice-9 match) > +  #:use-module (srfi srfi-1) >    #:export (alsa-configuration >              alsa-service-type >   > @@ -125,6 +126,8 @@ (define-record-type* >                 (default '((flat-volumes . no)))) >    (script-file pulseaudio-configuration-script-file >                 (default (file-append pulseaudio > "/etc/pulse/default.pa"))) > +  (extra-script-files pulseaudio-configuration-extra-script-files > +                      (default '())) >    (system-script-file pulseaudio-configuration-system-script-file >                        (default >                          (file-append pulseaudio > "/etc/pulse/system.pa")))) > @@ -145,14 +148,26 @@ (define pulseaudio-environment >         ("PULSE_CLIENTCONFIG" . ,(apply mixed-text-file "client.conf" >                                         (map pulseaudio-conf-entry > client-conf))))))) >   > +(define (extra-script-files->file-union extra-script-files) > +  "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with > FILE-UNION. > +Each file is named \"snippet-n.pa\", where N is their 1-offset > index." > +  (let ((labels (map (lambda (n) (format #f "snippet-~a.pa" n)) > +                     (iota (length extra-script-files) 1)))) > +    (file-union "default.pa.d" (zip labels extra-script-files)))) > + >  (define pulseaudio-etc >    (match-lambda > -    (($ _ _ default-script-file system- > script-file) > +    (($ _ _ default-script-file extra- > script-files > +                                   system-script-file) >       `(("pulse" >          ,(file-union >            "pulse" >            `(("default.pa" ,default-script-file) > -            ("system.pa" ,system-script-file)))))))) > +            ("system.pa" ,system-script-file) > +            ,@(if (null? extra-script-files) > +                  '() > +                  `(("default.pa.d" ,(extra-script-files->file-union > +                                      extra-script-files))))))))))) >   >  (define pulseaudio-service-type >    (service-type Is there a particular use-case for this (other than working around the location issue of default.pa et al.)? If not, I'd rather make it s.t. our other files can more easily be stitched together in-place. Also, assuming that we're using file-like objects here, I think we should use the store name minus prefix and hash for the file name. E.g. if Alice adds soundblaster.pa, it'd make sense to label it soundblaster.pa, so that changes to snippet order don't mess up any configuration referring to those files. Cheers From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 15:15:44 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 20:15:44 +0000 Received: from localhost ([127.0.0.1]:44230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEzZ2-0001iw-LX for submit@debbugs.gnu.org; Tue, 01 Feb 2022 15:15:44 -0500 Received: from mail-qv1-f42.google.com ([209.85.219.42]:38716) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEzZ1-0001ij-9c for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 15:15:43 -0500 Received: by mail-qv1-f42.google.com with SMTP id b12so17054459qvz.5 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 12:15:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=g7pAmRPcuAJHLwdXlGiIgvlyalHRUV1AgUfLty1WdQw=; b=DPS8vLu2O8LUyWKu8gcTq1pA5PtwESm0BU/wSR4oF3pkIF8vcps5RaKaP/3bBLZNA8 OiDKcZRB6fWjUywNW5FEnJMFgFxD0sd+6ROP0dcQyOh7av/8iAi44Dr65YrHzjyf9PR8 BA10avJgEVrL8a3RVgXb4SY4OFYDiDW4veMMCCIHm3pbbs+0l4tiFc3kZUKalpZnF44o BmXvFPVrUI1p4cf074ojbDUVZKmKA+RrN28I2QlW9zUG7NxhNdeC8J1PIkNgvMKcloH3 +ij1xv3NwEPV/Jk44dQv+ab4uOjV0+FqA7PmqvX1SEYBZ1ijB1fjcOFi+4qgvSVurOkQ 5LLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=g7pAmRPcuAJHLwdXlGiIgvlyalHRUV1AgUfLty1WdQw=; b=5NSZA8B79/bPlJ9agMgvZG6UeoRZGXIXSqGrIlbPX7I9nL+YSRN30t98L50INNV788 fj5VSpRwR9aO2SlEYihlG3QwfjQNvLpKGuLst+Htc3xYH8fZmXQMGtvi4vJ/CzUnz5Lm MrJxOF/hs3LUvEyBQsCRx+5MnQZFsC6Lx8ZkhGLaxbuasiLDMr2ue+6EKMTsjsX/401L tZYdIQh2QaZgldNYIP+6EBcO7t9F9zdiLbQOB3U32h1Qaf0iPiKz250F9Ea8z0B9t6Ks ZE0PvK+Skl2Fc9fTmWC0F7sPiLC66Eo9kVqTonbnGClUF6AEySANycNeVB1PEX+qrxd2 wlcg== X-Gm-Message-State: AOAM531CHoMLc5wvHIjtnCdlYm0TrsfMdqBMYU3Na9wP4/k0zmohvJv5 oeUrmoW9hRHKf8zO6viUg70U7/xt/2w= X-Google-Smtp-Source: ABdhPJxWdH6P7YdPi8YQLePBTwCKN4N7YlwqrjqVgAkEjGPXI0/2A8TfgSWiDKL9a96JK997hggpiQ== X-Received: by 2002:a05:6214:c44:: with SMTP id r4mr24346635qvj.96.1643746537602; Tue, 01 Feb 2022 12:15:37 -0800 (PST) Received: from hurd (dsl-149-193.b2b2c.ca. [66.158.149.193]) by smtp.gmail.com with ESMTPSA id 6sm5133334qtx.20.2022.02.01.12.15.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 12:15:37 -0800 (PST) From: Maxim Cournoyer To: Leo Famulari Subject: Re: [bug#53676] [PATCH 0/5] *** PulseAudio service improvements *** References: <20220201041352.14528-1-maxim.cournoyer@gmail.com> Date: Tue, 01 Feb 2022 15:15:36 -0500 In-Reply-To: (Leo Famulari's message of "Mon, 31 Jan 2022 23:24:53 -0500") Message-ID: <87bkzq1gyf.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Leo, Leo Famulari writes: > On Mon, Jan 31, 2022 at 11:13:52PM -0500, Maxim Cournoyer wrote: >> This small series adds an easy way to drop PulseAudio configuration scripts to >> /etc/pulse/default.pa.d. It also lifts the need to reboot the machine to have >> a new PulseAudio configuration active. > > Nice! That will be a great improvement. > >> Maxim Cournoyer (5): >> doc: Fix typo. >> services/sound: Normalize pulseaudio-configuration accessor names. >> gnu: pulseaudio: Graft to adjust configuration. >> services: pulseaudio: Add an extra-script-files configuration field. >> services: pulseaudio: Deploy the configuration files to /etc/pulse. > > I don't think we should use grafts for anything besides fixing very > serious bugs, although they are definitely useful to demonstrate new > features in a patch series. > > Pulseaudio only has ~1700 dependents. We can easily handle it on a > "new-features" branch or similar. True; I was thinking to proceed this way and ungraft it (as well as other grafted packages) in the branch that will need to be made soon to fix the Rust CVE. A specialized world rebuild branch. Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 15:18:38 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 20:18:38 +0000 Received: from localhost ([127.0.0.1]:44245 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEzbq-0001oA-CT for submit@debbugs.gnu.org; Tue, 01 Feb 2022 15:18:38 -0500 Received: from mail-qv1-f48.google.com ([209.85.219.48]:38547) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEzbp-0001nx-0X for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 15:18:37 -0500 Received: by mail-qv1-f48.google.com with SMTP id b12so17061336qvz.5 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 12:18:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=2FKOqX4saXK21OJdyibV7YtiHQhd9rvWH+GRhtHH9d8=; b=VzzikbZZD8kPDAHGJP0gCHXBOa9NkY0JecKVeUu/WN2439o4KoE4HRsxKisJ4o2YOH p6aoUJr34JzztMSjoxX9XbsiIXEblOSuiOCicf+YxT5qvzX7ZOI/g6Sa331Kdm0ZCBdZ 1TWhptsZ+sCoP8wIbkJYHLV2i6xx/ioICn5zaFQW6KlEqBulQ7qQ1f9G/CNWgccs2fmq 4VzoMm5p/46mYZJWv26mLwjRP7cZW/Y40S9TH132EY88T4QIjCCFleNCQosfrOEfWyuQ P15lRRVN3nE3mcW7NFdCJrmq6SH2RiPQ5ZDmK4lTqLFC2ecNmD3DSaVUl+yhO+SoGVB6 rxUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=2FKOqX4saXK21OJdyibV7YtiHQhd9rvWH+GRhtHH9d8=; b=fViaKhYTg/1Z7/9u9arhajEa2bgodSrKVlhVXDpDH7PmNY9Cgd6B7X3aTU9Ab88w/H VCd+UqQtYgUJx/7J5oHV8zOFnBv8bxx0c8UXiLybGD8Pj60aoHqjsEL85Rg/JiUjOGnW y0Bcsyv9nLGrarlVBVeUpmta9GxIgU90Qla2cfOhsw9lTZYxuBMIcjQv9V2fo0fTxC+g wZyfkjUimrH4GphrdcjTRETH0rH9FzGHa6xvVveegiBnFP8nBaXhuJ7GltC3/BVQhN/E JG28xenTM/BtYonXKJaFLdXmpbMitxpfGADLOeMEmjSro+YQt6DmrgmTUcocxqj33hNU xhxA== X-Gm-Message-State: AOAM533vaeSjKdN7zHrGLkZdY+Nj7+r8R48K/XSAB4BLBUhP4SMT0UG5 OGWxoEkwIgNq5iMvICQp/8yXfsLNz0M= X-Google-Smtp-Source: ABdhPJxFCcaDz6X/lcxUrUYfsi8sLjnQMQnjnYJCPrlHuimb+oDg6bZssD3yA5y3DGNbqbK3VCC3uA== X-Received: by 2002:a0c:fc43:: with SMTP id w3mr24516933qvp.92.1643746711466; Tue, 01 Feb 2022 12:18:31 -0800 (PST) Received: from hurd (dsl-149-193.b2b2c.ca. [66.158.149.193]) by smtp.gmail.com with ESMTPSA id j14sm11193675qkp.131.2022.02.01.12.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 12:18:30 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: [PATCH 2/5] services/sound: Normalize pulseaudio-configuration accessor names. References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-2-maxim.cournoyer@gmail.com> <9dfb26ef7c3e30baf1eba3334c2b9b5c593be76d.camel@gmail.com> Date: Tue, 01 Feb 2022 15:18:30 -0500 In-Reply-To: <9dfb26ef7c3e30baf1eba3334c2b9b5c593be76d.camel@gmail.com> (Liliana Marie Prikler's message of "Tue, 01 Feb 2022 20:48:57 +0100") Message-ID: <87a6fa1gtl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Liliana, Liliana Marie Prikler writes: > Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: >> * gnu/services/sound.scm (): Adjust getter >> names to match convention. >> --- >> =C2=A0gnu/services/sound.scm | 9 +++++---- >> =C2=A01 file changed, 5 insertions(+), 4 deletions(-) >>=20 >> diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm >> index 7beca35ffe..19eccfc860 100644 >> --- a/gnu/services/sound.scm >> +++ b/gnu/services/sound.scm >> @@ -2,6 +2,7 @@ >> =C2=A0;;; Copyright =C2=A9 2018, 2020 Oleg Pykhalov >> =C2=A0;;; Copyright =C2=A9 2020 Liliana Marie Prikler >> >> =C2=A0;;; Copyright =C2=A9 2020 Marius Bakke >> +;;; Copyright =C2=A9 2022 Maxim Cournoyer >> =C2=A0;;; >> =C2=A0;;; This file is part of GNU Guix. >> =C2=A0;;; >> @@ -115,16 +116,16 @@ (define alsa-service-type >> =C2=A0(define-record-type* >> =C2=A0=C2=A0 pulseaudio-configuration make-pulseaudio-configuration >> =C2=A0=C2=A0 pulseaudio-configuration? >> -=C2=A0 (client-conf pulseaudio-client-conf >> +=C2=A0 (client-conf pulseaudio-configuration-client-conf >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (default '())) >> -=C2=A0 (daemon-conf pulseaudio-daemon-conf >> +=C2=A0 (daemon-conf pulseaudio-configuration-daemon-conf >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 ;; Flat volumes may cause unpleasant experiences to >> users >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 ;; when applications inadvertently max out the system >> volume >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 ;; (see e.g. ). >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (default '((flat-volumes . no)))) >> -=C2=A0 (script-file pulseaudio-script-file >> +=C2=A0 (script-file pulseaudio-configuration-script-file >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (default (file-append pulseaudio >> "/etc/pulse/default.pa"))) >> -=C2=A0 (system-script-file pulseaudio-system-script-file >> +=C2=A0 (system-script-file pulseaudio-configuration-system-script-file >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (default >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (f= ile-append pulseaudio >> "/etc/pulse/system.pa")))) > I don't see calling code adjusted anywhere. Is this because we only > use match to access this records fields? The bindings are not public, so they shouldn't be used elsewhere; internally only match seems to be used yes. > On a related note, would it make sense to port this over to (define- > configuration)? Agreed. I'd prefer to keep this effort separate from this series though. Also, I still want to take some time to review the newly introduced Guix records sanitizers; I feel they should perhaps be leveraged in define-configuration (part of the appeal of define-configuration is serialization, the other part being input validation, which is what sanitizers seem to be designed for). Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 15:20:36 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 20:20:36 +0000 Received: from localhost ([127.0.0.1]:44251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEzdj-0001rZ-Sr for submit@debbugs.gnu.org; Tue, 01 Feb 2022 15:20:36 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:33319) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEzdh-0001rL-Pv for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 15:20:34 -0500 Received: by mail-qv1-f47.google.com with SMTP id b4so12236506qvf.0 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 12:20:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=yxqS1fFiWLS7ZF44s34Y7X7xDEXGxG1S8oBf6g0PX7w=; b=A5zk/POvr1TVAIPdPWSbDqSEEKl1wgniG7DKfuZXFutD0IWuO7c7Wcy3kfHbohh6Qn 9VvJANkLbTH4HQrNM7gkMAGv4ZZNZnSEZuVhZAmuUoRAOe6COlDAJ4U/4XxuXy0uKBem TiMb0/7PH0VQOE654NKJNr42H2pQdTooudL0euAPYewNUKKE3uoFtzE2rGsJ8RfosxbQ VSdm0JNoUv9hmi1MeAjH/BM1de6A2g7olpXN2rxxLp0TSG+Fo28emGGSoAnkMb33RJ7i ehu6Tq+PtoX/bpWI0r9eNqFUPyVffOQ49OYHhInX5u5d8QQTgZkRAMGTWlTaj4D8tAHz +0IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=yxqS1fFiWLS7ZF44s34Y7X7xDEXGxG1S8oBf6g0PX7w=; b=ah19INcgmD0dF2oOgLV1PA3kbQFL0wiaN4iidN1aSkV1eVH817zD8yYEOc5E2KZqze b0oQZQbOIv1iiv+eFtXbmFDbWdcZAogZHHTbiFqFCIG5UaoxYlK7YcOpFbpq7zX02ac6 dwteFgKybuDG0u8RmjW8vwt2lRdc5haqVcvUfGXHzRjJ3IMve//bZYb1R2EpCdyijz+2 NUnUQmuyFjBaT2K4bxpvKEkV/wN0pwNHYc7WznqtPPDYINWoIr05EAn2tMBsrDzY4AXx Kzut706akBPP9FblLA+e4INNEfoHxSSoITyyhXgfJ55zlac456I7HGdaSzEXfzFzkddL XNhg== X-Gm-Message-State: AOAM531iveQ2EXu430T3P1vH6hFwn1ELACV4QHZfHApTt7N96KrRfAUP vXtnZzG3pSQjPxxEb7kJqVVYDB8SVuc= X-Google-Smtp-Source: ABdhPJx1Fv/BHuypQIsM1lZKyicwuiL5drAtrZ3nHB2WNCA7hlSlMpfIJfIkaVhFBgWsY4pXB8vD1g== X-Received: by 2002:a05:6214:21e8:: with SMTP id p8mr24268871qvj.116.1643746828216; Tue, 01 Feb 2022 12:20:28 -0800 (PST) Received: from hurd (dsl-149-193.b2b2c.ca. [66.158.149.193]) by smtp.gmail.com with ESMTPSA id g24sm7756343qkk.76.2022.02.01.12.20.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 12:20:27 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: [PATCH 3/5] gnu: pulseaudio: Graft to adjust configuration. References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-3-maxim.cournoyer@gmail.com> <693cc82d449395853247c7fbf1b44d0a3c979c87.camel@gmail.com> Date: Tue, 01 Feb 2022 15:20:26 -0500 In-Reply-To: <693cc82d449395853247c7fbf1b44d0a3c979c87.camel@gmail.com> (Liliana Marie Prikler's message of "Tue, 01 Feb 2022 20:45:48 +0100") Message-ID: <875ypy1gqd.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Liliana, Liliana Marie Prikler writes: > Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: >> * gnu/packages/pulseaudio.scm (pulseaudio/fixed): New variable. >> (pulseaudio)[replacement]: Graft package with it. >> --- >> =C2=A0gnu/packages/pulseaudio.scm | 18 ++++++++++++++++++ >> =C2=A01 file changed, 18 insertions(+) >>=20 >> diff --git a/gnu/packages/pulseaudio.scm >> b/gnu/packages/pulseaudio.scm >> index fe028b5202..f529717ee1 100644 >> --- a/gnu/packages/pulseaudio.scm >> +++ b/gnu/packages/pulseaudio.scm >> @@ -178,6 +178,7 @@ (define-public libsamplerate >> =C2=A0(define-public pulseaudio >> =C2=A0=C2=A0 (package >> =C2=A0=C2=A0=C2=A0=C2=A0 (name "pulseaudio") >> +=C2=A0=C2=A0=C2=A0 (replacement pulseaudio/fixed) >> =C2=A0=C2=A0=C2=A0=C2=A0 (version "15.0") >> =C2=A0=C2=A0=C2=A0=C2=A0 (source (origin >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 (method url-fetch) >> @@ -269,6 +270,23 @@ (define-public pulseaudio >> =C2=A0=C2=A0=C2=A0=C2=A0 ;; 'LICENSE' for details. >> =C2=A0=C2=A0=C2=A0=C2=A0 (license l:gpl2+))) >> =C2=A0 >> +(define pulseaudio/fixed >> +=C2=A0 (package >> +=C2=A0=C2=A0=C2=A0 (inherit pulseaudio) >> +=C2=A0=C2=A0=C2=A0 (arguments >> +=C2=A0=C2=A0=C2=A0=C2=A0 (substitute-keyword-arguments (package-argumen= ts pulseaudio) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((#:phases phases) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `(modify-phases ,phases >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (add-after= 'unpack 'customize-default-script >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (lambda _ >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (call-with-port >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (open-file "src/daemon/default.pa.in" "a") >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 (lambda (port) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (format port "~%\ >> +### Include extra script files configured via the pulseaudio- >> service-type. >> +.nofail >> +.include /etc/pulse/default.pa.d~%"))))))))))) >> + > Note that there should be a .fail afterwards. =C2=A0 Hmm. I simply duplicated the existing two lines used by PulseAudio itself. I believe they do not care because it appears completely at the end of the file. > As Leo pointed out, we shouldn't do too many "feature grafts", so > instead it might be worth moving this part to pulseaudio-service-type > in some way, no? I'd prefer to keep it like this, for simplicity; we need to rebuild the world soon anyway to fix a Rust CVE, so we can batch things easily. Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 15:28:03 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 20:28:03 +0000 Received: from localhost ([127.0.0.1]:44262 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEzkw-00023N-IU for submit@debbugs.gnu.org; Tue, 01 Feb 2022 15:28:02 -0500 Received: from mail-qt1-f173.google.com ([209.85.160.173]:43591) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEzku-00022q-D6 for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 15:28:00 -0500 Received: by mail-qt1-f173.google.com with SMTP id x5so2406971qtw.10 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 12:28:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=Tu08mJNk/EGB23ZoYqw857FgrgCIECCHAF97VEoudpw=; b=Hff6Md6pKqYejdVUiE9dahcweL9w5UTCnmzqpOQmB/83U/vH2mJzzXkztkUmTNztRw KAL04JYQTb/etgnfbWxwouAzQluVVMLIFIyjcePUVc+zEWjaoJj3L02ZG6YPOWUvnngm HpxVOxrmwcpK9Xttzvbwy0inS9hW+rAPRhD3ROjkkdBBCJCZF4Cyrm81t3LxxWT9xf2q quCoCqMqYwNvk3B0AqimpfT/AEGcCLHaUwa66XUiv+ji5B7aNLpBLJeCYF+623tyUZKg k3S+4GhUZp3AqFeQtXIqKFli6SXLkEM1XKyMhBUi1eFPK8RU6J60K+kUjGdKI2pwG7xx wB/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=Tu08mJNk/EGB23ZoYqw857FgrgCIECCHAF97VEoudpw=; b=iDgKSk24roJth7NgT9Ft2mIqMh04L6Day2SSr+4dQPjPLLWVCHnMaBkuf65aVZA/hv vg5gCEqBD5OJdxTbSvcIjX0V6dIhXKGefwkpWrFjkO/INoIV3czuBanzE3gvHmwsYzrm MjMDC40IePwLH+axY+atQdiJp+WUsc0nawOSczCI3h/hmJH2cisfKFCq28ujmbjmIrBu pMT28EPycbOyoKSCaxPEZTxzT0diNY9IRrsuiZqT03mgPWIz1x1TouDJAJwnoHoqFaD3 5QLnRFE5USO0M6OqMH7w5U7V1zmRklRUr8lzzmYbAT8vR4WeS9ulSdwFVBTCkqr+L6Cg qxzg== X-Gm-Message-State: AOAM531ym8DMoRqah/uyZQq+bGTHF6kikY1KBx2f7w2uYcDZx1Dr0CiP B0u8gelnVxea8Wi90yO6w19YpsPZeyQ= X-Google-Smtp-Source: ABdhPJyfZpR/UZ+teJs2jvyG8AsGiATPysSJFlONeEpRjwDyRaC5cCJpKRivSLn2dj42NLE9/lAiuQ== X-Received: by 2002:ac8:58c3:: with SMTP id u3mr15453261qta.457.1643747274530; Tue, 01 Feb 2022 12:27:54 -0800 (PST) Received: from hurd (dsl-149-193.b2b2c.ca. [66.158.149.193]) by smtp.gmail.com with ESMTPSA id x11sm10443420qkm.108.2022.02.01.12.27.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 12:27:54 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: [PATCH 4/5] services: pulseaudio: Add an extra-script-files configuration field. References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-4-maxim.cournoyer@gmail.com> <97111754acacc576aec4eb55889a32474fe71f95.camel@gmail.com> Date: Tue, 01 Feb 2022 15:27:53 -0500 In-Reply-To: <97111754acacc576aec4eb55889a32474fe71f95.camel@gmail.com> (Liliana Marie Prikler's message of "Tue, 01 Feb 2022 20:56:28 +0100") Message-ID: <871r0m1gdy.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Liliana, Liliana Marie Prikler writes: > Hi, > > Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: >> * gnu/services/sound.scm () >> [extra-script-files]: Add field. >> (extra-script-files->file-union): Add procedure. >> (pulseaudio-etc): Use it. >> * doc/guix.texi: Document it. >> --- >> =C2=A0doc/guix.texi=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 | 27 +++++++++++++++++++++++++++ >> =C2=A0gnu/services/sound.scm | 19 +++++++++++++++++-- >> =C2=A02 files changed, 44 insertions(+), 2 deletions(-) >>=20 >> diff --git a/doc/guix.texi b/doc/guix.texi >> index a002670030..2f8df03461 100644 >> --- a/doc/guix.texi >> +++ b/doc/guix.texi >> @@ -21393,9 +21393,36 @@ List of settings to set in >> @file{daemon.conf}, formatted just like >> =C2=A0@item @code{script-file} (default: @code{(file-append pulseaudio >> "/etc/pulse/default.pa")}) >> =C2=A0Script file to use as @file{default.pa}. >> =C2=A0 >> +@item @code{extra-script-files} (default: @code{'())}) >> +A list of file-like objects defining extra PulseAudio scripts to run >> at >> +the initialization of the @command{pulseaudio} daemon.=C2=A0 For a >> reference >> +of the available commands, refer to @command{man pulse-cli-syntax}. >> + >> =C2=A0@item @code{system-script-file} (default: @code{(file-append >> pulseaudio "/etc/pulse/system.pa")}) >> =C2=A0Script file to use as @file{system.pa}. >> =C2=A0@end table >> + >> +The example below sets the default PulseAudio card profile, the >> default >> +sink and the default source to use for a old SoundBlaster Audigy >> sound >> +card: >> +@lisp >> +(pulseaudio-configuration >> + (extra-script-files >> +=C2=A0 (list (plain-file "configure-audigy-card" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (string-append "\ >> +set-card-profile alsa_card.pci-0000_01_01.0 \ >> +=C2=A0 output:analog-surround-40+input:analog-mono >> +set-default-source alsa_input.pci-0000_01_01.0.analog-mono >> +set-default-sink alsa_output.pci-0000_01_01.0.analog-surround- >> 40\n"))))) >> +@end lisp >> + >> +Note that @code{pulseaudio-service-type} is part of >> +@code{%desktop-services}; if your operating system declaration was >> +derived from one of the desktop templates, you'll want to adjust the >> +above example to modify the existing @code{pulseaudio-service-type} >> via >> +@code{modify-services} (@pxref{Service Reference, >> +@code{modify-services}}), instead of defining a new one. >> + >> =C2=A0@end deftp >> =C2=A0 >> =C2=A0@deffn {Scheme Variable} ladspa-service-type >> diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm >> index 19eccfc860..f529188a7c 100644 >> --- a/gnu/services/sound.scm >> +++ b/gnu/services/sound.scm >> @@ -34,6 +34,7 @@ (define-module (gnu services sound) >> =C2=A0=C2=A0 #:use-module (gnu packages linux) >> =C2=A0=C2=A0 #:use-module (gnu packages pulseaudio) >> =C2=A0=C2=A0 #:use-module (ice-9 match) >> +=C2=A0 #:use-module (srfi srfi-1) >> =C2=A0=C2=A0 #:export (alsa-configuration >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= alsa-service-type >> =C2=A0 >> @@ -125,6 +126,8 @@ (define-record-type* >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (default '((flat-volumes . no)))) >> =C2=A0=C2=A0 (script-file pulseaudio-configuration-script-file >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (default (file-append pulseaudio >> "/etc/pulse/default.pa"))) >> +=C2=A0 (extra-script-files pulseaudio-configuration-extra-script-files >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (default '())) >> =C2=A0=C2=A0 (system-script-file pulseaudio-configuration-system-script-= file >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (default >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (f= ile-append pulseaudio >> "/etc/pulse/system.pa")))) >> @@ -145,14 +148,26 @@ (define pulseaudio-environment >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("PULSE_CLIENTCONFIG" . ,(app= ly mixed-text-file "client.conf" >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (map pulseaudio-conf-entry >> client-conf))))))) >> =C2=A0 >> +(define (extra-script-files->file-union extra-script-files) >> +=C2=A0 "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with >> FILE-UNION. >> +Each file is named \"snippet-n.pa\", where N is their 1-offset >> index." >> +=C2=A0 (let ((labels (map (lambda (n) (format #f "snippet-~a.pa" n)) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (iota (length extra-scr= ipt-files) 1)))) >> +=C2=A0=C2=A0=C2=A0 (file-union "default.pa.d" (zip labels extra-script-= files)))) >> + >> =C2=A0(define pulseaudio-etc >> =C2=A0=C2=A0 (match-lambda >> -=C2=A0=C2=A0=C2=A0 (($ _ _ default-script-fi= le system- >> script-file) >> +=C2=A0=C2=A0=C2=A0 (($ _ _ default-script-fi= le extra- >> script-files >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 system-script-= file) >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `(("pulse" >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,(file-union >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "pulse" >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `(("default= .pa" ,default-script-file) >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("sy= stem.pa" ,system-script-file)))))))) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ("sy= stem.pa" ,system-script-file) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ,@(i= f (null? extra-script-files) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 '() >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `(("default.pa.d" ,(extra-script-files->f= ile-union >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 extra-script-files))))))))))) >> =C2=A0 >> =C2=A0(define pulseaudio-service-type >> =C2=A0=C2=A0 (service-type > Is there a particular use-case for this (other than working around the > location issue of default.pa et al.)? If not, I'd rather make it s.t. > our other files can more easily be stitched together in-place. You mean, a use case for extra-script-files? Sorry, I missed something in the "make it s.t. our other [...]"; what does "s.t." stands for? My use case is the one I documented in the manual; setting a default card profile for example. Also choosing the default sink and source of a card; this can be done in client.conf but that doesn't get reflected anywhere on the state of a running pulseaudio server it seems, contrary to calling 'set-default-sink ...', which takes effect server-side. > Also, assuming that we're using file-like objects here, I think we > should use the store name minus prefix and hash for the file name.=20 > E.g. if Alice adds soundblaster.pa, it'd make sense to label it > soundblaster.pa, so that changes to snippet order don't mess up any > configuration referring to those files. I actually wanted to do that but decided against since there's no clean API to retrieve the name of a G-Exp file-like object (it could be done, currently, but it'd be messy and fragile, it seems). But good observation, I wanted to document that the extra script files are loaded in the order they are listed. Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 16:27:03 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 21:27:03 +0000 Received: from localhost ([127.0.0.1]:44324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nF0g3-0003bN-Et for submit@debbugs.gnu.org; Tue, 01 Feb 2022 16:27:03 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:45735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nF0g1-0003as-9c for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 16:27:01 -0500 Received: by mail-ed1-f67.google.com with SMTP id p7so37119287edc.12 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 13:27:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=04UCdhxGtzBFYZQYfxevrUSEV45PvP6yBp5ZTemE89Q=; b=B9ektJFv4PauC9qzq37iFTFqSREOv/5F6dyDN9IhNg71XgoMRL9u0gDAvisyqEIFqG 6wlfDKvHoRGWwOe7w4xUzXBWvoEJYi3QmgglfM2C//EJXUhBNM7aE4C7XlGRqZE8Y2Hp GzAMUfFGnzKSGUNzrWaUUi6RQRz7FJWbclfSv4PZKylInFB37M6SKTx5dQe0EixP1wSB 1gmuU17OBwUcH1ZvR1IPcYKDzf4fkGfX0G5ACeJDrFYz9KneEReNgVHa4bu/bBPYlMIr SPBZE22p57DKFLBmOT4sfADKs5ayXTF+9R4cTMNYqlsmeq1b+qwI7Fv8uyNjk2QW8v7B 38mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=04UCdhxGtzBFYZQYfxevrUSEV45PvP6yBp5ZTemE89Q=; b=2Zv0VMhH+I0T71DyS9EjNjY2u1rNVKk6T0QPOo5N+w0a/OC7g7VvSP/Zkx3CnqN7fP x2ADpM6Kfm16yA+Fmz4MF8fU21vy2GyY1spY5KWKuC/voE8LcKP16mbO8fI7UD6QhHWo 6izUAaaYwO/ZlEXbMkXXkI1L2crQU9JkUjyuLpZXF6frUZexq6TpN6RA4c0L/j44z//8 L+8Ed10W9/QWyvZYs7CWupzlz2q1iTBdxuxfzehpxNzedDI+WHa/KuS5sfPYgl223nYS WEAObt81jvhhEUJunMFnN4klDbNbmO1ACACEZdys4lKDuoIEHQZp8oDr1L6UhlUIYf9q 6S7A== X-Gm-Message-State: AOAM531k2hTWbQ0m+qQKwqd2Wcad0xMc43f56cm//dKlce5jz6w/c78F dUe4on1o+s1G83Y7LNXuyM0= X-Google-Smtp-Source: ABdhPJz5hoCxEtLyv0otc1USoy9TgwXP/uPhwzucIL2p5a4YCLgqxP3srLUm1vEcv3uRTq8Hoospuw== X-Received: by 2002:a05:6402:125a:: with SMTP id l26mr5799197edw.455.1643750815360; Tue, 01 Feb 2022 13:26:55 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id n25sm13506358ejx.92.2022.02.01.13.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 13:26:54 -0800 (PST) Message-ID: <3c9845d7b893dddcd44be41d2ee475c29d9f5a85.camel@gmail.com> Subject: Re: [PATCH 4/5] services: pulseaudio: Add an extra-script-files configuration field. From: Liliana Marie Prikler To: Maxim Cournoyer Date: Tue, 01 Feb 2022 22:26:54 +0100 In-Reply-To: <871r0m1gdy.fsf@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-4-maxim.cournoyer@gmail.com> <97111754acacc576aec4eb55889a32474fe71f95.camel@gmail.com> <871r0m1gdy.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, Am Dienstag, dem 01.02.2022 um 15:27 -0500 schrieb Maxim Cournoyer: > [...] > > Is there a particular use-case for this (other than working around > > the location issue of default.pa et al.)?  If no [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, https://senderscore.org/blocklistlookup/ [209.85.208.67 listed in bl.score.senderscore.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liliana.prikler[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.67 listed in wl.mailspike.net] X-Debbugs-Envelope-To: 53676 Cc: 53676@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: 0.3 (/) Hi, Am Dienstag, dem 01.02.2022 um 15:27 -0500 schrieb Maxim Cournoyer: > [...] > > Is there a particular use-case for this (other than working around > > the location issue of default.pa et al.)?  If not, I'd rather make > > it s.t. our other files can more easily be stitched together in- > > place. > > You mean, a use case for extra-script-files?   Yes. > Sorry, I missed something in the "make it s.t. our other [...]"; what > does "s.t." stands for? "such that" or "so that". Pretty common among mathematicians, I think 🙃 > My use case is the one I documented in the manual; setting a default > card profile for example.  Also choosing the default sink and source > of a card; this can be done in client.conf but that doesn't get > reflected anywhere on the state of a running pulseaudio server it > seems, contrary to calling 'set-default-sink ...', which takes effect > server-side. And you can't do this inside default.pa, because ... ? > > Also, assuming that we're using file-like objects here, I think we > > should use the store name minus prefix and hash for the file name. > > E.g. if Alice adds soundblaster.pa, it'd make sense to label it > > soundblaster.pa, so that changes to snippet order don't mess up any > > configuration referring to those files. > > I actually wanted to do that but decided against since there's no > clean API to retrieve the name of a G-Exp file-like object (it could > be done, currently, but it'd be messy and fragile, it seems). > > But good observation, I wanted to document that the extra script > files are loaded in the order they are listed. Isn't that what "strip-store-file-name" from (guix build utils) does? (Let's ignore hard-coded hash length...) Cheers From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 16:29:17 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 21:29:17 +0000 Received: from localhost ([127.0.0.1]:44328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nF0iC-0003en-TW for submit@debbugs.gnu.org; Tue, 01 Feb 2022 16:29:17 -0500 Received: from mail-ej1-f65.google.com ([209.85.218.65]:35541) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nF0iA-0003eZ-Ls for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 16:29:15 -0500 Received: by mail-ej1-f65.google.com with SMTP id s5so58060907ejx.2 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 13:29:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=bi3A4v37+i3IwhS6qR7sDsCYV22+D/bZDWR0wlp61hs=; b=OvhRcTmwQh+ctUpYUylGd1nv/H3Xy+nFJk9Vo1vnB6CHp3xVe3lkkUwgMhLpfSLB65 HTgywlqOXEVE90QF9/DnK5K8NbenlobYupmMWnawN6Lq1X4Ze9t033G1ynNcEnaDrfJc JDQDaRqFR7XF91ObZHM/Mf8HeP9pAjurZhhcz9RJDHqLq7Z1eFKPoK3bIt8poyd1CtYj CJNa9Zs94F5YCL1eJiXsmwX6rSjgnu9eB3VXTmGmfOHcF8JR6AmF9Hu70oOhdwrRBIfQ YyoCX0ASNO6JYyEWn+CBnLkCbDTHq61GiDuE18QCEolOdNfNXsaxbG0B9A7vL/VEUPXc NKTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=bi3A4v37+i3IwhS6qR7sDsCYV22+D/bZDWR0wlp61hs=; b=iLdSDVBw8ID1g0COg4qykaL0yLouLO6G9pvQsiJYm656Kkggw17poODAG46KIs2OA8 0C72LbQ36ZBIc/W+rCF7linkQebIuEAVW/7rYsO/goALkUBJolDo/7x94xxvi4TO3GqF UEJRZ25AOQcXX+MwnO/OG5ho16lJ408lokMdnsI6UOdYW2DGTMCGHoLoNY4yZ8ZrNm3A TyyAamXcc4L/RUiY0wi4LS8MhhMyuRSj1ozWtv0Mi4FoSFHEkc8zSCQ8eSD0llc7vLo0 CYHAmxwXNm3qFO7FZGMH7PpC/iXCmsoqALuSJmdZ/CPRElNMwLcZFpNxG6asujYOyO2M RTnA== X-Gm-Message-State: AOAM532Qq65XiWkQabDWzFOEnCN6fvculrMuQuZIspn9eGSRwUq5wZ1d NGquPBx3RRmjtdW2EQGNCLM= X-Google-Smtp-Source: ABdhPJxeZaW7+5THllJQRRr2iolwAPIRy16Zc0IgNWpCOEbx3zMzkLItx4/Jk6YPn59arDRgKYOpdg== X-Received: by 2002:a17:907:60cf:: with SMTP id hv15mr22045392ejc.488.1643750948849; Tue, 01 Feb 2022 13:29:08 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id w26sm19914117edq.81.2022.02.01.13.29.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 13:29:08 -0800 (PST) Message-ID: <27f1c3b8340aca5c42245a8399a2da10e84cbb69.camel@gmail.com> Subject: Re: [PATCH 2/5] services/sound: Normalize pulseaudio-configuration accessor names. From: Liliana Marie Prikler To: Maxim Cournoyer Date: Tue, 01 Feb 2022 22:29:07 +0100 In-Reply-To: <87a6fa1gtl.fsf@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-2-maxim.cournoyer@gmail.com> <9dfb26ef7c3e30baf1eba3334c2b9b5c593be76d.camel@gmail.com> <87a6fa1gtl.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Am Dienstag, dem 01.02.2022 um 15:18 -0500 schrieb Maxim Cournoyer: > Hi Liliana, > > Liliana Marie Prikler writes: > > > Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: > > > > > [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, https://senderscore.org/blocklistlookup/ [209.85.218.65 listed in bl.score.senderscore.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liliana.prikler[at]gmail.com) 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.218.65 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 53676 Cc: 53676@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: 0.3 (/) Am Dienstag, dem 01.02.2022 um 15:18 -0500 schrieb Maxim Cournoyer: > Hi Liliana, > > Liliana Marie Prikler writes: > > > Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: > > > > > * gnu/services/sound.scm (): Adjust > > > getter > > > names to match convention. > > > --- > > >  gnu/services/sound.scm | 9 +++++---- > > >  1 file changed, 5 insertions(+), 4 deletions(-) > > > > > > diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm > > > index 7beca35ffe..19eccfc860 100644 > > > --- a/gnu/services/sound.scm > > > +++ b/gnu/services/sound.scm > > > @@ -2,6 +2,7 @@ > > >  ;;; Copyright © 2018, 2020 Oleg Pykhalov > > >  ;;; Copyright © 2020 Liliana Marie Prikler > > > > > >  ;;; Copyright © 2020 Marius Bakke > > > +;;; Copyright © 2022 Maxim Cournoyer > > >  ;;; > > >  ;;; This file is part of GNU Guix. > > >  ;;; > > > @@ -115,16 +116,16 @@ (define alsa-service-type > > >  (define-record-type* > > >    pulseaudio-configuration make-pulseaudio-configuration > > >    pulseaudio-configuration? > > > -  (client-conf pulseaudio-client-conf > > > +  (client-conf pulseaudio-configuration-client-conf > > >                 (default '())) > > > -  (daemon-conf pulseaudio-daemon-conf > > > +  (daemon-conf pulseaudio-configuration-daemon-conf > > >                 ;; Flat volumes may cause unpleasant experiences > > > to > > > users > > >                 ;; when applications inadvertently max out the > > > system > > > volume > > >                 ;; (see e.g. ). > > >                 (default '((flat-volumes . no)))) > > > -  (script-file pulseaudio-script-file > > > +  (script-file pulseaudio-configuration-script-file > > >                 (default (file-append pulseaudio > > > "/etc/pulse/default.pa"))) > > > -  (system-script-file pulseaudio-system-script-file > > > +  (system-script-file pulseaudio-configuration-system-script- > > > file > > >                        (default > > >                          (file-append pulseaudio > > > "/etc/pulse/system.pa")))) > > I don't see calling code adjusted anywhere.  Is this because we > > only use match to access this records fields? > > The bindings are not public, so they shouldn't be used elsewhere; > internally only match seems to be used yes. Good. > > On a related note, would it make sense to port this over to > > (define-configuration)? > > Agreed.  I'd prefer to keep this effort separate from this series > though.  Also, I still want to take some time to review the newly > introduced Guix records sanitizers; I feel they should perhaps be > leveraged in define-configuration (part of the appeal of > define-configuration is serialization, the other part being input > validation, which is what sanitizers seem to be designed for). Fair enough. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 16:37:30 2022 Received: (at 53676) by debbugs.gnu.org; 1 Feb 2022 21:37:30 +0000 Received: from localhost ([127.0.0.1]:44332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nF0q9-0003sM-S2 for submit@debbugs.gnu.org; Tue, 01 Feb 2022 16:37:30 -0500 Received: from mail-ej1-f68.google.com ([209.85.218.68]:43934) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nF0q8-0003s6-0Z for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 16:37:28 -0500 Received: by mail-ej1-f68.google.com with SMTP id d10so58383491eje.10 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 13:37:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=9+eQp0fKQ+n4QJqqmLINcnWxuswYuvgpK58bBpKTx5w=; b=US5peQ5KGRkwq9HZ7ZEGSNSyfrzxnTUtHGRfuqUeld6hCRPz228F8OFs+xukNkjEpK 8Nu9aK2V9r66Ju/VjXYQRMUsZnX4rMyupfjcJEMu8G4bqPBLkhVre6bCaskmaNusa81o 6fLqmeUIILNgRFcV5iEKTPwcXCDRs4zaHh2YYBBwGprMlX6ZR5TC70Nki727XkqIAg/m Ce5CzEuhhEd7IrRpmwKsE2jyV383cnoN9NBHe/6Oc8/k2GTywj0/YhrvItvnnA5JLGrL nsFiMh9iDjcR1wcLxHOG3RR3Cw4DzW+WZrUwiaCu/GNnZLz6yWbNNCWr2SbYmgpVLNFv TjbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=9+eQp0fKQ+n4QJqqmLINcnWxuswYuvgpK58bBpKTx5w=; b=LvESW7Um2RvHcquNTMiQTWV+3uXPJBoGWcCbJS7dTrRztfMN3e5I4Ut5aOq6LA7UsL 2gV7uAskWUTGF2Lf8R+idmp4NMInZDso8S7lVsHpebcBDI0xKB3Xniz9ANsDdrGgYFmY EI1FmD4ofBlCM+CFBOlMk8igAwi/PbvRY0eGRedSSoV5+mEk4qAO2K0HEbBxgVTU6JQV hFpGNkEMXYcsTxhcBmfu8sBHvi3DabUkLpwrNH5b8F9CIzzeTbiylP4rEkgK9saWhclM VGwoP87HRwhHsN2MeP/r4C4HJsSrTFnrcINZeAiDfM4fjXV2ARTtTFkPp81ULivxOmuP W9nQ== X-Gm-Message-State: AOAM530WwooO8JNHW0ijsmMhEcW/fWBBbLIrK5cSegE6z5QNiX0tktgF Z1nrujd5Rblz5OPzb+7KYkI= X-Google-Smtp-Source: ABdhPJzTmLyI7+OnnXlwE5mZFN0/jACZfp8+a+gj5Qw7MvTd/ebD9lNDYv8xrI3MCxd9SC9eUIN8AQ== X-Received: by 2002:a17:906:3cd:: with SMTP id c13mr22738584eja.720.1643751442175; Tue, 01 Feb 2022 13:37:22 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id by22sm14979509ejb.5.2022.02.01.13.37.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 13:37:21 -0800 (PST) Message-ID: Subject: Re: [PATCH 3/5] gnu: pulseaudio: Graft to adjust configuration. From: Liliana Marie Prikler To: Maxim Cournoyer Date: Tue, 01 Feb 2022 22:37:20 +0100 In-Reply-To: <875ypy1gqd.fsf@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-3-maxim.cournoyer@gmail.com> <693cc82d449395853247c7fbf1b44d0a3c979c87.camel@gmail.com> <875ypy1gqd.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Am Dienstag, dem 01.02.2022 um 15:20 -0500 schrieb Maxim Cournoyer: > Hi Liliana, > > Liliana Marie Prikler writes: > > > Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: > > > * gnu/packages/pulseaudio.scm (pulseaudio/fixed): New variable. > > > (pulseaudio)[replacement]: Graft package with it. > > > --- > > >  gnu/packages/pulseaudio.scm | 18 ++++++++++++++++++ > > >  1 file changed, 18 insertions(+) > > > > > > diff --git a/gnu/packages/pulseaudio.scm > > > b/gnu/packages/pulseaudio.scm > > > index fe028b5202..f529717ee1 100644 > > > --- a/gnu/packages/pulseaudio.scm > > > +++ b/gnu/packages/pulseaudio.scm > > > @@ -178,6 +178,7 @@ (define-public libsamplerate > > >  (define-public pulseaudio > > >    (package > > >      (name "pulseaudio") > > > +    (replacement pulseaudio/fixed) > > >      (version "15.0") > > >      (source (origin > > >               (method url-fetch) > > > @@ -269,6 +270,23 @@ (define-public pulseaudio > > >      ;; 'LICENSE' for details. > > >      (license l:gpl2+))) > > >   > > > +(define pulseaudio/fixed > > > +  (package > > > +    (inherit pulseaudio) > > > +    (arguments > > > +     (substitute-keyword-arguments (package-arguments > > > pulseaudio) > > > +       ((#:phases phases) > > > +        `(modify-phases ,phases > > > +           (add-after 'unpack 'customize-default-script > > > +             (lambda _ > > > +               (call-with-port > > > +                (open-file "src/daemon/default.pa.in" "a") > > > +                (lambda (port) > > > +                  (format port "~%\ > > > +### Include extra script files configured via the pulseaudio- > > > service-type. > > > +.nofail > > > +.include /etc/pulse/default.pa.d~%"))))))))))) > > > + > > Note that there should be a .fail afterwards.   > > Hmm.  I simply duplicated the existing two lines used by PulseAudio > itself.  I believe they do not care because it appears completely at > the end of the file. I think we would need to care though, because one could write a gexp that appends to default.pa, but then has unclear semantics. > > As Leo pointed out, we shouldn't do too many "feature grafts", so > > instead it might be worth moving this part to pulseaudio-service- > > type in some way, no? > > I'd prefer to keep it like this, for simplicity; we need to rebuild > the world soon anyway to fix a Rust CVE, so we can batch things > easily. Can you define "simplicity" here? In my opinion, services/stuff.scm or /etc/config.scm provide an easier point of change/extension than packages do -- particularly also because pulseaudio-service-type (even with this patch set) does not allow changing the pulseaudio package. For the record, if you're wondering why pulseaudio-service-type doesn't have a configuration knob for adding the pulseaudio package: pulseaudio is currently managed per user session through dbus, not shepherd. It'd be nice to have systemd-levels of control over user services, but we're not there yet. Cheers From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 22:44:20 2022 Received: (at 53676) by debbugs.gnu.org; 2 Feb 2022 03:44:20 +0000 Received: from localhost ([127.0.0.1]:51107 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nF6ZA-0000Gw-0H for submit@debbugs.gnu.org; Tue, 01 Feb 2022 22:44:20 -0500 Received: from mail-qt1-f179.google.com ([209.85.160.179]:33769) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nF6Z8-0000GW-Os for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 22:44:19 -0500 Received: by mail-qt1-f179.google.com with SMTP id i4so16386936qtr.0 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 19:44:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=f8QSU8giIps1u8DYdATkmd8QFzLmh9+/1m8W1xi778A=; b=jKs+Bk+vM188qW0+eCbEeiA6KoQ7jSVwWEHbA4dMlJtXKporIDvZL3pJmwGRRuIVKE A9lBnqhJLLCK0pz4/j4wzMSfECMI3NzmDOlCvD2d9k0bKuBi7p+WT4ZXwDisltL+MjWL J4mhsa4zi2XULoietJbxYgLGmk835ulYTqKDnOk4DCqGQvmyErYPm5IoXVn2a1MjERfK SUIGGgFOQC7RGNrV/HUhO5MCvEs41G96lewfbzmjyPa1x9ezPljXzw7vf5TYwJc0tcun viPwqSRnMNPxCPTDTNHD7hWQyUl+PeliCV5Zi/Wt6cM//lZwckVRnWjZwIR41VdmYX5C r4BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=f8QSU8giIps1u8DYdATkmd8QFzLmh9+/1m8W1xi778A=; b=KKfLHZoEvX3gsjq1RCybrXTNf+kzJ0rfWO4w/rhIDr6v56XqmqVofShrzp+3ASVCtl qd4jmHIvQVDBglq6SNnsMidnTdLCbwQA7tf9lFKSWNsXn07MQ2017zDh22QCvIDTPI0c Rqs3PwQ9htZmaiLLjy9QeBnBJMj8MCGz375YZ2w8ndlXFlET6923uJYvPMLhIXn+TRlO mfffPN/lmlo6p36W4Rzh4gr4hUyureCxAbHUe7yCKcqhl+wsOeSVpYYQR9+ctqcw40WH wVhr5MYqom8zGKSwbfVrzZTeCoCgqJcnazgCnISDVLiAs/AgVlVnFrg+77dBlJyVnPFh QcNw== X-Gm-Message-State: AOAM532zS6+7d9olKNetw9mzgH7wwSGoZSWzEj73axjtgnwjqIbPLqXe aR96XrrYuIvRGV9/+WGdiUpri21B0BE= X-Google-Smtp-Source: ABdhPJyjkOQlpDeZdtCleJpmUFTzfNrMUeAoMJWkOFrbXhdczLghrNOiDoMYTfnH7SQ4RPjfb8V5fA== X-Received: by 2002:a05:622a:1cc7:: with SMTP id bc7mr21509597qtb.418.1643773452859; Tue, 01 Feb 2022 19:44:12 -0800 (PST) Received: from hurd (dsl-149-193.b2b2c.ca. [66.158.149.193]) by smtp.gmail.com with ESMTPSA id o13sm4537171qtx.22.2022.02.01.19.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 19:44:12 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: [PATCH 4/5] services: pulseaudio: Add an extra-script-files configuration field. References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-4-maxim.cournoyer@gmail.com> <97111754acacc576aec4eb55889a32474fe71f95.camel@gmail.com> <871r0m1gdy.fsf@gmail.com> <3c9845d7b893dddcd44be41d2ee475c29d9f5a85.camel@gmail.com> Date: Tue, 01 Feb 2022 22:44:11 -0500 In-Reply-To: <3c9845d7b893dddcd44be41d2ee475c29d9f5a85.camel@gmail.com> (Liliana Marie Prikler's message of "Tue, 01 Feb 2022 22:26:54 +0100") Message-ID: <87o83qyltg.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hello, Liliana Marie Prikler writes: > Hi, > > Am Dienstag, dem 01.02.2022 um 15:27 -0500 schrieb Maxim Cournoyer: >> [...] >> > Is there a particular use-case for this (other than working around >> > the location issue of default.pa et al.)?=C2=A0 If not, I'd rather make >> > it s.t. our other files can more easily be stitched together in- >> > place. >>=20 >> You mean, a use case for extra-script-files?=C2=A0=C2=A0 > Yes. > >> Sorry, I missed something in the "make it s.t. our other [...]"; what >> does "s.t." stands for? > "such that" or "so that". Pretty common among mathematicians, I think > =F0=9F=99=83 Ah! >> My use case is the one I documented in the manual; setting a default >> card profile for example.=C2=A0 Also choosing the default sink and source >> of a card; this can be done in client.conf but that doesn't get >> reflected anywhere on the state of a running pulseaudio server it >> seems, contrary to calling 'set-default-sink ...', which takes effect >> server-side. > And you can't do this inside default.pa, because ... ? I could; but what I want is to *extend*, rather than *replace* the default.pa script; the native PulseAudio mechanism to do so is to put files under '/etc/default.pa.d'. We could simply tell people to use extra-special-file service to achieve that, but that's less discoverable than having a convenient, documented field to do so :-). >> > Also, assuming that we're using file-like objects here, I think we >> > should use the store name minus prefix and hash for the file name.=20 >> > E.g. if Alice adds soundblaster.pa, it'd make sense to label it >> > soundblaster.pa, so that changes to snippet order don't mess up any >> > configuration referring to those files. >>=20 >> I actually wanted to do that but decided against since there's no >> clean API to retrieve the name of a G-Exp file-like object (it could >> be done, currently, but it'd be messy and fragile, it seems). >>=20 >> But good observation, I wanted to document that the extra script >> files are loaded in the order they are listed. > Isn't that what "strip-store-file-name" from (guix build utils) does? > (Let's ignore hard-coded hash length...) 'strip-store-file-name' would be able to get the name from the store item (built derivation), but file-union takes a "two-element list where the first element is the file name to use in the new directory, and the second element is a gexp denoting the target file", e.g., before the file-like object is built. I don't see an easy way to make it work. Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 23:30:45 2022 Received: (at 53676) by debbugs.gnu.org; 2 Feb 2022 04:30:45 +0000 Received: from localhost ([127.0.0.1]:51166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nF7I4-0001jh-GO for submit@debbugs.gnu.org; Tue, 01 Feb 2022 23:30:44 -0500 Received: from mail-qk1-f169.google.com ([209.85.222.169]:34722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nF7I3-0001jR-E8 for 53676@debbugs.gnu.org; Tue, 01 Feb 2022 23:30:43 -0500 Received: by mail-qk1-f169.google.com with SMTP id bs32so5756045qkb.1 for <53676@debbugs.gnu.org>; Tue, 01 Feb 2022 20:30:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=C++qHmXcydU27r7P+cGpypG1Vjp7HeRU/8/FWAYWS7A=; b=YXN/l1mHmF8NU702OY1QXjAqAg1nqqmY9/fBAglu66qwP8nX4dpKTzWip8600ITgcX 9j/ITOD3gaVvwWfwJpVXxaOyiZSLU0/5AWKw/zYKq+d2da/ucbm072ItZIsTzzis7ZHJ 9zW42trd1CwxcO7lVMhZI3t+QaGVYMnRiqSnjWkMIehwYnmrA1+NNvqmhJXcMPGFoSaE xGeofFavDpGu0+/ZwiLAcBJ8NWBzD2t+y90vItDHl540kYUdabGhR0UtMINKpipITBWT Ww1lHy1RW8sK+3na9a/nISbQB2RwgnLKvUioInMI8cZ/iRqXmXEzsvIFe/vXcCbE0hP/ GW7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=C++qHmXcydU27r7P+cGpypG1Vjp7HeRU/8/FWAYWS7A=; b=funsgYAWPtDqzYC/1zeqM76hTGvQEw85kRd3CJ/V361a+FZIbhHsxChFKmSjnMK++n r922NH8/PrVaqdCYI0B1XqQykiYl3G+bX3ZR+yXKZE77epjaEMxdbKg98wyTXxA5Pep1 AZlvS55PGaA8CgpzzGIVzt/o2E6HMdrV16qYYfjvcr9C/3GdPCl+Hw2uk5mIUu6hkmhe wmzcrKlngDg+hx+JXcR8ARPhnqIqXfgiV7GZnYNoyr/b45j34bZkl5tmFephuhF7gR9G CNccCU/9IW44UsNnc++1Rc2msUsPWeAjNMx8wM8MrsaOQ6VYuqJwM/rdPNZ7GLS8sqOw VFyg== X-Gm-Message-State: AOAM531IdcLNVtnqE18/GLkv4wCuU1Pg5Yv7Bp3QCoBC9Lrlpir7LE4k hdtzesGY/CaEQmWWD+QbH78MJYsZVQk= X-Google-Smtp-Source: ABdhPJyJr1vB7s9VJOBSir+USvW0H1j7hIfj1zbcwP6nviAHPTsUd0PllB/qbVmlBGMey6SyYnWk4w== X-Received: by 2002:a37:a8c1:: with SMTP id r184mr19251877qke.722.1643776237682; Tue, 01 Feb 2022 20:30:37 -0800 (PST) Received: from hurd (dsl-149-193.b2b2c.ca. [66.158.149.193]) by smtp.gmail.com with ESMTPSA id w3sm11914525qta.13.2022.02.01.20.30.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 20:30:37 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: [PATCH 3/5] gnu: pulseaudio: Graft to adjust configuration. References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-3-maxim.cournoyer@gmail.com> <693cc82d449395853247c7fbf1b44d0a3c979c87.camel@gmail.com> <875ypy1gqd.fsf@gmail.com> Date: Tue, 01 Feb 2022 23:30:36 -0500 In-Reply-To: (Liliana Marie Prikler's message of "Tue, 01 Feb 2022 22:37:20 +0100") Message-ID: <87k0edzy8j.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hello again, Liliana Marie Prikler writes: > Am Dienstag, dem 01.02.2022 um 15:20 -0500 schrieb Maxim Cournoyer: >> Hi Liliana, >>=20 >> Liliana Marie Prikler writes: >>=20 >> > Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: >> > > * gnu/packages/pulseaudio.scm (pulseaudio/fixed): New variable. >> > > (pulseaudio)[replacement]: Graft package with it. >> > > --- >> > > =C2=A0gnu/packages/pulseaudio.scm | 18 ++++++++++++++++++ >> > > =C2=A01 file changed, 18 insertions(+) >> > >=20 >> > > diff --git a/gnu/packages/pulseaudio.scm >> > > b/gnu/packages/pulseaudio.scm >> > > index fe028b5202..f529717ee1 100644 >> > > --- a/gnu/packages/pulseaudio.scm >> > > +++ b/gnu/packages/pulseaudio.scm >> > > @@ -178,6 +178,7 @@ (define-public libsamplerate >> > > =C2=A0(define-public pulseaudio >> > > =C2=A0=C2=A0 (package >> > > =C2=A0=C2=A0=C2=A0=C2=A0 (name "pulseaudio") >> > > +=C2=A0=C2=A0=C2=A0 (replacement pulseaudio/fixed) >> > > =C2=A0=C2=A0=C2=A0=C2=A0 (version "15.0") >> > > =C2=A0=C2=A0=C2=A0=C2=A0 (source (origin >> > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (method url-fetch) >> > > @@ -269,6 +270,23 @@ (define-public pulseaudio >> > > =C2=A0=C2=A0=C2=A0=C2=A0 ;; 'LICENSE' for details. >> > > =C2=A0=C2=A0=C2=A0=C2=A0 (license l:gpl2+))) >> > > =C2=A0 >> > > +(define pulseaudio/fixed >> > > +=C2=A0 (package >> > > +=C2=A0=C2=A0=C2=A0 (inherit pulseaudio) >> > > +=C2=A0=C2=A0=C2=A0 (arguments >> > > +=C2=A0=C2=A0=C2=A0=C2=A0 (substitute-keyword-arguments (package-arg= uments >> > > pulseaudio) >> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((#:phases phases) >> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `(modify-phases ,phases >> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (add-a= fter 'unpack 'customize-default-script >> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 (lambda _ >> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 (call-with-port >> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (open-file "src/daemon/default.pa.in" "a") >> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 (lambda (port) >> > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (format port "~%\ >> > > +### Include extra script files configured via the pulseaudio- >> > > service-type. >> > > +.nofail >> > > +.include /etc/pulse/default.pa.d~%"))))))))))) >> > > + >> > Note that there should be a .fail afterwards. =C2=A0 >>=20 >> Hmm.=C2=A0 I simply duplicated the existing two lines used by PulseAudio >> itself.=C2=A0 I believe they do not care because it appears completely at >> the end of the file. > I think we would need to care though, because one could write a gexp > that appends to default.pa, but then has unclear semantics. If someone was to append something to default.pa (the exact one shipped with PulseAudio), they'd have to add the .fail themselves to undo PulseAudio's own .nofail, right? I don't see why we should go out of our way to change that. With the proposed 'extra-script-files', I'd argue that appending something to default.pa should be considered an anti-pattern; as the new field would be the more natural option to *extend* 'default.pa' (and having a field to override default.pa is still useful if you don't like any of the default behavior). >> > As Leo pointed out, we shouldn't do too many "feature grafts", so >> > instead it might be worth moving this part to pulseaudio-service- >> > type in some way, no? >>=20 >> I'd prefer to keep it like this, for simplicity; we need to rebuild >> the world soon anyway to fix a Rust CVE, so we can batch things >> easily. > Can you define "simplicity" here? In my opinion, services/stuff.scm or > /etc/config.scm provide an easier point of change/extension than > packages do -- particularly also because pulseaudio-service-type (even > with this patch set) does not allow changing the pulseaudio package. The default behavior of default.pa is to allow loading extra files from from 'pulsesysconfdir', which in our case corresponds to output/etc of pulseaudio; e.g.: --8<---------------cut here---------------start------------->8--- ### Allow including a default.pa.d directory, which if present, can be used ### for additional configuration snippets. .nofail .include /gnu/store/7xwgz4bavb1i8sfx1lm55hlrr3ngjkdx-pulseaudio-15.0/etc/pu= lse/default.pa.d --8<---------------cut here---------------end--------------->8--- That's not very useful, but is preserved in case pulseaudio ever decides to drop their own scripts in there. Adjusting this path is more natural and straightforwardly done from the package description than from the service, in my opinion. Does that make sense? Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 02 15:07:38 2022 Received: (at 53676) by debbugs.gnu.org; 2 Feb 2022 20:07:38 +0000 Received: from localhost ([127.0.0.1]:53756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFLuk-0000Sa-B9 for submit@debbugs.gnu.org; Wed, 02 Feb 2022 15:07:38 -0500 Received: from mail-ej1-f66.google.com ([209.85.218.66]:34425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFLui-0000SK-7M for 53676@debbugs.gnu.org; Wed, 02 Feb 2022 15:07:37 -0500 Received: by mail-ej1-f66.google.com with SMTP id h7so887908ejf.1 for <53676@debbugs.gnu.org>; Wed, 02 Feb 2022 12:07:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=Luz3gnhXjlCTznw08IIncyG7khYQzTXuhktzrNlTvZk=; b=acgUusqTa6HS+LsJZW7dd1lODQKUx/zDXmQihjyRuvzpgyFpvo4hNBfR0JBjaVeb2g Fu3NUyKe+tfNbqhVNFT2BhPmAC2wUWVXkcTAZiIxt/WfB17m9AX5HFa+rQVqcp6MbJCP WsKmTzbgLKoUj3CsNNfLUEVq5Q50PtS6tOOnXU53Xg97EzxSWeZ1YX9GlP8SXnhntjAL 1iLf+4Kcxj1uLpFDcbEVU+bTqIvVm1eKdZ77cRzjl5tGISj9KG05iybnWLiksOjgV82t J6ysjS2i+6jAtQUVExDJVfHNIruf+Y54EewxOu8Yk3i3PZ7PQuWZs80o95axc01RWq+r f4Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=Luz3gnhXjlCTznw08IIncyG7khYQzTXuhktzrNlTvZk=; b=TC9VdMO/nRqFn4dr/ul8ekfrR9xyAw+5t2RTS+x5R9T/yovySJzx/KlVeLAPHx9jf5 OnqYh0UOPFkJaNsI7EYUumUPXwgQByMXS3yME5bDWG3sizvwugXqyNL4h4/RhCcIgiVc fTJOHqs4KMx+LlzY0q1CIY5FHvQpMN/q26AsJjCGsDdF1+CetBo66OnvBWZsOLj/xVFe uQ2R8Mh027DZl6MhTnBL/MisWK8qOayHW3Gc5HxzZb/QK5uo+l08MOaNJzvYSYNnZARQ 3GR++QLNm9x25BmAkaDlC9W0BqFeh75wJ8xcLTzwe8FyOt6pewuogJs+l2bHMZP8seVA K5Fg== X-Gm-Message-State: AOAM533DS+xYS86ssx6aFcUiqx9D/JwUHftS4se1adALfoTY0RaicL03 2q4GBqfJ04Q0jLfLb2V1Y2F3w5NBbOY= X-Google-Smtp-Source: ABdhPJwAwxqbM5sTMMZI+mqtJMpCe/0OCMEucI1+Emv9pRY6k0b8jaSBvM8JYUTNXVOThcTPPyIkNg== X-Received: by 2002:a17:907:2da2:: with SMTP id gt34mr27489475ejc.620.1643832449100; Wed, 02 Feb 2022 12:07:29 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id d17sm21519237ede.88.2022.02.02.12.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 12:07:28 -0800 (PST) Message-ID: <2b8017576ee2570fd38ab61729556e31694b2552.camel@gmail.com> Subject: Re: [PATCH 4/5] services: pulseaudio: Add an extra-script-files configuration field. From: Liliana Marie Prikler To: Maxim Cournoyer Date: Wed, 02 Feb 2022 21:07:27 +0100 In-Reply-To: <87o83qyltg.fsf@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-4-maxim.cournoyer@gmail.com> <97111754acacc576aec4eb55889a32474fe71f95.camel@gmail.com> <871r0m1gdy.fsf@gmail.com> <3c9845d7b893dddcd44be41d2ee475c29d9f5a85.camel@gmail.com> <87o83qyltg.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi, Am Dienstag, dem 01.02.2022 um 22:44 -0500 schrieb Maxim Cournoyer: > > > My use case is the one I documented in the manual; setting a > > > default > > > card profile for example.  Also choosing the default sink and > > > source > > > of a card; this can be done in client.conf but that doesn't get > > > reflected anywhere on the state of a running pulseaudio server it > > > seems, contrary to calling 'set-default-sink ...', which takes > > > effect > > > server-side. > > And you can't do this inside default.pa, because ... ? > > I could; but what I want is to *extend*, rather than *replace* the > default.pa script; the native PulseAudio mechanism to do so is to put > files under '/etc/default.pa.d'.  We could simply tell people to use > extra-special-file service to achieve that, but that's less > discoverable than having a convenient, documented field to do so :-). I still don't understand what the big difference would be when it comes to Guix. You can already split your configuration over several modules and include the bits you want, it doesn't particularly have to be the way pulseaudio hacks around the lack of such functionality in traditional distros. Again, I might be missing a use case in which pulseaudio's style makes more sense, but there appears little reason to create these directories simply for the sake of it. > > > > Also, assuming that we're using file-like objects here, I think > > > > we should use the store name minus prefix and hash for the file > > > > name. > > > > E.g. if Alice adds soundblaster.pa, it'd make sense to label it > > > > soundblaster.pa, so that changes to snippet order don't mess up > > > > any configuration referring to those files. > > > > > > I actually wanted to do that but decided against since there's no > > > clean API to retrieve the name of a G-Exp file-like object (it > > > could be done, currently, but it'd be messy and fragile, it > > > seems). > > > > > > But good observation, I wanted to document that the extra script > > > files are loaded in the order they are listed. > > Isn't that what "strip-store-file-name" from (guix build utils) > > does? > > (Let's ignore hard-coded hash length...) > > 'strip-store-file-name' would be able to get the name from the store > item (built derivation), but file-union takes a "two-element list > where the first element is the file name to use in the new directory, > and the second element is a gexp denoting the target file", e.g., > before the file-like object is built.  I don't see an easy way to > make it work. For the record, I do think we'd like to use file-like objects here, not raw gexps. If that fails, why not expose the name to gexp mapping completely? I don't know why you'd want to take away that control. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 02 15:43:25 2022 Received: (at 53676) by debbugs.gnu.org; 2 Feb 2022 20:43:25 +0000 Received: from localhost ([127.0.0.1]:53768 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFMTN-0001Mm-4T for submit@debbugs.gnu.org; Wed, 02 Feb 2022 15:43:25 -0500 Received: from mail-ej1-f68.google.com ([209.85.218.68]:36382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFMTK-0001MW-UQ for 53676@debbugs.gnu.org; Wed, 02 Feb 2022 15:43:24 -0500 Received: by mail-ej1-f68.google.com with SMTP id s13so1093949ejy.3 for <53676@debbugs.gnu.org>; Wed, 02 Feb 2022 12:43:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=hZ5ykrL6BjGj3jMJsYX+2edoph7uCiPjoFvHSyzwI8s=; b=EK/F/Fxr6wzZ5++SNpTS8BWKDeZOcOXYkVk6xW2HDJkvWunzodBq0TBTCqrrn901kY GW9h/DgwTUEV7gV3YMeOoJheDcyG8YF03NbfpBssFj9Oy/w9zrxgj5t7xt20YF+tvBOd /YnRzMTWwVqplHyFtcLP6Nc3Q+VkRAkkJHF6Q5FsNHDX1aDcNGP+BgBWeH0YHSyf1dW0 9ThR1Nu1g7FBr0hqtFUWIvf7vaRxdyyCCE6/Ftk2lG88tCN23y9M9Rrgmk8Eajgl50oe BH+Qg9uWNLhX6a/t7ix9MZTVEbZqNvCQstv99bS8g0VhWBPqHI4seU9M+wnUFR9513Vn uDUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=hZ5ykrL6BjGj3jMJsYX+2edoph7uCiPjoFvHSyzwI8s=; b=ty4SFm260MU0xsK56JpGLcHjfVriCsSZ9V9MJfPmvEIOmtq0ivd88VkghbNRkm/Ow2 xB4rIBnTJ8MUK+sMwBslLEpWudVktrcYdabmrtNQ2G4LG5fRh+DgY+RI5spjw9ckaAET VP2eu38GYw86dUKB40P1gijcz4ItZwBcyR53xW82QHq+sARqxRvhaQCIF9Td1vZC3u9P slVv2xf8MOCnrjKAGbcYkhlpclFZfS/dq45n582maU9IHnt0mrEzR40weU/hFEMuh2V+ 2n950JwDpSuw8tjhWha8nhhl6C+4VMy5VOReyvSUyLAgPdB81LNTPRwsLaTaJAU5I08Q XIUQ== X-Gm-Message-State: AOAM530F4zh4kI9rRKwsAyEF0ZmsRTriGjX6VFeXj/EmAf+egftmtzwI /juyfpi7JKa+kmZjMG2gGNs= X-Google-Smtp-Source: ABdhPJx42dyReH/WDYvEDkcN8MhpQfNLeIVDmFIjrxC3LO1SvC8Hxn9/FJ5J52MzJ9bTmR5Yxsk/tg== X-Received: by 2002:a17:906:1291:: with SMTP id k17mr26254198ejb.451.1643834596833; Wed, 02 Feb 2022 12:43:16 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id d25sm12464707eje.41.2022.02.02.12.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 12:43:16 -0800 (PST) Message-ID: <2ed5ef40ecc06c783af81de129a62d3c42d87fec.camel@gmail.com> Subject: Re: [PATCH 3/5] gnu: pulseaudio: Graft to adjust configuration. From: Liliana Marie Prikler To: Maxim Cournoyer Date: Wed, 02 Feb 2022 21:43:14 +0100 In-Reply-To: <87k0edzy8j.fsf@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-3-maxim.cournoyer@gmail.com> <693cc82d449395853247c7fbf1b44d0a3c979c87.camel@gmail.com> <875ypy1gqd.fsf@gmail.com> <87k0edzy8j.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi, Am Dienstag, dem 01.02.2022 um 23:30 -0500 schrieb Maxim Cournoyer: > If someone was to append something to default.pa (the exact one shipped > with PulseAudio), they'd have to add the .fail themselves to undo > PulseAudio's own .nofail, right?  I don't see why we should go out of > our way to change that. Didn't you add that .nofail on your own? If not, why include the directive? > With the proposed 'extra-script-files', I'd argue that appending > something to default.pa should be considered an anti-pattern; as the > new field would be the more natural option to *extend* 'default.pa' > (and having a field to override default.pa is still useful if you don't > like any of the default behavior). I don't think you're making a good case here. Why do you want appending to default.pa to be an anti-pattern? > > > > > Can you define "simplicity" here?  In my opinion, services/stuff.scm > > or > > /etc/config.scm provide an easier point of change/extension than > > packages do -- particularly also because pulseaudio-service-type > > (even with this patch set) does not allow changing the pulseaudio > > package. > > The default behavior of default.pa is to allow loading extra files from > 'pulsesysconfdir', which in our case corresponds to output/etc > of pulseaudio; e.g.: > > --8<---------------cut here---------------start------------->8--- > ### Allow including a default.pa.d directory, which if present, can be > used > ### for additional configuration snippets. > .nofail > .include /gnu/store/7xwgz4bavb1i8sfx1lm55hlrr3ngjkdx-pulseaudio- > 15.0/etc/pulse/default.pa.d > --8<---------------cut here---------------end--------------->8--- > > That's not very useful, but is preserved in case pulseaudio ever > decides to drop their own scripts in there.  Adjusting this path is > more natural and straightforwardly done from the package description > than from the service, in my opinion. Well, by Hyrum's Law we can be sure that someone inherited pulseaudio to put files into pulsesysconfdir. That aside, I think substitute* would be expressing your intent better here, because what you actually want is to match that line and then append an .include /etc/pulse/default.pa.d hardcoded. I still don't agree that that's a good idea, however. Particularly, it would lead to including files from an "old distro" that was infected with Guix when that probably wasn't asked for. If at all enabled, I'd prefer if pulseaudio-service-type magically inserted that snippet for configurations that add files to default.pa.d. Note also that default.pa.d has no history [1] in traditional distros, so it's a feature that likely won't be missed by anyone, at least not out of nostalgia. In addition, I'd be careful with claims towards our intent of including this snippet at all. As far as I know, it simply wasn't removed, which might just as well mean that it didn't break the build for anyone. Cheers [1] https://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/daemon/default.pa.in?h=v14.2#n175 From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 02 17:43:30 2022 Received: (at 53676) by debbugs.gnu.org; 2 Feb 2022 22:43:30 +0000 Received: from localhost ([127.0.0.1]:53887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFOLa-0004Zz-0Z for submit@debbugs.gnu.org; Wed, 02 Feb 2022 17:43:30 -0500 Received: from minsky.hcoop.net ([104.248.1.95]:49616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFOLW-0004Zi-ST for 53676@debbugs.gnu.org; Wed, 02 Feb 2022 17:43:28 -0500 Received: from marsh.hcoop.net ([45.55.52.66]) by minsky.hcoop.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nFOLR-000869-C4; Wed, 02 Feb 2022 17:43:21 -0500 Date: Wed, 2 Feb 2022 17:43:21 -0500 (EST) From: Jack Hill X-X-Sender: jackhill@marsh.hcoop.net To: Liliana Marie Prikler Subject: Re: [bug#53676] [PATCH 5/5] services: pulseaudio: Deploy the configuration files to /etc/pulse. In-Reply-To: Message-ID: References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-5-maxim.cournoyer@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="925712948-386449738-1643841801=:9433" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@debbugs.gnu.org, Maxim Cournoyer 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 message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --925712948-386449738-1643841801=:9433 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT On Tue, 1 Feb 2022, Liliana Marie Prikler wrote: > Hi, > > Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: >> * gnu/services/sound.scm (pulseaudio-environment) >> [PULSE_CONFIG, PULSE_CLIENTCONFIG]: Use fix locations, and move logic >> to... >> (pulseaudio-etc): ... this service extension.  Guard against producing >> empty files. > > This patch reproduces (more or less) the initial layout we had for > pulseaudio-service-type.  However, that layout has been reported to not > work with some sandboxes. I tried tracking down a specific bug, but > could only gather . > >> Due to a bug with webkit sandboxing, we no longer put daemon.conf >> into /etc/pulse (my bad), but rather set PULSE_CONFIG to directly >> point to it. > > In other words, we should check whether Epiphany still plays sound > properly with this patch applied. > > Cheers I reported the original bugs for this in Guix [0] and WebKitGTK [1], so it was easy for me to find the references; hope they help! Unfortunately, it doesn't look like the WebKitGTK bug has been fixed (probably waiting on a C++ hacker). Note that the symptom I saw wasn't just that sound didn't work, but that the sandboxed processes crashed, so no web content was rendered. [0] https://issues.guix.gnu.org/40837 [1] https://bugs.webkit.org/show_bug.cgi?id=211131 Unfortunately, I haven't had time to test this series. Sorry! Jack --925712948-386449738-1643841801=:9433-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 06 01:30:43 2022 Received: (at 53676) by debbugs.gnu.org; 6 Feb 2022 06:30:44 +0000 Received: from localhost ([127.0.0.1]:36193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGb4N-0004Ct-D4 for submit@debbugs.gnu.org; Sun, 06 Feb 2022 01:30:43 -0500 Received: from mail-qk1-f171.google.com ([209.85.222.171]:45870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGb4L-0004Cd-70 for 53676@debbugs.gnu.org; Sun, 06 Feb 2022 01:30:41 -0500 Received: by mail-qk1-f171.google.com with SMTP id b22so8410108qkk.12 for <53676@debbugs.gnu.org>; Sat, 05 Feb 2022 22:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=2fpBWKDmVqxdwSEMrT8i/Uw3v5xPR9MxCUw3qDBDy+o=; b=mNaFYGz4wmjW9Fd/idTzo+kdoblgTVvS7EcE4zHUPCrzViBwPqXDRFh+B3IPp4fpf1 Oe76iRix6DF4jzHbRhfAGLyHAAKmswqEhYbhJH+Y7E2z/Qcshel0SXxx5u2Sar5OK7c6 6PydoEDfC89kUtrmb6SZ5tPlxtMEyYbGoFdyH3+eduuBnW80g+eyUxH/3Kqg9CFwMIMD CbbnHQk9FmHzhBvKJj1gSF2dA/+8QP4oZX2d5PO5+dVoUXEzERxAdoTJl2K+WUguJEuA gmtbxgfjWFJCJBQp9k9OnX48wViw/epJpIOL+3OGfmgwHKRLN0eH2EB/Ej7GIFec1zyg hlrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=2fpBWKDmVqxdwSEMrT8i/Uw3v5xPR9MxCUw3qDBDy+o=; b=ScfDXt2reylXstY2ObRRI33OCl/VEI3Uoclycu7lwPgbcCUkNfNvTOz1TgIy6/B+k8 qT62QVaDOX37ruIab6fg4lAgCBIqLC0GPPv3zAVZIeapNCNJfUbyauGvBLquIoC57pa8 i1GZY+gdMBjuf72WONKq1iJZlMuYdKI1O9kx8xomAInM/w8ESgoZeuQBCMJLHi3r84yM XvRGTQLwmyjYfL3cIYPYPyNMPN+2oyDWzY9PMxt6KYrZoO3ZTUewgiLmfamtGTeZuYFR xuk7LyFcrW832AnOWOiWqfS73QyJVhSAP6gUy1QgIoUKWZOSA8vGjPfaSNiZsi7WutBm 4fxg== X-Gm-Message-State: AOAM531Wo8eBZ1ZyFzSdOFiun3AS06IqCiN8yt9zV8YwodQ0x15hFUO1 q2MVT0nz2GSekamQ/+f8ZNhz0LmDZps= X-Google-Smtp-Source: ABdhPJw/eHS2ChwXtx0D0nfYaI+QuNL7r7LXi8sSBbiTor3x15NrxSi1TF7dmU46RU4zDgZ7WBblvQ== X-Received: by 2002:a05:620a:2048:: with SMTP id d8mr764603qka.649.1644129035431; Sat, 05 Feb 2022 22:30:35 -0800 (PST) Received: from hurd (dsl-10-149-121.b2b2c.ca. [72.10.149.121]) by smtp.gmail.com with ESMTPSA id r22sm3850412qtw.35.2022.02.05.22.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Feb 2022 22:30:34 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: bug#53676: [PATCH 0/5] *** PulseAudio service improvements *** References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-3-maxim.cournoyer@gmail.com> <693cc82d449395853247c7fbf1b44d0a3c979c87.camel@gmail.com> <875ypy1gqd.fsf@gmail.com> <87k0edzy8j.fsf@gmail.com> <2ed5ef40ecc06c783af81de129a62d3c42d87fec.camel@gmail.com> Date: Sun, 06 Feb 2022 01:30:33 -0500 In-Reply-To: <2ed5ef40ecc06c783af81de129a62d3c42d87fec.camel@gmail.com> (Liliana Marie Prikler's message of "Wed, 02 Feb 2022 21:43:14 +0100") Message-ID: <87h79c1p86.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Liliana, Liliana Marie Prikler writes: > Hi, > > Am Dienstag, dem 01.02.2022 um 23:30 -0500 schrieb Maxim Cournoyer: >> If someone was to append something to default.pa (the exact one shipped >> with PulseAudio), they'd have to add the .fail themselves to undo >> PulseAudio's own .nofail, right?=C2=A0 I don't see why we should go out = of >> our way to change that. > Didn't you add that .nofail on your own? If not, why include the > directive? You are right that it's not needed. I've reviewed how that's done, see below. >> With the proposed 'extra-script-files', I'd argue that appending >> something to default.pa should be considered an anti-pattern; as the >> new field would be the more natural option to *extend* 'default.pa' >> (and having a field to override default.pa is still useful if you don't >> like any of the default behavior). > I don't think you're making a good case here. Why do you want > appending to default.pa to be an anti-pattern? Basically, to keep things as simple as they can be. I'm expecting that extending the default.pa file must be a more common use case than hacking it up, justifying the 'extra-script-files' simple entry point catered for this use case. Compare: --8<---------------cut here---------------start------------->8--- (script-file (computed-file "default.pa" #~(begin (copy-file #$(file-apend pulseaudio "/etc/d= efault.pa") #$output) (call-with-port (open-file #$output "a") (lambda (port) (format port "~%\ set-card-profile alsa_card.pci-0000_01_01.0 output:analog-surround-40+input= :analog-mono set-default-source alsa_input.pci-0000_01_01.0.analog-mono set-default-sink alsa_output.pci-0000_01_01.0.analog-surround-40~%")))))) --8<---------------cut here---------------end--------------->8--- to: --8<---------------cut here---------------start------------->8--- (extra-script-files (list (plain-file "configure-audigy-card" (string-append "\ set-card-profile alsa_card.pci-0000_01_01.0 output:analog-surround-40+input= :analog-mono set-default-source alsa_input.pci-0000_01_01.0.analog-mono set-default-sink alsa_output.pci-0000_01_01.0.analog-surround-40\n")))) --8<---------------cut here---------------end--------------->8--- The later seems simpler, especially for someone starting with Guix and not very familiar with Guile and G-expressions. [...] > That aside, I think substitute* would be expressing your intent better > here, because what you actually want is to match that line and then > append an .include /etc/pulse/default.pa.d hardcoded. Good idea; I've made the change, like so: --8<---------------cut here---------------start------------->8--- modified gnu/packages/pulseaudio.scm @@ -279,13 +279,12 @@ (define pulseaudio/fixed `(modify-phases ,phases (add-after 'unpack 'customize-default-script (lambda _ - (call-with-port - (open-file "src/daemon/default.pa.in" "a") - (lambda (port) - (format port "~%\ -### Include extra script files configured via the pulseaudio-service-type. -.nofail -.include /etc/pulse/default.pa.d~%"))))))))))) + (substitute* "src/daemon/default.pa.in" + (("^\\.include.*default.pa.d.*" anchor) + (string-append + ;; Honor PulseAudio script extensions found under + ;; /etc/pulse/default.pa.d. + anchor ".include /etc/pulse/default.pa.d\n"))))))))))) =20 (define-public pavucontrol (package --8<---------------cut here---------------end--------------->8--- > I still don't agree that that's a good idea, however. Particularly, it > would lead to including files from an "old distro" that was infected > with Guix when that probably wasn't asked for. If at all enabled, I'd > prefer if pulseaudio-service-type magically inserted that snippet for > configurations that add files to default.pa.d. There are pros and cons; people might be find it handy that a Guix-installed pulseaudio also honors their user scripts living under /etc/pulse/default.pa.d. It seems low risk to me; not worth the extra complexity in my opinion. Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 06 02:25:17 2022 Received: (at 53676) by debbugs.gnu.org; 6 Feb 2022 07:25:17 +0000 Received: from localhost ([127.0.0.1]:36261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGbvB-0005kC-40 for submit@debbugs.gnu.org; Sun, 06 Feb 2022 02:25:17 -0500 Received: from mail-qv1-f47.google.com ([209.85.219.47]:40506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGbv8-0005jv-Og for 53676@debbugs.gnu.org; Sun, 06 Feb 2022 02:25:15 -0500 Received: by mail-qv1-f47.google.com with SMTP id v10so860953qvk.7 for <53676@debbugs.gnu.org>; Sat, 05 Feb 2022 23:25:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=RISkv4jWWcnSk77Dc3oHk/Qpyk0BiWtEZuNg6Yxwtg4=; b=SjPxnePnEiPzeYFxeDsHqQbgXDLZh+m6d01TbLYHKI2wWqYk1BFrkJA70H8d1FK9oT Rnoq6sDjhpLSOjjjlWLhZBtDJ+g6nuLsC44PBrPOIsVR47Zrk+t0gXR3kqfVceqvXCdv AuYORt9EK7kBRXrH0KPj1ZxFNT1YYr8WZ0U79yPo3KdrsPCskvWQKYO3dOSAwMEGDLr1 r0tUWT1GO4AcSehvHzTpFHmiFUuczrkzEU575Q1bacLcrASNUVETcD6ogt2hWbtC1AOZ m+7wqHI0B4Ua9usdiNFNr3WRJ4e4AMencKEzPGlk9VpRO2swLLaD2Ma+VupPLSa3oc8C 9XjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=RISkv4jWWcnSk77Dc3oHk/Qpyk0BiWtEZuNg6Yxwtg4=; b=FIFkWftlGnsdtaGHguOjoOORTE+TpLkDiXjRwY8rkPWmLNfPeXPYf1XxlZDQii0WPG 52Bx8bT9O3DfINTr8lqL9FDFyByDjow/3xv8xsuZRTzEtzwIMh5ZblhxjGEae7wG/1Vs XjHiu5jDbtWu3mEPjwMitjM14YuOkpd+WIhE3SQqOoBRpZPXAVHamSsVfgGf+oXSIMeS //4FWLEIy5xmgHMZt6O9rHd7wAqOCROgpdexLqUC/WoO670ii6KuKX8ftJ8g02IL+eXL hGZaI+nVHgkdQKqTX2SOYIcBH5Y+s/zeFD/fLik1pOe6GRN1gZ/PCyEx1BwRhY4duvRo PDDg== X-Gm-Message-State: AOAM533ATOt155k3mk2l3aEETFtrk5WyFhNW/GKV7SiBRnjQE2I6X/Sk O8XwuErGnONkdgGzQUaIUlc1HmrjR/M= X-Google-Smtp-Source: ABdhPJzyucaXUmmr26LAjr3VGAEbn/SdV+y3Ms9dPBh67cWtgxkwWf6OAGybsZ8mDqpl+A/vhinrzg== X-Received: by 2002:a05:6214:268d:: with SMTP id gm13mr4126269qvb.125.1644132308911; Sat, 05 Feb 2022 23:25:08 -0800 (PST) Received: from hurd (dsl-10-149-121.b2b2c.ca. [72.10.149.121]) by smtp.gmail.com with ESMTPSA id q8sm3549236qkl.65.2022.02.05.23.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Feb 2022 23:25:08 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: [PATCH 4/5] services: pulseaudio: Add an extra-script-files configuration field. References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-4-maxim.cournoyer@gmail.com> <97111754acacc576aec4eb55889a32474fe71f95.camel@gmail.com> <871r0m1gdy.fsf@gmail.com> <3c9845d7b893dddcd44be41d2ee475c29d9f5a85.camel@gmail.com> <87o83qyltg.fsf@gmail.com> <2b8017576ee2570fd38ab61729556e31694b2552.camel@gmail.com> Date: Sun, 06 Feb 2022 02:25:07 -0500 In-Reply-To: <2b8017576ee2570fd38ab61729556e31694b2552.camel@gmail.com> (Liliana Marie Prikler's message of "Wed, 02 Feb 2022 21:07:27 +0100") Message-ID: <87czk01mp8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Liliana, [...] >> 'strip-store-file-name' would be able to get the name from the store >> item (built derivation), but file-union takes a "two-element list >> where the first element is the file name to use in the new directory, >> and the second element is a gexp denoting the target file", e.g., >> before the file-like object is built.=C2=A0 I don't see an easy way to >> make it work. > For the record, I do think we'd like to use file-like objects here, not > raw gexps. If that fails, why not expose the name to gexp mapping > completely? I don't know why you'd want to take away that control. If we limit ourselves to file-like objects, we can do something like this: --8<---------------cut here---------------start------------->8--- 1 file changed, 20 insertions(+), 4 deletions(-) gnu/services/sound.scm | 24 ++++++++++++++++++++---- modified gnu/services/sound.scm @@ -26,10 +26,12 @@ (define-module (gnu services sound) #:use-module (gnu services) #:use-module (gnu system pam) #:use-module (gnu system shadow) + #:use-module (guix diagnostics) #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix records) #:use-module (guix store) + #:use-module (guix ui) #:use-module (gnu packages audio) #:use-module (gnu packages linux) #:use-module (gnu packages pulseaudio) @@ -149,10 +151,24 @@ (define pulseaudio-environment ("PULSE_CLIENTCONFIG" . "/etc/pulse/client.conf"))))) =20 (define (extra-script-files->file-union extra-script-files) - "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE-UNIO= N. -Each file is named \"snippet-n.pa\", where N is their 1-offset index." - (let ((labels (map (lambda (n) (format #f "snippet-~a.pa" n)) - (iota (length extra-script-files) 1)))) + "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE-UNIO= N." + + (define (file-like->name file) + (let ((name (match file + ((? local-file?) + (local-file-name file)) + ((? plain-file?) + (plain-file-name file)) + ((? computed-file?) + (computed-file-name file)) + (_ (leave (G_ "~a is not a local-file, plain-file or \ +computed-file object~%") file))))) + (unless (string-suffix? name ".pa") + (leave (G_ "`~a' lacks the required '.pa' file name extension~%") + name)) + name)) + + (let ((labels (map file-like->name extra-script-files))) (file-union "default.pa.d" (zip labels extra-script-files)))) =20 (define pulseaudio-etc --8<---------------cut here---------------end--------------->8--- It works; and I agree it's nice to have control over the file name. Maxim From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 06 03:02:31 2022 Received: (at 53676) by debbugs.gnu.org; 6 Feb 2022 08:02:31 +0000 Received: from localhost ([127.0.0.1]:36295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGcVD-0006gz-FN for submit@debbugs.gnu.org; Sun, 06 Feb 2022 03:02:31 -0500 Received: from mail-ej1-f68.google.com ([209.85.218.68]:42878) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGcVC-0006gm-4P for 53676@debbugs.gnu.org; Sun, 06 Feb 2022 03:02:30 -0500 Received: by mail-ej1-f68.google.com with SMTP id m4so33064307ejb.9 for <53676@debbugs.gnu.org>; Sun, 06 Feb 2022 00:02:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=rfQr+QcPmuaCAx+T5ndQG6iPEmXxKBijM29ZTUm3FJA=; b=WP5b6xRE//ZzQ6uIa0dWNd3VDqt4irOvmt+oDTHXjALkPv0apTMrzRjC1ZzDEcIait ViqHSKDYRX1UJdhfpdos/D4L7eez022RjPduepPiiPXTka9Q0y7z7T0uutc3woz0tP0I YhruYkhVeh3BT9OVmMFmEPwao9QKc3bBIgvS1s5nb41bOqhxmMTGS5i5vfThqrhgzYY7 1gafqGDI/nN7Jigz4M8/Cp0qQnEvg6Rmi+xw2OWKZ0NJkI37RDA/PpjHOSCzV4Mx+nbV +iBeaZ5K+Gf/RcWvmzhv2dLIn/etcfgKlEEwgA3a9ggFlKXnOimdq+i928j88NiatqTI N8sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=rfQr+QcPmuaCAx+T5ndQG6iPEmXxKBijM29ZTUm3FJA=; b=Rv/iq8r3Ui5lyMtNzZvJuDKJOm514sVRc/vZmB7tp3eFgS8XqPFjXMAGYCcbtqIHYM in1kvV0ZSQvubTuTfLyS4ceVfYpVSuuUKHFvx6aBAAh6/Kb6jWARtso3cA4vO+JOMefx gk4Y0Ukq09xmLhDR5y8fLphd/F6ysCtoq3KlBu9Cbog2lC940yUKqu9RBeDExELztCQN mF+aDfT51YDt+yNoql4vY0/YiVrBoGZRt1yX8NUVgw19KHZNo9Ln4tWuI0PoBXoG4GhA GTFdVzbXPtfkqIbWPD7TbCf51+lBc1ZzrJ5tAg0/jZrKx+e0iFdDk3NVW9BrHdItCNzC Pp6A== X-Gm-Message-State: AOAM533Vp56Bgp6zCI6bMRZoze/j8pInVo3rZrJhrl7CxJYPtrfZbIt2 LrcelWXd5Xgv6oruRMEnBrA= X-Google-Smtp-Source: ABdhPJwtgk6Qk7YKZAMn23AsVLDmFWvP0VUv2JRNNF20A4BvrVkz679jlgIQud5bGQ8jihRaxSshOA== X-Received: by 2002:a17:907:7e92:: with SMTP id qb18mr5796389ejc.555.1644134543985; Sun, 06 Feb 2022 00:02:23 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id fw6sm1052979ejc.143.2022.02.06.00.02.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 00:02:23 -0800 (PST) Message-ID: Subject: Re: [PATCH 4/5] services: pulseaudio: Add an extra-script-files configuration field. From: Liliana Marie Prikler To: Maxim Cournoyer Date: Sun, 06 Feb 2022 09:02:22 +0100 In-Reply-To: <87czk01mp8.fsf@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-4-maxim.cournoyer@gmail.com> <97111754acacc576aec4eb55889a32474fe71f95.camel@gmail.com> <871r0m1gdy.fsf@gmail.com> <3c9845d7b893dddcd44be41d2ee475c29d9f5a85.camel@gmail.com> <87o83qyltg.fsf@gmail.com> <2b8017576ee2570fd38ab61729556e31694b2552.camel@gmail.com> <87czk01mp8.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Maxim, Am Sonntag, dem 06.02.2022 um 02:25 -0500 schrieb Maxim Cournoyer: > Hi Liliana, > > [...] > > > > 'strip-store-file-name' would be able to get the name from the > > > store > > > item (built derivation), but file-union takes a "two-element list > > > where the first element is the file name to use in the new > > > directory, > > > and the second element is a gexp denoting the target file", e.g., > > > before the file-like object is built.  I don't see an easy way to > > > make it work. > > For the record, I do think we'd like to use file-like objects here, > > not > > raw gexps.  If that fails, why not expose the name to gexp mapping > > completely?  I don't know why you'd want to take away that control. > > If we limit ourselves to file-like objects, we can do something like > this: > > --8<---------------cut here---------------start------------->8--- > 1 file changed, 20 insertions(+), 4 deletions(-) > gnu/services/sound.scm | 24 ++++++++++++++++++++---- > > modified   gnu/services/sound.scm > @@ -26,10 +26,12 @@ (define-module (gnu services sound) >    #:use-module (gnu services) >    #:use-module (gnu system pam) >    #:use-module (gnu system shadow) > +  #:use-module (guix diagnostics) >    #:use-module (guix gexp) >    #:use-module (guix packages) >    #:use-module (guix records) >    #:use-module (guix store) > +  #:use-module (guix ui) >    #:use-module (gnu packages audio) >    #:use-module (gnu packages linux) >    #:use-module (gnu packages pulseaudio) > @@ -149,10 +151,24 @@ (define pulseaudio-environment >         ("PULSE_CLIENTCONFIG" . "/etc/pulse/client.conf"))))) >   >  (define (extra-script-files->file-union extra-script-files) > -  "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE- > UNION. > -Each file is named \"snippet-n.pa\", where N is their 1-offset index." > -  (let ((labels (map (lambda (n) (format #f "snippet-~a.pa" n)) > -                     (iota (length extra-script-files) 1)))) > +  "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE- > UNION." > + > +  (define (file-like->name file) > +    (let ((name (match file > +                  ((? local-file?) > +                   (local-file-name file)) > +                  ((? plain-file?) > +                   (plain-file-name file)) > +                  ((? computed-file?) > +                   (computed-file-name file)) > +                  (_ (leave (G_ "~a is not a local-file, plain-file or > \ > +computed-file object~%") file))))) > +      (unless (string-suffix? name ".pa") > +        (leave (G_ "`~a' lacks the required '.pa' file name > extension~%") > +               name)) > +      name)) > + > +  (let ((labels (map file-like->name extra-script-files))) >      (file-union "default.pa.d" (zip labels extra-script-files)))) >   >  (define pulseaudio-etc > --8<---------------cut here---------------end--------------->8--- > > It works; and I agree it's nice to have control over the file name. Note that file-like->name serves multiple duties here. In my opinion it'd be better to --8<---------------cut here---------------start------------->8--- (define (file-like-name file) ((match file ((? local-file?) local-file-name)  ((? plain-file?) plain-file-name)  ((? computed-file?) computed-file-name) [...] (_ (const #f))) ; alternatively raise an error file)) --8<---------------cut here---------------end--------------->8--- That at least decouples it from the burden of having to check whether it is a valid pulseaudio script file name, which makes it reusable elsewhere. As a note regarding correctness, perhaps we should write an implementation in (guix gexp) that works for everything that has a gexp-compiler, but that's out of scope for now. On the pulseaudio side, you'd compose that with an --8<---------------cut here---------------start------------->8--- (define (assert-pulseaudio-script-file-name name) (unless name (raise ...)) (unless (string-suffix? name ".pa") (leave ...)) name) --8<---------------cut here---------------end--------------->8--- Cheers From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 06 04:07:47 2022 Received: (at 53676) by debbugs.gnu.org; 6 Feb 2022 09:07:47 +0000 Received: from localhost ([127.0.0.1]:36398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGdWN-0004RD-BW for submit@debbugs.gnu.org; Sun, 06 Feb 2022 04:07:47 -0500 Received: from mail-ej1-f66.google.com ([209.85.218.66]:34398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGdWL-0004R0-Ql for 53676@debbugs.gnu.org; Sun, 06 Feb 2022 04:07:46 -0500 Received: by mail-ej1-f66.google.com with SMTP id h7so33298998ejf.1 for <53676@debbugs.gnu.org>; Sun, 06 Feb 2022 01:07:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=I6Wi3bbWnwYz5A/gjCeOE18OrQFVUna+0PZYeYeNl9I=; b=opToeXlsu78TDY+AS91E9E+zNiWTOcLYs8Lr7N0NGWXeHNIdm7teYDDIuvzLxNb2XC N5fNgl2JukM9hX9YlsQbC2NnSa4BuZ4FoDfRO4zpfCdXjVb9f3F+xImY5AwmdP6iseum RP0a9WaBzCbBZX4QEyXVz84d4mJ/Mu+vU5217vt1Ag+zWiLzn0wFmTKQeA5UAuMxmqf3 AzJA5Jj93/6hOWhcVdcGA9rcMM5FN68909Rd8Wh3S2cOl3J43IZVZlqv0HnnByXszZ6P QLk7DuejPdLpdIChxNt4AUUo6zkudEHqwp9879URSYbFJtMMVZVuR8xlH82eioISVXrD ZiyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=I6Wi3bbWnwYz5A/gjCeOE18OrQFVUna+0PZYeYeNl9I=; b=MnhNzbIPrHz38/5Cc/leWJVmc3/jEIpCEo3Do2ycO1uOeauNWYU0qpdrdvjDBV2CAq LJhWNgBxe38uOc5POmkIY7LjPxoCuK+PorI4IABCH7IPYfZdc9dTZTgbphF8SWJPNnqY IkvdMPEbs5WDXxgRHrUmPSyWJqcbPGzRg9Jx5rb7gJWK7x6G+Cffm6sJ4jMCn95GcTqx mLKHHCAqXC1BW9cyCirLj6tCHXQEKG1NYcHS1cdQ9rEdil4m/r5o4U+Uhn2EvskEGcPw Rq1JrxtPsOC71mpW6ep61Uo1QUd4vB46QgbX8LiW/9vsh0HHS8+WvYgaSi7zXVR18DiX j5BA== X-Gm-Message-State: AOAM5301gfDetL8yGk3VCttwJaPsRQ/Jlhm0pPedV36QJzlDqlMyiTwP ocpkKcEGw75vaJgbqTjRl8c= X-Google-Smtp-Source: ABdhPJw2hmFM1J1RO38OG+aY63qKV1PB3gAyaQ1cBkjyw/CQMkVKUIgG1d49XtElw7lpCtkWPwWYRw== X-Received: by 2002:a17:906:c14d:: with SMTP id dp13mr5832627ejc.132.1644138459805; Sun, 06 Feb 2022 01:07:39 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id qk26sm495557ejb.145.2022.02.06.01.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 01:07:39 -0800 (PST) Message-ID: Subject: Re: bug#53676: [PATCH 0/5] *** PulseAudio service improvements *** From: Liliana Marie Prikler To: Maxim Cournoyer Date: Sun, 06 Feb 2022 10:07:38 +0100 In-Reply-To: <87h79c1p86.fsf_-_@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-3-maxim.cournoyer@gmail.com> <693cc82d449395853247c7fbf1b44d0a3c979c87.camel@gmail.com> <875ypy1gqd.fsf@gmail.com> <87k0edzy8j.fsf@gmail.com> <2ed5ef40ecc06c783af81de129a62d3c42d87fec.camel@gmail.com> <87h79c1p86.fsf_-_@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.4 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi Maxim, Am Sonntag, dem 06.02.2022 um 01:30 -0500 schrieb Maxim Cournoyer: > > > With the proposed 'extra-script-files', I'd argue that appending > > > something to default.pa should be considered an anti-pat [...] Content analysis details: (1.4 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, https://senderscore.org/blocklistlookup/ [209.85.218.66 listed in bl.score.senderscore.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liliana.prikler[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.218.66 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.218.66 listed in wl.mailspike.net] 0.1 URI_HEX URI: URI hostname has long hexadecimal sequence 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53676 Cc: 53676@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: 0.4 (/) Hi Maxim, Am Sonntag, dem 06.02.2022 um 01:30 -0500 schrieb Maxim Cournoyer: > > > With the proposed 'extra-script-files', I'd argue that appending > > > something to default.pa should be considered an anti-pattern; as > > > the new field would be the more natural option to *extend* > > > 'default.pa' (and having a field to override default.pa is still > > > useful if you don't like any of the default behavior). > > I don't think you're making a good case here.  Why do you want > > appending to default.pa to be an anti-pattern? > > Basically, to keep things as simple as they can be.  I'm expecting > that extending the default.pa file must be a more common use case > than hacking it up, justifying the 'extra-script-files' simple entry > point catered for this use case.  Compare: > > --8<---------------cut here---------------start------------->8--- > (script-file (computed-file "default.pa" >                             #~(begin >                                 (copy-file #$(file-apend pulseaudio > "/etc/default.pa") >                                            #$output) >                                 (call-with-port >                                   (open-file #$output "a") >                                     (lambda (port) >                                       (format port "~%\ > set-card-profile alsa_card.pci-0000_01_01.0 output:analog-surround- > 40+input:analog-mono > set-default-source alsa_input.pci-0000_01_01.0.analog-mono > set-default-sink alsa_output.pci-0000_01_01.0.analog-surround- > 40~%")))))) > --8<---------------cut here---------------end--------------->8--- > > to: > > --8<---------------cut here---------------start------------->8--- > (extra-script-files >   (list (plain-file "configure-audigy-card" >           (string-append "\ > set-card-profile alsa_card.pci-0000_01_01.0 output:analog-surround- > 40+input:analog-mono > set-default-source alsa_input.pci-0000_01_01.0.analog-mono > set-default-sink alsa_output.pci-0000_01_01.0.analog-surround-40\n")))) > --8<---------------cut here---------------end--------------->8--- to: --8<---------------cut here---------------start------------->8--- (script-file  (mixed-text-file "default.pa" ".include" ;; (pulseaudio-configuration-script-file service) (file-append pulseaudio "/etc/default.pa") " set-card-profile alsa_card.pci-0000_01_01.0 output:analog-surround-40+input:analog-mono set-default-source alsa_input.pci-0000_01_01.0.analog-mono set-default-sink alsa_output.pci-0000_01_01.0.analog-surround-40\n")) --8<---------------cut here---------------end--------------->8--- which yields --8<---------------cut here---------------start------------->8--- .include /gnu/store/7xwgz4bavb1i8sfx1lm55hlrr3ngjkdx-pulseaudio- 15.0/etc/default.pa set-card-profile alsa_card.pci-0000_01_01.0 output:analog-surround-40+input:analog-mono set-default-source alsa_input.pci-0000_01_01.0.analog-mono set-default-sink alsa_output.pci-0000_01_01.0.analog-surround-40 --8<---------------cut here---------------end--------------->8--- > The later seems simpler, especially for someone starting with Guix and > not very familiar with Guile and G-expressions. That's because you're (intentionally or otherwise) not making a fair comparison. The way I wrote above is the way I intended pulseaudio- service-type to be used and it's in terms of writing the pulseaudio configuration not that much harder than what you are proposing. It'd be trivial to add a clause to ".include /etc/pulse/default.pa.d" through the service configuration layer. Also with pulseaudio < 15.0, you could – after groking gexps a little – produce --8<---------------cut here---------------start------------->8--- .include /gnu/store/7xwgz4bavb1i8sfx1lm55hlrr3ngjkdx-pulseaudio- 15.0/etc/default.pa .include /gnu/store/12345678901234567890123456789012-audigy-card.pa .include /gnu/store/12345678901234567890123456789013-other-stuff.pa [...] --8<---------------cut here---------------end--------------->8--- inside that mixed-text-file. With pulseaudio 15.0, you can also (define my-pulseaudio-extra-config (directory-union ...)) and use it like --8<---------------cut here---------------start------------->8--- (script-file (mixed-text-file "default.pa" ".include" (file-append pulseaudio "/etc/default.pa") ".include" my-pulseaudio-extra-config)) --8<---------------cut here---------------end--------------->8--- > > > I still don't agree that that's a good idea, however.  > > Particularly, it would lead to including files from an "old distro" > > that was infected with Guix when that probably wasn't asked for.  > > If at all enabled, I'd prefer if pulseaudio-service-type magically > > inserted that snippet for configurations that add files to > > default.pa.d. > > There are pros and cons; people might be find it handy that a > Guix-installed pulseaudio also honors their user scripts living under > /etc/pulse/default.pa.d.  It seems low risk to me; not worth the > extra complexity in my opinion. Note that you are introducing extra complexity to create that directory from pulseaudio-service-type. In particular, I don't see how your solution is a notable improvement over mixed-text-file, which to me seems better suited towards this purpose. Cheers From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 07 17:29:46 2022 Received: (at 53676) by debbugs.gnu.org; 7 Feb 2022 22:29:46 +0000 Received: from localhost ([127.0.0.1]:44035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHCW1-0005l5-JC for submit@debbugs.gnu.org; Mon, 07 Feb 2022 17:29:45 -0500 Received: from mail-qt1-f170.google.com ([209.85.160.170]:33291) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHCVx-0005kq-BU for 53676@debbugs.gnu.org; Mon, 07 Feb 2022 17:29:44 -0500 Received: by mail-qt1-f170.google.com with SMTP id p14so13351907qtx.0 for <53676@debbugs.gnu.org>; Mon, 07 Feb 2022 14:29:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=g+WuRMSrw+7x4gBdTdIddoQ4T/rY2WgSpVQT9K8SYlM=; b=Eq3RzJox31ZOJFCmBewgjn42Kh5H5WuHWY2/BT+CCt0pdukKkZfrzDwqZHc/NldJA3 cCTvMq2Lzg0eZpXPrkcn2rR0MTuX0KPhcHuVKSq+LzCbDY69xcExST/GZ6RdVcjfDx6e wAqDzQ4hkvU7ZwZsxUjKx9/1kJohwpfX6l23ivwf6VUXq86WG+8iFXVpR6N8WRvHQrYR B6FbRc3VMcQdBTohT0LHA6b69l6ejeLOad1WsD0gc/z1ZQ/zWIl/A7b18juaw/DDUKZf KHT7TMSooE7iNKRcsSfqR6kjQdfWGbn/DvYIvzipsp1Vo1rFtyq3Q0ZpwzzT+36xy7ug i21Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=g+WuRMSrw+7x4gBdTdIddoQ4T/rY2WgSpVQT9K8SYlM=; b=72pHrciJuYC1ugGSmTeBkzp1WpSId1e5WXtyUfN6OWfCF+IpftaehhgCdWdC1XU5pw enTuYy0uA5uZjGkr5hg2ipB0yWuhDHAy/SCYQE9DGLYB84wnywCpWgtMUchhufeGb4HQ l6plMge40Ma4AjCQnz3/iAiIrhDEkbglbEXnNB+wlpdVtUKG4iXf5FGp77buQ5keXWUf Cvzw1I0AN3QjdxHsi5WsF5QvlDVUbHrSgAtEo6+cd8WUqBTtPwwtmDx1Ts10ybR70bg1 LAu6vKdZPixI17SF0WqQXfMfZ5mas6HVUYD7mrdB5JW00R31bVyV3YLZqia/RnyiBPqX ENdA== X-Gm-Message-State: AOAM532XW/RhcqsjI/y+OSOG6dXeVZyzLQTW4A9dn34J6rDI2b7u3mWC Scjx6RpTHTu51EJtV2u68L1PkrHrhdI= X-Google-Smtp-Source: ABdhPJx2TEjaLHIGsoRVK8FSb024yk61rbGGhuLW20TJwWHfSEqlgq867LATcWNwdZiEeZAjI8oMhQ== X-Received: by 2002:ac8:5b91:: with SMTP id a17mr1260491qta.570.1644272975427; Mon, 07 Feb 2022 14:29:35 -0800 (PST) Received: from hurd (dsl-154-179.b2b2c.ca. [66.158.154.179]) by smtp.gmail.com with ESMTPSA id x13sm6307586qko.114.2022.02.07.14.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 14:29:34 -0800 (PST) From: Maxim Cournoyer To: Jack Hill Subject: Re: bug#53676: [PATCH 0/5] *** PulseAudio service improvements *** References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-5-maxim.cournoyer@gmail.com> Date: Mon, 07 Feb 2022 17:29:33 -0500 In-Reply-To: (Jack Hill's message of "Wed, 2 Feb 2022 17:43:21 -0500 (EST)") Message-ID: <87mtj2z4xe.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@debbugs.gnu.org, Liliana Marie Prikler 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 Jack, Jack Hill writes: > On Tue, 1 Feb 2022, Liliana Marie Prikler wrote: > >> Hi, >> >> Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: >>> * gnu/services/sound.scm (pulseaudio-environment) >>> [PULSE_CONFIG, PULSE_CLIENTCONFIG]: Use fix locations, and move logic >>> to... >>> (pulseaudio-etc): ... this service extension.=C2=A0 Guard against produ= cing >>> empty files. >> >> This patch reproduces (more or less) the initial layout we had for >> pulseaudio-service-type. =C2=A0However, that layout has been reported to= not >> work with some sandboxes. I tried tracking down a specific bug, but >> could only gather . >> >>> Due to a bug with webkit sandboxing, we no longer put daemon.conf >>> into /etc/pulse (my bad), but rather set PULSE_CONFIG to directly >>> point to it. >> >> In other words, we should check whether Epiphany still plays sound >> properly with this patch applied. >> >> Cheers > > I reported the original bugs for this in Guix [0] and WebKitGTK [1], > so it was easy for me to find the references; hope they help! > Unfortunately, it doesn't look like the WebKitGTK bug has been fixed > (probably waiting on a C++ hacker). Note that the symptom I saw wasn't > just that sound didn't work, but that the sandboxed processes crashed, > so no web content was rendered. > > [0] https://issues.guix.gnu.org/40837 > [1] https://bugs.webkit.org/show_bug.cgi?id=3D211131 > > Unfortunately, I haven't had time to test this series. Thanks for this! I wasn't aware of the history; I tried it and it failed the same. The following fix I attempted in webkitgtk did not seem to do anything: --8<---------------cut here---------------start------------->8--- modified Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -337,7 +338,16 @@ static void bindIfExists(Vector& args, const = char* path, BindFlags bind bindType =3D "--ro-bind-try"; else bindType =3D "--bind-try"; - args.appendVector(Vector({ bindType, path, path })); + + // Canonicalize the source path, otherwise a symbolic link could + // point to a location outside of the namespace. + char canonicalPath[PATH_MAX]; + if (!realpath(path, canonicalPath)) { + if (strlen(path) + 1 > PATH_MAX) + return; // too long of a path + strcpy(path, canonicalPath); // no-op + } + args.appendVector(Vector({ bindType, canonicalPath, path })); } =20 static void bindDBusSession(Vector& args, XDGDBusProxyLauncher& p= roxy) --8<---------------cut here---------------end--------------->8--- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 00:21:40 2022 Received: (at 53676) by debbugs.gnu.org; 8 Feb 2022 05:21:40 +0000 Received: from localhost ([127.0.0.1]:44722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHIwe-00009p-IL for submit@debbugs.gnu.org; Tue, 08 Feb 2022 00:21:40 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:34658) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHIwZ-00009Z-9n for 53676@debbugs.gnu.org; Tue, 08 Feb 2022 00:21:39 -0500 Received: by mail-ed1-f66.google.com with SMTP id co28so7919269edb.1 for <53676@debbugs.gnu.org>; Mon, 07 Feb 2022 21:21:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=gdQq3mdICGj/V/iQNFQuhZFNAGIN2eUVcSW2ponL2MA=; b=odCHTCnyRThZ8AGGFZ8RTdB2xKHh4jn9X7RXW1P1uJc0cqF/+62sGl9enT0N+d0ywB A+gJ/JZclmgGN8stsrWBCBI3eugZDWER+JcBudgAUA3gFIE6REJwFKWFpcF8HhZ6iX6d fZilYRCrHxLgks/6MVjCSXIhVWSOR+sXX0X/Lw2BZGU4PXNt9Ikdj+wIxZjN9jm5+Rb2 sGjinjTOZHMZPUE3GuGY9f1NHca7xjUApfTFV2RBJ4WkzyZBlHaFhCRYkyEaVLxufw90 8ScjwaVOXUJCd1tdLsihOY09aXOjF/Doo83bvKyrFLpMUJrJanm8OtLdqJlqoVhix767 8z5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=gdQq3mdICGj/V/iQNFQuhZFNAGIN2eUVcSW2ponL2MA=; b=EdMyi+d0WRnyTKgmEyTpvoT0rAwBFjZAjN1OHH8FDPU6GzM2UYfmvvWGxGSjCh96Sj 3GY3VOh+XvU6R/oPhTXG+Fsk/EmPdPQR8L5IxUhYTrmSu1SWrxvsNp6ezdFQAXKjnPt/ TyIdG+6oZppMGtcx7xajU7KQdPXBQa6RbF1jDCQ1KJqkPpFX/ULqC4NG9mnHDmnmRkMu UQU0NJ0stkufC8DuSUrBfGTSIz0bzNiQ/y8TSTZLH82B/6pwpikKg5yb3359WAkZJjUb +Onhqp03xE3Peqd7BRUmrUWiVTMPYjMSY9+je3rVWCjvERhNtT9X8tUYHGJ8QiPSGG9A Zgcg== X-Gm-Message-State: AOAM532wcQ8S0A1JfdxRV5wuUuNmIM08bRkFRKaNxxZvdOvE8NVL3nQX xzP5gf+h6+nESWwKFJoRrOg= X-Google-Smtp-Source: ABdhPJxRGz0GrLZ9Ps/lZn+XlnqHCosz7KljcvqBkhNzmd/x+4BAzrBohTLbZtybfRtRcFgmcpND3g== X-Received: by 2002:aa7:cc06:: with SMTP id q6mr2805760edt.44.1644297689151; Mon, 07 Feb 2022 21:21:29 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id h21sm2432955edt.26.2022.02.07.21.21.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 21:21:28 -0800 (PST) Message-ID: Subject: Re: bug#53676: [PATCH 0/5] *** PulseAudio service improvements *** From: Liliana Marie Prikler To: Maxim Cournoyer , Jack Hill Date: Tue, 08 Feb 2022 06:21:26 +0100 In-Reply-To: <87mtj2z4xe.fsf_-_@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-5-maxim.cournoyer@gmail.com> <87mtj2z4xe.fsf_-_@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi, Am Montag, dem 07.02.2022 um 17:29 -0500 schrieb Maxim Cournoyer: > Thanks for this!  I wasn't aware of the history; I tried it and it > failed the same.  The following fix I attempted in webkitgtk did not > seem to do anything: > > --8<---------------cut here---------------start------------->8--- > modified   > Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp > @@ -24,6 +24,7 @@ >  #include >  #include >  #include > +#include >  #include >  #include >  #include > @@ -337,7 +338,16 @@ static void bindIfExists(Vector& args, > const char* path, BindFlags bind >          bindType = "--ro-bind-try"; >      else >          bindType = "--bind-try"; > -    args.appendVector(Vector({ bindType, path, path })); > + > +    // Canonicalize the source path, otherwise a symbolic link could > +    // point to a location outside of the namespace. > +    char canonicalPath[PATH_MAX]; > +    if (!realpath(path, canonicalPath)) { > +        if (strlen(path) + 1 > PATH_MAX) > +            return;                  // too long of a path > +        strcpy(path, canonicalPath); // no-op > +    } > +    args.appendVector(Vector({ bindType, canonicalPath, > path })); >  } Apart from raw char arrays and string.h looking funny (and wrong) in C++, what is strcpy supposed to do here? Would it work if we mapped canonicalPath to path (i.e. `ls path' in the container would be `ls canonicalPath' under the hood)? Cheers From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 05:13:10 2022 Received: (at 53676) by debbugs.gnu.org; 8 Feb 2022 10:13:10 +0000 Received: from localhost ([127.0.0.1]:45410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHNUj-0005gf-Qg for submit@debbugs.gnu.org; Tue, 08 Feb 2022 05:13:10 -0500 Received: from albert.telenet-ops.be ([195.130.137.90]:60854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHNUW-0005fq-SW for 53676@debbugs.gnu.org; Tue, 08 Feb 2022 05:13:08 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by albert.telenet-ops.be with bizsmtp id saCu2600L4UW6Th06aCudn; Tue, 08 Feb 2022 11:12:55 +0100 Message-ID: Subject: Re: [bug#53676] [PATCH 0/5] *** PulseAudio service improvements *** From: Maxime Devos To: Maxim Cournoyer , Jack Hill Date: Tue, 08 Feb 2022 11:12:50 +0100 In-Reply-To: <87mtj2z4xe.fsf_-_@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-5-maxim.cournoyer@gmail.com> <87mtj2z4xe.fsf_-_@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-sZWXQuWEFr/AFA/L+mAM" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1644315175; bh=WUIGyvNFGrZgPudrPoZ1U6YWuwBp2q7+wLPJtdDS/Mg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=nl3DVQnm1m7XvhtgElSj8MX2JzEd86FKdlpMzzwopbNR5fKXpjg+T3p4S4Eb8Ynym XyeB/5PsE8Dr+UrST0bm1szpahZU8w1C+We315lFBzVLMVPE3Y8UPu27+hV/nk+8XV 4PUqLB9z3ERfsoIV/l0BO6UUH/KcFUK3wz/s2W/aZXNbZRi1yELOLVSFfKwiiR7JCY 3kF5CX4orewbupyauWJOXBd5qyBEwCBql33R3L5uqgYEcmOC3i07qPzgQqG4wW19bC U7DM7L8YTVD0A0T5ujSYcNllL/FE4F5YlLqKRrmx7M8cWMZvBP3PE086U4xbhr/D0b 66d96qNu9H7EQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@debbugs.gnu.org, Liliana Marie Prikler 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 (-) --=-sZWXQuWEFr/AFA/L+mAM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Maxim Cournoyer schreef op ma 07-02-2022 om 17:29 [-0500]: > +=C2=A0=C2=A0=C2=A0 char canonicalPath[PATH_MAX]; PATH_MAX does not exist on the Hurd, see . Also, according to more a kind of minimum and not really a maximum; apparently most uses of PATH_MAX are wrong. recommend= s a geometrically growing series. Greetings, Maxime. --=-sZWXQuWEFr/AFA/L+mAM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYgJCIhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7n+JAPwONRyMWBT3KiIC7XzrPjw+15KD oZ2itQAPIHcOOaFaSgEAgoKWwf9WCiLi5un6rFb6k97LgJaLYC1t1QbyJzvyQwo= =aTHT -----END PGP SIGNATURE----- --=-sZWXQuWEFr/AFA/L+mAM-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 09:25:52 2022 Received: (at 53676) by debbugs.gnu.org; 8 Feb 2022 14:25:52 +0000 Received: from localhost ([127.0.0.1]:45969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHRRH-0004nV-KN for submit@debbugs.gnu.org; Tue, 08 Feb 2022 09:25:52 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:39770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHRRG-0004nJ-Gy for 53676@debbugs.gnu.org; Tue, 08 Feb 2022 09:25:51 -0500 Received: by mail-qt1-f171.google.com with SMTP id e16so14806861qtq.6 for <53676@debbugs.gnu.org>; Tue, 08 Feb 2022 06:25:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=C50fow2l9JZvVNPpZ52zxXTlwUJ5LmjkTW5jTNjNmcY=; b=bY1st+2mvsFlYXKra5kIyCofYOpP8Piw/8CCqD699CflKh6hseuvXAhl3DZIFwuaoL iFN5kPCvaf6dZCfvhJP7zL7kEa7KOdjpwAGH3fst229zXFwxMupD/Y6fGHt747XvLno2 uKVHcGjvmDjcu8I+TRz5eMNd1lR9+1fyFTEaKoZR4uakbEnESnDSuyH14dCabIaqNm+m 8gqe7UnIsjUmn8To/SIUDGikk6Nt0l9VpxY0UOzykZ/WRpVOZ+89vSXaaUkUVl3sWiN6 Br3GniVgw+h11jVcm8OI+c2N4YXKGHFbudLB6Tp9L91hEp9DF78glo35R9fqhA4Jf4dM VBQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=C50fow2l9JZvVNPpZ52zxXTlwUJ5LmjkTW5jTNjNmcY=; b=CdZyxgNjuY8/foIVZZxxHwKyDfQHI+bOf0gcGvmdnhPcNvhQYnXUj8aKxxnCbJEjAU xvh3q+Xj8lvwsfD/wt1qvTN7houzJcx8DpJkqHP0qRFud75TONeaK9zSPryNSnQNdsPh EZtBqneKXOD6LlGccUYXGZNpkKyzbnp1wuKkZR5TYpRhMHIxHthekSjF3Gcewv8th17J HwQ9PwDEBV9ve3pD5S4CHJit3neu7HIU1T7w+elaOPcKb+mQBaWpoXT34+7rt2QnGA1H QBshQy1mUuQrr5u2m0H5OhGvM91ksfRNabkWdI1vwyJ+0j1/SbHJXFPX7ZvaNpAoAeSD wQKA== X-Gm-Message-State: AOAM531BnRKRzQdKPXH2hQe3/FJsJy06WWzUg350Auc0oBdjNmuSO8lx c6rIPlNzuC1gtSOqhRRZVhcHyXnoryg= X-Google-Smtp-Source: ABdhPJwnmjw36RXubMaMNHdqP8dNoFTtgKMAycc07gyckDhXlgcurxfGLM/qGmUXb4l0wxhCkneEVw== X-Received: by 2002:a05:622a:446:: with SMTP id o6mr3124859qtx.504.1644330343714; Tue, 08 Feb 2022 06:25:43 -0800 (PST) Received: from hurd (dsl-154-179.b2b2c.ca. [66.158.154.179]) by smtp.gmail.com with ESMTPSA id a22sm7534938qtx.38.2022.02.08.06.25.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 06:25:43 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: bug#53676: [PATCH 0/5] *** PulseAudio service improvements *** References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-5-maxim.cournoyer@gmail.com> <87mtj2z4xe.fsf_-_@gmail.com> Date: Tue, 08 Feb 2022 09:25:42 -0500 In-Reply-To: (Liliana Marie Prikler's message of "Tue, 08 Feb 2022 06:21:26 +0100") Message-ID: <87zgn11lll.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Jack Hill , 53676@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 (-) Hi Liliana, Liliana Marie Prikler writes: > Hi, > > Am Montag, dem 07.02.2022 um 17:29 -0500 schrieb Maxim Cournoyer: >> Thanks for this!=C2=A0 I wasn't aware of the history; I tried it and it >> failed the same.=C2=A0 The following fix I attempted in webkitgtk did not >> seem to do anything: >>=20 >> --8<---------------cut here---------------start------------->8--- >> modified=C2=A0=C2=A0 >> Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp >> @@ -24,6 +24,7 @@ >> =C2=A0#include >> =C2=A0#include >> =C2=A0#include >> +#include >> =C2=A0#include >> =C2=A0#include >> =C2=A0#include >> @@ -337,7 +338,16 @@ static void bindIfExists(Vector& args, >> const char* path, BindFlags bind >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bindType =3D "--ro-bind= -try"; >> =C2=A0=C2=A0=C2=A0=C2=A0 else >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bindType =3D "--bind-tr= y"; >> -=C2=A0=C2=A0=C2=A0 args.appendVector(Vector({ bindType, path, = path })); >> + >> +=C2=A0=C2=A0=C2=A0 // Canonicalize the source path, otherwise a symboli= c link could >> +=C2=A0=C2=A0=C2=A0 // point to a location outside of the namespace. >> +=C2=A0=C2=A0=C2=A0 char canonicalPath[PATH_MAX]; >> +=C2=A0=C2=A0=C2=A0 if (!realpath(path, canonicalPath)) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (strlen(path) + 1 > PATH_= MAX) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 retu= rn;=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // too long of a path >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 strcpy(path, canonicalPath);= // no-op >> +=C2=A0=C2=A0=C2=A0 } >> +=C2=A0=C2=A0=C2=A0 args.appendVector(Vector({ bindType, canoni= calPath, >> path })); >> =C2=A0} > Apart from raw char arrays and string.h looking funny (and wrong) in > C++, what is strcpy supposed to do here? Would it work if we mapped > canonicalPath to path (i.e. `ls path' in the container would be `ls > canonicalPath' under the hood)? I first went the C++ solution, which is std::filesystem::canonical, but was suggested in #webkitgtk (on the GNOME IRC server) to use the POSIX realpath, already in use in that file, upon finding out that their build system is configured to disallow the use of exceptions (-fno-exceptions). I refined the experiment as: --8<---------------cut here---------------start------------->8--- diff --git a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp b= /Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp index 0d5dd4f6986d..1512b73a985d 100644 --- a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp +++ b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp @@ -325,6 +325,18 @@ enum class BindFlags { Device, }; =20 +static void bindSymlinksRealPath(Vector& args, const char* path, + const char* bindOption =3D "--ro-bind") +{ + char realPath[PATH_MAX]; + + if (realpath(path, realPath) && strcmp(path, realPath)) { + args.appendVector(Vector({ + bindOption, realPath, realPath, + })); + } +} + static void bindIfExists(Vector& args, const char* path, BindFlag= s bindFlags =3D BindFlags::ReadOnly) { if (!path || path[0] =3D=3D '\0') @@ -337,6 +349,10 @@ static void bindIfExists(Vector& args, const = char* path, BindFlags bind bindType =3D "--ro-bind-try"; else bindType =3D "--bind-try"; + + // Canonicalize the source path, otherwise a symbolic link could + // point to a location outside of the namespace. + bindSymlinksRealPath(args, path, bindType); args.appendVector(Vector({ bindType, path, path })); } =20 @@ -615,17 +631,6 @@ static void bindV4l(Vector& args) })); } =20 -static void bindSymlinksRealPath(Vector& args, const char* path) -{ - char realPath[PATH_MAX]; - - if (realpath(path, realPath) && strcmp(path, realPath)) { - args.appendVector(Vector({ - "--ro-bind", realPath, realPath, - })); - } -} - // Translate a libseccomp error code into an error message. libseccomp // mostly returns negative errno values such as -ENOMEM, but some // standard errno values are used for non-standard purposes where their --8<---------------cut here---------------end--------------->8--- Which produced the intended bwrap arguments, but unfortunately that'd still fail. The issue seems to be related to attempt to bind /etc/pulse/client.conf over something already existing there; it can be simply reproduced with: --8<---------------cut here---------------start------------->8--- $ guix shell bubblewrap -- bwrap --ro-bind /gnu /gnu \ --ro-bind /etc /etc \ --ro-bind /etc/pulse/client.conf /etc/pulse/client.conf \ /gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8/bin/bash bwrap: Can't create file at /etc/pulse/client.conf: No such file or directo= ry --8<---------------cut here---------------end--------------->8--- One thing to try would be to not bind mount client.conf; /etc/ is already bind mounted as a whole. If the resolved paths are all bind mounted (which they are since we share the whole of /gnu), we should be OK. Alternatively we could try to bind only the resolved paths, and rewrite the environment variables such as PULSE_CLIENTCONFIG at run time in webkitgtk such that it points to the resolved destination. To be continued... Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 09:27:29 2022 Received: (at 53676) by debbugs.gnu.org; 8 Feb 2022 14:27:29 +0000 Received: from localhost ([127.0.0.1]:45974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHRSr-0004po-Ea for submit@debbugs.gnu.org; Tue, 08 Feb 2022 09:27:29 -0500 Received: from mail-qt1-f174.google.com ([209.85.160.174]:35551) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHRSl-0004pW-Th for 53676@debbugs.gnu.org; Tue, 08 Feb 2022 09:27:28 -0500 Received: by mail-qt1-f174.google.com with SMTP id j12so14803913qtr.2 for <53676@debbugs.gnu.org>; Tue, 08 Feb 2022 06:27:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=bZm0aj22Oq1X1c0l5SDfF4HiaBcZkeRsUTNQVS22vKY=; b=NdyfWPtUWnywlW76ENo5IbXKu7oAoEjd0E855VYCT6u3kGT19uz45dcJ1NuFep5xpV +ZIK34OpenMRdFB8Cy2aWOMEGubR6cSCpvUugh0IJ65ndqmIppZrMpboKOkXZ+HkElUu Ubl0axeBLKV83SjRVqeYHllugwAw1fjYKCL0N2ucbQCZv9d3+J6Xc0fuair2AZ+wuDZd 50sgX/gZxei2hpn6EA+OyYp1wsapo/5fmzwCyGCTliIakbXVtk+54GFchZ8ALf8PsMvO 2Q6T5J1Or0cXYG1YHHTsaGHziXng2uCSsIRiGGw5wIAVTeqhA0yAJCLoAHAVd5ccG4dm va5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=bZm0aj22Oq1X1c0l5SDfF4HiaBcZkeRsUTNQVS22vKY=; b=H6Xv8aLkHW6iIBjjMQfFqyhw35sJW9xLDjmXjcSvquyysaVuCN2SbOctEP3EcSHuKs UUNkYJ/t43a0uONcskYvDI9oa5iFr5wRriX6HG370UahExHxfImBrgnWo3xNuQk2wWXN v6p7rs1CnY0Uhjmy/UvCKRLEHo+qcBSc7N/hgy7XrEn+evx/i3b8RWcIGWHIHWHd04xq VxYqCRhDlK6wEed6yif/ohe2mp1+ZeEYz6jKpviq2zgcIIviMGmFTJIqgQWqfLoV4hls R5PJ8Eg23mOtRHSLPBWaoM3nzKn/sbDO+CGdxuljlU/CIvFTiw+qSQqh4Uq0wbu0YV2T KODg== X-Gm-Message-State: AOAM531hy4RA5deaUO18gauWtk6FysSMOcPFv/Lil7mx2lTeDhzKF6cA BBP3miCucmm3LeeN0alL8S3zZdDPTBc= X-Google-Smtp-Source: ABdhPJzc6miwGKbZ07jj1MpzNOJI1e+ni1647X2WJzEkKrwi9RjHh3fICiK2YrozhQjD+nEek969Mg== X-Received: by 2002:a05:622a:215:: with SMTP id b21mr3081131qtx.199.1644330438523; Tue, 08 Feb 2022 06:27:18 -0800 (PST) Received: from hurd (dsl-154-179.b2b2c.ca. [66.158.154.179]) by smtp.gmail.com with ESMTPSA id k20sm7526385qtx.64.2022.02.08.06.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 06:27:18 -0800 (PST) From: Maxim Cournoyer To: Maxime Devos Subject: Re: [bug#53676] [PATCH 0/5] *** PulseAudio service improvements *** References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-5-maxim.cournoyer@gmail.com> <87mtj2z4xe.fsf_-_@gmail.com> Date: Tue, 08 Feb 2022 09:27:17 -0500 In-Reply-To: (Maxime Devos's message of "Tue, 08 Feb 2022 11:12:50 +0100") Message-ID: <87v8xp1liy.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Jack Hill , 53676@debbugs.gnu.org, Liliana Marie Prikler 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 Maxime, Maxime Devos writes: > Maxim Cournoyer schreef op ma 07-02-2022 om 17:29 [-0500]: >> +=C2=A0=C2=A0=C2=A0 char canonicalPath[PATH_MAX]; > > PATH_MAX does not exist on the Hurd, see > . > Also, according to > more a kind of minimum and not really a maximum; apparently > most uses of PATH_MAX are wrong. > > recomme= nds a > geometrically growing series. Interesting! Note that PATH_MAX is already in use in that BubblewrapLauncher.cpp file. Thanks for the links! Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 09:29:37 2022 Received: (at 53676) by debbugs.gnu.org; 8 Feb 2022 14:29:37 +0000 Received: from localhost ([127.0.0.1]:45979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHRUu-0004sh-SI for submit@debbugs.gnu.org; Tue, 08 Feb 2022 09:29:37 -0500 Received: from mail-qk1-f172.google.com ([209.85.222.172]:37533) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHRUt-0004sS-6F for 53676@debbugs.gnu.org; Tue, 08 Feb 2022 09:29:35 -0500 Received: by mail-qk1-f172.google.com with SMTP id 71so13806555qkf.4 for <53676@debbugs.gnu.org>; Tue, 08 Feb 2022 06:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=KT1I9kRuDCAXmdXCwgLb5ikHOyZFO6PQzYCARJ3OZxQ=; b=kcCWlxjrBxMa5GdPc0NMNTYGjQoiAMzY5+O8pItS5ERsoUkY7NsHrsVq5cXzoDXGnE tymvBhNR5AYQ9amf9JtwpduJhVAhY+Be12zV/ZgQpSIOBe7TGtJTZEDImzBww7yUb1+5 eKmWiHRRfhlJDj69ufseZYP7KYnpVYS66mu+IkGM/12XGexX6+JnZsICk86HxfY4zCTK podPuPyXhO6mUYHUCafS6OEh2cFN/4f13OKXQ0xNLNU4eFWJXMNS8jBzWgV8yWn+Uqyo 4Qxdi+2kmSvif7xs8yiXLjlxB18yCqJ2QH0VxkFxOaUmnBiMfeRf8zkmDfRa8fmAfvvW gK7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=KT1I9kRuDCAXmdXCwgLb5ikHOyZFO6PQzYCARJ3OZxQ=; b=F9f40wMnwMe3pwY4NRD2JNHusPLQKI5Z9NhVbj+WrAmgVKJbqqOpCFxYDmcQln9Mah ugkG8oXe90UgaSr6nJz0wmTl8qxwIoBHHltcQNHKS3S9oy7EvCSiblKlAGy2Ib7HRKGz utonui6XuDlj3MR6ta0UvRcVtrFqDgwTUbT4/Na3FI8kLDn/gDPg6gYAIsNyrf5OeG1B z2QtJYT0jgunA/ixaEIVVGQzYsExNDkfqixJpstx0untsdGaIQ7yppYUJXngKkKopjGG T4PyxttqQ7QZqVt5BwEjEvmnBiSUQuGdtE8HAI8P+uamY/ZcqSX+Umb42xWB8RPDiShw U6cw== X-Gm-Message-State: AOAM531yvPJZBah39KVDfO8xaqagXPaSKRgG0w73/BzbbC1YjJJdNbi/ OnQpPH1cMvufnibJEUUJitGdqbkNTWo= X-Google-Smtp-Source: ABdhPJxUNfvcqsOYvZp5c1z5r7w6i+Q/dG0qil7hPEuIVezWJMU4GKiL6dhRSKZKzOQ2lzyiJlnWFQ== X-Received: by 2002:a37:9cc:: with SMTP id 195mr2599420qkj.529.1644330569485; Tue, 08 Feb 2022 06:29:29 -0800 (PST) Received: from hurd (dsl-154-179.b2b2c.ca. [66.158.154.179]) by smtp.gmail.com with ESMTPSA id n7sm7409355qkp.119.2022.02.08.06.29.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 06:29:28 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: bug#53676: [PATCH 0/5] *** PulseAudio service improvements *** References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-5-maxim.cournoyer@gmail.com> <87mtj2z4xe.fsf_-_@gmail.com> Date: Tue, 08 Feb 2022 09:29:27 -0500 In-Reply-To: (Liliana Marie Prikler's message of "Tue, 08 Feb 2022 06:21:26 +0100") Message-ID: <87r18d1lfc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Jack Hill , 53676@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 (-) Hi again, I forgot to mention; apparently the best/complete way to setup PulseAudio in a BubbleWrap container is as flatpak does it; I was pointed to this code: https://github.com/flatpak/flatpak/blob/4470bf142523e8a9bd6791880a66676225dea555/common/flatpak-run.c#L725, but I haven't had time to review it much yet. Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 14:32:02 2022 Received: (at 53676) by debbugs.gnu.org; 8 Feb 2022 19:32:02 +0000 Received: from localhost ([127.0.0.1]:48708 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHWDa-0007Sf-EN for submit@debbugs.gnu.org; Tue, 08 Feb 2022 14:32:02 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:39599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHWDY-0007SF-5Y for 53676@debbugs.gnu.org; Tue, 08 Feb 2022 14:32:01 -0500 Received: by mail-ed1-f67.google.com with SMTP id u18so503880edt.6 for <53676@debbugs.gnu.org>; Tue, 08 Feb 2022 11:32:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=ssIRlFAFWJUIB5+LBFzHwGjgFRwdXgeORLF4t/sOFG0=; b=B1lPwUTEf4b5SAWMrz+7oZGSxPmNnH0AHFtub0Rr8KsKf9191kFO3niKyCcVvHagnF HmHWig0QekVfHnK6CFqckre/2Syi95ixymO71rbO5SXcJUOrg9hl5BNMdLco80sTsN4C pfzCIrXkae2EIY3/1sWFzJ94BuoFVR0muXb3iKzoiuEBbMrIK69T1f5414tjuxIGoZbW CqHc4SvrLuPYu7PhQyhA1YeRCvH0rLkDKSlNBzSGvkaO+Sk03Yt4yOp4a+Ttmoj8y60B yJ/W03EYeVtyVDpKoZTUIMPMftWxTNB7HglxQCsN94UeosboNVJ/FYLor2OerejZB2Ra 42Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=ssIRlFAFWJUIB5+LBFzHwGjgFRwdXgeORLF4t/sOFG0=; b=CGEpfGicwMrAFSTWx+LRFE0w4A5q0QUH4/KdDQT+cGakeEVB1POD53Ecy3lUMqsHQ9 D3JSnCZzWl+YdGvN+JZa0QbLGAk5U9Z2C0S01UCIezXp7oFbjysqLbJX0d1X0w9M1JxZ m5lOk8LIsYWzNRJvw8GGrSWLZ1lTKs55ue0YeoGywnH8hvy4hzaiKPo2c0XyukFY2pR2 m9IJqWG4OuBeWfqmRqQqDPK6HS28SyOv0ITMaVe4UwTLjDSc6lh7UYZZX8RLT8IHmzHC F2/XXsIiP4NIkndtnNqVCGYIk8HPCTxqdCN0KaqGARP8MGKy3mp9eDKqo3mR7+RDZ0MR NLTA== X-Gm-Message-State: AOAM533kmSS6zzXVFl1feDaGTsWvdNiY7WKBXaG7Rx3P41JhSaOuze2C T2TaOV29AC5BlKsKy7PXspM= X-Google-Smtp-Source: ABdhPJw3KCx3FzW+XZYtKYoG5Wuib0rn+m+hbh0HVyDxEmTKJDPe3HciB0Or1S0lY2eVBTkNxJlK8g== X-Received: by 2002:aa7:c689:: with SMTP id n9mr6085672edq.412.1644348714009; Tue, 08 Feb 2022 11:31:54 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id cr8sm7326217edb.47.2022.02.08.11.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Feb 2022 11:31:53 -0800 (PST) Message-ID: Subject: Re: bug#53676: [PATCH 0/5] *** PulseAudio service improvements *** From: Liliana Marie Prikler To: Maxim Cournoyer Date: Tue, 08 Feb 2022 20:31:52 +0100 In-Reply-To: <87zgn11lll.fsf@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-5-maxim.cournoyer@gmail.com> <87mtj2z4xe.fsf_-_@gmail.com> <87zgn11lll.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, Am Dienstag, dem 08.02.2022 um 09:25 -0500 schrieb Maxim Cournoyer: > Hi Liliana, > > Liliana Marie Prikler writes: > > > Hi, > > > > Am Montag, dem 07.02.2022 um 17:29 -0500 schrieb Maxim Cournoyer [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, https://senderscore.org/blocklistlookup/ [209.85.208.67 listed in bl.score.senderscore.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liliana.prikler[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.67 listed in wl.mailspike.net] -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: 53676 Cc: Jack Hill , 53676@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: 0.3 (/) Hi, Am Dienstag, dem 08.02.2022 um 09:25 -0500 schrieb Maxim Cournoyer: > Hi Liliana, > > Liliana Marie Prikler writes: > > > Hi, > > > > Am Montag, dem 07.02.2022 um 17:29 -0500 schrieb Maxim Cournoyer: > > > Thanks for this!  I wasn't aware of the history; I tried it and > > > it > > > failed the same.  The following fix I attempted in webkitgtk did > > > not > > > seem to do anything: > > > > > > --8<---------------cut here---------------start------------->8--- > > > modified   > > > Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp > > > @@ -24,6 +24,7 @@ > > >  #include > > >  #include > > >  #include > > > +#include > > >  #include > > >  #include > > >  #include > > > @@ -337,7 +338,16 @@ static void bindIfExists(Vector& > > > args, > > > const char* path, BindFlags bind > > >          bindType = "--ro-bind-try"; > > >      else > > >          bindType = "--bind-try"; > > > -    args.appendVector(Vector({ bindType, path, path > > > })); > > > + > > > +    // Canonicalize the source path, otherwise a symbolic link > > > could > > > +    // point to a location outside of the namespace. > > > +    char canonicalPath[PATH_MAX]; > > > +    if (!realpath(path, canonicalPath)) { > > > +        if (strlen(path) + 1 > PATH_MAX) > > > +            return;                  // too long of a path > > > +        strcpy(path, canonicalPath); // no-op > > > +    } > > > +    args.appendVector(Vector({ bindType, canonicalPath, > > > path })); > > >  } > > Apart from raw char arrays and string.h looking funny (and wrong) > > in > > C++, what is strcpy supposed to do here?  Would it work if we > > mapped > > canonicalPath to path (i.e. `ls path' in the container would be `ls > > canonicalPath' under the hood)? > > I first went the C++ solution, which is std::filesystem::canonical, > but was suggested in #webkitgtk (on the GNOME IRC server) to use the > POSIX realpath, already in use in that file, upon finding out that > their build system is configured to disallow the use of exceptions > (-fno-exceptions).  I refined the experiment as: > > --8<---------------cut here---------------start------------->8--- > diff --git > a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp > b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp > index 0d5dd4f6986d..1512b73a985d 100644 > --- a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp > +++ b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp > @@ -325,6 +325,18 @@ enum class BindFlags { >      Device, >  }; >   > +static void bindSymlinksRealPath(Vector& args, const char* > path, > +                                 const char* bindOption = "--ro- > bind") > +{ > +    char realPath[PATH_MAX]; > + > +    if (realpath(path, realPath) && strcmp(path, realPath)) { > +        args.appendVector(Vector({ > +            bindOption, realPath, realPath, > +        })); > +    } > +} > + >  static void bindIfExists(Vector& args, const char* path, > BindFlags bindFlags = BindFlags::ReadOnly) >  { >      if (!path || path[0] == '\0') > @@ -337,6 +349,10 @@ static void bindIfExists(Vector& args, > const char* path, BindFlags bind >          bindType = "--ro-bind-try"; >      else >          bindType = "--bind-try"; > + > +    // Canonicalize the source path, otherwise a symbolic link could > +    // point to a location outside of the namespace. > +    bindSymlinksRealPath(args, path, bindType); >      args.appendVector(Vector({ bindType, path, path })); >  } >   > @@ -615,17 +631,6 @@ static void bindV4l(Vector& args) >      })); >  } >   > -static void bindSymlinksRealPath(Vector& args, const char* > path) > -{ > -    char realPath[PATH_MAX]; > - > -    if (realpath(path, realPath) && strcmp(path, realPath)) { > -        args.appendVector(Vector({ > -            "--ro-bind", realPath, realPath, > -        })); > -    } > -} > - >  // Translate a libseccomp error code into an error message. > libseccomp >  // mostly returns negative errno values such as -ENOMEM, but some >  // standard errno values are used for non-standard purposes where > their >  --8<---------------cut here---------------end--------------->8--- Note that Webkit has a FileSystem namespace with a realPath function that does std::filesystem::canonical already. > Which produced the intended bwrap arguments, but unfortunately that'd > still fail.  The issue seems to be related to attempt to bind > /etc/pulse/client.conf over something already existing there; it can > be simply reproduced with: > > --8<---------------cut here---------------start------------->8--- > $ guix shell bubblewrap -- bwrap --ro-bind /gnu /gnu \ >     --ro-bind /etc /etc \ >     --ro-bind /etc/pulse/client.conf /etc/pulse/client.conf \ >     /gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal- > 5.1.8/bin/bash > bwrap: Can't create file at /etc/pulse/client.conf: No such file or > directory > --8<---------------cut here---------------end--------------->8--- > > One thing to try would be to not bind mount client.conf; /etc/ is > already bind mounted as a whole.  If the resolved paths are all bind > mounted (which they are since we share the whole of /gnu), we should > be OK. Do we really need to bind all of /etc? I think it'd make sense to try and shrink that. Not bind-mounting it is not a solution IIUC. At least it appears that is the standard quo in which the symlink is unresolved. I think bubblewrap simply ignores symlinks due to their inherent TOCTOU characteristics and other "fun" things one could do with them. > [...] > > To be continued... From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 23 22:48:19 2022 Received: (at control) by debbugs.gnu.org; 24 Feb 2022 03:48:19 +0000 Received: from localhost ([127.0.0.1]:47051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nN575-0006BN-17 for submit@debbugs.gnu.org; Wed, 23 Feb 2022 22:48:19 -0500 Received: from mail-qk1-f169.google.com ([209.85.222.169]:34739) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nN573-0006B6-3N for control@debbugs.gnu.org; Wed, 23 Feb 2022 22:48:17 -0500 Received: by mail-qk1-f169.google.com with SMTP id 185so861811qkh.1 for ; Wed, 23 Feb 2022 19:48:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:from:subject; bh=5FfuGj6kUv6kpsAGt4RCvKFOgSJvxA2TlCM+o0f+ZLE=; b=BuzGyIaxqmP+6iwRWKoZ/FewM6erD4DLbOaeobRZ3Qtacsq3DBQCNRXa4zT5FPzDNH EDWL9PonLh8fO5fs0snnicW+bK3egC8qL5MG3uvpMOWqTEMQDhE18ajI/bnITHQXoVHP 3I5dGV8E0K7BuYc5BDP6QG6I08b9KNLmws+qEZ20+zFaEtKcljjb8E0rk7Mz8FScIGxF Fd8TCO0L+xkUhxfjH54qyljf0RV0UcGmFw2PIhF557Zws2KZFP8n0BrpMkd7BFrUEY6+ IKgoJAsTs4YQluBqyIW71RDTwVGa8n1SuAdZKuzjE81mYcfm5HK5n86TclWXHsPRHg/e Xx+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:from:subject; bh=5FfuGj6kUv6kpsAGt4RCvKFOgSJvxA2TlCM+o0f+ZLE=; b=2tqFbuZJCUFWXuqF8riu7GzozxdTNoeohrqQ7IP0bnO+64WoMXmrjz78sLrkWwRAk0 nxynYQUqVa2/5dcLudyoSNJaak1GwbuIp+WG810tnGHYGlrclplT1nB/fCodgKPyf1FK WVIeNnBvMyZSVayvPvtXGQV09imB3mtTdwCVDfHjp43z7ziwE7SgNxOFg/1121jEqvb4 xnJiKA3iDXt+hPrgQ8s415ezxPVHd0lDhoDMNeMNRJRAu+smMuyGAfpZ8lmw30Yiwb3T IT6+VKh+3Gmss+Jocf9i5eIpTYiaG1iXobE21xWBegaBrnXCLCuY2jzNTCOZRMbjS953 hv3g== X-Gm-Message-State: AOAM530YAT9yHGRN7abbsNkf24Nk0sRT6awg3CtVDvTFpPwyZwsuLtft kscZK6RMNT+abuz641Bbnh9dCT0wDiU= X-Google-Smtp-Source: ABdhPJyjjItcGX2cgsWTBysncHj/POMHgZuQ7za9z7RlVNhI4HTiYtYjMxiFEzm05YOH2VR2hOxXzQ== X-Received: by 2002:a37:946:0:b0:47d:6768:edcc with SMTP id 67-20020a370946000000b0047d6768edccmr503541qkj.120.1645674491185; Wed, 23 Feb 2022 19:48:11 -0800 (PST) Received: from hurd (dsl-156-1.b2b2c.ca. [66.158.156.1]) by smtp.gmail.com with ESMTPSA id i4sm966469qti.24.2022.02.23.19.48.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 19:48:10 -0800 (PST) Date: Wed, 23 Feb 2022 22:48:09 -0500 Message-Id: <87sfs9kjra.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #53676 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 (-) block 53676 by 54135 quit From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 09:42:55 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 14:42:55 +0000 Received: from localhost ([127.0.0.1]:47996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNFKZ-0005OU-AI for submit@debbugs.gnu.org; Thu, 24 Feb 2022 09:42:55 -0500 Received: from mail-qv1-f54.google.com ([209.85.219.54]:47100) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNFKY-0005OH-EP for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 09:42:54 -0500 Received: by mail-qv1-f54.google.com with SMTP id j5so3803521qvs.13 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 06:42:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=6AXZ4BxkngeUzlBsNOJfzQr9AzrOWhAaVGrF0rVPzZc=; b=KpiHs2TjM/sep2yGFF/ndhCnETFL+js/YkYjrJak3OcUy/UY7cC4Q/4yfK6r8m2qlG 8xybNz6MNrjm7FuoKhieZUu1Oe3GuStBGi7WtjntzDvjPc2Ce4EZjboktC/MmZydX+zS YEZtaJHEJyhgV9EdhRE0NzPM4yXYWrlbUEUerI0jUZMEBCWm1trYUbeQgxiL3z842K/W x45y0ZVYAOIapVuZd59bWqUjWa7AE3BXWIco+eDgkZtBWRSbN8zoJPe4i1zC3H7fskH3 tyeL+YPPMoN6hNIlbnbNNWYbky8UOvA1WYdciBfjJDc/nggUgpnT1/i7M4Ei2APb3wDD ePOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=6AXZ4BxkngeUzlBsNOJfzQr9AzrOWhAaVGrF0rVPzZc=; b=Du6DjOqn6mGnhfe20CPJs2XHRw5HK1UnEtutHdqht3C/A/HYTbu3Kbyc0L2Z66nX0t iYPG08p0g0HDYOqlkUrCOt23qmJ9So5Wu8X5eImadkEwP4Ok+MEEKx5yy5hpp3H4xtTe CYHVOsYzPAfZEybk1MsU16VFY84nD5GJYMsOlfiuWknbVjbg0XewZha2a82SE1pBQzlr g4JefuFJtIcAPUHGjG+p9iZm8skYtuGazlyVf0MZLGktJkOrHpemjO9a8c2PTUDeGHlg 6rUYb5s4CGcPk16IQCSTGFa2FTQLzr6wakTqpHVCUQE8Zj1jTL6zk4h+AQTJ/e3HKeXL DZGQ== X-Gm-Message-State: AOAM533uJPkuDEofZPyqhKKwwEQrbK77thHPqWLe3eNKnhrh35wX9b5o b29nwoaLSxjHD1KGQ1G2U+iYGWI7/u92WA== X-Google-Smtp-Source: ABdhPJybs7F0ZJBKYzHI24xkeczjfveAPKSga8UbS0HcTgCtxwCcgpLyPXa1UTdve+uQOsusygmnkw== X-Received: by 2002:a05:622a:c:b0:2dd:b184:c181 with SMTP id x12-20020a05622a000c00b002ddb184c181mr2519737qtw.273.1645713768623; Thu, 24 Feb 2022 06:42:48 -0800 (PST) Received: from hurd (dsl-156-1.b2b2c.ca. [66.158.156.1]) by smtp.gmail.com with ESMTPSA id o81sm1344504qke.134.2022.02.24.06.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 06:42:48 -0800 (PST) From: Maxim Cournoyer To: Jack Hill Subject: Re: [bug#53676] [PATCH 5/5] services: pulseaudio: Deploy the configuration files to /etc/pulse. References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-5-maxim.cournoyer@gmail.com> Date: Thu, 24 Feb 2022 09:42:46 -0500 In-Reply-To: (Jack Hill's message of "Wed, 2 Feb 2022 17:43:21 -0500 (EST)") Message-ID: <87k0dkjpg9.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@debbugs.gnu.org, Liliana Marie Prikler 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 Jack, Liliana, Jack Hill writes: > On Tue, 1 Feb 2022, Liliana Marie Prikler wrote: > >> Hi, >> >> Am Montag, dem 31.01.2022 um 23:19 -0500 schrieb Maxim Cournoyer: >>> * gnu/services/sound.scm (pulseaudio-environment) >>> [PULSE_CONFIG, PULSE_CLIENTCONFIG]: Use fix locations, and move logic >>> to... >>> (pulseaudio-etc): ... this service extension.=C2=A0 Guard against produ= cing >>> empty files. >> >> This patch reproduces (more or less) the initial layout we had for >> pulseaudio-service-type. =C2=A0However, that layout has been reported to= not >> work with some sandboxes. I tried tracking down a specific bug, but >> could only gather . >> >>> Due to a bug with webkit sandboxing, we no longer put daemon.conf >>> into /etc/pulse (my bad), but rather set PULSE_CONFIG to directly >>> point to it. Our webkitgtk has not been patched so that keeping PULSE_CLIENTCONFIG pointing to /etc should work, unblocking this series. I'll now address the remaining comments from Liliana and send an updated series. Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 11:25:13 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 16:25:13 +0000 Received: from localhost ([127.0.0.1]:50233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNGvY-0002U0-Tr for submit@debbugs.gnu.org; Thu, 24 Feb 2022 11:25:13 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:35687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNGvX-0002Tg-3g for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 11:25:11 -0500 Received: by mail-qv1-f50.google.com with SMTP id 8so4495729qvf.2 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 08:25:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=y/nicHGhJRl9eRolkeLC27HQVxzu8HBQYLFGePJcqiA=; b=XebcqwGxXyJo3o/6RymZMOnNfRHCvA0QW+LSVIenIHQ8QjXx6QD9XmZE+lXbUFditG ml90ckq92nacDat+hbY+XciEi8u01wQ54xyLhXDaSMOfwWy80uHqORCJ0znhNGMpxptd 5nWd7zP0KzvW1UbeRnhfhCRHEelrUygZPr95cvLs3uNdu2MzxPbGyAl1/LU84CBBnqNm vuAyoI1HdwhG+RM5y7DJ8TAoH7pl7/pnmDjdB0vpoX790PzDDoY27BtPZxAVQuw+Uujw pUcye6/ewKbMkCneVdrNiJlF7oBsW8t4deeERV9B5Y16UlZ1zSGL2rST25hgChmGkMN+ x6kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=y/nicHGhJRl9eRolkeLC27HQVxzu8HBQYLFGePJcqiA=; b=xW+kVemgS4cpOdHFlRg9WiGQzpr+Z/p9xCnwTSFMSpvtVl/QHRpphGLTOvf/yFpMet bBkRfnYJ4BCgoFOK7AnxlhhuvphQyHr4k9VvBfXhbHWbjGA0HhIXShg71Y49T4TTqAEn Nfi6QSzgV/inbKkNlUAsYwXGXwcyStwEtdmgCh+cAMbC3PGic/6KBKT7RkrNQMcjLeOZ mbT2Hj7tBvsQWYWwFKm3Vy7oN1UG3KF073Tr3JoiffZkKMxI4ZbQkzWYCS3lPkBJg6OO 9KylACOjaJdz4VaamaVYve1apYSBGMB9nKUHQAYim4dnazmw6P/+CRu2fkjPP3bq+ONs eUQA== X-Gm-Message-State: AOAM533t8OVMl9KXmN4OwDPVumRXApudxZzTkw4pe/K6TrvFqJNMzxli /JxK7fxaoqYJVfWBIwyRM40KAXAZYaYpWQ== X-Google-Smtp-Source: ABdhPJzOEG/g6OrElnlGnWtSgQqW/8DUO7fPS7+vpGr6rYQ6QZXuk7jGuhnjhRyhvR+r+7RVf8MSeA== X-Received: by 2002:ad4:564b:0:b0:42c:3cdb:16c7 with SMTP id bl11-20020ad4564b000000b0042c3cdb16c7mr2693321qvb.86.1645719905093; Thu, 24 Feb 2022 08:25:05 -0800 (PST) Received: from hurd (dsl-156-1.b2b2c.ca. [66.158.156.1]) by smtp.gmail.com with ESMTPSA id c7sm1615135qtp.61.2022.02.24.08.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:25:04 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: [PATCH 4/5] services: pulseaudio: Add an extra-script-files configuration field. References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-4-maxim.cournoyer@gmail.com> <97111754acacc576aec4eb55889a32474fe71f95.camel@gmail.com> <871r0m1gdy.fsf@gmail.com> <3c9845d7b893dddcd44be41d2ee475c29d9f5a85.camel@gmail.com> <87o83qyltg.fsf@gmail.com> <2b8017576ee2570fd38ab61729556e31694b2552.camel@gmail.com> <87czk01mp8.fsf@gmail.com> Date: Thu, 24 Feb 2022 11:25:03 -0500 In-Reply-To: (Liliana Marie Prikler's message of "Sun, 06 Feb 2022 09:02:22 +0100") Message-ID: <874k4ojkps.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Liliana, Liliana Marie Prikler writes: [...] > Note that file-like->name serves multiple duties here. In my opinion > it'd be better to > > (define (file-like-name file) > ((match file > ((? local-file?) local-file-name) > =C2=A0((? plain-file?) plain-file-name) > =C2=A0((? computed-file?) computed-file-name) > [...] > (_ (const #f))) ; alternatively raise an error > file)) > > That at least decouples it from the burden of having to check whether > it is a valid pulseaudio script file name, which makes it reusable > elsewhere. I've modified it like so: --8<---------------cut here---------------start------------->8--- modified gnu/services/sound.scm @@ -154,21 +154,24 @@ (define (extra-script-files->file-union extra-script-= files) "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE-UNIO= N." (define (file-like->name file) - (let ((name (match file - ((? local-file?) - (local-file-name file)) - ((? plain-file?) - (plain-file-name file)) - ((? computed-file?) - (computed-file-name file)) - (_ (leave (G_ "~a is not a local-file, plain-file or \ -computed-file object~%") file))))) - (unless (string-suffix? ".pa" name) - (leave (G_ "`~a' lacks the required `.pa' file name extension~%") - name)) - name)) - - (let ((labels (map file-like->name extra-script-files))) + (match file + ((? local-file?) + (local-file-name file)) + ((? plain-file?) + (plain-file-name file)) + ((? computed-file?) + (computed-file-name file)) + (_ (leave (G_ "~a is not a local-file, plain-file or \ +computed-file object~%") file)))) + + (define (assert-pulseaudio-script-file-name name) + (unless (string-suffix? ".pa" name) + (leave (G_ "`~a' lacks the required `.pa' file name extension~%") na= me)) + name) + + (let ((labels (map (compose assert-pulseaudio-script-file-name) + file-like->name + extra-script-files))) (file-union "default.pa.d" (zip labels extra-script-files)))) --8<---------------cut here---------------end--------------->8--- Thanks for the suggestion. I'll be sending a v2 series soon. Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 11:31:32 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 16:31:33 +0000 Received: from localhost ([127.0.0.1]:50239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH1g-0002eI-LW for submit@debbugs.gnu.org; Thu, 24 Feb 2022 11:31:32 -0500 Received: from mail-qv1-f46.google.com ([209.85.219.46]:42648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH1e-0002e5-Ok for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 11:31:31 -0500 Received: by mail-qv1-f46.google.com with SMTP id e22so4473242qvf.9 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 08:31:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=fgtXJzuekx1+ZgDnLU+5K6/2LxksjgdneLkUyzRIe8E=; b=cIRzqH5JkKDY8g2HzPCQeLw/tzXHQpfjskxVOPE23tNTK2Z9uE78yxFmBn5iTUoUH2 M2vB3FvLc3QlF0Jt5AxmVyp+LKSKadVIDIrnmgOjXsxk4fEGXBl/Pgl/iHPpgkiER19A NnFICermt8VZe01sHEzsJkAs8BrGTdXKk8T7BAHh38GRh4PDSxF3iGrU2Tg3OPwiGdU8 7x57q3uCjpu4ty1PXB91jAkmmnBX008Jo6MdYeivQ5JObXnwJhkp4U9JQBG2+4aI9nkC q3s8dwSiV25BT25YJNkzj6eGmz3VZAc9IGgaECHS3Mc0+OEpIsnfw36EHoCn9+uyAi4R o6xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=fgtXJzuekx1+ZgDnLU+5K6/2LxksjgdneLkUyzRIe8E=; b=mSgsswmMu94pot0EeBVHFP1MXhFRJL2k6yjppUs26b6ybqEJQtpDkUbfLJl7ySGhi/ amIOtxnSbhY/dVNYtqtsU/Cu+vgXpJ5SByrp1/9fM6t2Q8EgJv9ijB8bSEZiF+meL/Mb JmsRei9x7EZh+ydBjeVg/7nSSZ/VtDvv1RSkRb6boOafI/FR4LGDyJWCftqW9Nu9igEJ eeYIK+7LSvBpnlVcGwNDAszbuR+DYMGKw4XpFmXrGgLBp0TvrBQgraCowCxCmrTEFm/0 C0LEan8JlpgAK34B6vJeQPqC2O2TITSQdiOLiPnuWJAxRAa6+pKjzK0LyjeSeCpfe6Xm tRtQ== X-Gm-Message-State: AOAM5314FBUPDiN8XzgXwrta0n+dptszjlPKfjC2ZWJEutkE8otDQwjz ElKEDivgKhF45gQqjMDR7pAr+hWHKkjyDA== X-Google-Smtp-Source: ABdhPJxyE4M8ovNhw1HcdiUTkP1SAwoZuudfMfYBN6ivH9XC78jbzhlm+dPD96MHVu4zJfCNNsGWEw== X-Received: by 2002:a05:622a:1b8d:b0:2d9:7048:5d68 with SMTP id bp13-20020a05622a1b8d00b002d970485d68mr3187170qtb.5.1645720284976; Thu, 24 Feb 2022 08:31:24 -0800 (PST) Received: from hurd (dsl-156-1.b2b2c.ca. [66.158.156.1]) by smtp.gmail.com with ESMTPSA id u12sm1971329qta.76.2022.02.24.08.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:31:24 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: bug#53676: [PATCH 0/5] *** PulseAudio service improvements *** References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-3-maxim.cournoyer@gmail.com> <693cc82d449395853247c7fbf1b44d0a3c979c87.camel@gmail.com> <875ypy1gqd.fsf@gmail.com> <87k0edzy8j.fsf@gmail.com> <2ed5ef40ecc06c783af81de129a62d3c42d87fec.camel@gmail.com> <87h79c1p86.fsf_-_@gmail.com> Date: Thu, 24 Feb 2022 11:31:23 -0500 In-Reply-To: (Liliana Marie Prikler's message of "Sun, 06 Feb 2022 10:07:38 +0100") Message-ID: <8735k8jkf8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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: -0.9 (/) Hi Liliana, Liliana Marie Prikler writes: [...] > The way I wrote above is the way I intended pulseaudio- service-type > to be used and it's in terms of writing the pulseaudio configuration > not that much harder than what you are proposing. It'd be trivial to > add a clause to ".include /etc/pulse/default.pa.d" through the service > configuration layer. Also with pulseaudio < 15.0, you could =E2=80=93 af= ter > groking gexps a little =E2=80=93 produce > > .include /gnu/store/7xwgz4bavb1i8sfx1lm55hlrr3ngjkdx-pulseaudio- > 15.0/etc/default.pa > .include /gnu/store/12345678901234567890123456789012-audigy-card.pa > .include /gnu/store/12345678901234567890123456789013-other-stuff.pa > [...] > > > inside that mixed-text-file. With pulseaudio 15.0, you can also > > (define my-pulseaudio-extra-config > (directory-union ...)) > > and use it like > > (script-file > (mixed-text-file "default.pa" > ".include" > (file-append pulseaudio "/etc/default.pa") > ".include" my-pulseaudio-extra-config)) That is nice, but is still a bit more demanding from users: 1. They need to know how to compose multiple G-Exps expressions such as mixed-text-file and file-append. 2. They need to know to use ".include" directives from PulseAudio. My proposed change reduces the knowledge needed to just a single usage of a G-Exp file-like object, such as plain-file or local-file; I think that's a bit easier to grok for starters. The resulting configuration is also easy to inspect; it's all under /etc/pulse as the user would expect. Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 11:36:28 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 16:36:28 +0000 Received: from localhost ([127.0.0.1]:50243 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH6S-0002lG-9n for submit@debbugs.gnu.org; Thu, 24 Feb 2022 11:36:28 -0500 Received: from mail-qk1-f169.google.com ([209.85.222.169]:39865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH6R-0002l3-45 for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 11:36:27 -0500 Received: by mail-qk1-f169.google.com with SMTP id t21so2257927qkg.6 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 08:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=KN8Fzt92Sq1XYzbBQB4OJ0mZuxKhTtUH8AHoByD56f4=; b=qYJEd+GFoMfnN+Lc0BM1KX5FzSzdrW8DQ4LSC61lDpzuCEghH9+sgPYecYzmRuaujL fdg+6rvAxgMRdbZDCouB5War3PbUTo5Iy7IOA3oDzHXJ9MhOrN8A1YX0Zqu9x/iwcEHo qxKX5GnZVqoLpICps6+v57yPWNuaCtkGYTC8v0ekuixrh+l9zp5XWfsg2OHjaAMDq+65 puHofOKUXHrJKfZCZiwIltDqX47wkidsx6eYizo+ggDkRgFe69z/TEQI7iU3qn45QQsy Kfs84wjnLPvFDAN5Ef6ZrVsDpxEvecEjHg9cHzGBARNp9uFh5rSwaMWx/n628G+cDMWX L6nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=KN8Fzt92Sq1XYzbBQB4OJ0mZuxKhTtUH8AHoByD56f4=; b=sPzEGvGK/oZQjDEBV+n1AkvzRan5I85wiosp1/eOzVgB0VOMPCoHdkHAHCpFWtl30a O6ChEqpRFhNUx79rIea6nz//sHw9GMq2eSV4Cz9WHRaWUPZPAT33L/BM7B3MEB89+Kd6 2CB5WgYaAoqp6WssQj/eQdT6k5Djzi88ETrU/Uq+CU7/PGikph9CfYrvyxapeTnROLZo KRV3p/gM2v1YlBJAtOFnWTcap96dU7BThjbrqGwMrm04Y81MZ1Yn7U0a67KIT1Wc3V+z A9ORkuaS4ky128dsicHY18Myg2f6GGsvWY485MPnXEzktppIUxWoDS2QK/BfoXT0eovS d6Aw== X-Gm-Message-State: AOAM533c4p+Je9hQQZZ6m3f6xvCmm9XkNLGa1bh2d80tbLnLlNrkP0da DDxw+Tid1qw1K9v/5Mq9n8avuETbRsSylQ== X-Google-Smtp-Source: ABdhPJwtGjbv+ty3g6dTfn/hwclIseG2k5RqFiHUYKFpifbv0jnM2qFRhMgzSKJUop0roSZZz0xuRA== X-Received: by 2002:a37:ac0d:0:b0:62c:e3da:99e8 with SMTP id e13-20020a37ac0d000000b0062ce3da99e8mr2114503qkm.261.1645720581451; Thu, 24 Feb 2022 08:36:21 -0800 (PST) Received: from hurd (dsl-156-1.b2b2c.ca. [66.158.156.1]) by smtp.gmail.com with ESMTPSA id z196-20020a3765cd000000b0050848cdb596sm24256qkb.101.2022.02.24.08.36.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:36:21 -0800 (PST) From: Maxim Cournoyer To: Maxime Devos Subject: Re: bug#53676: [PATCH 0/5] *** PulseAudio service improvements *** References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-5-maxim.cournoyer@gmail.com> <87mtj2z4xe.fsf_-_@gmail.com> <87v8xp1liy.fsf@gmail.com> Date: Thu, 24 Feb 2022 11:36:20 -0500 In-Reply-To: <87v8xp1liy.fsf@gmail.com> (Maxim Cournoyer's message of "Tue, 08 Feb 2022 09:27:17 -0500") Message-ID: <87y220i5mj.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Jack Hill , 53676@debbugs.gnu.org, Liliana Marie Prikler 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 (-) Hello, Maxim Cournoyer writes: > Hi Maxime, > > Maxime Devos writes: > >> Maxim Cournoyer schreef op ma 07-02-2022 om 17:29 [-0500]: >>> +=C2=A0=C2=A0=C2=A0 char canonicalPath[PATH_MAX]; >> >> PATH_MAX does not exist on the Hurd, see >> . >> Also, according to >> more a kind of minimum and not really a maximum; apparently >> most uses of PATH_MAX are wrong. >> >> recomm= ends a >> geometrically growing series. > > Interesting! Note that PATH_MAX is already in use in that > BubblewrapLauncher.cpp file. For your information, the upstreamed patch [0] doesn't use PATH_MAX anymore; it uses the FileSystem::realPath procedure of WebKit. Thanks to Liliana for mentioning its existence! [0] https://bugs.webkit.org/show_bug.cgi?id=3D211131 Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 11:39:06 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 16:39:06 +0000 Received: from localhost ([127.0.0.1]:50247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH8z-0002p8-OG for submit@debbugs.gnu.org; Thu, 24 Feb 2022 11:39:05 -0500 Received: from mail-qk1-f174.google.com ([209.85.222.174]:36413) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH8x-0002od-Am for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 11:39:04 -0500 Received: by mail-qk1-f174.google.com with SMTP id g24so2285746qkl.3 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 08:39:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jwYIFT94rjG8tPeSUKZdaZQXom6hlZLBBIH/bNXBhiE=; b=AYxRZnrU1rILVvniYnMv4tSjBSRyfh+DaIlE3mtpj5zzA1hghH3iovqLIadbq4MzqB 9z9xmVNPmb18SmeNxZ893L2WoyXdJey/4XuXYONZGqbCay2KhocinJFd9Z645euotgnR b3xJiPW7KYV5gtqCNWvX9poHXmpmCLnj1+NWPPlYo33vWFZLIN/oq13Lx1wSWjNPNyIp nsUfQlECJbMpDwgXeHk8FbSLFo6NdBZKpjk08WcEZ7lQp1dsE6D2I90SMe+9/0rU3Ksp PsI6DGLQ3PSHHoM06W8pwqfaH0t3LulZdr/zE2/QYqOCVdLvX6IPJNc6tzMILRBHuC0z EX6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=jwYIFT94rjG8tPeSUKZdaZQXom6hlZLBBIH/bNXBhiE=; b=PLuVVl8Arpx326IeVSbU01jilbKFieL1teDU3Sg81iKAcs4Cme78EgmcMERAhIfFck tjjYqHaoLateGhZpdvSjSy2YXtTZPISo/TkDIA1P9vaFTir8SgtPc/N3R23rjAWNiWZ7 VWMPgNB4HRwbv2L8LYriD7v/v/AcA88NgDq/ma6bigTB/sFwjIq2w+qccbpy6kzWsCWi LU5dx+lV8koxJqpVb5pHExRmcH+SsS0RHf3QSUOFFOlSNgl5DR8fjW3L1zVSGIfHKomc XuflDLiE/l5tOH+mV/MjMYQAr2zLVMIJ9B/6S9MD/tr9Lx3GTfR4HB/N3piB+TbxFXOF x13A== X-Gm-Message-State: AOAM5300Qc4F+3Nyke44wDRI9zj9reVTwFaV9bILCp2i/BXZKlgBRJhT zbdWxk1y1dhKahH/TwsgBlfHaNMuQNTp7w== X-Google-Smtp-Source: ABdhPJxH0gF0Y/cLXoY3SwjIJ465CShgcnhQu2Tw7TUfXAmGbjCShIrXwry6RV1NzZVW80n03cRE8Q== X-Received: by 2002:a37:6c46:0:b0:60d:d526:7e48 with SMTP id h67-20020a376c46000000b0060dd5267e48mr2150971qkc.451.1645720737590; Thu, 24 Feb 2022 08:38:57 -0800 (PST) Received: from localhost.localdomain (dsl-156-1.b2b2c.ca. [66.158.156.1]) by smtp.gmail.com with ESMTPSA id b13sm1900956qtb.71.2022.02.24.08.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:38:57 -0800 (PST) From: Maxim Cournoyer To: 53676@debbugs.gnu.org Subject: [PATCH v2 1/4] services/sound: Normalize pulseaudio-configuration accessor names. Date: Thu, 24 Feb 2022 11:38:25 -0500 Message-Id: <20220224163828.11330-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Maxim Cournoyer 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 (-) * gnu/services/sound.scm (): Adjust getter names to match convention. --- gnu/services/sound.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index 03e62a1e36..9684e06d13 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2018, 2020 Oleg Pykhalov ;;; Copyright © 2020 Liliana Marie Prikler ;;; Copyright © 2020 Marius Bakke +;;; Copyright © 2022 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -115,16 +116,16 @@ (define alsa-service-type (define-record-type* pulseaudio-configuration make-pulseaudio-configuration pulseaudio-configuration? - (client-conf pulseaudio-client-conf + (client-conf pulseaudio-configuration-client-conf (default '())) - (daemon-conf pulseaudio-daemon-conf + (daemon-conf pulseaudio-configuration-daemon-conf ;; Flat volumes may cause unpleasant experiences to users ;; when applications inadvertently max out the system volume ;; (see e.g. ). (default '((flat-volumes . no)))) - (script-file pulseaudio-script-file + (script-file pulseaudio-configuration-script-file (default (file-append pulseaudio "/etc/pulse/default.pa"))) - (system-script-file pulseaudio-system-script-file + (system-script-file pulseaudio-configuration-system-script-file (default (file-append pulseaudio "/etc/pulse/system.pa")))) -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 11:39:15 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 16:39:15 +0000 Received: from localhost ([127.0.0.1]:50250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH99-0002pW-1A for submit@debbugs.gnu.org; Thu, 24 Feb 2022 11:39:15 -0500 Received: from mail-qk1-f172.google.com ([209.85.222.172]:34412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH97-0002pH-72 for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 11:39:13 -0500 Received: by mail-qk1-f172.google.com with SMTP id 185so2292053qkh.1 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 08:39:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pfjS6st8V2vxUl+TtaswrzeKmoAYhPWd8TMUzV0AquU=; b=RBP3yUb2Z4EtO+NKJdFQPLeP4HbS5yNVCFeFQ5tc97PY4C4EdHCmToPRMs1cU3bY5A 2zfOY+E/apWyKqXAeYcpRLpTFK0Lgq8fXYOJZXgAoNAUmzM4He6yjZTcnFbGyAPIrfEd YuMfJ4xK0bAH9HoRWlpuGp4/AD42gA08sImGCaU/k9vb7AgDeMbnwiBTotL13gHOAKrZ APrm0NyZdjN7LvQpUAp7Kqpq30E5iE62oL+CwoHpPV5SFyzR0gi98tmZGuEAdOQ5QHCR hV3uz8Fv43MhU3CBygCQFQoPf6t+7u3tTqnyp7DgonKvyL9bvIpapBdxtiXVu4mh6DKu gIxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pfjS6st8V2vxUl+TtaswrzeKmoAYhPWd8TMUzV0AquU=; b=hFjQYT24NksJeBr8PJektUKV+T5QKNi1SAvMT58PgHgbQ3ZcEeVnocFisQczssl6k2 KAMRcYqAyF1CkbcZWkO5+ztWR7BEiB67xarlRvLYEn6z93FHvivptaTgcwRsacTiM6pU ZKygqDDTcBMErovZaEyUkQxDtFu8sx9MNw4vG95o8zRnXCfcE+e1fCOUAIRnfPc1dpWJ r1a80++yoXws3SbR0maOqzr6JCEKuCPXzZEwZsBseCyEud8UBQOusCL0kF0bPX1RCXxt cgCsKy25+uzPlA5BYRMibszc9lo+pHgq4uUC04c1GRB57HE27EZM6uDV/20qcaSBiFxD YzBA== X-Gm-Message-State: AOAM530dWPxf4mBf6G7Dyo7v8yLPd1Zbjhucon3YIsNs1HZZUC1vAUGr ihyZQPqKVFQw0pdOtJLWCVSY4vbO6ccgMQ== X-Google-Smtp-Source: ABdhPJyWXr68fWE5plbclj+zbcGanQ+QY35tjeOzHDT9aeVV6mmknKtlVH9oy6DbOyBJH3vEn5Uw4A== X-Received: by 2002:ae9:e016:0:b0:60d:fbbb:52d7 with SMTP id m22-20020ae9e016000000b0060dfbbb52d7mr2157621qkk.481.1645720747532; Thu, 24 Feb 2022 08:39:07 -0800 (PST) Received: from localhost.localdomain (dsl-156-1.b2b2c.ca. [66.158.156.1]) by smtp.gmail.com with ESMTPSA id b13sm1900956qtb.71.2022.02.24.08.39.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:39:07 -0800 (PST) From: Maxim Cournoyer To: 53676@debbugs.gnu.org Subject: [PATCH v2 2/4] gnu: pulseaudio: Graft to adjust configuration. Date: Thu, 24 Feb 2022 11:38:26 -0500 Message-Id: <20220224163828.11330-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220224163828.11330-1-maxim.cournoyer@gmail.com> References: <20220224163828.11330-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Maxim Cournoyer 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 (-) * gnu/packages/pulseaudio.scm (pulseaudio/fixed): New variable. (pulseaudio)[replacement]: Graft package with it. --- gnu/packages/pulseaudio.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gnu/packages/pulseaudio.scm b/gnu/packages/pulseaudio.scm index fe028b5202..c1b3d33d4a 100644 --- a/gnu/packages/pulseaudio.scm +++ b/gnu/packages/pulseaudio.scm @@ -178,6 +178,7 @@ (define-public libsamplerate (define-public pulseaudio (package (name "pulseaudio") + (replacement pulseaudio/fixed) (version "15.0") (source (origin (method url-fetch) @@ -269,6 +270,22 @@ (define-public pulseaudio ;; 'LICENSE' for details. (license l:gpl2+))) +(define pulseaudio/fixed + (package + (inherit pulseaudio) + (arguments + (substitute-keyword-arguments (package-arguments pulseaudio) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'customize-default-script + (lambda _ + (substitute* "src/daemon/default.pa.in" + (("^\\.include.*default.pa.d.*" anchor) + (string-append + ;; Honor PulseAudio script extensions found under + ;; /etc/pulse/default.pa.d. + anchor ".include /etc/pulse/default.pa.d\n"))))))))))) + (define-public pavucontrol (package (name "pavucontrol") -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 11:39:18 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 16:39:18 +0000 Received: from localhost ([127.0.0.1]:50253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH9C-0002pm-B6 for submit@debbugs.gnu.org; Thu, 24 Feb 2022 11:39:18 -0500 Received: from mail-qv1-f41.google.com ([209.85.219.41]:46790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH9A-0002pM-Cj for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 11:39:16 -0500 Received: by mail-qv1-f41.google.com with SMTP id j5so4488113qvs.13 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 08:39:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=//0UcyvMykC0klOPtwtR6f4nL79ZAGy3oAQCvAhj/kI=; b=I/ZQ0FwbwuV0Ull++DL9p/5s3dI0ZTljma3us9FVW8OvNL3hMBFR2cPFMJIXv7bXVg kzQNNcGby3Mc3alGT1kK8xjt3wj7r/iZHkbR0Ptg54/lc/cJ37PavSX2YTWYnN7yj8Mn rCBdDryVOo9/9FW0nX2MQFV4aNjVxYkNmfjqWMRxqq07wykMoFB80LBOO826OsLOntXS SPd9EKhmna/ida0zcWQ6g/rIb7jOl9mHUOpF45RHigdtkfwGGwf6GcXV7M2D76jgO4mO KZKla0XpuKNxp+Pn3JT/IXVV11WT4DsR55E2NhSBPWAKdaWq4RL6VqrckXrlQPKZCuKY L0pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=//0UcyvMykC0klOPtwtR6f4nL79ZAGy3oAQCvAhj/kI=; b=vPI4PsD4qVGAeHeCQQk6QVynBTgqayt+VWP2NDMB9EMS+4iCIhQa5WSCxDlbCtF2hr HqaXTBeABpFkgfu9SnEVRAJWptHsLzxi2E+3YsHi6Cx1+U3CxDzIamkpb7udQ+tt1DoK wpXSQB8szOVZnVGFUhpa6JLKqow9WKMd43dD9DCBjEUNIauJOYIWu0CFkO+CAyPcnGf+ j/5ni7eHHd7KLA+h2j9M5OQW845pw5RocQKx3am3jGNB11CpzWR5Oz1Maw7J5lmZBSR5 5CD+ZjS4VEoYm0wpbQGAJ3zzTO9Vsd+DSJ4XSJQVhS9sMC0ZsTUlPmlTT2sqP2jxOuA5 u+9Q== X-Gm-Message-State: AOAM5300me/53JUrjV0Re6kJrqNynZTCVJ73NUuZEzpXziOpgmP0MXhW nmHTtk04rd7o+XmbgsrobKkPeuKZi4vDwQ== X-Google-Smtp-Source: ABdhPJyb/PEQ2hJAC13Ws7nhbFpL6JuSDWdxZa41qq197+saUqU1oz4T+w6OXEfeJYDHmJYyNK4RnA== X-Received: by 2002:ac8:5648:0:b0:2ce:dd03:59fa with SMTP id 8-20020ac85648000000b002cedd0359famr3163046qtt.288.1645720750579; Thu, 24 Feb 2022 08:39:10 -0800 (PST) Received: from localhost.localdomain (dsl-156-1.b2b2c.ca. [66.158.156.1]) by smtp.gmail.com with ESMTPSA id b13sm1900956qtb.71.2022.02.24.08.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:39:10 -0800 (PST) From: Maxim Cournoyer To: 53676@debbugs.gnu.org Subject: [PATCH v2 3/4] services: pulseaudio: Add an extra-script-files configuration field. Date: Thu, 24 Feb 2022 11:38:27 -0500 Message-Id: <20220224163828.11330-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220224163828.11330-1-maxim.cournoyer@gmail.com> References: <20220224163828.11330-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Maxim Cournoyer 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 (-) * gnu/services/sound.scm () [extra-script-files]: Add field. (extra-script-files->file-union): Add procedure. (pulseaudio-etc): Use it. * doc/guix.texi: Document it. --- doc/guix.texi | 30 ++++++++++++++++++++++++++++++ gnu/services/sound.scm | 38 ++++++++++++++++++++++++++++++++++++-- 2 files changed, 66 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index f336c26e8a..9941be5033 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -21509,9 +21509,39 @@ List of settings to set in @file{daemon.conf}, formatted just like @item @code{script-file} (default: @code{(file-append pulseaudio "/etc/pulse/default.pa")}) Script file to use as @file{default.pa}. +@item @code{extra-script-files} (default: @code{'())}) +A list of file-like objects defining extra PulseAudio scripts to run at +the initialization of the @command{pulseaudio} daemon, after the main +@code{script-file}. The scripts are deployed to the +@file{/etc/pulse/default.pa.d} directory; they should have the +@samp{.pa} file name extension. For a reference of the available +commands, refer to @command{man pulse-cli-syntax}. + @item @code{system-script-file} (default: @code{(file-append pulseaudio "/etc/pulse/system.pa")}) Script file to use as @file{system.pa}. @end table + +The example below sets the default PulseAudio card profile, the default +sink and the default source to use for a old SoundBlaster Audigy sound +card: +@lisp +(pulseaudio-configuration + (extra-script-files + (list (plain-file "audigy.pa" + (string-append "\ +set-card-profile alsa_card.pci-0000_01_01.0 \ + output:analog-surround-40+input:analog-mono +set-default-source alsa_input.pci-0000_01_01.0.analog-mono +set-default-sink alsa_output.pci-0000_01_01.0.analog-surround-40\n"))))) +@end lisp + +Note that @code{pulseaudio-service-type} is part of +@code{%desktop-services}; if your operating system declaration was +derived from one of the desktop templates, you'll want to adjust the +above example to modify the existing @code{pulseaudio-service-type} via +@code{modify-services} (@pxref{Service Reference, +@code{modify-services}}), instead of defining a new one. + @end deftp @deffn {Scheme Variable} ladspa-service-type diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index 9684e06d13..eecea1a733 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -26,14 +26,17 @@ (define-module (gnu services sound) #:use-module (gnu services) #:use-module (gnu system pam) #:use-module (gnu system shadow) + #:use-module (guix diagnostics) #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix records) #:use-module (guix store) + #:use-module (guix ui) #:use-module (gnu packages audio) #:use-module (gnu packages linux) #:use-module (gnu packages pulseaudio) #:use-module (ice-9 match) + #:use-module (srfi srfi-1) #:export (alsa-configuration alsa-service-type @@ -125,6 +128,8 @@ (define-record-type* (default '((flat-volumes . no)))) (script-file pulseaudio-configuration-script-file (default (file-append pulseaudio "/etc/pulse/default.pa"))) + (extra-script-files pulseaudio-configuration-extra-script-files + (default '())) (system-script-file pulseaudio-configuration-system-script-file (default (file-append pulseaudio "/etc/pulse/system.pa")))) @@ -145,14 +150,43 @@ (define pulseaudio-environment ("PULSE_CLIENTCONFIG" . ,(apply mixed-text-file "client.conf" (map pulseaudio-conf-entry client-conf))))))) +(define (extra-script-files->file-union extra-script-files) + "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE-UNION." + + (define (file-like->name file) + (match file + ((? local-file?) + (local-file-name file)) + ((? plain-file?) + (plain-file-name file)) + ((? computed-file?) + (computed-file-name file)) + (_ (leave (G_ "~a is not a local-file, plain-file or \ +computed-file object~%") file)))) + + (define (assert-pulseaudio-script-file-name name) + (unless (string-suffix? ".pa" name) + (leave (G_ "`~a' lacks the required `.pa' file name extension~%") name)) + name) + + (let ((labels (map (compose assert-pulseaudio-script-file-name + file-like->name) + extra-script-files))) + (file-union "default.pa.d" (zip labels extra-script-files)))) + (define pulseaudio-etc (match-lambda - (($ _ _ default-script-file system-script-file) + (($ _ _ default-script-file extra-script-files + system-script-file) `(("pulse" ,(file-union "pulse" `(("default.pa" ,default-script-file) - ("system.pa" ,system-script-file)))))))) + ("system.pa" ,system-script-file) + ,@(if (null? extra-script-files) + '() + `(("default.pa.d" ,(extra-script-files->file-union + extra-script-files))))))))))) (define pulseaudio-service-type (service-type -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 11:39:22 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 16:39:22 +0000 Received: from localhost ([127.0.0.1]:50256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH9F-0002q1-Oh for submit@debbugs.gnu.org; Thu, 24 Feb 2022 11:39:22 -0500 Received: from mail-qv1-f50.google.com ([209.85.219.50]:34403) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNH9D-0002pV-Cy for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 11:39:19 -0500 Received: by mail-qv1-f50.google.com with SMTP id ba20so4610815qvb.1 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 08:39:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vhTTMDJdJkrTEyt5h66ZuKIKIyb4H3aU6NIk7ktcSBo=; b=EEGHfUJWaAmoUDuoDEhTvVp7peSfZ+z2dz2xra4ODF4W6Bhiq+xHBC3paVvkQ9gKmH mtKExMXAaKQTYcikKSLBjSL/ukFqC0Ae2vpqwtxmDw3YJxWKP/1C9ya+Ac2Vw7qe04c0 DMgXs8tSBZBA3fkMXAlUSQrPW27bcEM+2hcTCXernfJjLtYOeD+9IVyaWiDrNKdQ/nj3 OEP1wxqQX6vNkgs0gaIK9d5/cgvsWbovMhb+A4cqunLDMC6RoLNYOKetVcHUabmbo9RP Bbawmd7m2hK5gb/bmwOXhcV0B/iq9xwb0p3e48bbPmfaHZSsEwQofxNd4R2LB1j1evF0 GfYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vhTTMDJdJkrTEyt5h66ZuKIKIyb4H3aU6NIk7ktcSBo=; b=Ka+vq/i3/ueFavOZKNgSzPCcq+Xzl+dyvjvXcAqd7q1gIxMH7B5VFdahugO90PS+Sx MICBqcsfWLJDZkI2zJ334xgLN7kULRfKxT2O42MGBdiat/JmO/x774tvjjly2MrdCj8P DV/NAJtK446Jpkm5rIYnA8OHWdtI3wV+3qlv9KqZQwXQnJmBGImmw46LEhYshU5oAqf+ e5PMJIt+zJtajlGSg4byfJrjaBjw+f28AMs+Z79z+pNqiDKVbywL9lT3TlWPGn2AFn2G /YWmNGYLyi2HMSu6tUCJ3QgszfJoFXyJESD8QWNbLymixXTijOrd/vub2gsXQ/eWbQQU TGug== X-Gm-Message-State: AOAM530888YX0fTUBp81xlgwxxZrrQJuF25nMYIhZXqnHsuU5YTrbum6 ZPSfpuGSHLJ3sMwc9yQY9ODg+Nz5Y3Blag== X-Google-Smtp-Source: ABdhPJwQ8WSX7tu/ad6MIjWEcRW/JTuvq1wZ9Qv/59/7YIF1boYrzgconuWzCdcBBISg2c89zPIaTA== X-Received: by 2002:a05:6214:23cf:b0:42c:a789:146 with SMTP id hr15-20020a05621423cf00b0042ca7890146mr2812205qvb.89.1645720753654; Thu, 24 Feb 2022 08:39:13 -0800 (PST) Received: from localhost.localdomain (dsl-156-1.b2b2c.ca. [66.158.156.1]) by smtp.gmail.com with ESMTPSA id b13sm1900956qtb.71.2022.02.24.08.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 08:39:13 -0800 (PST) From: Maxim Cournoyer To: 53676@debbugs.gnu.org Subject: [PATCH v2 4/4] services: pulseaudio: Deploy the configuration files to /etc/pulse. Date: Thu, 24 Feb 2022 11:38:28 -0500 Message-Id: <20220224163828.11330-4-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220224163828.11330-1-maxim.cournoyer@gmail.com> References: <20220224163828.11330-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: Maxim Cournoyer 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 (-) * gnu/services/sound.scm (pulseaudio-environment) [PULSE_CONFIG, PULSE_CLIENTCONFIG]: Use fix locations, and move logic to... (pulseaudio-etc): ... this service extension. Guard against producing empty files. --- gnu/services/sound.scm | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm index eecea1a733..336f6c39a0 100644 --- a/gnu/services/sound.scm +++ b/gnu/services/sound.scm @@ -144,11 +144,11 @@ (define (pulseaudio-conf-entry arg) (define pulseaudio-environment (match-lambda (($ client-conf daemon-conf default-script-file) - `(("PULSE_CONFIG" . ,(apply mixed-text-file "daemon.conf" - "default-script-file = " default-script-file "\n" - (map pulseaudio-conf-entry daemon-conf))) - ("PULSE_CLIENTCONFIG" . ,(apply mixed-text-file "client.conf" - (map pulseaudio-conf-entry client-conf))))))) + ;; These config files kept at a fixed location, so that the following + ;; environment values are stable and do not require the user to reboot to + ;; effect their PulseAudio configuration changes. + '(("PULSE_CONFIG" . "/etc/pulse/daemon.conf") + ("PULSE_CLIENTCONFIG" . "/etc/pulse/client.conf"))))) (define (extra-script-files->file-union extra-script-files) "Return a G-exp obtained by processing EXTRA-SCRIPT-FILES with FILE-UNION." @@ -176,8 +176,8 @@ (define (assert-pulseaudio-script-file-name name) (define pulseaudio-etc (match-lambda - (($ _ _ default-script-file extra-script-files - system-script-file) + (($ client-conf daemon-conf default-script-file + extra-script-files system-script-file) `(("pulse" ,(file-union "pulse" @@ -186,7 +186,18 @@ (define pulseaudio-etc ,@(if (null? extra-script-files) '() `(("default.pa.d" ,(extra-script-files->file-union - extra-script-files))))))))))) + extra-script-files)))) + ,@(if (null? daemon-conf) + '() + `(("daemon.conf" + ,(apply mixed-text-file "daemon.conf" + "default-script-file = " default-script-file "\n" + (map pulseaudio-conf-entry daemon-conf))))) + ,@(if (null? client-conf) + '() + `(("client.conf" + ,(apply mixed-text-file "client.conf" + (map pulseaudio-conf-entry client-conf)))))))))))) (define pulseaudio-service-type (service-type -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 13:53:43 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 18:53:43 +0000 Received: from localhost ([127.0.0.1]:50424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNJFH-0000RB-Lx for submit@debbugs.gnu.org; Thu, 24 Feb 2022 13:53:43 -0500 Received: from laurent.telenet-ops.be ([195.130.137.89]:45514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNJFF-0000R2-SS for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 13:53:43 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by laurent.telenet-ops.be with bizsmtp id z6tf2600A4UW6Th016tftb; Thu, 24 Feb 2022 19:53:39 +0100 Message-ID: <27655b0c24666a93d23800ee74837ea032667432.camel@telenet.be> Subject: Re: [bug#53676] [PATCH v2 3/4] services: pulseaudio: Add an extra-script-files configuration field. From: Maxime Devos To: Maxim Cournoyer , 53676@debbugs.gnu.org Date: Thu, 24 Feb 2022 19:53:34 +0100 In-Reply-To: <20220224163828.11330-3-maxim.cournoyer@gmail.com> References: <20220224163828.11330-1-maxim.cournoyer@gmail.com> <20220224163828.11330-3-maxim.cournoyer@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-WdOALBRQ6nfrSoBPjfbv" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1645728819; bh=3lCT0+vgsQ5r6xrpjWHcRZ63Q495wQ1Ux3ubRe1cdQs=; h=Subject:From:To:Date:In-Reply-To:References; b=W9wrOEhSRgLdVq8gaYKV49hBRuP6W52a2qdwyT8am0UATSVNMkn3uYGekO1vZr+QR OW7tEi0KeJthu431AajxBWYEleFNAAcwwTIeYqA0opdqS4rXShcN8EN37WBpZ1XGYI B68Up0uInRkGeuSLESvq4tnYkSLmmT6QEd032VsmEczJ7NI9ijc3XaUlzHvU1R3hbU u1YoP0XlkHX7bSl15/opu6Y+rO48PegBvpMHYNEZiZEGhOep5+cWhauZyZz1cRGVGv VzsImygSqb2D8pFLhq0BXkSNueV1DLPBDbPAtzrVIOuo1Gp6/gd+4QXmXBSgpE79Tg O/LtDgG753ONQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53676 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 (-) --=-WdOALBRQ6nfrSoBPjfbv Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Maxim Cournoyer schreef op do 24-02-2022 om 11:38 [-0500]: > +=C2=A0 (define (file-like->name file) > +=C2=A0=C2=A0=C2=A0 (match file > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((? local-file?) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (local-file-name file)) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((? plain-file?) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (plain-file-name file)) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((? computed-file?) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (computed-file-name file)) > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (_ (leave (G_ "~a is not a local-file, pl= ain-file or \ > +computed-file object~%") file)))) This would not work with things like '(file-append ...)'. Perhaps 'extra-script-files->file-union' can be made more general by creating a variant of 'file-union' for this use case? Maybe something like (untested): ;; Based on 'file-union' (define* (file-directory . files) ; files: (file-like1 file-like2 ...) (computed-file name (with-imported-modules '((guix build utils)) (gexp (begin (use-modules (guix build utils)) (mkdir (ungexp output)) (chdir (ungexp output)) (ungexp-splicing (map (lambda (source) (gexp (let ((target (basename source)) ;; Stat the source to abort early if it do= es ;; not exist. (stat (ungexp source)) (symlink (ungexp source) (ungexp target)))= )) files))))))) Greetings, Maxime. --=-WdOALBRQ6nfrSoBPjfbv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYhfULhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7hRYAQCLySQxGVpB0Ib46gJgIEt3kpFd 09PAG6BQ81iVqoZdmwD+LT5Fyr8jyucUaNsFqGvFrY8dO78oUAQ8VAMHQpXMTQo= =l2tY -----END PGP SIGNATURE----- --=-WdOALBRQ6nfrSoBPjfbv-- From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 14:47:35 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 19:47:35 +0000 Received: from localhost ([127.0.0.1]:50471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNK5O-0001j4-IH for submit@debbugs.gnu.org; Thu, 24 Feb 2022 14:47:35 -0500 Received: from mail-ej1-f68.google.com ([209.85.218.68]:37688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNK5M-0001i7-2Q for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 14:47:33 -0500 Received: by mail-ej1-f68.google.com with SMTP id bg10so6578183ejb.4 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 11:47:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=7hLOAQ8C7vQxAKhyrcdvkpvyT+oNYprFilUcoxmJpiM=; b=M5InkhowjD8VrYU0Rm1FS/mHPD1avaDFSNJ4YW97V/r8mwSTxJWYGVbaw7TPa7duvu TdkxbpYfjqWG55q7fk0LLpyOLZXVDLEmCunoM779Uvdm9ekafLa7wGu8YhqTRJHHhjYO Fl0A2+D77dyMKtchqr+/Y8cI3FGh3LHiobfDynvmn1QWp9CY4Y74AyuOpnlRtdSNgqmL KyXySoA0nVpUW0XTCHuJOkdAP2yvvszecJhS6puSG5nbQGU8qlGXx5S/ZFCx536SqDd4 292ObpMj0o5DtjlRXkO87gFtAc1VkSKcngmMYtSdydU2yikzCi5Fd17PIoWzH6VYhL1+ 5zIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=7hLOAQ8C7vQxAKhyrcdvkpvyT+oNYprFilUcoxmJpiM=; b=p9VpFzakrb0hTPNJbBSzR5xA4UeOsaxy8XVUZOrngf9G0DRp4P5D4v5xlrHWFZw6qB 66yTYdAgE1C7Jz3fSvU6HnnHLuD/GjMvsT0DCayOpkG1aFn+uEFwB7BWc76IgCL/UAcq C13/35b0wIvtSBPXQC6j67QdP3PaJKc4d0pob0hgKKUC8pvdUv4JDQhU0s/WH0LDkTWE JdOw3BLAnJxxcO7Wy77kQlSJyo5hPJ1U9yElHmu/VJx7VBNyStpfn7Z8QlWZle7BGjDY lIAcXvuoHK4abpF9/5VE5F2KIPsmdduuTTIuM/0D20o3HnPEuMy59qaXiSOe6sevFz4C HQSA== X-Gm-Message-State: AOAM531MV5XMyNfO+u6JSsPEgyUNFWmaesB8P4P3JSPC8lP+fFLf/Jli v99P63r0G+IEfGmTrhm+WTw= X-Google-Smtp-Source: ABdhPJzo1ubYh9Qe9nmEDvSA+tgojUJkXc09lamG6U4/QpfftkVcKaVt57M8/9qvy7e2gJY8BD+Maw== X-Received: by 2002:a17:907:6006:b0:6ce:46f:fe4b with SMTP id fs6-20020a170907600600b006ce046ffe4bmr3397610ejc.7.1645732046113; Thu, 24 Feb 2022 11:47:26 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id w12-20020a17090649cc00b006d0bee77b9asm108916ejv.72.2022.02.24.11.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 11:47:25 -0800 (PST) Message-ID: <387664c06141015c8fbf8db79a29e7ab09367dc2.camel@gmail.com> Subject: Re: [PATCH v2 2/4] gnu: pulseaudio: Graft to adjust configuration. From: Liliana Marie Prikler To: Maxim Cournoyer , 53676@debbugs.gnu.org Date: Thu, 24 Feb 2022 20:47:24 +0100 In-Reply-To: <20220224163828.11330-2-maxim.cournoyer@gmail.com> References: <20220224163828.11330-1-maxim.cournoyer@gmail.com> <20220224163828.11330-2-maxim.cournoyer@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 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 (-) Am Donnerstag, dem 24.02.2022 um 11:38 -0500 schrieb Maxim Cournoyer: > * gnu/packages/pulseaudio.scm (pulseaudio/fixed): New variable. > (pulseaudio)[replacement]: Graft package with it. > --- >  gnu/packages/pulseaudio.scm | 17 +++++++++++++++++ >  1 file changed, 17 insertions(+) > > diff --git a/gnu/packages/pulseaudio.scm > b/gnu/packages/pulseaudio.scm > index fe028b5202..c1b3d33d4a 100644 > --- a/gnu/packages/pulseaudio.scm > +++ b/gnu/packages/pulseaudio.scm > @@ -178,6 +178,7 @@ (define-public libsamplerate >  (define-public pulseaudio >    (package >      (name "pulseaudio") > +    (replacement pulseaudio/fixed) >      (version "15.0") >      (source (origin >               (method url-fetch) > @@ -269,6 +270,22 @@ (define-public pulseaudio >      ;; 'LICENSE' for details. >      (license l:gpl2+))) >   > +(define pulseaudio/fixed > +  (package > +    (inherit pulseaudio) > +    (arguments > +     (substitute-keyword-arguments (package-arguments pulseaudio) > +       ((#:phases phases) > +        `(modify-phases ,phases > +           (add-after 'unpack 'customize-default-script > +             (lambda _ > +               (substitute* "src/daemon/default.pa.in" > +                 (("^\\.include.*default.pa.d.*" anchor) > +                  (string-append > +                   ;; Honor PulseAudio script extensions found under > +                   ;; /etc/pulse/default.pa.d. > +                   anchor ".include > /etc/pulse/default.pa.d\n"))))))))))) > + I still think it'd be wiser to do this inside the code that generates the configuration when we do fill /etc/pulse/default.pa.d given that there's stuff to source. At the very least, we'd avoid a graft for the moment, but we'd also avoid some "lol, just source anything" scenarios. Cheers From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 15:26:51 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 20:26:51 +0000 Received: from localhost ([127.0.0.1]:50532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNKhP-0002gm-Dt for submit@debbugs.gnu.org; Thu, 24 Feb 2022 15:26:51 -0500 Received: from mail-ej1-f68.google.com ([209.85.218.68]:42556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNKhN-0002gY-5V for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 15:26:49 -0500 Received: by mail-ej1-f68.google.com with SMTP id hw13so6714242ejc.9 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 12:26:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=cppYzRLYeSXtDqPIIIKhk5+w6IcCU7B5p444w9ScrrI=; b=ZOvbF8ci6zD0P6DOTQLFqTZgtCpYJwzMXdbcIdKYoJkOBEIxP11yF9koshqR/PpDGj qhK16XWqy+Yc9cCSyatsv8NAitjgVL7bqQb0Cs5a+QRwRh/GhvoeZvcQO199kFBy0R3b amY194WRSfh7/XQi1sa/tAVyV8fV3bD4Dzln0vjmzvrpcIr1gaIgBYyZvXqhZwEZUh2P /3RCzt1ViyEhGFhJzA3tEkTXl1vwkET7lUi1+AIP3JSDg8pTvomevZOqBvclyRnNc/LH U3Ze5E4bsrQI4RGq7vpaD1JN5YTYVrKj4erFC2u+M8g2035YqBRcKoKmTNJbPB+NCXDB qUDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=cppYzRLYeSXtDqPIIIKhk5+w6IcCU7B5p444w9ScrrI=; b=RkXJqaVow3xA+Q/0yKngZ1I+ytOEC0hsnVzOiWlSV/90fbSBxO+Z4LGHWrSqxWIRXK FvDSd4GL01+yU4wTh3OQzPjA0u44LZtAq1fZikUPEL6PE/tASCJYxBJxrfYdz2/AQoEr cINxqSrYMWGgRtCl0ihPfGsHRHSHrY5iVyNa6DFEhOWTHU1XtksVt0C6SA6MRO43MoJR +1WSRmcnUm7EosLrbxxyUwvK7HA1/7Y01jMoc4GsJ8bHAusZTAE2urouOziKqm4PFUUF lfTbsHMuNAf4ifhJ3/+7rKJ822O4i8HqAy2EtMgGvhYAg5caKrPqDbc8yQuWjQ7C0Z64 gr3g== X-Gm-Message-State: AOAM5332GVKUS0RI3mevPWXwJYjsVyKYrd9S3DfiX/9ANXVZVOKTb1aJ FMhopx0SxVUR4ZhHa3DkHR0= X-Google-Smtp-Source: ABdhPJwaZqKqKTmzVDvhg8BudrA0qfKq2Dtitaba91MVkHJLcLGtOTHvi3dUHw8pjaBsSyt2mOiGkA== X-Received: by 2002:a17:906:81d5:b0:6cf:1fb9:3440 with SMTP id e21-20020a17090681d500b006cf1fb93440mr3583501ejx.351.1645734403286; Thu, 24 Feb 2022 12:26:43 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id f15-20020a50e08f000000b004134a121ed2sm253122edl.82.2022.02.24.12.26.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 12:26:42 -0800 (PST) Message-ID: <80e871f177b21b948615865b124432c706427392.camel@gmail.com> Subject: Re: bug#53676: [PATCH 0/5] *** PulseAudio service improvements *** From: Liliana Marie Prikler To: Maxim Cournoyer Date: Thu, 24 Feb 2022 21:26:41 +0100 In-Reply-To: <8735k8jkf8.fsf@gmail.com> References: <20220201041933.16603-1-maxim.cournoyer@gmail.com> <20220201041933.16603-3-maxim.cournoyer@gmail.com> <693cc82d449395853247c7fbf1b44d0a3c979c87.camel@gmail.com> <875ypy1gqd.fsf@gmail.com> <87k0edzy8j.fsf@gmail.com> <2ed5ef40ecc06c783af81de129a62d3c42d87fec.camel@gmail.com> <87h79c1p86.fsf_-_@gmail.com> <8735k8jkf8.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi, Am Donnerstag, dem 24.02.2022 um 11:31 -0500 schrieb Maxim Cournoyer: > That is nice, but is still a bit more demanding from users: > > 1. They need to know how to compose multiple G-Exps expressions such > as mixed-text-file and file-append. > 2. They need to know to use ".include" directives from PulseAudio. I don't think 2 counts here. We assume the users know how to code PulseAudio configuration script when we hand them the possibility to edit it, so... > My proposed change reduces the knowledge needed to just a single > usage of a G-Exp file-like object, such as plain-file or local-file; > I think that's a bit easier to grok for starters.  The resulting > configuration is also easy to inspect; it's all under /etc/pulse as > the user would expect. That is a benefit, but I'm not sure how much of a benefit it is over doing things "manually", particularly in terms of how config files end up looking vs. the stuff we need to add to make that change. At the very least, we should ensure our internals are clean and maintainable. Cheers From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 17:00:44 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 22:00:44 +0000 Received: from localhost ([127.0.0.1]:50635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNMAF-0007Cb-Qr for submit@debbugs.gnu.org; Thu, 24 Feb 2022 17:00:44 -0500 Received: from mail-qk1-f171.google.com ([209.85.222.171]:43626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNMAE-0007CO-Cb for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 17:00:42 -0500 Received: by mail-qk1-f171.google.com with SMTP id z66so3019778qke.10 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 14:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=KzPK3cySntE1UoIo79Trm2UhCEMJXFCOnaSQlAH7eIg=; b=S8j7/Rc2gFUhyPeRkTj7Cbuzk9Bfn8RTccKQ7j8vjoPwhexbJtm26Bpd52e7Wo8tas z2esuVWFdGeAiJCWZFx2eB2FLc/0Ssvb9V5Ry3T+Y5yIat7NcTbPB7aSsGgm07LP+oyJ vlm/Vwukq/Gx9IXta54Mc0ofFw2GMJdlNxkWRRDth5lofGrcYvOnwprjAV44pnWtXUbK Rr6F43ltjRFyhT6RcLNEcoWcoIR289RqclF64rv9+hylkeIPErImdDPWFVem6HebJnej n0CktAKt17+L+tNk99h/VWF4vU+hli8i9ymvLs6H3M9H9VZbQRddX9xcgTvsY/EcXeKd Djig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=KzPK3cySntE1UoIo79Trm2UhCEMJXFCOnaSQlAH7eIg=; b=SHku3OSPrj6YXKrdj/JLLjly+tsugLfiPk0NfWAICqwzryVv/q31fKcyKJuRkxXETM U4MGCKA9ZSpeySf6CmfJ5n1BOEETWwyFRxk9y4SIOF9jjNN1XGtyMzDdnDeHBqhH4G/W miYKpyXTv3JPhA599lrOqBEZUwPlmdiyG8LxzO0C4ZSNAfbo+Uql7lW67ar5F7MKchF+ ejT1BGCP22prDGf3r6abkADJ140tp4p7xWpY2TmefbikAyKVgG0+bjflu4LYrqKliItE UKXxwrZNPb5JA7hcv1kj8Mg96DUXnx8jZdrRE7HuGsvQ0gEURD1HaQg9GdXovGHOKLGv zd8A== X-Gm-Message-State: AOAM531ZyTH8Z+tNiyDJIQkAEUcjrFMc0uwrUizU+rgtjFdHYks6/FxX aaEm/CtS4JMcNfraM8L/aTjgo+/uVULKxg== X-Google-Smtp-Source: ABdhPJzgaYygLjfwxOWQMkSv3PDQJdNLe5OAVXByhJbfexDgVU0dAiadf+YqsA6snLrbp88DF3rvGg== X-Received: by 2002:a37:80b:0:b0:507:58e:5dd4 with SMTP id 11-20020a37080b000000b00507058e5dd4mr3147076qki.130.1645740036372; Thu, 24 Feb 2022 14:00:36 -0800 (PST) Received: from hurd (dsl-156-1.b2b2c.ca. [66.158.156.1]) by smtp.gmail.com with ESMTPSA id o1-20020a37be01000000b00648eadafd9bsm414760qkf.24.2022.02.24.14.00.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 14:00:35 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: [PATCH v2 2/4] gnu: pulseaudio: Graft to adjust configuration. References: <20220224163828.11330-1-maxim.cournoyer@gmail.com> <20220224163828.11330-2-maxim.cournoyer@gmail.com> <387664c06141015c8fbf8db79a29e7ab09367dc2.camel@gmail.com> Date: Thu, 24 Feb 2022 17:00:34 -0500 In-Reply-To: <387664c06141015c8fbf8db79a29e7ab09367dc2.camel@gmail.com> (Liliana Marie Prikler's message of "Thu, 24 Feb 2022 20:47:24 +0100") Message-ID: <877d9j2ad9.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Liliana, Liliana Marie Prikler writes: > Am Donnerstag, dem 24.02.2022 um 11:38 -0500 schrieb Maxim Cournoyer: >> * gnu/packages/pulseaudio.scm (pulseaudio/fixed): New variable. >> (pulseaudio)[replacement]: Graft package with it. [...] >> +(define pulseaudio/fixed >> +=C2=A0 (package >> +=C2=A0=C2=A0=C2=A0 (inherit pulseaudio) >> +=C2=A0=C2=A0=C2=A0 (arguments >> +=C2=A0=C2=A0=C2=A0=C2=A0 (substitute-keyword-arguments (package-argumen= ts pulseaudio) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((#:phases phases) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 `(modify-phases ,phases >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (add-after= 'unpack 'customize-default-script >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (lambda _ >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 (substitute* "src/daemon/default.pa.in" >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 (("^\\.include.*default.pa.d.*" anchor) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (string-append >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; Honor PulseAudio script extensio= ns found under >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; /etc/pulse/default.pa.d. >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 anchor ".include >> /etc/pulse/default.pa.d\n"))))))))))) >> + > I still think it'd be wiser to do this inside the code that generates > the configuration when we do fill /etc/pulse/default.pa.d given that > there's stuff to source. At the very least, we'd avoid a graft for the > moment, but we'd also avoid some "lol, just source anything" scenarios. Thank you for your continued feedback. The reason I prefer this simple substitution to a conditional one is two-fold: 1. It avoids two actors potentially touching the default 'script-file' (the pulseaudio-service-type code as well as the user), which could be unwieldy (do we plug the default.pa.d after their changes to ensure it is there, or before, which means it'd potentially be erased?). Having it part of the shipped default.pa file makes this simpler to reason with. 2. It allows foreign distribution users to keep their custom user script working even when they use our pulseaudio package (it makes our pulseaudio package behave as intended by upstream). I wouldn't mind using a feature branch to get the < 2k dependent packages rebuilt as suggested by Leo, if you think that's preferable. Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 24 17:20:58 2022 Received: (at 53676) by debbugs.gnu.org; 24 Feb 2022 22:20:58 +0000 Received: from localhost ([127.0.0.1]:50666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNMTq-0007g4-Hw for submit@debbugs.gnu.org; Thu, 24 Feb 2022 17:20:58 -0500 Received: from mail-qk1-f172.google.com ([209.85.222.172]:33417) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNMTn-0007fl-Vw for 53676@debbugs.gnu.org; Thu, 24 Feb 2022 17:20:57 -0500 Received: by mail-qk1-f172.google.com with SMTP id bm39so3123611qkb.0 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 14:20:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=dqOmnj24gb45Kdgakg/HScFlnC9/SBhfz1UAmZi0dLA=; b=QQ36BIxmvWdrrmQwNkNGpHLzgowU2aOl5/sjEku4WdIMi/67c2G9SFNLnkgyXMwle2 BLS2AtLl02OXzO7MdRn5HEaCR+fAcQcZ8Z40vpTIkDpbgeP9pTtZsX7/YE3wqgEhryCV tKynarxDUBu0oc+cy/wtppCmpYI6mhT13uNvbfZ1zkjCQAaoJcxwci0QgEHtLj47iJRm GPpAiu+MKmDIBznibl0Z7XmFLXIq+Q0vABtDODgl/osKr9UKjcnGR1xwTXRPZCiTOoNj 9GVSN4tjT89/Do+Efcy9cuVrFKY2ukLQd3jIyWHUqb8qpcrLQuUXYSm9WJrvdfSl+aYz xnSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=dqOmnj24gb45Kdgakg/HScFlnC9/SBhfz1UAmZi0dLA=; b=hmC7fTKmXFw7FTAZN8ZcEUTqLxMCqFUMM1V1lcj4K9kf2w9vXPrYcoX1tr+5RVbt3R FcA0EK3dzGgiTh7XHaSzupS/nuUSP6OIBNHEmPNG2lNYcO+UwzE7x00Zy2ROcucrbctz Ycg26sYpG468gopQYVnLyDCaY2wqaweusSWSUiBZkA1wtFmM6ffZl3qwYnLeEGkpJlP+ 0pLLnlJ4le/scpgIl/iKZmJyYBM1ThlepgbrB3/YfW+ckxyVUDYQa8aW5d6GNum/v894 QNKxcB2n7fVUVfhN1whPesm/4tQT/Ljfzlw6o1B+NECZbBRv0OAghxZnjeigw98jDklh VOsA== X-Gm-Message-State: AOAM533A3GkEsZaNO00Ib0oTgTn4XvH/zPoR3DwCfNx5MXo0nBlybXOA qE0hyjL5uIASWkJMqx/WBZ+RiLMuIRtb5g== X-Google-Smtp-Source: ABdhPJytF665nm9xD/gGI+wqH2PhlQ6A8FEHkP8NSA/TTnESF7OqkvewbXMMeL49cWOeb+nlZ2QXRA== X-Received: by 2002:a05:620a:2812:b0:649:63d5:6151 with SMTP id f18-20020a05620a281200b0064963d56151mr2827960qkp.277.1645741250265; Thu, 24 Feb 2022 14:20:50 -0800 (PST) Received: from hurd (dsl-156-1.b2b2c.ca. [66.158.156.1]) by smtp.gmail.com with ESMTPSA id b6-20020ac87fc6000000b002dea65d1c7dsm401899qtk.47.2022.02.24.14.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 14:20:49 -0800 (PST) From: Maxim Cournoyer To: Maxime Devos Subject: Re: [bug#53676] [PATCH v2 3/4] services: pulseaudio: Add an extra-script-files configuration field. References: <20220224163828.11330-1-maxim.cournoyer@gmail.com> <20220224163828.11330-3-maxim.cournoyer@gmail.com> <27655b0c24666a93d23800ee74837ea032667432.camel@telenet.be> Date: Thu, 24 Feb 2022 17:20:48 -0500 In-Reply-To: <27655b0c24666a93d23800ee74837ea032667432.camel@telenet.be> (Maxime Devos's message of "Thu, 24 Feb 2022 19:53:34 +0100") Message-ID: <87zgmfzz27.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Maxime, Maxime Devos writes: > Maxim Cournoyer schreef op do 24-02-2022 om 11:38 [-0500]: >> +=C2=A0 (define (file-like->name file) >> +=C2=A0=C2=A0=C2=A0 (match file >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((? local-file?) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (local-file-name file)) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((? plain-file?) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (plain-file-name file)) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((? computed-file?) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (computed-file-name file)) >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (_ (leave (G_ "~a is not a local-file, p= lain-file or \ >> +computed-file object~%") file)))) > > This would not work with things like '(file-append ...)'. > Perhaps 'extra-script-files->file-union' can be made more general > by creating a variant of 'file-union' for this use case? > Maybe something like (untested): > > ;; Based on 'file-union' > (define* (file-directory . files) > ; files: (file-like1 file-like2 ...) > (computed-file name > (with-imported-modules '((guix build utils)) > (gexp > (begin > (use-modules (guix build utils)) > > (mkdir (ungexp output)) > (chdir (ungexp output)) > (ungexp-splicing > (map (lambda (source) > (gexp > (let ((target (basename source)) > ;; Stat the source to abort early if it = does > ;; not exist. > (stat (ungexp source)) > (symlink (ungexp source) (ungexp target)= )))) > files))))))) Not a bad idea, but it steers a bit on the too-complicated side of things for my taste; for one thing, I wouldn't know how to do the validation of the file name anymore (it needs to end by ".pa"). It could be done inside that procedure, but it'd become more tangled. The simple file-like->name procedure above will error with an accurate message telling the users about its limits (that it only accepts local-file, plain-file or computed-file). G-Exp wizards can still opt the mixed-text-file + any G-Exp transformation they wish via the 'script-file' field. Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 25 00:20:46 2022 Received: (at 53676) by debbugs.gnu.org; 25 Feb 2022 05:20:46 +0000 Received: from localhost ([127.0.0.1]:51046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNT26-0004c0-94 for submit@debbugs.gnu.org; Fri, 25 Feb 2022 00:20:46 -0500 Received: from mail-ej1-f66.google.com ([209.85.218.66]:37491) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNT24-0004bl-VF for 53676@debbugs.gnu.org; Fri, 25 Feb 2022 00:20:45 -0500 Received: by mail-ej1-f66.google.com with SMTP id bg10so8671694ejb.4 for <53676@debbugs.gnu.org>; Thu, 24 Feb 2022 21:20:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=MthHyFbTDTB38MPLp0SKea62wGfKkj5akqJ146OWOJg=; b=E2UQHzLKYMHOta6W1kmoDLVm6kjfO7SaEikvXC434nPsZfe2eMFua8qQEJDMotpQaN diTgLUeYb0YB1lKgZJEhNLO8NmxhlvzSIowuIcxkTJtzMgrda9mwM7Ph4jQGTrSzL2xM J1iSidkHC7US9JITw4qV52+dmuNC/zHlGHUd2dojw9RQBIHb9fqgLJUEm3ORK0Vq+l+C UvgDv831rE44yGYYqHn60gH9EkhCYqyrbnzPLHVy1Q+YEOVzXGhznxYRcxpk/B5m+dLR K96C/Eh4uEbWy0Wt1O1+EP37bV5fMZY/uCvjSCQKh8jHIGlgojtS4W8jZog8RPprXxwC mUbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=MthHyFbTDTB38MPLp0SKea62wGfKkj5akqJ146OWOJg=; b=CrkQjEruhVoPd9ccJu0BCC37mV1ct8C2JIpHUb1Kh1qZ6KLYywZ+U1j7r7zvTjAc62 Riwtdr12EVijIL97h2TtAw5oy6XxrWu53x9zArV2ce1bICeGxSBoZXbC5pW9d1L/+Mcx 3CRtzHSx9erjC8waXf8pqoUSwKY+8JY/+ovky8jmJr82vNEVQtab61MshGDcos9RmnkG 6cBAxT+wsQfGyNTg8TybzBR8snz5b5H/r/B/fVC0Z9RenfEQdZSKp1QL9/SRIGqCVBim 7PsyXBXDGjIaewHim1vy7qYT5zHAJ32tudTi1inolvnhlBtFCROtdGxZYtReeZZOddGh RUFQ== X-Gm-Message-State: AOAM533xQ+pQ42C1d7Fn3/SyE55P9BsL34+5Go8iMQ0bSTW1n2h9+qWL f+BnbmWe//Z6Vpm5ZTNjexQ= X-Google-Smtp-Source: ABdhPJw6SVrk9SnZwIGtadWrH9FYEQx4U02xSqDahZxq4vfm5V4iC3urh9LDNbFaxuEYszk9RjEPWg== X-Received: by 2002:a17:906:1f11:b0:685:d50e:3bf9 with SMTP id w17-20020a1709061f1100b00685d50e3bf9mr4863517ejj.275.1645766438952; Thu, 24 Feb 2022 21:20:38 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id p3-20020a1709060e8300b006d0e8ada804sm553200ejf.127.2022.02.24.21.20.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 21:20:38 -0800 (PST) Message-ID: <103c1a1c803c3d8ae73dffa1e4ee9a71bc28d33b.camel@gmail.com> Subject: Re: [PATCH v2 2/4] gnu: pulseaudio: Graft to adjust configuration. From: Liliana Marie Prikler To: Maxim Cournoyer Date: Fri, 25 Feb 2022 06:20:37 +0100 In-Reply-To: <877d9j2ad9.fsf@gmail.com> References: <20220224163828.11330-1-maxim.cournoyer@gmail.com> <20220224163828.11330-2-maxim.cournoyer@gmail.com> <387664c06141015c8fbf8db79a29e7ab09367dc2.camel@gmail.com> <877d9j2ad9.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Maxim, Am Donnerstag, dem 24.02.2022 um 17:00 -0500 schrieb Maxim Cournoyer: > Thank you for your continued feedback.  The reason I prefer this > simple substitution to a conditional one is two-fold: > > 1. It avoids two actors potentially touching the default 'script- > file' (the pulseaudio-service-type code as well as the user), which > could be unwieldy (do we plug the default.pa.d after their changes to > ensure it is there, or before, which means it'd potentially be > erased?).  Having it part of the shipped default.pa file makes this > simpler to reason with. Sure, but all we'd need here is proper documentation. For the record, I would check if a `source /etc/pulse/default.pa.d' is in the user- supplied file (even if commented) and append it if not. > 2. It allows foreign distribution users to keep their custom user > script working even when they use our pulseaudio package (it makes > our pulseaudio package behave as intended by upstream). That ignores the case where users modify their distro's default.pa *and* put stuff into default.pa.d. This might be necessary in some scenarios where the upstream default breaks user expectations. I'd really prefer if foreign distro users just set their environment variables, as those work unconditionally as intended. > I wouldn't mind using a feature branch to get the < 2k dependent > packages rebuilt as suggested by Leo, if you think that's preferable. That would work for the rebuilds, making this not a graft, but I'm still concerned whether we really want these semantics or not. With the WebkitGTK bug fixed, we can put our generated default.pa into /etc again, making it more debuggable. My personal opinion is still on explicitly declared rather than implicitly assumed. Cheers From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 01:21:54 2022 Received: (at 53676) by debbugs.gnu.org; 26 Feb 2022 06:21:54 +0000 Received: from localhost ([127.0.0.1]:54156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNqSn-0000J2-Vu for submit@debbugs.gnu.org; Sat, 26 Feb 2022 01:21:54 -0500 Received: from mail-qt1-f175.google.com ([209.85.160.175]:35674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNqSl-0000Io-Kb for 53676@debbugs.gnu.org; Sat, 26 Feb 2022 01:21:52 -0500 Received: by mail-qt1-f175.google.com with SMTP id w1so4505142qtj.2 for <53676@debbugs.gnu.org>; Fri, 25 Feb 2022 22:21:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=3LzqYJ2krX80Q0UCBCDoLASCeCh8PcHXgdnCj+9s5sY=; b=dfJnqJBFQ9eujJDHkNgJKJUFSnAhMBDtoJ7vwu3kH/deb1TgkghPvp96lK3VdF/7A2 5xQTpwy3/U0At7y+N/gva0aISnlTXHYoLwLxD5Mhpt4mc87wADJ3JeXtm/urKIviwjoK YezGRUiES6tDVM6EkDlqe5PYffoxNoQuT/e4f2IPcp/GLHo2K85UALLN9YR9eU4Cfeib oKSjvhQeBENSoCHj42h9hUrRLVpoh1Yt/hJ1/baK7/YaZk5fWqfBwUWfhK5KP6aJr7tc yKnZTke12P2eQobPCnXD6aRy0+xV3m6YHaeNSO+m2+HwR9wbF+6YNkShOL4AForu3+0g 2IQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=3LzqYJ2krX80Q0UCBCDoLASCeCh8PcHXgdnCj+9s5sY=; b=g9OPfQcDD+1JwjoO11tEKALEzAb6dKPLi4//aBjMrxQP1kYmaIxaKnSKPJsuUHjAJw gwxWMofSa9afUFKDcGTErsjtsaJ4DGdS3mknNUMpN4z771HSS0+obLLWa38KVcuOr8o3 H3Ibz4znmn5Vf+JWxVgZT55g3xhjvczCsCkTpJPj1dRYokLri5AQ0t4pdeUlUYA0YR7O wvK9zsjIJNbpWpHlvJEskE+vmtgbVwGXepw5YMRJfA9olRCINbr0Xc+yXnrByBkBjo67 cnc2gGPohRuFzX0PzBhh59FU9PpeNBc3Qb2ZephmK98qD17JcQ7/S2wYqf44KLKU1t93 JLoQ== X-Gm-Message-State: AOAM533hDll5ViUc4UBTMLW3iKBmfaK2HCv8NVBrKCGDAV0PE1Uu3HHd kHFLDleqrhRggCz2WCSP5fKPImwYGuzZRQ== X-Google-Smtp-Source: ABdhPJx1oMwMUqnYOYdeoY7dUkDbBTjXDPrlICNn6U7kUOhRUtv85oMkP/xtEU9OIrKLjqaMA8j7wg== X-Received: by 2002:ac8:570d:0:b0:2dd:97c8:e413 with SMTP id 13-20020ac8570d000000b002dd97c8e413mr9802236qtw.3.1645856505814; Fri, 25 Feb 2022 22:21:45 -0800 (PST) Received: from hurd (dsl-149-67.b2b2c.ca. [66.158.149.67]) by smtp.gmail.com with ESMTPSA id 194-20020a3706cb000000b005081e1550c8sm2211679qkg.78.2022.02.25.22.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Feb 2022 22:21:45 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: [PATCH v2 2/4] gnu: pulseaudio: Graft to adjust configuration. References: <20220224163828.11330-1-maxim.cournoyer@gmail.com> <20220224163828.11330-2-maxim.cournoyer@gmail.com> <387664c06141015c8fbf8db79a29e7ab09367dc2.camel@gmail.com> <877d9j2ad9.fsf@gmail.com> <103c1a1c803c3d8ae73dffa1e4ee9a71bc28d33b.camel@gmail.com> Date: Sat, 26 Feb 2022 01:21:44 -0500 In-Reply-To: <103c1a1c803c3d8ae73dffa1e4ee9a71bc28d33b.camel@gmail.com> (Liliana Marie Prikler's message of "Fri, 25 Feb 2022 06:20:37 +0100") Message-ID: <87zgmew3k7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Liliana, Liliana Marie Prikler writes: > Hi Maxim, > > Am Donnerstag, dem 24.02.2022 um 17:00 -0500 schrieb Maxim Cournoyer: >> Thank you for your continued feedback.=C2=A0 The reason I prefer this >> simple substitution to a conditional one is two-fold: >>=20 >> 1. It avoids two actors potentially touching the default 'script- >> file' (the pulseaudio-service-type code as well as the user), which >> could be unwieldy (do we plug the default.pa.d after their changes to >> ensure it is there, or before, which means it'd potentially be >> erased?).=C2=A0 Having it part of the shipped default.pa file makes this >> simpler to reason with. > Sure, but all we'd need here is proper documentation. For the record, > I would check if a `source /etc/pulse/default.pa.d' is in the user- > supplied file (even if commented) and append it if not. OK; I went a bit dumber/safer: when extra-script-files is non-null, the .include is appended. >> 2. It allows foreign distribution users to keep their custom user >> script working even when they use our pulseaudio package (it makes >> our pulseaudio package behave as intended by upstream). > That ignores the case where users modify their distro's default.pa > *and* put stuff into default.pa.d. This might be necessary in some > scenarios where the upstream default breaks user expectations. I'd > really prefer if foreign distro users just set their environment > variables, as those work unconditionally as intended. That sounds a bit hypothetical, but yes, it's a possibility. >> I wouldn't mind using a feature branch to get the < 2k dependent >> packages rebuilt as suggested by Leo, if you think that's preferable. > That would work for the rebuilds, making this not a graft, but I'm > still concerned whether we really want these semantics or not. With > the WebkitGTK bug fixed, we can put our generated default.pa into /etc > again, making it more debuggable. My personal opinion is still on > explicitly declared rather than implicitly assumed. OK, if we want to add the .include conditionally, I'd go with something like: --8<---------------cut here---------------start------------->8--- modified doc/guix.texi @@ -21507,7 +21507,10 @@ List of settings to set in @file{daemon.conf}, for= matted just like @var{client-conf}. =20 @item @code{script-file} (default: @code{(file-append pulseaudio "/etc/pul= se/default.pa")}) -Script file to use as @file{default.pa}. +Script file to use as @file{default.pa}. In case the +@code{extra-script-files} field below is used, an @code{.include} +directive pointing to @file{/etc/pulse/default.pa.d} is appended to the +provided script. =20 @item @code{extra-script-files} (default: @code{'())}) A list of file-like objects defining extra PulseAudio scripts to run at modified gnu/services/sound.scm @@ -174,6 +174,21 @@ (define (assert-pulseaudio-script-file-name name) extra-script-files))) (file-union "default.pa.d" (zip labels extra-script-files)))) =20 +(define (append-include-directive script-file) + "Append an include directive to source scripts under /etc/pulse/default.= pa.d." + (computed-file "default.pa" + #~(begin + (use-modules (ice-9 textual-ports)) + (define script-text + (call-with-input-file #$script-file get-string-all)) + (call-with-output-file #$output + (lambda (port) + (format port (string-append script-text + " +# Added by Guix to include scripts specified in extra-script-files. +.nofail +.include /etc/pulse/default.pa.d~%"))))))) + (define pulseaudio-etc (match-lambda (($ client-conf daemon-conf default-script-= file @@ -181,7 +196,10 @@ (define pulseaudio-etc `(("pulse" ,(file-union "pulse" - `(("default.pa" ,default-script-file) + `(("default.pa" + ,(if (null? extra-script-files) + default-script-file + (append-include-directive default-script-file))) ("system.pa" ,system-script-file) ,@(if (null? extra-script-files) '() --8<---------------cut here---------------end--------------->8--- A mixed-file as you used previously (combining two .include) could have been used, but I prefer to have the content directly visible under /etc/pulse/default.pa (and the shebang line preserved). This gets rid of the change on the pulseaudio package itself. What do you think? Thank you, Maxim From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 08:19:21 2022 Received: (at 53676) by debbugs.gnu.org; 26 Feb 2022 13:19:21 +0000 Received: from localhost ([127.0.0.1]:54531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwym-0005zc-W4 for submit@debbugs.gnu.org; Sat, 26 Feb 2022 08:19:21 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:33337) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNwyl-0005zP-Cy for 53676@debbugs.gnu.org; Sat, 26 Feb 2022 08:19:19 -0500 Received: by mail-ed1-f66.google.com with SMTP id s14so11094109edw.0 for <53676@debbugs.gnu.org>; Sat, 26 Feb 2022 05:19:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=WtKRjXngVtSqza7HYbMkUktl1Cog03Pr3Du53aZ+62c=; b=bwCzgZuaalxwo70ILSJMFG4xdWXO9RTMFOtlbwBFMci8eztdXQixHhpqNcrTotjPfa uTwFI/4O97qfcfcFNZlWXv0gU6RSjKWdPRs2lVgubcMuxzUSGPLsIsSNhvQK6/bTc7NL E33oqkuemyOHRnAJGZNErDjOMCkfLpavdb+Mls2RSGPCELMt8SEi616/YiyZuIIvxtrf jE34w23lpekuH3pRSAd8oIIBcUnVjDZKzGybj+pG5fYuPzdO/6AjZy6lfSuotS36f6JE IufeR0YW3RHj0NprXJGgFlnMO/NX4n1tkWory/YP1cidgRXLPkxw0rHunvjsyv6HAlW9 2NPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=WtKRjXngVtSqza7HYbMkUktl1Cog03Pr3Du53aZ+62c=; b=b32mzoKzsdKGw/UkcZpp0w4a7CUsB+B0dFNtQe86J1QGaSRRsOaEVChIqCqnmAfh66 PmueOO2YXpNiHTC1XMto4GmLxXHrfFzR+a0FZm8YbVS4hEEYzxPcPuwRAZFeK7ZDWlsv vGHi+FZkZ6GHRoL4QXYMDHd9FphXZTg5EjYls9ilQvqmzNSNAg91uhFRRBD+Abe3JX2S aruB8PjjxrNZMHxR7g3ydxE3uwE+5VVKp9AbncpVWy8y4ZWb8L4HDIS/W+ZeJ/ClOqLL HSMt8UhzQ/Hep8NDCJMvxRv1IyL1xd0XOVvboMFYfuuA6U4bX1GiiUceiLatMRioUjvH MgJQ== X-Gm-Message-State: AOAM531rohDqId2rx0pgeYpgo3+jgTEZRJaBJFu/mComqB1mys1hnHyX lTJUfESDX8xieFAqftCh94E= X-Google-Smtp-Source: ABdhPJxTkIShR6vUNPlTVV660ca0V60hXc7gOx7TOtRMsog4Eltb4tNWYnmWeKG7pZ/IVrqgzMXJ1Q== X-Received: by 2002:aa7:d1d7:0:b0:410:d6cf:82b2 with SMTP id g23-20020aa7d1d7000000b00410d6cf82b2mr11033087edp.193.1645881553330; Sat, 26 Feb 2022 05:19:13 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id p7-20020aa7cc87000000b00410ee30cefbsm2827536edt.71.2022.02.26.05.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 05:19:12 -0800 (PST) Message-ID: <7e6c5696e16e3452640aa8936d9ceb09c613314b.camel@gmail.com> Subject: Re: [PATCH v2 2/4] gnu: pulseaudio: Graft to adjust configuration. From: Liliana Marie Prikler To: Maxim Cournoyer Date: Sat, 26 Feb 2022 14:19:11 +0100 In-Reply-To: <87zgmew3k7.fsf@gmail.com> References: <20220224163828.11330-1-maxim.cournoyer@gmail.com> <20220224163828.11330-2-maxim.cournoyer@gmail.com> <387664c06141015c8fbf8db79a29e7ab09367dc2.camel@gmail.com> <877d9j2ad9.fsf@gmail.com> <103c1a1c803c3d8ae73dffa1e4ee9a71bc28d33b.camel@gmail.com> <87zgmew3k7.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676 Cc: 53676@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 (-) Hi Maxim, Am Samstag, dem 26.02.2022 um 01:21 -0500 schrieb Maxim Cournoyer: > Hi Liliana, > > Liliana Marie Prikler writes: > > > Hi Maxim, > > > > Am Donnerstag, dem 24.02.2022 um 17:00 -0500 schrieb Maxim > > Cournoyer: > > > > > Thank you for your continued feedback.  The reason I prefer this > > > simple substitution to a conditional one is two-fold: > > > > > > 1. It avoids two actors potentially touching the default 'script- > > > file' (the pulseaudio-service-type code as well as the user), > > > which could be unwieldy (do we plug the default.pa.d after their > > > changes to ensure it is there, or before, which means it'd > > > potentially be erased?).  Having it part of the shipped > > > default.pa file makes this simpler to reason with. > > Sure, but all we'd need here is proper documentation.  For the > > record, I would check if a `source /etc/pulse/default.pa.d' is in > > the user-supplied file (even if commented) and append it if not. > > OK; I went a bit dumber/safer: when extra-script-files is non-null, > the .include is appended. That works too and from what I can see you documented it, so people will at least understand it if they read the manual :) > > > I wouldn't mind using a feature branch to get the < 2k dependent > > > packages rebuilt as suggested by Leo, if you think that's > > > preferable. > > That would work for the rebuilds, making this not a graft, but I'm > > still concerned whether we really want these semantics or not.  > > With the WebkitGTK bug fixed, we can put our generated default.pa > > into /etc again, making it more debuggable.  My personal opinion is > > still on explicitly declared rather than implicitly assumed. > > OK, if we want to add the .include conditionally, I'd go with > something like: > > --8<---------------cut here---------------start------------->8--- > modified   doc/guix.texi > @@ -21507,7 +21507,10 @@ List of settings to set in > @file{daemon.conf}, formatted just like >  @var{client-conf}. >   >  @item @code{script-file} (default: @code{(file-append pulseaudio > "/etc/pulse/default.pa")}) > -Script file to use as @file{default.pa}. > +Script file to use as @file{default.pa}.  In case the > +@code{extra-script-files} field below is used, an @code{.include} > +directive pointing to @file{/etc/pulse/default.pa.d} is appended to > the > +provided script. >   >  @item @code{extra-script-files} (default: @code{'())}) >  A list of file-like objects defining extra PulseAudio scripts to run > at > modified   gnu/services/sound.scm > @@ -174,6 +174,21 @@ (define (assert-pulseaudio-script-file-name > name) >                       extra-script-files))) >      (file-union "default.pa.d" (zip labels extra-script-files)))) >   > +(define (append-include-directive script-file) > +  "Append an include directive to source scripts under > /etc/pulse/default.pa.d." > +  (computed-file "default.pa" > +                 #~(begin > +                     (use-modules (ice-9 textual-ports)) > +                     (define script-text > +                       (call-with-input-file #$script-file get- > string-all)) > +                     (call-with-output-file #$output > +                       (lambda (port) > +                         (format port (string-append script-text > +                                                     " > +# Added by Guix to include scripts specified in extra-script-files. > +.nofail > +.include /etc/pulse/default.pa.d~%"))))))) > + >  (define pulseaudio-etc >    (match-lambda >      (($ client-conf daemon-conf default- > script-file > @@ -181,7 +196,10 @@ (define pulseaudio-etc >       `(("pulse" >          ,(file-union >            "pulse" > -          `(("default.pa" ,default-script-file) > +          `(("default.pa" > +             ,(if (null? extra-script-files) > +                  default-script-file > +                  (append-include-directive default-script-file))) >              ("system.pa" ,system-script-file) >              ,@(if (null? extra-script-files) >                    '() > --8<---------------cut here---------------end--------------->8--- > > A mixed-file as you used previously (combining two .include) could > have been used, but I prefer to have the content directly visible > under /etc/pulse/default.pa (and the shebang line preserved). I trust that this code does as you say it does, but looking at it with my static analysis glasses I have no reason to believe it doesn't. > This gets rid of the change on the pulseaudio package itself. > > What do you think? Looks good to me. Is feedback from others still pending to make a v3 or am I the last straw here? Cheers From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 26 09:14:20 2022 Received: (at 53676-done) by debbugs.gnu.org; 26 Feb 2022 14:14:20 +0000 Received: from localhost ([127.0.0.1]:54570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxq0-0007Vn-5U for submit@debbugs.gnu.org; Sat, 26 Feb 2022 09:14:20 -0500 Received: from mail-qv1-f44.google.com ([209.85.219.44]:45665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNxpz-0007VV-D1 for 53676-done@debbugs.gnu.org; Sat, 26 Feb 2022 09:14:19 -0500 Received: by mail-qv1-f44.google.com with SMTP id h13so8888136qvk.12 for <53676-done@debbugs.gnu.org>; Sat, 26 Feb 2022 06:14:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=wc/cEYfQwFgzbOY8FDTDTiErL7YLyn6u/MA0wZyRkfw=; b=qdFrLQ4bzKQz50l6BlIMUFLTRkwpHG4nHiuLUWSxtN+e8QQQ3qIxkn4vjCn+k+zA1C ZASNeN0qcbNO/sK/XU+5HUrgC4wgt32sjFmJm38Z+2jy+qtf94G5ud5uMVSkYx0IuZWy bUVyvqOa1i9TkmCK2gvQeczIQqXbV/YiRBinY7354fSFOdBTv3CTdPJ8rFkhZ5CigOid yP6jN62t2wmNI71TChDtGysHBv/hqSzzXfPUQYZ7PgSReiii0Dm1uq7mBELP3IZwSIhQ HOibsYRbpfejySWpsV3Kdhh9xrt1drGsOY+PYjBA740IB2lH9w2xrlV2jWLdDIVscVch VJ9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=wc/cEYfQwFgzbOY8FDTDTiErL7YLyn6u/MA0wZyRkfw=; b=U7IkZJDx3WVexSbex5wjH5ifV4ZLPSWI2s2mCoi3EmxDHtJsPZjLeK5hTq16bXeEws ZsW3oMtKTIFbfpsO0padKMtZ0oKgLmw3VVWIPcNQ7CmMrBpgi4UXQ5y7o7l01qz/AUv6 ZmvSc5sCQn45Ta7VnKpMeZlS3RsAS59Y/DMHOfF5rF7Gp1YtKxI4Uo3SVop5zRtWYWXS rJdpP14tRQgoi9+9hO+TkQGqZpDs6Hinjvgag5QlOiaPbEuIIN/GS8EQ67VjBHT2glj2 oexLqgt6jwX4qz84vkyMISkU4ypilU2sCH36IU5247+SsRlKvq+nMO46UskGPKqwCNe6 N/Aw== X-Gm-Message-State: AOAM532YTgZBkwtQSBJKiMoQDREY9WBwiiY0iMB05sdS6mdaLElX4Ajt hHP7tOooL8ZW++TPfsEUE0X0HMlMqpsIMw== X-Google-Smtp-Source: ABdhPJx8kFkt/PDvhUFm65E4jRaHFHC9jAcWIe/t1NG5yjTfKBZmqYrVSTM34LRIx1SiHZSq6Ahpbg== X-Received: by 2002:a05:6214:76b:b0:432:f424:4ea2 with SMTP id f11-20020a056214076b00b00432f4244ea2mr942441qvz.121.1645884853631; Sat, 26 Feb 2022 06:14:13 -0800 (PST) Received: from hurd (dsl-149-67.b2b2c.ca. [66.158.149.67]) by smtp.gmail.com with ESMTPSA id r13-20020ac85c8d000000b002de72dbc987sm3303232qta.21.2022.02.26.06.14.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 06:14:12 -0800 (PST) From: Maxim Cournoyer To: Liliana Marie Prikler Subject: Re: [PATCH v2 2/4] gnu: pulseaudio: Graft to adjust configuration. References: <20220224163828.11330-1-maxim.cournoyer@gmail.com> <20220224163828.11330-2-maxim.cournoyer@gmail.com> <387664c06141015c8fbf8db79a29e7ab09367dc2.camel@gmail.com> <877d9j2ad9.fsf@gmail.com> <103c1a1c803c3d8ae73dffa1e4ee9a71bc28d33b.camel@gmail.com> <87zgmew3k7.fsf@gmail.com> <7e6c5696e16e3452640aa8936d9ceb09c613314b.camel@gmail.com> Date: Sat, 26 Feb 2022 09:14:12 -0500 In-Reply-To: <7e6c5696e16e3452640aa8936d9ceb09c613314b.camel@gmail.com> (Liliana Marie Prikler's message of "Sat, 26 Feb 2022 14:19:11 +0100") Message-ID: <87czj9ww97.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53676-done Cc: 53676-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 (-) Hi Liliana, Liliana Marie Prikler writes: [...] > Looks good to me. Is feedback from others still pending to make a v3 > or am I the last straw here? There was a suggestion by Maxime to attempt generalizing file-union with implicit names from the file-like objects, but as I noted this would make things a bit more complicated/tangled... perhaps it could accept name sanitizer procedure as argument. I'd prefer to keep such effort distinct, as I think it could live next to file-union as file-union* for example. I've now pushed this series, thank a lot for all the comments/feedback! Maxim From unknown Sat Jun 21 17:33:56 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 27 Mar 2022 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator