GNU bug report logs - #39053
[PATCH] Add pulseaudio configuration and fix volume bugs

Previous Next

Package: guix-patches;

Reported by: Leo Prikler <leo.prikler <at> student.tugraz.at>

Date: Thu, 9 Jan 2020 13:59:02 UTC

Severity: normal

Tags: patch

Merged with 39052, 39054, 39055, 39061, 39062, 39063, 39064, 39065

Done: Marius Bakke <mbakke <at> fastmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#39052: closed ([PATCH 1/3] services: Add pulseaudio-configuration.)
Date: Sat, 11 Jan 2020 17:24:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 11 Jan 2020 18:23:26 +0100
with message-id <87ftglzz3l.fsf <at> devup.no>
and subject line Re: [bug#39053] [PATCH] Add pulseaudio configuration and fix volume bugs
has caused the debbugs.gnu.org bug report #39053,
regarding [PATCH 1/3] services: Add pulseaudio-configuration.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
39053: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=39053
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Leo Prikler <leo.prikler <at> student.tugraz.at>
To: guix-patches <at> gnu.org
Subject: [PATCH 1/3] services: Add pulseaudio-configuration.
Date: Thu,  9 Jan 2020 14:57:44 +0100
* gnu/services/sound (<pulseaudio-configuration>): New record.
(pulseaudio-etc): New procedure.
(pulseaudio-service-type): Update accordingly.
---
 gnu/services/sound.scm | 47 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 45 insertions(+), 2 deletions(-)

diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm
index aaca733729..f01d958ce7 100644
--- a/gnu/services/sound.scm
+++ b/gnu/services/sound.scm
@@ -34,6 +34,7 @@
   #:export (alsa-configuration
             alsa-service-type
 
+            pulseaudio-configuration
             pulseaudio-service-type))
 
 ;;; Commentary:
@@ -106,19 +107,61 @@ ctl.!default {
 ;;; PulseAudio
 ;;;
 
+(define-record-type* <pulseaudio-configuration>
+  pulseaudio-configuration make-pulseaudio-configuration
+  pulseaudio-configuration?
+  (package pulseaudio-package (default pulseaudio))
+  (client-conf pulseaudio-client-conf (default '()))
+  (daemon-conf pulseaudio-daemon-conf (default '((flat-volumes no))))
+  (default-script pulseaudio-default-script (default #f))
+  (system-script pulseaudio-system-script (default #f)))
+
 (define (pulseaudio-environment config)
   ;; Define this variable in the global environment such that
   ;; pulseaudio swh-plugins works.
   `(("LADSPA_PATH"
      . ,(file-append swh-plugins "/lib/ladspa"))))
 
+(define (pulseaudio-conf-entry arg)
+  (match arg
+    ((key value)
+     (format #f "~a = ~s~%" key value))
+    ((? string? _)
+     (string-append arg "\n"))))
+
+(define pulseaudio-etc
+  (match-lambda
+    (($ <pulseaudio-configuration> package client-conf daemon-conf
+                                   default-script system-script)
+     (let ((default.pa (if default-script
+                           (apply mixed-text-file "default.pa"
+                                  default-script)
+                           (file-append package "/etc/pulse/default.pa"))))
+       `(("pulse"
+          ,(file-union
+            "pulse"
+            `(("client.conf"
+               ,(apply mixed-text-file "client.conf"
+                       (map pulseaudio-conf-entry client-conf)))
+              ("daemon.conf"
+               ,(apply mixed-text-file "daemon.conf"
+                       "default-script-file = " default.pa "\n"
+                       (map pulseaudio-conf-entry daemon-conf)))
+              ("default.pa" ,default.pa)
+              ("system.pa"
+               ,(if system-script
+                    (apply mixed-text-file "system.pa"
+                           system-script)
+                    (file-append package "/etc/pulse/system.pa")))))))))))
+
 (define pulseaudio-service-type
   (service-type
    (name 'pulseaudio)
    (extensions
     (list (service-extension session-environment-service-type
-                             pulseaudio-environment)))
-   (default-value #f)
+                             pulseaudio-environment)
+          (service-extension etc-service-type pulseaudio-etc)))
+   (default-value (pulseaudio-configuration))
    (description "Configure PulseAudio sound support.")))
 
 ;;; sound.scm ends here
-- 
2.24.1



[Message part 3 (message/rfc822, inline)]
From: Marius Bakke <mbakke <at> fastmail.com>
To: Leo Prikler <leo.prikler <at> student.tugraz.at>, 39053-done <at> debbugs.gnu.org
Cc: 38172-done <at> debbugs.gnu.org
Subject: Re: [bug#39053] [PATCH] Add pulseaudio configuration and fix volume
 bugs
Date: Sat, 11 Jan 2020 18:23:26 +0100
[Message part 4 (text/plain, inline)]
Leo Prikler <leo.prikler <at> student.tugraz.at> writes:

> This series of patches adds a configuration type for pulseaudio and also fixes
> a bug, where various applications would inadvertently max out the system volume
> (see e.g. #38172).

Thanks!  I've pushed the patches with mentioned tweaks in
2c7511fb6..71e33e32f.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 5 years and 126 days ago.

Previous Next


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