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>
11 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
12 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
14 ;;; This file is part of GNU Guix.
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29 (define-module (gnu packages pulseaudio)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix utils)
34 #:use-module ((guix licenses) #:prefix l:)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system python)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages algebra)
39 #:use-module (gnu packages audio)
40 #:use-module (gnu packages autotools)
41 #:use-module (gnu packages avahi)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages dbm)
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages gtk)
46 #:use-module (gnu packages libcanberra)
47 #:use-module (gnu packages web)
48 #:use-module (gnu packages linux)
49 #:use-module (gnu packages m4)
50 #:use-module (gnu packages protobuf)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages python-xyz)
53 #:use-module (gnu packages python-web)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages xiph)
56 #:use-module (gnu packages xorg))
58 (define-public libsndfile
64 (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
66 (patches (search-patches "libsndfile-armhf-type-checks.patch"
67 "libsndfile-CVE-2017-8361-8363-8365.patch"
68 "libsndfile-CVE-2017-8362.patch"
69 "libsndfile-CVE-2017-12562.patch"))
72 "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz"))))
73 (build-system gnu-build-system)
75 `(("libvorbis" ,libvorbis)
79 `(("pkg-config" ,pkg-config)))
80 (home-page "http://www.mega-nerd.com/libsndfile/")
81 (synopsis "Reading and writing files containing sampled sound")
83 "Libsndfile is a C library for reading and writing files containing
84 sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
85 one standard library interface.
87 It was designed to handle both little-endian (such as WAV) and
88 big-endian (such as AIFF) data, and to compile and run correctly on
89 little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
90 as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
91 SPARC. Hopefully the design of the library will also make it easy to extend
92 for reading and writing new sound file formats.")
95 (define-public libsamplerate
97 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
101 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
105 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
106 (build-system gnu-build-system)
108 `(("pkg-config" ,pkg-config)
109 ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
111 `(("libsndfile" ,libsndfile)
115 (modify-phases %standard-phases
116 (add-after 'unpack 'fix-configure
117 (lambda* (#:key inputs native-inputs #:allow-other-keys)
118 ;; Replace outdated config.sub and config.guess:
119 (with-directory-excursion "Cfg"
120 (for-each (lambda (file)
121 (install-file (string-append
123 (or native-inputs inputs) "automake")
125 ,(version-major+minor
126 (package-version automake))
128 '("config.sub" "config.guess")))
130 (home-page "http://www.mega-nerd.com/SRC/index.html")
131 (synopsis "Audio sample rate conversion library")
133 "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
134 audio. One example of where such a thing would be useful is converting audio
135 from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
138 SRC is capable of arbitrary and time varying conversions; from downsampling by
139 a factor of 256 to upsampling by the same factor. Arbitrary in this case means
140 that the ratio of input and output sample rates can be an irrational
141 number. The conversion ratio can also vary with time for speeding up and
142 slowing down effects.
144 SRC provides a small set of converters to allow quality to be traded off
145 against computation cost. The current best converter provides a
146 signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
147 the theoretical best bandwidth for a given pair of input and output sample
151 (define-public pulseaudio
158 "https://freedesktop.org/software/pulseaudio/releases/"
159 name "-" version ".tar.xz"))
162 "0mw0ybrqj7hvf8lqs5gjzip464hfnixw453lr0mqzlng3b5266wn"))
163 (modules '((guix build utils)))
165 ;; Disable console-kit support by default since it's deprecated
168 (substitute* "src/daemon/default.pa.in"
169 (("load-module module-console-kit" all)
170 (string-append "#" all "\n")))
172 (patches (search-patches
173 "pulseaudio-fix-mult-test.patch"
174 "pulseaudio-longer-test-timeout.patch"))))
175 (build-system gnu-build-system)
177 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
178 "--disable-oss-output"
180 (string-append "--with-udev-rules-dir="
181 (assoc-ref %outputs "out")
182 "/lib/udev/rules.d"))
183 #:phases (modify-phases %standard-phases
184 (add-before 'check 'pre-check
186 ;; 'tests/lock-autospawn-test.c' wants to create a file
187 ;; under ~/.config/pulse.
188 (setenv "HOME" (getcwd))
189 ;; 'thread-test' needs more time on hydra and on slower
190 ;; machines, so we set the default timeout to 120 seconds.
191 (setenv "CK_DEFAULT_TIMEOUT" "120")
194 ;; TODO: Add optional inputs (GTK+?).
195 `(("alsa-lib" ,alsa-lib)
198 ("speexdsp" ,speexdsp)
199 ("libsndfile" ,libsndfile)
200 ("jack" ,jack-1) ; For routing the output to jack.
207 ;; For the optional X11 modules.
213 ("eudev" ,eudev))) ;for the detection of hardware audio devices
216 ("glib:bin" ,glib "bin")
217 ("intltool" ,intltool)
219 ("pkg-config" ,pkg-config)))
221 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
224 (home-page "http://www.pulseaudio.org/")
225 (synopsis "Sound server")
227 "PulseAudio is a sound server. It is basically a proxy for your sound
228 applications. It allows you to do advanced operations on your sound data as
229 it passes between your application and your hardware. Things like
230 transferring the audio to a different machine, changing the sample format or
231 channel count and mixing several sounds into one are easily achieved using a
234 ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
235 ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
236 ;; 'LICENSE' for details.
239 (define-public pavucontrol
246 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
251 "14486c6lmmirkhscbfygz114f6yzf97h35n3h3pdr27w4mdfmlmk"))))
252 (build-system gnu-build-system)
254 `(("libcanberra" ,libcanberra)
256 ("pulseaudio" ,pulseaudio)))
258 `(("intltool" ,intltool)
259 ("pkg-config" ,pkg-config)))
260 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
261 (synopsis "PulseAudio volume control")
263 "PulseAudio Volume Control (pavucontrol) provides a GTK+
264 graphical user interface to connect to a PulseAudio server and
265 easily control the volume of all clients, sinks, etc.")
268 (define-public ponymix
274 (uri (string-append "https://github.com/falconindy/ponymix/"
275 "archive/" version ".tar.gz"))
278 "1c0ch98zry3c4ixywwynjid1n1nh4xl4l1p548giq2w3zwflaghn"))
279 (file-name (string-append name "-" version ".tar.gz"))))
280 (build-system gnu-build-system)
282 `(#:tests? #f ; There is no test suite.
283 #:make-flags (let ((out (assoc-ref %outputs "out")))
284 (list (string-append "DESTDIR=" out)))
286 (modify-phases %standard-phases
287 (add-after 'unpack 'patch-paths
289 (substitute* "Makefile"
291 (delete 'configure)))) ; There's no configure phase.
293 `(("pulseaudio" ,pulseaudio)))
295 `(("pkg-config" ,pkg-config)))
296 (home-page "https://github.com/falconindy/ponymix")
297 (synopsis "Console-based PulseAudio mixer")
298 (description "Ponymix is a PulseAudio mixer and volume controller with a
299 command-line interface. In addition, it is possible to use named sources and
303 (define-public pulsemixer
309 (uri (string-append "https://github.com/GeorgeFilipkin/"
310 "pulsemixer/archive/" version ".tar.gz"))
311 (file-name (string-append name "-" version ".tar.gz"))
314 "1lpad90ifr2xfldyf39sbwx1v85rif2gm9w774gwwpjv53zfgk1g"))))
315 (build-system python-build-system)
318 (modify-phases %standard-phases
319 (add-after 'unpack 'patch-path
320 (lambda* (#:key inputs #:allow-other-keys)
321 (let ((pulse (assoc-ref inputs "pulseaudio")))
322 (substitute* "pulsemixer"
324 (string-append pulse "/lib/libpulse.so.0")))
327 `(("pulseaudio" ,pulseaudio)))
328 (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
329 (synopsis "Command-line and curses mixer for PulseAudio")
330 (description "Pulsemixer is a PulseAudio mixer with command-line and
331 curses-style interfaces.")
334 (define-public pulseaudio-dlna
335 ;; The last release was in 2016; use a more recent commit.
336 (let ((commit "4472928dd23f274193f14289f59daec411023ab0")
339 (name "pulseaudio-dlna")
340 (version (git-version "0.5.2" revision commit))
345 (url "https://github.com/masmu/pulseaudio-dlna.git")
347 (file-name (git-file-name name version))
350 "1dfn7036vrq49kxv4an7rayypnm5dlawsf02pfsldw877hzdamqk"))))
351 (build-system python-build-system)
352 (arguments `(#:python ,python-2))
354 `(("python2-chardet" ,python2-chardet)
355 ("python2-dbus" ,python2-dbus)
356 ("python2-docopt" ,python2-docopt)
357 ("python2-futures" ,python2-futures)
358 ("python2-pygobject" ,python2-pygobject)
359 ("python2-lxml" ,python2-lxml)
360 ("python2-netifaces" ,python2-netifaces)
361 ("python2-notify2" ,python2-notify2)
362 ("python2-protobuf" ,python2-protobuf)
363 ("python2-psutil" ,python2-psutil)
364 ("python2-requests" ,python2-requests)
365 ("python2-pyroute2" ,python2-pyroute2)
366 ("python2-setproctitle" ,python2-setproctitle)
367 ("python2-zeroconf" ,python2-zeroconf)))
368 (home-page "https://github.com/masmu/pulseaudio-dlna")
369 (synopsis "Stream audio to DLNA/UPnP and Chromecast devices")
370 (description "This lightweight streaming server brings DLNA/UPnP and
371 Chromecast support to PulseAudio. It can stream your current PulseAudio
372 playback to different UPnP devices (UPnP Media Renderers, including Sonos
373 devices and some Smart TVs) or Chromecasts in your network. You should also
374 install one or more of the following packages alongside pulseaudio-dlna:
377 @item ffmpeg - transcoding support for multiple codecs
378 @item flac - FLAC transcoding support
379 @item lame - MP3 transcoding support
380 @item opus-tools - Opus transcoding support
381 @item sox - WAV transcoding support
382 @item vorbis-tools - Vorbis transcoding support