all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Liliana Marie Prikler <liliana.prikler@gmail.com>
Cc: 53676@debbugs.gnu.org
Subject: [bug#53676] [PATCH 0/5] *** PulseAudio service improvements ***
Date: Sun, 06 Feb 2022 01:30:33 -0500	[thread overview]
Message-ID: <87h79c1p86.fsf_-_@gmail.com> (raw)
In-Reply-To: <2ed5ef40ecc06c783af81de129a62d3c42d87fec.camel@gmail.com> (Liliana Marie Prikler's message of "Wed, 02 Feb 2022 21:43:14 +0100")

Hi Liliana,

Liliana Marie Prikler <liliana.prikler@gmail.com> 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?  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/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---

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")))))))))))
 
 (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




  reply	other threads:[~2022-02-06  6:31 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01  4:13 [bug#53676] [PATCH 0/5] *** PulseAudio service improvements *** Maxim Cournoyer
2022-02-01  4:19 ` [bug#53676] [PATCH 1/5] doc: Fix typo Maxim Cournoyer
2022-02-01  4:19   ` [bug#53676] [PATCH 2/5] services/sound: Normalize pulseaudio-configuration accessor names Maxim Cournoyer
2022-02-01 19:48     ` Liliana Marie Prikler
2022-02-01 20:18       ` Maxim Cournoyer
2022-02-01 21:29         ` Liliana Marie Prikler
2022-02-01  4:19   ` [bug#53676] [PATCH 3/5] gnu: pulseaudio: Graft to adjust configuration Maxim Cournoyer
2022-02-01 19:45     ` Liliana Marie Prikler
2022-02-01 20:20       ` Maxim Cournoyer
2022-02-01 21:37         ` Liliana Marie Prikler
2022-02-02  4:30           ` Maxim Cournoyer
2022-02-02 20:43             ` Liliana Marie Prikler
2022-02-06  6:30               ` Maxim Cournoyer [this message]
2022-02-06  9:07                 ` [bug#53676] [PATCH 0/5] *** PulseAudio service improvements *** Liliana Marie Prikler
2022-02-24 16:31                   ` Maxim Cournoyer
2022-02-24 20:26                     ` Liliana Marie Prikler
2022-02-01  4:19   ` [bug#53676] [PATCH 4/5] services: pulseaudio: Add an extra-script-files configuration field Maxim Cournoyer
2022-02-01 19:56     ` Liliana Marie Prikler
2022-02-01 20:27       ` Maxim Cournoyer
2022-02-01 21:26         ` Liliana Marie Prikler
2022-02-02  3:44           ` Maxim Cournoyer
2022-02-02 20:07             ` Liliana Marie Prikler
2022-02-06  7:25               ` Maxim Cournoyer
2022-02-06  8:02                 ` Liliana Marie Prikler
2022-02-24 16:25                   ` Maxim Cournoyer
2022-02-01  4:19   ` [bug#53676] [PATCH 5/5] services: pulseaudio: Deploy the configuration files to /etc/pulse Maxim Cournoyer
2022-02-01 19:43     ` Liliana Marie Prikler
2022-02-02 22:43       ` Jack Hill
2022-02-07 22:29         ` [bug#53676] [PATCH 0/5] *** PulseAudio service improvements *** Maxim Cournoyer
2022-02-08  5:21           ` Liliana Marie Prikler
2022-02-08 14:25             ` Maxim Cournoyer
2022-02-08 19:31               ` Liliana Marie Prikler
2022-02-08 14:29             ` Maxim Cournoyer
2022-02-08 10:12           ` Maxime Devos
2022-02-08 14:27             ` Maxim Cournoyer
2022-02-24 16:36               ` Maxim Cournoyer
2022-02-24 14:42         ` [bug#53676] [PATCH 5/5] services: pulseaudio: Deploy the configuration files to /etc/pulse Maxim Cournoyer
2022-02-01 19:49   ` [bug#53676] [PATCH 1/5] doc: Fix typo Liliana Marie Prikler
2022-02-01  4:24 ` [bug#53676] [PATCH 0/5] *** PulseAudio service improvements *** Leo Famulari
2022-02-01 20:15   ` Maxim Cournoyer
2022-02-24 16:38 ` [bug#53676] [PATCH v2 1/4] services/sound: Normalize pulseaudio-configuration accessor names Maxim Cournoyer
2022-02-24 16:38   ` [bug#53676] [PATCH v2 2/4] gnu: pulseaudio: Graft to adjust configuration Maxim Cournoyer
2022-02-24 19:47     ` Liliana Marie Prikler
2022-02-24 22:00       ` Maxim Cournoyer
2022-02-25  5:20         ` Liliana Marie Prikler
2022-02-26  6:21           ` Maxim Cournoyer
2022-02-26 13:19             ` Liliana Marie Prikler
2022-02-26 14:14               ` bug#53676: " Maxim Cournoyer
2022-02-24 16:38   ` [bug#53676] [PATCH v2 3/4] services: pulseaudio: Add an extra-script-files configuration field Maxim Cournoyer
2022-02-24 18:53     ` Maxime Devos
2022-02-24 22:20       ` Maxim Cournoyer
2022-02-24 16:38   ` [bug#53676] [PATCH v2 4/4] services: pulseaudio: Deploy the configuration files to /etc/pulse Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h79c1p86.fsf_-_@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=53676@debbugs.gnu.org \
    --cc=liliana.prikler@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.