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, 2020 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>
13 ;;; Copyright © 2020 Amin Bandali <bandali@gnu.org>
15 ;;; This file is part of GNU Guix.
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30 (define-module (gnu packages pulseaudio)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix git-download)
34 #:use-module (guix utils)
35 #:use-module ((guix licenses) #:prefix l:)
36 #:use-module (guix build-system glib-or-gtk)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system python)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages algebra)
41 #:use-module (gnu packages audio)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages avahi)
44 #:use-module (gnu packages boost)
45 #:use-module (gnu packages check)
46 #:use-module (gnu packages dbm)
47 #:use-module (gnu packages glib)
48 #:use-module (gnu packages gettext)
49 #:use-module (gnu packages gnome)
50 #:use-module (gnu packages gtk)
51 #:use-module (gnu packages libcanberra)
52 #:use-module (gnu packages web)
53 #:use-module (gnu packages linux)
54 #:use-module (gnu packages m4)
55 #:use-module (gnu packages perl)
56 #:use-module (gnu packages protobuf)
57 #:use-module (gnu packages python)
58 #:use-module (gnu packages python-xyz)
59 #:use-module (gnu packages python-web)
60 #:use-module (gnu packages pkg-config)
61 #:use-module (gnu packages xiph)
62 #:use-module (gnu packages xml)
63 #:use-module (gnu packages xorg))
65 (define-public libsndfile
71 (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
73 (patches (search-patches "libsndfile-armhf-type-checks.patch"
74 "libsndfile-CVE-2017-8361-8363-8365.patch"
75 "libsndfile-CVE-2017-8362.patch"
76 "libsndfile-CVE-2017-12562.patch"))
79 "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz"))))
80 (build-system gnu-build-system)
82 `(("libvorbis" ,libvorbis)
86 `(("pkg-config" ,pkg-config)))
87 (home-page "http://www.mega-nerd.com/libsndfile/")
88 (synopsis "Reading and writing files containing sampled sound")
90 "Libsndfile is a C library for reading and writing files containing
91 sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
92 one standard library interface.
94 It was designed to handle both little-endian (such as WAV) and
95 big-endian (such as AIFF) data, and to compile and run correctly on
96 little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
97 as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
98 SPARC. Hopefully the design of the library will also make it easy to extend
99 for reading and writing new sound file formats.")
102 (define-public libsamplerate
104 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
108 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
112 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
113 (build-system gnu-build-system)
115 `(("pkg-config" ,pkg-config)
116 ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
118 `(("libsndfile" ,libsndfile)
122 (modify-phases %standard-phases
123 (add-after 'unpack 'fix-configure
124 (lambda* (#:key inputs native-inputs #:allow-other-keys)
125 ;; Replace outdated config.sub and config.guess:
126 (with-directory-excursion "Cfg"
127 (for-each (lambda (file)
128 (install-file (string-append
130 (or native-inputs inputs) "automake")
132 ,(version-major+minor
133 (package-version automake))
135 '("config.sub" "config.guess")))
137 (home-page "http://www.mega-nerd.com/SRC/index.html")
138 (synopsis "Audio sample rate conversion library")
140 "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
141 audio. One example of where such a thing would be useful is converting audio
142 from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
145 SRC is capable of arbitrary and time varying conversions; from downsampling by
146 a factor of 256 to upsampling by the same factor. Arbitrary in this case means
147 that the ratio of input and output sample rates can be an irrational
148 number. The conversion ratio can also vary with time for speeding up and
149 slowing down effects.
151 SRC provides a small set of converters to allow quality to be traded off
152 against computation cost. The current best converter provides a
153 signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
154 the theoretical best bandwidth for a given pair of input and output sample
158 (define-public pulseaudio
165 "https://freedesktop.org/software/pulseaudio/releases/"
166 name "-" version ".tar.xz"))
169 "0mw0ybrqj7hvf8lqs5gjzip464hfnixw453lr0mqzlng3b5266wn"))
170 (modules '((guix build utils)))
172 ;; Disable console-kit support by default since it's deprecated
175 (substitute* "src/daemon/default.pa.in"
176 (("load-module module-console-kit" all)
177 (string-append "#" all "\n")))
179 (patches (search-patches
180 "pulseaudio-fix-mult-test.patch"
181 "pulseaudio-longer-test-timeout.patch"))))
182 (build-system gnu-build-system)
184 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
185 "--disable-oss-output"
187 (string-append "--with-udev-rules-dir="
188 (assoc-ref %outputs "out")
189 "/lib/udev/rules.d"))
190 #:phases (modify-phases %standard-phases
191 (add-before 'check 'pre-check
193 ;; 'tests/lock-autospawn-test.c' wants to create a file
194 ;; under ~/.config/pulse.
195 (setenv "HOME" (getcwd))
196 ;; 'thread-test' needs more time on hydra and on slower
197 ;; machines, so we set the default timeout to 120 seconds.
198 (setenv "CK_DEFAULT_TIMEOUT" "120")
201 ;; TODO: Add optional inputs (GTK+?).
202 `(("alsa-lib" ,alsa-lib)
205 ("speexdsp" ,speexdsp)
206 ("libsndfile" ,libsndfile)
207 ("jack" ,jack-1) ; For routing the output to jack.
214 ;; For the optional X11 modules.
220 ("eudev" ,eudev))) ;for the detection of hardware audio devices
223 ("gettext" ,gettext-minimal)
224 ("glib:bin" ,glib "bin")
227 ("perl-xml-parser" ,perl-xml-parser)
228 ("pkg-config" ,pkg-config)))
230 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
233 (home-page "http://www.pulseaudio.org/")
234 (synopsis "Sound server")
236 "PulseAudio is a sound server. It is basically a proxy for your sound
237 applications. It allows you to do advanced operations on your sound data as
238 it passes between your application and your hardware. Things like
239 transferring the audio to a different machine, changing the sample format or
240 channel count and mixing several sounds into one are easily achieved using a
243 ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
244 ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
245 ;; 'LICENSE' for details.
248 (define-public pavucontrol
255 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
260 "14486c6lmmirkhscbfygz114f6yzf97h35n3h3pdr27w4mdfmlmk"))))
261 (build-system glib-or-gtk-build-system)
263 `(("adwaita-icon-theme" ,adwaita-icon-theme) ;hard-coded theme
265 ("libcanberra" ,libcanberra)
266 ("pulseaudio" ,pulseaudio)))
268 `(("intltool" ,intltool)
269 ("pkg-config" ,pkg-config)))
270 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
271 (synopsis "PulseAudio volume control")
273 "PulseAudio Volume Control (pavucontrol) provides a GTK+
274 graphical user interface to connect to a PulseAudio server and
275 easily control the volume of all clients, sinks, etc.")
278 (define-public ponymix
285 (url "https://github.com/falconindy/ponymix/")
287 (file-name (git-file-name name version))
290 "08yp7fprmzm6px5yx2rvzri0l60bra5h59l26pn0k071a37ks1rb"))))
291 (build-system gnu-build-system)
293 `(#:tests? #f ; There is no test suite.
294 #:make-flags (let ((out (assoc-ref %outputs "out")))
295 (list (string-append "DESTDIR=" out)))
297 (modify-phases %standard-phases
298 (add-after 'unpack 'patch-paths
300 (substitute* "Makefile"
302 (delete 'configure)))) ; There's no configure phase.
304 `(("pulseaudio" ,pulseaudio)))
306 `(("pkg-config" ,pkg-config)))
307 (home-page "https://github.com/falconindy/ponymix")
308 (synopsis "Console-based PulseAudio mixer")
309 (description "Ponymix is a PulseAudio mixer and volume controller with a
310 command-line interface. In addition, it is possible to use named sources and
314 (define-public pulsemixer
321 (url "https://github.com/GeorgeFilipkin/pulsemixer")
323 (file-name (git-file-name name version))
326 "162nfpyqn4gp45x332a73n07c118vispz3jicin4p67x3f8f0g3j"))))
327 (build-system python-build-system)
330 (modify-phases %standard-phases
331 (add-after 'unpack 'patch-path
332 (lambda* (#:key inputs #:allow-other-keys)
333 (let ((pulse (assoc-ref inputs "pulseaudio")))
334 (substitute* "pulsemixer"
336 (string-append pulse "/lib/libpulse.so.0")))
339 `(("pulseaudio" ,pulseaudio)))
340 (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
341 (synopsis "Command-line and curses mixer for PulseAudio")
342 (description "Pulsemixer is a PulseAudio mixer with command-line and
343 curses-style interfaces.")
346 (define-public pulseaudio-dlna
347 ;; The last release was in 2016; use a more recent commit.
348 (let ((commit "4472928dd23f274193f14289f59daec411023ab0")
351 (name "pulseaudio-dlna")
352 (version (git-version "0.5.2" revision commit))
357 (url "https://github.com/masmu/pulseaudio-dlna.git")
359 (file-name (git-file-name name version))
362 "1dfn7036vrq49kxv4an7rayypnm5dlawsf02pfsldw877hzdamqk"))))
363 (build-system python-build-system)
364 (arguments `(#:python ,python-2))
366 `(("python2-chardet" ,python2-chardet)
367 ("python2-dbus" ,python2-dbus)
368 ("python2-docopt" ,python2-docopt)
369 ("python2-futures" ,python2-futures)
370 ("python2-pygobject" ,python2-pygobject)
371 ("python2-lxml" ,python2-lxml)
372 ("python2-netifaces" ,python2-netifaces)
373 ("python2-notify2" ,python2-notify2)
374 ("python2-protobuf" ,python2-protobuf)
375 ("python2-psutil" ,python2-psutil)
376 ("python2-requests" ,python2-requests)
377 ("python2-pyroute2" ,python2-pyroute2)
378 ("python2-setproctitle" ,python2-setproctitle)
379 ("python2-zeroconf" ,python2-zeroconf)))
380 (home-page "https://github.com/masmu/pulseaudio-dlna")
381 (synopsis "Stream audio to DLNA/UPnP and Chromecast devices")
382 (description "This lightweight streaming server brings DLNA/UPnP and
383 Chromecast support to PulseAudio. It can stream your current PulseAudio
384 playback to different UPnP devices (UPnP Media Renderers, including Sonos
385 devices and some Smart TVs) or Chromecasts in your network. You should also
386 install one or more of the following packages alongside pulseaudio-dlna:
389 @item ffmpeg - transcoding support for multiple codecs
390 @item flac - FLAC transcoding support
391 @item lame - MP3 transcoding support
392 @item opus-tools - Opus transcoding support
393 @item sox - WAV transcoding support
394 @item vorbis-tools - Vorbis transcoding support
398 (define-public pamixer
406 (url "https://github.com/cdemoulins/pamixer.git")
408 (file-name (git-file-name name version))
410 (base32 "1i14550n8paijwwnhksv5izgfqm3s5q2773bdfp6vyqybkll55f7"))))
411 (build-system gnu-build-system)
413 `(#:tests? #f ; There is no test suite.
415 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
417 (modify-phases %standard-phases
418 (delete 'configure) ; There's no configure phase.
419 (add-before 'install 'mkdir-bin
421 (mkdir-p (string-append (assoc-ref %outputs "out") "/bin"))
425 ("pulseaudio" ,pulseaudio)))
426 (home-page "https://github.com/cdemoulins/pamixer")
427 (synopsis "PulseAudio command line mixer")
429 "pamixer is like amixer but for PulseAudio, allowing easy control of the
430 volume levels of the sinks (get, set, decrease, increase, toggle mute, etc).")
433 (define-public pasystray
441 (url "https://github.com/christophgysin/pasystray.git")
442 (commit (string-append name "-" version))))
443 (file-name (git-file-name name version))
445 (base32 "0xx1bm9kimgq11a359ikabdndqg5q54pn1d1dyyjnrj0s41168fk"))))
446 (build-system gnu-build-system)
449 (modify-phases %standard-phases
450 (add-before 'bootstrap 'remove-bootstrap.sh
452 ;; Interferes with the bootstrap phase.
453 (delete-file "bootstrap.sh")
456 `(("autoconf" ,autoconf)
457 ("automake" ,automake)
458 ("pkg-config" ,pkg-config)))
462 ("libnotify" ,libnotify)
464 ("pulseaudio" ,pulseaudio)))
465 (home-page "https://github.com/christophgysin/pasystray")
466 (synopsis "PulseAudio controller for the system tray")
467 (description "@command{pasystray} enables control of various
468 PulseAudio server settings from the X11 system tray. See the project
469 README.md for a detailed list of features.")
470 (license l:lgpl2.1+)))