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>
14 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
15 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
17 ;;; This file is part of GNU Guix.
19 ;;; GNU Guix is free software; you can redistribute it and/or modify it
20 ;;; under the terms of the GNU General Public License as published by
21 ;;; the Free Software Foundation; either version 3 of the License, or (at
22 ;;; your option) any later version.
24 ;;; GNU Guix is distributed in the hope that it will be useful, but
25 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 ;;; GNU General Public License for more details.
29 ;;; You should have received a copy of the GNU General Public License
30 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32 (define-module (gnu packages pulseaudio)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix utils)
37 #:use-module ((guix licenses) #:prefix l:)
38 #:use-module (guix build-system cmake)
39 #:use-module (guix build-system glib-or-gtk)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system go)
42 #:use-module (guix build-system meson)
43 #:use-module (guix build-system python)
44 #:use-module (gnu packages)
45 #:use-module (gnu packages algebra)
46 #:use-module (gnu packages audio)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages avahi)
49 #:use-module (gnu packages boost)
50 #:use-module (gnu packages check)
51 #:use-module (gnu packages dbm)
52 #:use-module (gnu packages glib)
53 #:use-module (gnu packages gettext)
54 #:use-module (gnu packages gnome)
55 #:use-module (gnu packages gtk)
56 #:use-module (gnu packages libcanberra)
57 #:use-module (gnu packages web)
58 #:use-module (gnu packages linux)
59 #:use-module (gnu packages m4)
60 #:use-module (gnu packages perl)
61 #:use-module (gnu packages protobuf)
62 #:use-module (gnu packages python)
63 #:use-module (gnu packages python-xyz)
64 #:use-module (gnu packages python-web)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages xiph)
67 #:use-module (gnu packages xml)
68 #:use-module (gnu packages xorg))
70 (define-public libsndfile
76 (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
78 (patches (search-patches "libsndfile-armhf-type-checks.patch"
79 "libsndfile-CVE-2017-8361-8363-8365.patch"
80 "libsndfile-CVE-2017-8362.patch"
81 "libsndfile-CVE-2017-12562.patch"))
84 "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz"))))
85 (build-system gnu-build-system)
87 `(("libvorbis" ,libvorbis)
91 `(("pkg-config" ,pkg-config)))
92 (home-page "http://www.mega-nerd.com/libsndfile/")
93 (synopsis "Reading and writing files containing sampled sound")
95 "Libsndfile is a C library for reading and writing files containing
96 sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
97 one standard library interface.
99 It was designed to handle both little-endian (such as WAV) and
100 big-endian (such as AIFF) data, and to compile and run correctly on
101 little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
102 as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
103 SPARC. Hopefully the design of the library will also make it easy to extend
104 for reading and writing new sound file formats.")
107 (define-public libsamplerate
109 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
113 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
117 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
118 (build-system gnu-build-system)
120 `(("pkg-config" ,pkg-config)
121 ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
123 `(("libsndfile" ,libsndfile)
127 (modify-phases %standard-phases
128 (add-after 'unpack 'fix-configure
129 (lambda* (#:key inputs native-inputs #:allow-other-keys)
130 ;; Replace outdated config.sub and config.guess:
131 (with-directory-excursion "Cfg"
132 (for-each (lambda (file)
133 (install-file (string-append
135 (or native-inputs inputs) "automake")
137 ,(version-major+minor
138 (package-version automake))
140 '("config.sub" "config.guess")))
142 (home-page "http://www.mega-nerd.com/SRC/index.html")
143 (synopsis "Audio sample rate conversion library")
145 "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
146 audio. One example of where such a thing would be useful is converting audio
147 from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
150 SRC is capable of arbitrary and time varying conversions; from downsampling by
151 a factor of 256 to upsampling by the same factor. Arbitrary in this case means
152 that the ratio of input and output sample rates can be an irrational
153 number. The conversion ratio can also vary with time for speeding up and
154 slowing down effects.
156 SRC provides a small set of converters to allow quality to be traded off
157 against computation cost. The current best converter provides a
158 signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
159 the theoretical best bandwidth for a given pair of input and output sample
163 (define-public pulseaudio
170 "https://freedesktop.org/software/pulseaudio/releases/"
171 name "-" version ".tar.xz"))
174 "0mw0ybrqj7hvf8lqs5gjzip464hfnixw453lr0mqzlng3b5266wn"))
175 (modules '((guix build utils)))
177 ;; Disable console-kit support by default since it's deprecated
180 (substitute* "src/daemon/default.pa.in"
181 (("load-module module-console-kit" all)
182 (string-append "#" all "\n")))
184 (patches (search-patches
185 "pulseaudio-fix-mult-test.patch"
186 "pulseaudio-longer-test-timeout.patch"))))
187 (build-system gnu-build-system)
189 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
190 "--disable-oss-output"
192 (string-append "--with-udev-rules-dir="
193 (assoc-ref %outputs "out")
194 "/lib/udev/rules.d"))
195 #:phases (modify-phases %standard-phases
196 (add-before 'check 'pre-check
198 ;; 'tests/lock-autospawn-test.c' wants to create a file
199 ;; under ~/.config/pulse.
200 (setenv "HOME" (getcwd))
201 ;; 'thread-test' needs more time on hydra and on slower
202 ;; machines, so we set the default timeout to 120 seconds.
203 (setenv "CK_DEFAULT_TIMEOUT" "120")
206 ;; TODO: Add optional inputs (GTK+?).
207 `(("alsa-lib" ,alsa-lib)
210 ("speexdsp" ,speexdsp)
211 ("libsndfile" ,libsndfile)
212 ("jack" ,jack-1) ; For routing the output to jack.
219 ;; For the optional X11 modules.
225 ("eudev" ,eudev))) ;for the detection of hardware audio devices
228 ("gettext" ,gettext-minimal)
229 ("glib:bin" ,glib "bin")
232 ("perl-xml-parser" ,perl-xml-parser)
233 ("pkg-config" ,pkg-config)))
235 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
238 (home-page "http://www.pulseaudio.org/")
239 (synopsis "Sound server")
241 "PulseAudio is a sound server. It is basically a proxy for your sound
242 applications. It allows you to do advanced operations on your sound data as
243 it passes between your application and your hardware. Things like
244 transferring the audio to a different machine, changing the sample format or
245 channel count and mixing several sounds into one are easily achieved using a
248 ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
249 ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
250 ;; 'LICENSE' for details.
253 (define-public pavucontrol
260 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
265 "1qhlkl3g8d7h72xjskii3g1l7la2cavwp69909pzmbi2jyn5pi4g"))))
266 (build-system glib-or-gtk-build-system)
268 `(("adwaita-icon-theme" ,adwaita-icon-theme) ;hard-coded theme
270 ("libcanberra" ,libcanberra)
271 ("pulseaudio" ,pulseaudio)))
273 `(("intltool" ,intltool)
274 ("pkg-config" ,pkg-config)))
275 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
276 (synopsis "PulseAudio volume control")
278 "PulseAudio Volume Control (pavucontrol) provides a GTK+
279 graphical user interface to connect to a PulseAudio server and
280 easily control the volume of all clients, sinks, etc.")
283 (define-public ponymix
290 (url "https://github.com/falconindy/ponymix/")
292 (file-name (git-file-name name version))
295 "08yp7fprmzm6px5yx2rvzri0l60bra5h59l26pn0k071a37ks1rb"))))
296 (build-system gnu-build-system)
298 `(#:tests? #f ; There is no test suite.
299 #:make-flags (let ((out (assoc-ref %outputs "out")))
300 (list (string-append "DESTDIR=" out)))
302 (modify-phases %standard-phases
303 (add-after 'unpack 'patch-paths
305 (substitute* "Makefile"
307 (delete 'configure)))) ; There's no configure phase.
309 `(("pulseaudio" ,pulseaudio)))
311 `(("pkg-config" ,pkg-config)))
312 (home-page "https://github.com/falconindy/ponymix")
313 (synopsis "Console-based PulseAudio mixer")
314 (description "Ponymix is a PulseAudio mixer and volume controller with a
315 command-line interface. In addition, it is possible to use named sources and
319 (define-public pulsemixer
326 (url "https://github.com/GeorgeFilipkin/pulsemixer")
328 (file-name (git-file-name name version))
331 "1jagx9zmz5pfsld8y2rj2kqg6ww9f6vqiawfy3vhqc49x3xx92p4"))))
332 (build-system python-build-system)
335 (modify-phases %standard-phases
336 (add-after 'unpack 'patch-path
337 (lambda* (#:key inputs #:allow-other-keys)
338 (let ((pulse (assoc-ref inputs "pulseaudio")))
339 (substitute* "pulsemixer"
341 (string-append pulse "/lib/libpulse.so.0")))
344 `(("pulseaudio" ,pulseaudio)))
345 (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
346 (synopsis "Command-line and curses mixer for PulseAudio")
347 (description "Pulsemixer is a PulseAudio mixer with command-line and
348 curses-style interfaces.")
351 (define-public pulseaudio-dlna
352 ;; The last release was in 2016; use a more recent commit.
353 (let ((commit "4472928dd23f274193f14289f59daec411023ab0")
356 (name "pulseaudio-dlna")
357 (version (git-version "0.5.2" revision commit))
362 (url "https://github.com/masmu/pulseaudio-dlna")
364 (file-name (git-file-name name version))
367 "1dfn7036vrq49kxv4an7rayypnm5dlawsf02pfsldw877hzdamqk"))))
368 (build-system python-build-system)
369 (arguments `(#:python ,python-2))
371 `(("python2-chardet" ,python2-chardet)
372 ("python2-dbus" ,python2-dbus)
373 ("python2-docopt" ,python2-docopt)
374 ("python2-futures" ,python2-futures)
375 ("python2-pygobject" ,python2-pygobject)
376 ("python2-lxml" ,python2-lxml)
377 ("python2-netifaces" ,python2-netifaces)
378 ("python2-notify2" ,python2-notify2)
379 ("python2-protobuf" ,python2-protobuf)
380 ("python2-psutil" ,python2-psutil)
381 ("python2-requests" ,python2-requests)
382 ("python2-pyroute2" ,python2-pyroute2)
383 ("python2-setproctitle" ,python2-setproctitle)
384 ("python2-zeroconf" ,python2-zeroconf)))
385 (home-page "https://github.com/masmu/pulseaudio-dlna")
386 (synopsis "Stream audio to DLNA/UPnP and Chromecast devices")
387 (description "This lightweight streaming server brings DLNA/UPnP and
388 Chromecast support to PulseAudio. It can stream your current PulseAudio
389 playback to different UPnP devices (UPnP Media Renderers, including Sonos
390 devices and some Smart TVs) or Chromecasts in your network. You should also
391 install one or more of the following packages alongside pulseaudio-dlna:
394 @item ffmpeg - transcoding support for multiple codecs
395 @item flac - FLAC transcoding support
396 @item lame - MP3 transcoding support
397 @item opus-tools - Opus transcoding support
398 @item sox - WAV transcoding support
399 @item vorbis-tools - Vorbis transcoding support
403 (define-public pamixer
411 (url "https://github.com/cdemoulins/pamixer")
413 (file-name (git-file-name name version))
415 (base32 "1i14550n8paijwwnhksv5izgfqm3s5q2773bdfp6vyqybkll55f7"))))
416 (build-system gnu-build-system)
418 `(#:tests? #f ; There is no test suite.
420 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
422 (modify-phases %standard-phases
423 (delete 'configure) ; There's no configure phase.
424 (add-before 'install 'mkdir-bin
426 (mkdir-p (string-append (assoc-ref %outputs "out") "/bin"))
430 ("pulseaudio" ,pulseaudio)))
431 (home-page "https://github.com/cdemoulins/pamixer")
432 (synopsis "PulseAudio command line mixer")
434 "pamixer is like amixer but for PulseAudio, allowing easy control of the
435 volume levels of the sinks (get, set, decrease, increase, toggle mute, etc).")
438 (define-public pasystray
446 (url "https://github.com/christophgysin/pasystray")
447 (commit (string-append name "-" version))))
448 (file-name (git-file-name name version))
450 (base32 "0xx1bm9kimgq11a359ikabdndqg5q54pn1d1dyyjnrj0s41168fk"))))
451 (build-system gnu-build-system)
454 (modify-phases %standard-phases
455 (add-before 'bootstrap 'remove-bootstrap.sh
457 ;; Interferes with the bootstrap phase.
458 (delete-file "bootstrap.sh")
461 `(("autoconf" ,autoconf)
462 ("automake" ,automake)
463 ("pkg-config" ,pkg-config)))
467 ("libnotify" ,libnotify)
469 ("pulseaudio" ,pulseaudio)))
470 (home-page "https://github.com/christophgysin/pasystray")
471 (synopsis "PulseAudio controller for the system tray")
472 (description "@command{pasystray} enables control of various
473 PulseAudio server settings from the X11 system tray. See the project
474 README.md for a detailed list of features.")
475 (license l:lgpl2.1+)))
477 (define-public paprefs
484 (uri (string-append "https://www.freedesktop.org/software/pulseaudio/"
485 name "/" name "-" version ".tar.xz"))
488 "189z5p20hk0xv9vwvym293503j4pwl03xqk9hl7cl6dwgv0l7wkf"))))
489 (build-system meson-build-system)
491 `(("gettext" ,gettext-minimal)
492 ("pkg-config" ,pkg-config)))
495 ("pulseaudio" ,pulseaudio)))
496 (home-page "https://freedesktop.org/software/pulseaudio/paprefs/")
497 (synopsis "Simple GTK based configuration dialog for the PulseAudio sound
499 (description "@command{paprefs} is a simple GTK based configuration
500 dialog for the PulseAudio sound server. Note that this program can
501 only configure local servers, and requires that a special module
502 module-gsettings is loaded in the sound server.")
505 (define-public rnnoise
513 (url "https://github.com/werman/noise-suppression-for-voice")
514 (commit (string-append "v" version))))
515 (file-name (git-file-name name version))
517 (base32 "18bq5b50xw3d4r1ildinafpg3isb9y216430h4mm9wr3ir7h76a7"))))
518 (build-system cmake-build-system)
523 `(;; TODO: Package VST to build the corresponding plugin.
524 ("pulseaudio" ,pulseaudio)))
525 (home-page "https://github.com/werman/noise-suppression-for-voice")
526 (synopsis "Real-time Noise suppression plugin based on Xiph's RNNoise")
527 (description "The plugin is meant to suppress a wide range of noise
528 origins: computer fans, office, crowd, airplane, car, train, construction.
530 Mild background noise is always suppressed, loud sounds, like
531 clicking of mechanical keyboard, are suppressed while there is no voice
532 however they are only reduced in volume when voice is present.
534 The plugin is made to work with 1 or 2 channels (ladspa plugin),
535 16 bit, 48000 Hz audio input.")
538 (define-public noisetorch
541 (version "0.6.1-beta")
546 (url "https://github.com/lawl/NoiseTorch")
548 (file-name (git-file-name name version))
550 (base32 "1jmh7204mhlabdn0azfjrm3kb944j24n0w0cwibqrs9lfgdn8k52"))))
551 (build-system go-build-system)
553 `(#:import-path "github.com/lawl/NoiseTorch"
556 (modify-phases %standard-phases
557 (add-after 'unpack 'symlink-rnnoise
558 (lambda* (#:key inputs #:allow-other-keys)
559 (with-directory-excursion "src/github.com/lawl/NoiseTorch"
560 (let ((dir "librnnoise_ladspa/bin/ladspa")
561 (rnnoise (assoc-ref inputs "rnnoise")))
563 (symlink (string-append rnnoise "/lib/ladspa/librnnoise_ladspa.so")
564 (string-append dir "/librnnoise_ladspa.so"))))
566 (add-after 'unpack 'gen-version.go
568 (with-directory-excursion "src/github.com/lawl/NoiseTorch"
569 (substitute* "main.go"
570 (("//go:generate go run scripts/embedversion\\.go") ""))
571 (with-output-to-file "version.go"
573 (format #t "package main~%~%var version=~s~&" ,version))))
575 (add-before 'build 'go-generate
577 (with-directory-excursion "src/github.com/lawl/NoiseTorch"
578 (invoke "go" "generate")))))))
580 `(("rnnoise" ,rnnoise)))
581 (home-page "https://github.com/lawl/NoiseTorch")
582 (synopsis "Real-time microphone noise suppression")
583 (description "NoiseTorch creates a virtual PulseAudio microphone that
584 suppresses noise, in any application. Use whichever conferencing or VOIP
585 application you like and simply select the NoiseTorch Virtual Microphone as
586 input to torch the sound of your mechanical keyboard, computer fans, trains