unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#38949] [PATCH] services: Add pulseaudio service.
@ 2020-01-05 17:39 Oleg Pykhalov
  2020-01-08  7:26 ` bug#38949: " Oleg Pykhalov
  0 siblings, 1 reply; 2+ messages in thread
From: Oleg Pykhalov @ 2020-01-05 17:39 UTC (permalink / raw)
  To: 38949; +Cc: Oleg Pykhalov

* gnu/services/sound.scm (pulseaudio-environment): New procedure.
(pulseaudio-service-type): New variable.
* doc/guix.texi (Sound Services): Document it.
---
 doc/guix.texi          | 14 ++++++++++++++
 gnu/services/sound.scm | 28 ++++++++++++++++++++++++++--
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index df1ba428a5..bb0ef17ddd 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -15951,6 +15951,20 @@ pcm.!default @{
 See @uref{https://www.alsa-project.org/main/index.php/Asoundrc} for the
 details.
 
+@deffn {Scheme Variable} pulseaudio-service-type
+This is the type for the @uref{http://www.pulseaudio.org/, PulseAudio
+sound server}, which sets the @var{LADSPA_PATH} environment variable to
+allow PulseAudio load modules from @code{swh-plugins} package.
+
+See @uref{http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html} for the
+details.
+
+The following example will setup the service:
+
+@lisp
+(service pulseaudio-service-type)
+@end lisp
+@end deffn
 
 @node Database Services
 @subsection Database Services
diff --git a/gnu/services/sound.scm b/gnu/services/sound.scm
index f2dd24402f..aaca733729 100644
--- a/gnu/services/sound.scm
+++ b/gnu/services/sound.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
+;;; Copyright © 2018, 2020 Oleg Pykhalov <go.wigust@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,16 +21,20 @@
   #:use-module (gnu services configuration)
   #:use-module (gnu services shepherd)
   #:use-module (gnu services)
+  #:use-module (gnu system pam)
   #:use-module (gnu system shadow)
   #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix records)
   #:use-module (guix store)
+  #:use-module (gnu packages audio)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages pulseaudio)
   #:use-module (ice-9 match)
   #:export (alsa-configuration
-            alsa-service-type))
+            alsa-service-type
+
+            pulseaudio-service-type))
 
 ;;; Commentary:
 ;;;
@@ -97,4 +101,24 @@ ctl.!default {
    (default-value (alsa-configuration))
    (description "Configure low-level Linux sound support, ALSA.")))
 
+\f
+;;;
+;;; PulseAudio
+;;;
+
+(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-service-type
+  (service-type
+   (name 'pulseaudio)
+   (extensions
+    (list (service-extension session-environment-service-type
+                             pulseaudio-environment)))
+   (default-value #f)
+   (description "Configure PulseAudio sound support.")))
+
 ;;; sound.scm ends here
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#38949: [PATCH] services: Add pulseaudio service.
  2020-01-05 17:39 [bug#38949] [PATCH] services: Add pulseaudio service Oleg Pykhalov
@ 2020-01-08  7:26 ` Oleg Pykhalov
  0 siblings, 0 replies; 2+ messages in thread
From: Oleg Pykhalov @ 2020-01-08  7:26 UTC (permalink / raw)
  To: 38949-done

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]

Oleg Pykhalov <go.wigust@gmail.com> writes:

> * gnu/services/sound.scm (pulseaudio-environment): New procedure.
> (pulseaudio-service-type): New variable.
> * doc/guix.texi (Sound Services): Document it.
> ---
>  doc/guix.texi          | 14 ++++++++++++++
>  gnu/services/sound.scm | 28 ++++++++++++++++++++++++++--
>  2 files changed, 40 insertions(+), 2 deletions(-)
>
[…]

Pushed to master as a66ee82a05d8ff1ef7c5ff9ac7723cb32fc4e22a

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-08  7:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-05 17:39 [bug#38949] [PATCH] services: Add pulseaudio service Oleg Pykhalov
2020-01-08  7:26 ` bug#38949: " Oleg Pykhalov

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).