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 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 ;;;
14 ;;; This file is part of GNU Guix.
15 ;;;
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.
20 ;;;
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.
25 ;;;
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/>.
28
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))
57
58 (define-public libsndfile
59 (package
60 (name "libsndfile")
61 (version "1.0.28")
62 (source (origin
63 (method url-fetch)
64 (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
65 version ".tar.gz"))
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"))
70 (sha256
71 (base32
72 "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz"))))
73 (build-system gnu-build-system)
74 (inputs
75 `(("libvorbis" ,libvorbis)
76 ("libogg" ,libogg)
77 ("flac" ,flac)))
78 (native-inputs
79 `(("pkg-config" ,pkg-config)))
80 (home-page "http://www.mega-nerd.com/libsndfile/")
81 (synopsis "Reading and writing files containing sampled sound")
82 (description
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.
86
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.")
93 (license l:gpl2+)))
94
95 (define-public libsamplerate
96 (package
97 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
98 (version "0.1.9")
99 (source (origin
100 (method url-fetch)
101 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
102 version ".tar.gz"))
103 (sha256
104 (base32
105 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
106 (build-system gnu-build-system)
107 (native-inputs
108 `(("pkg-config" ,pkg-config)
109 ("automake" ,automake))) ;For up to date 'config.guess' and 'config.sub'.
110 (propagated-inputs
111 `(("libsndfile" ,libsndfile)
112 ("fftw" ,fftw)))
113 (arguments
114 `(#:phases
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
122 (assoc-ref
123 (or native-inputs inputs) "automake")
124 "/share/automake-"
125 ,(version-major+minor
126 (package-version automake))
127 "/" file) "."))
128 '("config.sub" "config.guess")))
129 #t)))))
130 (home-page "http://www.mega-nerd.com/SRC/index.html")
131 (synopsis "Audio sample rate conversion library")
132 (description
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
136 players.
137
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.
143
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
148 rates.")
149 (license l:bsd-2)))
150
151 (define-public pulseaudio
152 (package
153 (name "pulseaudio")
154 (version "13.0")
155 (source (origin
156 (method url-fetch)
157 (uri (string-append
158 "https://freedesktop.org/software/pulseaudio/releases/"
159 name "-" version ".tar.xz"))
160 (sha256
161 (base32
162 "0mw0ybrqj7hvf8lqs5gjzip464hfnixw453lr0mqzlng3b5266wn"))
163 (modules '((guix build utils)))
164 (snippet
165 ;; Disable console-kit support by default since it's deprecated
166 ;; anyway.
167 '(begin
168 (substitute* "src/daemon/default.pa.in"
169 (("load-module module-console-kit" all)
170 (string-append "#" all "\n")))
171 #t))
172 (patches (search-patches
173 "pulseaudio-fix-mult-test.patch"
174 "pulseaudio-longer-test-timeout.patch"))))
175 (build-system gnu-build-system)
176 (arguments
177 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
178 "--disable-oss-output"
179 "--enable-bluez5"
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
185 (lambda _
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")
192 #t)))))
193 (inputs
194 ;; TODO: Add optional inputs (GTK+?).
195 `(("alsa-lib" ,alsa-lib)
196 ("bluez" ,bluez)
197 ("sbc" ,sbc)
198 ("speexdsp" ,speexdsp)
199 ("libsndfile" ,libsndfile)
200 ("jack" ,jack-1) ; For routing the output to jack.
201 ("dbus" ,dbus)
202 ("glib" ,glib)
203 ("libltdl" ,libltdl)
204 ("fftwf" ,fftwf)
205 ("avahi" ,avahi)
206
207 ;; For the optional X11 modules.
208 ("libice" ,libice)
209 ("libsm" ,libsm)
210 ("libxcb" ,libxcb)
211 ("libxtst" ,libxtst)
212
213 ("eudev" ,eudev))) ;for the detection of hardware audio devices
214 (native-inputs
215 `(("check" ,check)
216 ("glib:bin" ,glib "bin")
217 ("intltool" ,intltool)
218 ("m4" ,m4)
219 ("pkg-config" ,pkg-config)))
220 (propagated-inputs
221 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
222 `(("libcap" ,libcap)
223 ("gdbm" ,gdbm)))
224 (home-page "http://www.pulseaudio.org/")
225 (synopsis "Sound server")
226 (description
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
232 sound server.")
233
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.
237 (license l:gpl2+)))
238
239 (define-public pavucontrol
240 (package
241 (name "pavucontrol")
242 (version "3.0")
243 (source (origin
244 (method url-fetch)
245 (uri (string-append
246 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
247 version
248 ".tar.xz"))
249 (sha256
250 (base32
251 "14486c6lmmirkhscbfygz114f6yzf97h35n3h3pdr27w4mdfmlmk"))))
252 (build-system gnu-build-system)
253 (inputs
254 `(("libcanberra" ,libcanberra)
255 ("gtkmm" ,gtkmm)
256 ("pulseaudio" ,pulseaudio)))
257 (native-inputs
258 `(("intltool" ,intltool)
259 ("pkg-config" ,pkg-config)))
260 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
261 (synopsis "PulseAudio volume control")
262 (description
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.")
266 (license l:gpl2+)))
267
268 (define-public ponymix
269 (package
270 (name "ponymix")
271 (version "5")
272 (source (origin
273 (method url-fetch)
274 (uri (string-append "https://github.com/falconindy/ponymix/"
275 "archive/" version ".tar.gz"))
276 (sha256
277 (base32
278 "1c0ch98zry3c4ixywwynjid1n1nh4xl4l1p548giq2w3zwflaghn"))
279 (file-name (string-append name "-" version ".tar.gz"))))
280 (build-system gnu-build-system)
281 (arguments
282 `(#:tests? #f ; There is no test suite.
283 #:make-flags (let ((out (assoc-ref %outputs "out")))
284 (list (string-append "DESTDIR=" out)))
285 #:phases
286 (modify-phases %standard-phases
287 (add-after 'unpack 'patch-paths
288 (lambda _
289 (substitute* "Makefile"
290 (("/usr") ""))))
291 (delete 'configure)))) ; There's no configure phase.
292 (inputs
293 `(("pulseaudio" ,pulseaudio)))
294 (native-inputs
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
300 sinks.")
301 (license l:expat)))
302
303 (define-public pulsemixer
304 (package
305 (name "pulsemixer")
306 (version "1.4.0")
307 (source (origin
308 (method url-fetch)
309 (uri (string-append "https://github.com/GeorgeFilipkin/"
310 "pulsemixer/archive/" version ".tar.gz"))
311 (file-name (string-append name "-" version ".tar.gz"))
312 (sha256
313 (base32
314 "1lpad90ifr2xfldyf39sbwx1v85rif2gm9w774gwwpjv53zfgk1g"))))
315 (build-system python-build-system)
316 (arguments
317 `(#:phases
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"
323 (("libpulse.so.0")
324 (string-append pulse "/lib/libpulse.so.0")))
325 #t))))))
326 (inputs
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.")
332 (license l:expat)))
333
334 (define-public pulseaudio-dlna
335 ;; The last release was in 2016; use a more recent commit.
336 (let ((commit "4472928dd23f274193f14289f59daec411023ab0")
337 (revision "1"))
338 (package
339 (name "pulseaudio-dlna")
340 (version (git-version "0.5.2" revision commit))
341 (source
342 (origin
343 (method git-fetch)
344 (uri (git-reference
345 (url "https://github.com/masmu/pulseaudio-dlna.git")
346 (commit commit)))
347 (file-name (git-file-name name version))
348 (sha256
349 (base32
350 "1dfn7036vrq49kxv4an7rayypnm5dlawsf02pfsldw877hzdamqk"))))
351 (build-system python-build-system)
352 (arguments `(#:python ,python-2))
353 (inputs
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:
375
376 @itemize
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
383 @end itemize")
384 (license l:gpl3+))))