From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gL9SDktr/2EuigAAgWs5BA (envelope-from ) for ; Sun, 06 Feb 2022 07:31:39 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id yFyxC0tr/2HTKAEA9RJhRA (envelope-from ) for ; Sun, 06 Feb 2022 07:31:39 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3625D19FC9 for ; Sun, 6 Feb 2022 07:31:38 +0100 (CET) Received: from localhost ([::1]:48060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGb5E-0000xZ-3R for larch@yhetil.org; Sun, 06 Feb 2022 01:31:36 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGb4g-0000xK-ID for guix-patches@gnu.org; Sun, 06 Feb 2022 01:31:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42296) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGb4g-0005Gm-3d for guix-patches@gnu.org; Sun, 06 Feb 2022 01:31:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nGb4f-0004DQ-Ta for guix-patches@gnu.org; Sun, 06 Feb 2022 01:31:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53676] [PATCH 0/5] *** PulseAudio service improvements *** Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 06 Feb 2022 06:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53676 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Liliana Marie Prikler Cc: 53676@debbugs.gnu.org Received: via spool by 53676-submit@debbugs.gnu.org id=B53676.164412904416181 (code B ref 53676); Sun, 06 Feb 2022 06:31:01 +0000 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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644129098; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=2fpBWKDmVqxdwSEMrT8i/Uw3v5xPR9MxCUw3qDBDy+o=; b=pXyyKp75fn4EO/xd4MUTM9SvJJdwub2Tz/sTmQZmCi+8FhT2wHxq5gpy7fGr4dsbvWJi48 jpe//mIfuxEmhrggrsAAwb7D9YKlLP4TOyJ4ONCxAWvi3F9IQxUWaa1+Fn7e6FXvFET/X7 rIKuTazrzIpeZ09k/O2E7J9L7o0axjF3VoYLGCG9VCSw2MjPNXZo1jBfnWjHH8O3RZvm9S D0gczhlLRPN4RDkC5u8GF1Ud9ANCxZrYmQKT9uRaS0I0PAjNP/ygF/ZHb/J0oiPi7FN9cV G89r9jalaotYe9Dyx7H2eyORrU6wWN8eI9gUwyx5nrAAJWGMKlil6NNE/IbdsQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644129098; a=rsa-sha256; cv=none; b=sgb23yWve9nLeY7YIY7FFyHmeWguL4Ylg/GFMnTOmjI+iGEU3i6t1FZTSpgrFNLkeHUj6Z NTGgrpP5iPWdePhmzQwQNh6r+Wji7iNtC7WJdp+DyFMz5m6AfbAY1MPxC+rQWOrwQCeGsX 6V8HwYRDC/KRUkF4RrlJGMFHQdw9tDdGz3Ro0RzAntd+1IRjc99QUf+C8OhJnJMXXKyvw5 xsDgu7undyW1CiMd646VWpoGjkGRSSLnvoyAAV4pCr4dYPXLZPhpHd9VTObDAZ1Dsq9QwX SAMRulQoK/yBvOPTeN/GtgqAxvzHoTFckzZxUUP+iKbNLAJ6ZhM2QPrrjbcHpA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=mNaFYGz4; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=mNaFYGz4; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3625D19FC9 X-Spam-Score: -2.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: whqZwVQ4dvou 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