1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
7 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
8 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
9 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages pulseaudio)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module ((guix licenses) #:prefix l:)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system python)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages algebra)
35 #:use-module (gnu packages audio)
36 #:use-module (gnu packages autotools)
37 #:use-module (gnu packages avahi)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages databases)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages libcanberra)
43 #:use-module (gnu packages web)
44 #:use-module (gnu packages linux)
45 #:use-module (gnu packages m4)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages xiph))
49 (define-public libsndfile
55 (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
57 (patches (search-patches "libsndfile-armhf-type-checks.patch"
58 "libsndfile-CVE-2017-8361-8363-8365.patch"
59 "libsndfile-CVE-2017-8362.patch"
60 "libsndfile-CVE-2017-12562.patch"))
63 "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz"))))
64 (build-system gnu-build-system)
66 `(("libvorbis" ,libvorbis)
70 `(("pkg-config" ,pkg-config)))
71 (home-page "http://www.mega-nerd.com/libsndfile/")
72 (synopsis "Reading and writing files containing sampled sound")
74 "Libsndfile is a C library for reading and writing files containing
75 sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
76 one standard library interface.
78 It was designed to handle both little-endian (such as WAV) and
79 big-endian (such as AIFF) data, and to compile and run correctly on
80 little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
81 as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
82 SPARC. Hopefully the design of the library will also make it easy to extend
83 for reading and writing new sound file formats.")
86 (define-public libsamplerate
88 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
92 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
96 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
97 (build-system gnu-build-system)
99 `(("pkg-config" ,pkg-config)))
101 `(("libsndfile" ,libsndfile)
103 (home-page "http://www.mega-nerd.com/SRC/index.html")
104 (synopsis "Audio sample rate conversion library")
106 "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
107 audio. One example of where such a thing would be useful is converting audio
108 from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
111 SRC is capable of arbitrary and time varying conversions; from downsampling by
112 a factor of 256 to upsampling by the same factor. Arbitrary in this case means
113 that the ratio of input and output sample rates can be an irrational
114 number. The conversion ratio can also vary with time for speeding up and
115 slowing down effects.
117 SRC provides a small set of converters to allow quality to be traded off
118 against computation cost. The current best converter provides a
119 signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
120 the theoretical best bandwidth for a given pair of input and output sample
124 (define-public pulseaudio
131 "https://freedesktop.org/software/pulseaudio/releases/"
132 name "-" version ".tar.xz"))
135 "0ma0p8iry7fil7qb4pm2nx2pm65kq9hk9xc4r5wkf14nqbzni5l0"))
136 (modules '((guix build utils)))
138 ;; Disable console-kit support by default since it's deprecated
141 (substitute* "src/daemon/default.pa.in"
142 (("load-module module-console-kit" all)
143 (string-append "#" all "\n")))
145 (patches (search-patches
146 "pulseaudio-fix-mult-test.patch"
147 "pulseaudio-longer-test-timeout.patch"))))
148 (build-system gnu-build-system)
150 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
151 "--disable-oss-output"
153 (string-append "--with-udev-rules-dir="
154 (assoc-ref %outputs "out")
155 "/lib/udev/rules.d"))
156 #:phases (modify-phases %standard-phases
157 (add-before 'check 'pre-check
159 ;; 'tests/lock-autospawn-test.c' wants to create a file
160 ;; under ~/.config/pulse.
161 (setenv "HOME" (getcwd))
162 ;; 'thread-test' needs more time on hydra and on slower
163 ;; machines, so we set the default timeout to 120 seconds.
164 (setenv "CK_DEFAULT_TIMEOUT" "120")
167 ;; TODO: Add optional inputs (GTK+?).
168 `(("alsa-lib" ,alsa-lib)
171 ("speexdsp" ,speexdsp)
172 ("libsndfile" ,libsndfile)
173 ("jack" ,jack-1) ; For routing the output to jack.
179 ("eudev" ,eudev))) ;for the detection of hardware audio devices
182 ("glib:bin" ,glib "bin")
183 ("intltool" ,intltool)
185 ("pkg-config" ,pkg-config)))
187 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
190 (home-page "http://www.pulseaudio.org/")
191 (synopsis "Sound server")
193 "PulseAudio is a sound server. It is basically a proxy for your sound
194 applications. It allows you to do advanced operations on your sound data as
195 it passes between your application and your hardware. Things like
196 transferring the audio to a different machine, changing the sample format or
197 channel count and mixing several sounds into one are easily achieved using a
200 ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
201 ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
202 ;; 'LICENSE' for details.
205 (define-public pavucontrol
212 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
217 "14486c6lmmirkhscbfygz114f6yzf97h35n3h3pdr27w4mdfmlmk"))))
218 (build-system gnu-build-system)
220 '(#:configure-flags '("CXXFLAGS=-std=c++11"))) ; required by gtkmm
222 `(("libcanberra" ,libcanberra)
224 ("pulseaudio" ,pulseaudio)))
226 `(("intltool" ,intltool)
227 ("pkg-config" ,pkg-config)))
228 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
229 (synopsis "PulseAudio volume control")
231 "PulseAudio Volume Control (pavucontrol) provides a GTK+
232 graphical user interface to connect to a PulseAudio server and
233 easily control the volume of all clients, sinks, etc.")
236 (define-public ponymix
242 (uri (string-append "https://github.com/falconindy/ponymix/"
243 "archive/" version ".tar.gz"))
246 "1c0ch98zry3c4ixywwynjid1n1nh4xl4l1p548giq2w3zwflaghn"))
247 (file-name (string-append name "-" version ".tar.gz"))))
248 (build-system gnu-build-system)
250 `(#:tests? #f ; There is no test suite.
251 #:make-flags (let ((out (assoc-ref %outputs "out")))
252 (list (string-append "DESTDIR=" out)))
254 (modify-phases %standard-phases
255 (add-after 'unpack 'patch-paths
257 (substitute* "Makefile"
259 (delete 'configure)))) ; There's no configure phase.
261 `(("pulseaudio" ,pulseaudio)))
263 `(("pkg-config" ,pkg-config)))
264 (home-page "https://github.com/falconindy/ponymix")
265 (synopsis "Console-based PulseAudio mixer")
266 (description "Ponymix is a PulseAudio mixer and volume controller with a
267 command-line interface. In addition, it is possible to use named sources and
271 (define-public pulsemixer
277 (uri (string-append "https://github.com/GeorgeFilipkin/"
278 "pulsemixer/archive/" version ".tar.gz"))
279 (file-name (string-append name "-" version ".tar.gz"))
282 "1lpad90ifr2xfldyf39sbwx1v85rif2gm9w774gwwpjv53zfgk1g"))))
283 (build-system python-build-system)
286 (modify-phases %standard-phases
287 (add-after 'unpack 'patch-path
288 (lambda* (#:key inputs #:allow-other-keys)
289 (let ((pulse (assoc-ref inputs "pulseaudio")))
290 (substitute* "pulsemixer"
292 (string-append pulse "/lib/libpulse.so.0")))
295 `(("pulseaudio" ,pulseaudio)))
296 (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
297 (synopsis "Command-line and curses mixer for PulseAudio")
298 (description "Pulsemixer is a PulseAudio mixer with command-line and
299 curses-style interfaces.")