From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4OjyEQGQ/2F6YAEAgWs5BA (envelope-from ) for ; Sun, 06 Feb 2022 10:08:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id ULeoDgGQ/2G+3QAAauVa8A (envelope-from ) for ; Sun, 06 Feb 2022 10:08:17 +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 A381F12CF8 for ; Sun, 6 Feb 2022 10:08:16 +0100 (CET) Received: from localhost ([::1]:44012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGdWp-00020S-G6 for larch@yhetil.org; Sun, 06 Feb 2022 04:08:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGdWc-0001zv-8m for guix-patches@gnu.org; Sun, 06 Feb 2022 04:08:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42507) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGdWb-00088g-W1 for guix-patches@gnu.org; Sun, 06 Feb 2022 04:08:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nGdWb-0004Ry-N2 for guix-patches@gnu.org; Sun, 06 Feb 2022 04:08:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53676] [PATCH 0/5] *** PulseAudio service improvements *** Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 06 Feb 2022 09:08: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: Maxim Cournoyer Cc: 53676@debbugs.gnu.org Received: via spool by 53676-submit@debbugs.gnu.org id=B53676.164413846717067 (code B ref 53676); Sun, 06 Feb 2022 09:08:01 +0000 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: From: Liliana Marie Prikler 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-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=1644138496; 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=I6Wi3bbWnwYz5A/gjCeOE18OrQFVUna+0PZYeYeNl9I=; b=OtlEudJOTuvejrUQyDqqjHNNX17pE78LdT4LWCCezGcEQz3DacNp4gelU2FQtTCKYDKiWg 1u9PMiqlZrcITTWvwIBqjkU09A65f2F7LTDn9qf8HkdKVX/Jr855yNhgCXwdRfz/tRWTqb iaj4zfswn4idOG1rHpdRelArr9LAd/C7gGjGYbW1xTs9IQlYKiZTFU2GDcRVuK5tKczd+1 SaCf8n/mmLUo3S1AQX5T+CopXV2OSih5n1zSBDbTgKMvBfqBseNmaZ4Gbb+ymjkPt30Hcq Hp/tyTuzfMzTZ8hRSvYI4Wm6VJNYwtNRcVYSvPs8vgZm/MMVScsJCD/JIbMUgA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644138496; a=rsa-sha256; cv=none; b=j+Tlui8J9mI1/EMHt0CKUonixc9/J6faWb6XWVhQjsbtxIaooT+uqYnc80CHbHkzInwJsP vSsm+0CKd8ED8kuY/CO2vz7M7mITqYpln6hFXOHc7WOKqaUo6YC9DqvGM/MRc1v1jt4tE3 ix+DEMCcccQxw+Ps5Y42aI8jVBDHUAQyK6rxjgpZeAGAi1ldoLvla63sMWZHZcnaRxyX3L oudSLaMruapOnz9RD61CQD4egs3WCIeyQh3nlgBtfDxbyN/T3d2XFOshmqQNjYt9uGecMw Ut6aW5cwdoKAjAqKP2lcvdqJAvikZu6TKzr2phRM/nfXeB+epYm4+TdQr0rw9A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=opToeXls; 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=opToeXls; 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: A381F12CF8 X-Spam-Score: -2.03 X-Migadu-Scanner: scn1.migadu.com X-TUID: MduiqQoN81BQ 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