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>
16 ;;; Copyright © 2020 Marius Bakke <marius@gnu.org>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages pulseaudio)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix git-download)
37 #:use-module (guix utils)
38 #:use-module ((guix licenses) #:prefix l:)
39 #:use-module (guix build-system cmake)
40 #:use-module (guix build-system glib-or-gtk)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system go)
43 #:use-module (guix build-system meson)
44 #:use-module (guix build-system python)
45 #:use-module (gnu packages)
46 #:use-module (gnu packages algebra)
47 #:use-module (gnu packages audio)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages avahi)
50 #:use-module (gnu packages boost)
51 #:use-module (gnu packages check)
52 #:use-module (gnu packages dbm)
53 #:use-module (gnu packages glib)
54 #:use-module (gnu packages gettext)
55 #:use-module (gnu packages gnome)
56 #:use-module (gnu packages gtk)
57 #:use-module (gnu packages libcanberra)
58 #:use-module (gnu packages web)
59 #:use-module (gnu packages linux)
60 #:use-module (gnu packages m4)
61 #:use-module (gnu packages perl)
62 #:use-module (gnu packages protobuf)
63 #:use-module (gnu packages python)
64 #:use-module (gnu packages python-xyz)
65 #:use-module (gnu packages python-web)
66 #:use-module (gnu packages pkg-config)
67 #:use-module (gnu packages xiph)
68 #:use-module (gnu packages xml)
69 #:use-module (gnu packages xorg))
71 (define-public libsndfile
77 (uri (string-append "https://github.com/erikd/libsndfile"
78 "/releases/download/v" version
79 "/libsndfile-" version ".tar.bz2"))
82 "06k1wj3lwm7vf21s8yqy51k6nrkn9z610bj1gxb618ag5hq77wlx"))
83 (modules '((ice-9 textual-ports) (guix build utils)))
86 ;; Remove carriage returns (CRLF) to prevent bogus
87 ;; errors from bash like "$'\r': command not found".
88 (let ((data (call-with-input-file
89 "tests/pedantic-header-test.sh.in"
92 (string-split (get-string-all port)
94 (call-with-output-file "tests/pedantic-header-test.sh.in"
95 (lambda (port) (format port data))))
97 ;; While at it, fix hard coded executable name.
98 (substitute* "tests/test_wrapper.sh.in"
99 (("^/usr/bin/env") "env"))
101 (build-system gnu-build-system)
103 `(("libvorbis" ,libvorbis)
107 `(("pkg-config" ,pkg-config)
109 (home-page "http://www.mega-nerd.com/libsndfile/")
110 (synopsis "Reading and writing files containing sampled sound")
112 "Libsndfile is a C library for reading and writing files containing
113 sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
114 one standard library interface.
116 It was designed to handle both little-endian (such as WAV) and
117 big-endian (such as AIFF) data, and to compile and run correctly on
118 little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
119 as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
120 SPARC. Hopefully the design of the library will also make it easy to extend
121 for reading and writing new sound file formats.")
124 (define-public libsamplerate
126 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
130 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
134 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
135 (build-system gnu-build-system)
137 `(("pkg-config" ,pkg-config)
138 ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
140 `(("libsndfile" ,libsndfile)
144 (modify-phases %standard-phases
145 (add-after 'unpack 'fix-configure
146 (lambda* (#:key inputs native-inputs #:allow-other-keys)
147 ;; Replace outdated config.sub and config.guess:
148 (with-directory-excursion "Cfg"
149 (for-each (lambda (file)
150 (install-file (string-append
152 (or native-inputs inputs) "automake")
154 ,(version-major+minor
155 (package-version automake))
157 '("config.sub" "config.guess")))
159 (home-page "http://www.mega-nerd.com/SRC/index.html")
160 (synopsis "Audio sample rate conversion library")
162 "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
163 audio. One example of where such a thing would be useful is converting audio
164 from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
167 SRC is capable of arbitrary and time varying conversions; from downsampling by
168 a factor of 256 to upsampling by the same factor. Arbitrary in this case means
169 that the ratio of input and output sample rates can be an irrational
170 number. The conversion ratio can also vary with time for speeding up and
171 slowing down effects.
173 SRC provides a small set of converters to allow quality to be traded off
174 against computation cost. The current best converter provides a
175 signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
176 the theoretical best bandwidth for a given pair of input and output sample
180 (define-public pulseaudio
187 "https://freedesktop.org/software/pulseaudio/releases/"
188 name "-" version ".tar.xz"))
191 "0qf20rgg0ysrnvg3359j56ndls07qmfn5rsy9r85bc42jdfpfd58"))
192 (modules '((guix build utils)))
194 ;; Disable console-kit support by default since it's deprecated
197 (substitute* "src/daemon/default.pa.in"
198 (("load-module module-console-kit" all)
199 (string-append "#" all "\n")))
201 (patches (search-patches
202 "pulseaudio-fix-mult-test.patch"
203 "pulseaudio-longer-test-timeout.patch"))))
204 (build-system gnu-build-system)
206 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
207 "--disable-oss-output"
209 (string-append "--with-udev-rules-dir="
210 (assoc-ref %outputs "out")
211 "/lib/udev/rules.d"))
212 #:phases (modify-phases %standard-phases
213 (add-before 'check 'pre-check
215 ;; 'tests/lock-autospawn-test.c' wants to create a file
216 ;; under ~/.config/pulse.
217 (setenv "HOME" (getcwd))
218 ;; 'thread-test' needs more time on hydra and on slower
219 ;; machines, so we set the default timeout to 120 seconds.
220 (setenv "CK_DEFAULT_TIMEOUT" "120")
223 ;; TODO: Add optional inputs (GTK+?).
224 `(("alsa-lib" ,alsa-lib)
227 ("speexdsp" ,speexdsp)
228 ("libsndfile" ,libsndfile)
229 ("jack" ,jack-1) ; For routing the output to jack.
236 ;; For the optional X11 modules.
242 ("eudev" ,eudev))) ;for the detection of hardware audio devices
245 ("gettext" ,gettext-minimal)
246 ("glib:bin" ,glib "bin")
249 ("perl-xml-parser" ,perl-xml-parser)
250 ("pkg-config" ,pkg-config)))
252 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
255 (home-page "http://www.pulseaudio.org/")
256 (synopsis "Sound server")
258 "PulseAudio is a sound server. It is basically a proxy for your sound
259 applications. It allows you to do advanced operations on your sound data as
260 it passes between your application and your hardware. Things like
261 transferring the audio to a different machine, changing the sample format or
262 channel count and mixing several sounds into one are easily achieved using a
265 ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
266 ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
267 ;; 'LICENSE' for details.
270 (define-public pavucontrol
277 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
282 "1qhlkl3g8d7h72xjskii3g1l7la2cavwp69909pzmbi2jyn5pi4g"))))
283 (build-system glib-or-gtk-build-system)
285 `(("adwaita-icon-theme" ,adwaita-icon-theme) ;hard-coded theme
287 ("libcanberra" ,libcanberra)
288 ("pulseaudio" ,pulseaudio)))
290 `(("intltool" ,intltool)
291 ("pkg-config" ,pkg-config)))
292 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
293 (synopsis "PulseAudio volume control")
295 "PulseAudio Volume Control (pavucontrol) provides a GTK+
296 graphical user interface to connect to a PulseAudio server and
297 easily control the volume of all clients, sinks, etc.")
300 (define-public ponymix
307 (url "https://github.com/falconindy/ponymix/")
309 (file-name (git-file-name name version))
312 "08yp7fprmzm6px5yx2rvzri0l60bra5h59l26pn0k071a37ks1rb"))))
313 (build-system gnu-build-system)
315 `(#:tests? #f ; There is no test suite.
316 #:make-flags (let ((out (assoc-ref %outputs "out")))
317 (list (string-append "DESTDIR=" out)))
319 (modify-phases %standard-phases
320 (add-after 'unpack 'patch-paths
322 (substitute* "Makefile"
324 (delete 'configure)))) ; There's no configure phase.
326 `(("pulseaudio" ,pulseaudio)))
328 `(("pkg-config" ,pkg-config)))
329 (home-page "https://github.com/falconindy/ponymix")
330 (synopsis "Console-based PulseAudio mixer")
331 (description "Ponymix is a PulseAudio mixer and volume controller with a
332 command-line interface. In addition, it is possible to use named sources and
336 (define-public pulsemixer
343 (url "https://github.com/GeorgeFilipkin/pulsemixer")
345 (file-name (git-file-name name version))
348 "1jagx9zmz5pfsld8y2rj2kqg6ww9f6vqiawfy3vhqc49x3xx92p4"))))
349 (build-system python-build-system)
352 (modify-phases %standard-phases
353 (add-after 'unpack 'patch-path
354 (lambda* (#:key inputs #:allow-other-keys)
355 (let ((pulse (assoc-ref inputs "pulseaudio")))
356 (substitute* "pulsemixer"
358 (string-append pulse "/lib/libpulse.so.0")))
361 `(("pulseaudio" ,pulseaudio)))
362 (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
363 (synopsis "Command-line and curses mixer for PulseAudio")
364 (description "Pulsemixer is a PulseAudio mixer with command-line and
365 curses-style interfaces.")
368 (define-public pulseaudio-dlna
369 ;; The last release was in 2016; use a more recent commit.
370 (let ((commit "4472928dd23f274193f14289f59daec411023ab0")
373 (name "pulseaudio-dlna")
374 (version (git-version "0.5.2" revision commit))
379 (url "https://github.com/masmu/pulseaudio-dlna")
381 (file-name (git-file-name name version))
384 "1dfn7036vrq49kxv4an7rayypnm5dlawsf02pfsldw877hzdamqk"))))
385 (build-system python-build-system)
386 (arguments `(#:python ,python-2))
388 `(("python2-chardet" ,python2-chardet)
389 ("python2-dbus" ,python2-dbus)
390 ("python2-docopt" ,python2-docopt)
391 ("python2-futures" ,python2-futures)
392 ("python2-pygobject" ,python2-pygobject)
393 ("python2-lxml" ,python2-lxml)
394 ("python2-netifaces" ,python2-netifaces)
395 ("python2-notify2" ,python2-notify2)
396 ("python2-protobuf" ,python2-protobuf)
397 ("python2-psutil" ,python2-psutil)
398 ("python2-requests" ,python2-requests)
399 ("python2-pyroute2" ,python2-pyroute2)
400 ("python2-setproctitle" ,python2-setproctitle)
401 ("python2-zeroconf" ,python2-zeroconf)))
402 (home-page "https://github.com/masmu/pulseaudio-dlna")
403 (synopsis "Stream audio to DLNA/UPnP and Chromecast devices")
404 (description "This lightweight streaming server brings DLNA/UPnP and
405 Chromecast support to PulseAudio. It can stream your current PulseAudio
406 playback to different UPnP devices (UPnP Media Renderers, including Sonos
407 devices and some Smart TVs) or Chromecasts in your network. You should also
408 install one or more of the following packages alongside pulseaudio-dlna:
411 @item ffmpeg - transcoding support for multiple codecs
412 @item flac - FLAC transcoding support
413 @item lame - MP3 transcoding support
414 @item opus-tools - Opus transcoding support
415 @item sox - WAV transcoding support
416 @item vorbis-tools - Vorbis transcoding support
420 (define-public pamixer
428 (url "https://github.com/cdemoulins/pamixer")
430 (file-name (git-file-name name version))
432 (base32 "1i14550n8paijwwnhksv5izgfqm3s5q2773bdfp6vyqybkll55f7"))))
433 (build-system gnu-build-system)
435 `(#:tests? #f ; There is no test suite.
437 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
439 (modify-phases %standard-phases
440 (delete 'configure) ; There's no configure phase.
441 (add-before 'install 'mkdir-bin
443 (mkdir-p (string-append (assoc-ref %outputs "out") "/bin"))
447 ("pulseaudio" ,pulseaudio)))
448 (home-page "https://github.com/cdemoulins/pamixer")
449 (synopsis "PulseAudio command line mixer")
451 "pamixer is like amixer but for PulseAudio, allowing easy control of the
452 volume levels of the sinks (get, set, decrease, increase, toggle mute, etc).")
455 (define-public pasystray
463 (url "https://github.com/christophgysin/pasystray")
464 (commit (string-append name "-" version))))
465 (file-name (git-file-name name version))
467 (base32 "0xx1bm9kimgq11a359ikabdndqg5q54pn1d1dyyjnrj0s41168fk"))))
468 (build-system gnu-build-system)
471 (modify-phases %standard-phases
472 (add-before 'bootstrap 'remove-bootstrap.sh
474 ;; Interferes with the bootstrap phase.
475 (delete-file "bootstrap.sh")
478 `(("autoconf" ,autoconf)
479 ("automake" ,automake)
480 ("pkg-config" ,pkg-config)))
484 ("libnotify" ,libnotify)
486 ("pulseaudio" ,pulseaudio)))
487 (home-page "https://github.com/christophgysin/pasystray")
488 (synopsis "PulseAudio controller for the system tray")
489 (description "@command{pasystray} enables control of various
490 PulseAudio server settings from the X11 system tray. See the project
491 README.md for a detailed list of features.")
492 (license l:lgpl2.1+)))
494 (define-public paprefs
501 (uri (string-append "https://www.freedesktop.org/software/pulseaudio/"
502 name "/" name "-" version ".tar.xz"))
505 "189z5p20hk0xv9vwvym293503j4pwl03xqk9hl7cl6dwgv0l7wkf"))))
506 (build-system meson-build-system)
508 `(("gettext" ,gettext-minimal)
509 ("pkg-config" ,pkg-config)))
512 ("pulseaudio" ,pulseaudio)))
513 (home-page "https://freedesktop.org/software/pulseaudio/paprefs/")
514 (synopsis "Simple GTK based configuration dialog for the PulseAudio sound
516 (description "@command{paprefs} is a simple GTK based configuration
517 dialog for the PulseAudio sound server. Note that this program can
518 only configure local servers, and requires that a special module
519 module-gsettings is loaded in the sound server.")
522 (define-public rnnoise
530 (url "https://github.com/werman/noise-suppression-for-voice")
531 (commit (string-append "v" version))))
532 (file-name (git-file-name name version))
534 (base32 "11pwisbcks7g0mdgcrrv49v3ci1l6m26bbb7f67xz4pr1hai5dwc"))))
535 (build-system cmake-build-system)
540 `(;; TODO: Package VST to build the corresponding plugin.
541 ("pulseaudio" ,pulseaudio)))
542 (home-page "https://github.com/werman/noise-suppression-for-voice")
543 (synopsis "Real-time Noise suppression plugin based on Xiph's RNNoise")
544 (description "The plugin is meant to suppress a wide range of noise
545 origins: computer fans, office, crowd, airplane, car, train, construction.
547 Mild background noise is always suppressed, loud sounds, like
548 clicking of mechanical keyboard, are suppressed while there is no voice
549 however they are only reduced in volume when voice is present.
551 The plugin is made to work with 1 or 2 channels (ladspa plugin),
552 16 bit, 48000 Hz audio input.")
555 (define-public noisetorch
563 (url "https://github.com/lawl/NoiseTorch")
565 (file-name (git-file-name name version))
567 (base32 "115sq4waq048bv82lnq5sblf62m50yvyakx7x06qq359v7qf5ji1"))))
568 (build-system go-build-system)
570 `(#:import-path "github.com/lawl/NoiseTorch"
573 (modify-phases %standard-phases
574 (add-after 'unpack 'symlink-rnnoise
575 (lambda* (#:key inputs #:allow-other-keys)
576 (with-directory-excursion "src/github.com/lawl/NoiseTorch"
577 (let ((dir "librnnoise_ladspa/bin/ladspa")
578 (rnnoise (assoc-ref inputs "rnnoise")))
580 (symlink (string-append rnnoise "/lib/ladspa/librnnoise_ladspa.so")
581 (string-append dir "/librnnoise_ladspa.so"))))
583 (add-after 'unpack 'gen-version.go
585 (with-directory-excursion "src/github.com/lawl/NoiseTorch"
586 (substitute* "main.go"
587 (("//go:generate go run scripts/embedversion\\.go") ""))
588 (with-output-to-file "version.go"
590 (format #t "package main~%~%var version=~s~&" ,version))))
592 (add-after 'unpack 'disable-update-check.go
594 (with-directory-excursion "src/github.com/lawl/NoiseTorch"
595 (substitute* "main.go"
596 ((".*updateCheck.*") "")))
598 (add-before 'build 'go-generate
600 (with-directory-excursion "src/github.com/lawl/NoiseTorch"
601 (invoke "go" "generate")))))))
603 `(("rnnoise" ,rnnoise)))
604 (home-page "https://github.com/lawl/NoiseTorch")
605 (synopsis "Real-time microphone noise suppression")
606 (description "NoiseTorch creates a virtual PulseAudio microphone that
607 suppresses noise, in any application. Use whichever conferencing or VOIP
608 application you like and simply select the NoiseTorch Virtual Microphone as
609 input to torch the sound of your mechanical keyboard, computer fans, trains