Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / pulseaudio.scm
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 ;;;
15 ;;; This file is part of GNU Guix.
16 ;;;
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.
21 ;;;
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.
26 ;;;
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/>.
29
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))
64
65 (define-public libsndfile
66 (package
67 (name "libsndfile")
68 (version "1.0.28")
69 (source (origin
70 (method url-fetch)
71 (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
72 version ".tar.gz"))
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"))
77 (sha256
78 (base32
79 "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz"))))
80 (build-system gnu-build-system)
81 (inputs
82 `(("libvorbis" ,libvorbis)
83 ("libogg" ,libogg)
84 ("flac" ,flac)))
85 (native-inputs
86 `(("pkg-config" ,pkg-config)))
87 (home-page "http://www.mega-nerd.com/libsndfile/")
88 (synopsis "Reading and writing files containing sampled sound")
89 (description
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.
93
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.")
100 (license l:gpl2+)))
101
102 (define-public libsamplerate
103 (package
104 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
105 (version "0.1.9")
106 (source (origin
107 (method url-fetch)
108 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
109 version ".tar.gz"))
110 (sha256
111 (base32
112 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
113 (build-system gnu-build-system)
114 (native-inputs
115 `(("pkg-config" ,pkg-config)
116 ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
117 (propagated-inputs
118 `(("libsndfile" ,libsndfile)
119 ("fftw" ,fftw)))
120 (arguments
121 `(#:phases
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
129 (assoc-ref
130 (or native-inputs inputs) "automake")
131 "/share/automake-"
132 ,(version-major+minor
133 (package-version automake))
134 "/" file) "."))
135 '("config.sub" "config.guess")))
136 #t)))))
137 (home-page "http://www.mega-nerd.com/SRC/index.html")
138 (synopsis "Audio sample rate conversion library")
139 (description
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
143 players.
144
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.
150
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
155 rates.")
156 (license l:bsd-2)))
157
158 (define-public pulseaudio
159 (package
160 (name "pulseaudio")
161 (version "13.0")
162 (source (origin
163 (method url-fetch)
164 (uri (string-append
165 "https://freedesktop.org/software/pulseaudio/releases/"
166 name "-" version ".tar.xz"))
167 (sha256
168 (base32
169 "0mw0ybrqj7hvf8lqs5gjzip464hfnixw453lr0mqzlng3b5266wn"))
170 (modules '((guix build utils)))
171 (snippet
172 ;; Disable console-kit support by default since it's deprecated
173 ;; anyway.
174 '(begin
175 (substitute* "src/daemon/default.pa.in"
176 (("load-module module-console-kit" all)
177 (string-append "#" all "\n")))
178 #t))
179 (patches (search-patches
180 "pulseaudio-fix-mult-test.patch"
181 "pulseaudio-longer-test-timeout.patch"))))
182 (build-system gnu-build-system)
183 (arguments
184 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
185 "--disable-oss-output"
186 "--enable-bluez5"
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
192 (lambda _
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")
199 #t)))))
200 (inputs
201 ;; TODO: Add optional inputs (GTK+?).
202 `(("alsa-lib" ,alsa-lib)
203 ("bluez" ,bluez)
204 ("sbc" ,sbc)
205 ("speexdsp" ,speexdsp)
206 ("libsndfile" ,libsndfile)
207 ("jack" ,jack-1) ; For routing the output to jack.
208 ("dbus" ,dbus)
209 ("glib" ,glib)
210 ("libltdl" ,libltdl)
211 ("fftwf" ,fftwf)
212 ("avahi" ,avahi)
213
214 ;; For the optional X11 modules.
215 ("libice" ,libice)
216 ("libsm" ,libsm)
217 ("libxcb" ,libxcb)
218 ("libxtst" ,libxtst)
219
220 ("eudev" ,eudev))) ;for the detection of hardware audio devices
221 (native-inputs
222 `(("check" ,check)
223 ("gettext" ,gettext-minimal)
224 ("glib:bin" ,glib "bin")
225 ("m4" ,m4)
226 ("perl" ,perl)
227 ("perl-xml-parser" ,perl-xml-parser)
228 ("pkg-config" ,pkg-config)))
229 (propagated-inputs
230 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
231 `(("libcap" ,libcap)
232 ("gdbm" ,gdbm)))
233 (home-page "http://www.pulseaudio.org/")
234 (synopsis "Sound server")
235 (description
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
241 sound server.")
242
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.
246 (license l:gpl2+)))
247
248 (define-public pavucontrol
249 (package
250 (name "pavucontrol")
251 (version "3.0")
252 (source (origin
253 (method url-fetch)
254 (uri (string-append
255 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
256 version
257 ".tar.xz"))
258 (sha256
259 (base32
260 "14486c6lmmirkhscbfygz114f6yzf97h35n3h3pdr27w4mdfmlmk"))))
261 (build-system glib-or-gtk-build-system)
262 (inputs
263 `(("adwaita-icon-theme" ,adwaita-icon-theme) ;hard-coded theme
264 ("gtkmm" ,gtkmm)
265 ("libcanberra" ,libcanberra)
266 ("pulseaudio" ,pulseaudio)))
267 (native-inputs
268 `(("intltool" ,intltool)
269 ("pkg-config" ,pkg-config)))
270 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
271 (synopsis "PulseAudio volume control")
272 (description
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.")
276 (license l:gpl2+)))
277
278 (define-public ponymix
279 (package
280 (name "ponymix")
281 (version "5")
282 (source (origin
283 (method git-fetch)
284 (uri (git-reference
285 (url "https://github.com/falconindy/ponymix/")
286 (commit version)))
287 (file-name (git-file-name name version))
288 (sha256
289 (base32
290 "08yp7fprmzm6px5yx2rvzri0l60bra5h59l26pn0k071a37ks1rb"))))
291 (build-system gnu-build-system)
292 (arguments
293 `(#:tests? #f ; There is no test suite.
294 #:make-flags (let ((out (assoc-ref %outputs "out")))
295 (list (string-append "DESTDIR=" out)))
296 #:phases
297 (modify-phases %standard-phases
298 (add-after 'unpack 'patch-paths
299 (lambda _
300 (substitute* "Makefile"
301 (("/usr") ""))))
302 (delete 'configure)))) ; There's no configure phase.
303 (inputs
304 `(("pulseaudio" ,pulseaudio)))
305 (native-inputs
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
311 sinks.")
312 (license l:expat)))
313
314 (define-public pulsemixer
315 (package
316 (name "pulsemixer")
317 (version "1.5.0")
318 (source (origin
319 (method git-fetch)
320 (uri (git-reference
321 (url "https://github.com/GeorgeFilipkin/pulsemixer")
322 (commit version)))
323 (file-name (git-file-name name version))
324 (sha256
325 (base32
326 "162nfpyqn4gp45x332a73n07c118vispz3jicin4p67x3f8f0g3j"))))
327 (build-system python-build-system)
328 (arguments
329 `(#:phases
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"
335 (("libpulse.so.0")
336 (string-append pulse "/lib/libpulse.so.0")))
337 #t))))))
338 (inputs
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.")
344 (license l:expat)))
345
346 (define-public pulseaudio-dlna
347 ;; The last release was in 2016; use a more recent commit.
348 (let ((commit "4472928dd23f274193f14289f59daec411023ab0")
349 (revision "1"))
350 (package
351 (name "pulseaudio-dlna")
352 (version (git-version "0.5.2" revision commit))
353 (source
354 (origin
355 (method git-fetch)
356 (uri (git-reference
357 (url "https://github.com/masmu/pulseaudio-dlna.git")
358 (commit commit)))
359 (file-name (git-file-name name version))
360 (sha256
361 (base32
362 "1dfn7036vrq49kxv4an7rayypnm5dlawsf02pfsldw877hzdamqk"))))
363 (build-system python-build-system)
364 (arguments `(#:python ,python-2))
365 (inputs
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:
387
388 @itemize
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
395 @end itemize")
396 (license l:gpl3+))))
397
398 (define-public pamixer
399 (package
400 (name "pamixer")
401 (version "1.4")
402 (source
403 (origin
404 (method git-fetch)
405 (uri (git-reference
406 (url "https://github.com/cdemoulins/pamixer.git")
407 (commit version)))
408 (file-name (git-file-name name version))
409 (sha256
410 (base32 "1i14550n8paijwwnhksv5izgfqm3s5q2773bdfp6vyqybkll55f7"))))
411 (build-system gnu-build-system)
412 (arguments
413 `(#:tests? #f ; There is no test suite.
414 #:make-flags
415 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
416 #:phases
417 (modify-phases %standard-phases
418 (delete 'configure) ; There's no configure phase.
419 (add-before 'install 'mkdir-bin
420 (lambda _
421 (mkdir-p (string-append (assoc-ref %outputs "out") "/bin"))
422 #t)))))
423 (inputs
424 `(("boost" ,boost)
425 ("pulseaudio" ,pulseaudio)))
426 (home-page "https://github.com/cdemoulins/pamixer")
427 (synopsis "PulseAudio command line mixer")
428 (description
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).")
431 (license l:gpl3+)))
432
433 (define-public pasystray
434 (package
435 (name "pasystray")
436 (version "0.7.1")
437 (source
438 (origin
439 (method git-fetch)
440 (uri (git-reference
441 (url "https://github.com/christophgysin/pasystray.git")
442 (commit (string-append name "-" version))))
443 (file-name (git-file-name name version))
444 (sha256
445 (base32 "0xx1bm9kimgq11a359ikabdndqg5q54pn1d1dyyjnrj0s41168fk"))))
446 (build-system gnu-build-system)
447 (arguments
448 `(#:phases
449 (modify-phases %standard-phases
450 (add-before 'bootstrap 'remove-bootstrap.sh
451 (lambda _
452 ;; Interferes with the bootstrap phase.
453 (delete-file "bootstrap.sh")
454 #t)))))
455 (native-inputs
456 `(("autoconf" ,autoconf)
457 ("automake" ,automake)
458 ("pkg-config" ,pkg-config)))
459 (inputs
460 `(("avahi" ,avahi)
461 ("gtk+" ,gtk+)
462 ("libnotify" ,libnotify)
463 ("libx11" ,libx11)
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+)))