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>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages pulseaudio)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module ((guix licenses) #:prefix l:)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system python)
32 #:use-module (gnu packages)
33 #:use-module (gnu packages algebra)
34 #:use-module (gnu packages autotools)
35 #:use-module (gnu packages avahi)
36 #:use-module (gnu packages check)
37 #:use-module (gnu packages databases)
38 #:use-module (gnu packages glib)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages libcanberra)
41 #:use-module (gnu packages web)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages m4)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages xiph))
47 (define-public libsndfile
50 (replacement libsndfile/fixed)
54 (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
56 (patches (search-patches "libsndfile-armhf-type-checks.patch"
57 "libsndfile-CVE-2017-8361-8363-8365.patch"
58 "libsndfile-CVE-2017-8362.patch"))
61 "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz"))))
62 (build-system gnu-build-system)
64 `(("libvorbis" ,libvorbis)
68 `(("pkg-config" ,pkg-config)))
69 (home-page "http://www.mega-nerd.com/libsndfile/")
70 (synopsis "Reading and writing files containing sampled sound")
72 "Libsndfile is a C library for reading and writing files containing
73 sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
74 one standard library interface.
76 It was designed to handle both little-endian (such as WAV) and
77 big-endian (such as AIFF) data, and to compile and run correctly on
78 little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
79 as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
80 SPARC. Hopefully the design of the library will also make it easy to extend
81 for reading and writing new sound file formats.")
84 (define libsndfile/fixed
88 (inherit (package-source libsndfile))
90 (origin-patches (package-source libsndfile))
91 (search-patches "libsndfile-CVE-2017-12562.patch")))))))
93 (define-public libsamplerate
95 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
99 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
103 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
104 (build-system gnu-build-system)
106 `(("pkg-config" ,pkg-config)))
108 `(("libsndfile" ,libsndfile)
110 (home-page "http://www.mega-nerd.com/SRC/index.html")
111 (synopsis "Audio sample rate conversion library")
113 "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
114 audio. One example of where such a thing would be useful is converting audio
115 from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
118 SRC is capable of arbitrary and time varying conversions; from downsampling by
119 a factor of 256 to upsampling by the same factor. Arbitrary in this case means
120 that the ratio of input and output sample rates can be an irrational
121 number. The conversion ratio can also vary with time for speeding up and
122 slowing down effects.
124 SRC provides a small set of converters to allow quality to be traded off
125 against computation cost. The current best converter provides a
126 signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
127 the theoretical best bandwidth for a given pair of input and output sample
131 (define-public pulseaudio
138 "https://freedesktop.org/software/pulseaudio/releases/"
139 name "-" version ".tar.xz"))
142 "17ndr6kc7hpv4ih4gygwlcpviqifbkvnk4fbwf4n25kpb991qlpj"))
143 (modules '((guix build utils)))
145 ;; Disable console-kit support by default since it's deprecated
148 (substitute* "src/daemon/default.pa.in"
149 (("load-module module-console-kit" all)
150 (string-append "#" all "\n")))
152 (patches (search-patches
153 "pulseaudio-fix-mult-test.patch"
154 "pulseaudio-longer-test-timeout.patch"))))
155 (build-system gnu-build-system)
157 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
158 "--disable-oss-output"
160 (string-append "--with-udev-rules-dir="
161 (assoc-ref %outputs "out")
162 "/lib/udev/rules.d"))
163 #:phases (modify-phases %standard-phases
164 (add-before 'check 'pre-check
166 ;; 'tests/lock-autospawn-test.c' wants to create a file
167 ;; under ~/.config/pulse.
168 (setenv "HOME" (getcwd))
169 ;; 'thread-test' needs more time on hydra and on slower
170 ;; machines, so we set the default timeout to 120 seconds.
171 (setenv "CK_DEFAULT_TIMEOUT" "120")
174 ;; TODO: Add optional inputs (GTK+?).
175 `(("alsa-lib" ,alsa-lib)
179 ("libsndfile" ,libsndfile)
180 ("libsamplerate" ,libsamplerate)
183 ("intltool" ,intltool)
188 ("eudev" ,eudev) ;for the detection of hardware audio devices
191 `(("pkg-config" ,pkg-config)))
193 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
196 (home-page "http://www.pulseaudio.org/")
197 (synopsis "Sound server")
199 "PulseAudio is a sound server. It is basically a proxy for your sound
200 applications. It allows you to do advanced operations on your sound data as
201 it passes between your application and your hardware. Things like
202 transferring the audio to a different machine, changing the sample format or
203 channel count and mixing several sounds into one are easily achieved using a
206 ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
207 ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
208 ;; 'LICENSE' for details.
211 (define-public pavucontrol
218 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
223 "14486c6lmmirkhscbfygz114f6yzf97h35n3h3pdr27w4mdfmlmk"))))
224 (build-system gnu-build-system)
226 '(#:configure-flags '("CXXFLAGS=-std=c++11"))) ; required by gtkmm
228 `(("libcanberra" ,libcanberra)
230 ("pulseaudio" ,pulseaudio)))
232 `(("intltool" ,intltool)
233 ("pkg-config" ,pkg-config)))
234 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
235 (synopsis "PulseAudio volume control")
237 "PulseAudio Volume Control (pavucontrol) provides a GTK+
238 graphical user interface to connect to a PulseAudio server and
239 easily control the volume of all clients, sinks, etc.")
242 (define-public ponymix
248 (uri (string-append "https://github.com/falconindy/ponymix/"
249 "archive/" version ".tar.gz"))
252 "1c0ch98zry3c4ixywwynjid1n1nh4xl4l1p548giq2w3zwflaghn"))
253 (file-name (string-append name "-" version ".tar.gz"))))
254 (build-system gnu-build-system)
256 `(#:tests? #f ; There is no test suite.
257 #:make-flags (let ((out (assoc-ref %outputs "out")))
258 (list (string-append "DESTDIR=" out)))
260 (modify-phases %standard-phases
261 (add-after 'unpack 'patch-paths
263 (substitute* "Makefile"
265 (delete 'configure)))) ; There's no configure phase.
267 `(("pulseaudio" ,pulseaudio)))
269 `(("pkg-config" ,pkg-config)))
270 (home-page "https://github.com/falconindy/ponymix")
271 (synopsis "Console-based PulseAudio mixer")
272 (description "Ponymix is a PulseAudio mixer and volume controller with a
273 command-line interface. In addition, it is possible to use named sources and
277 (define-public pulsemixer
283 (uri (string-append "https://github.com/GeorgeFilipkin/"
284 "pulsemixer/archive/" version ".tar.gz"))
285 (file-name (string-append name "-" version ".tar.gz"))
288 "1lpad90ifr2xfldyf39sbwx1v85rif2gm9w774gwwpjv53zfgk1g"))))
289 (build-system python-build-system)
292 (modify-phases %standard-phases
293 (add-after 'unpack 'patch-path
294 (lambda* (#:key inputs #:allow-other-keys)
295 (let ((pulse (assoc-ref inputs "pulseaudio")))
296 (substitute* "pulsemixer"
298 (string-append pulse "/lib/libpulse.so.0")))
301 `(("pulseaudio" ,pulseaudio)))
302 (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
303 (synopsis "Command-line and curses mixer for PulseAudio")
304 (description "Pulsemixer is a PulseAudio mixer with command-line and
305 curses-style interfaces.")