gnu: Add external-program.
[jackhill/guix/guix.git] / gnu / packages / pulseaudio.scm
CommitLineData
37bfb448 1;;; GNU Guix --- Functional package management for GNU
3246cc91 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
4373278e 3;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
9dd61217 4;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
de1b319d 5;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
3cd959a4 6;;; Copyright © 2017 Thomas Danckaert <post@thomasdanckaert.be>
efc95e7b 7;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
05bdb5e6 8;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
27a976ed 9;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
d5e60a2a 10;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
e2332dec 11;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
37bfb448
LC
12;;;
13;;; This file is part of GNU Guix.
14;;;
15;;; GNU Guix is free software; you can redistribute it and/or modify it
16;;; under the terms of the GNU General Public License as published by
17;;; the Free Software Foundation; either version 3 of the License, or (at
18;;; your option) any later version.
19;;;
20;;; GNU Guix is distributed in the hope that it will be useful, but
21;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23;;; GNU General Public License for more details.
24;;;
25;;; You should have received a copy of the GNU General Public License
26;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27
28(define-module (gnu packages pulseaudio)
29 #:use-module (guix packages)
30 #:use-module (guix download)
e2332dec 31 #:use-module (guix git-download)
b5b73a82 32 #:use-module ((guix licenses) #:prefix l:)
37bfb448 33 #:use-module (guix build-system gnu)
df71c88c 34 #:use-module (guix build-system python)
b645425f 35 #:use-module (gnu packages)
54ff0b7d 36 #:use-module (gnu packages algebra)
d5e60a2a 37 #:use-module (gnu packages audio)
38cf2ba0 38 #:use-module (gnu packages autotools)
37bfb448 39 #:use-module (gnu packages avahi)
54ff0b7d 40 #:use-module (gnu packages check)
255d1bbe 41 #:use-module (gnu packages dbm)
37bfb448 42 #:use-module (gnu packages glib)
66fb2d23
LC
43 #:use-module (gnu packages gtk)
44 #:use-module (gnu packages libcanberra)
f6ad09ae 45 #:use-module (gnu packages web)
54ff0b7d 46 #:use-module (gnu packages linux)
37bfb448 47 #:use-module (gnu packages m4)
e2332dec
AG
48 #:use-module (gnu packages protobuf)
49 #:use-module (gnu packages python)
50 #:use-module (gnu packages python-xyz)
51 #:use-module (gnu packages python-web)
54ff0b7d 52 #:use-module (gnu packages pkg-config)
531b63eb
DNB
53 #:use-module (gnu packages xiph)
54 #:use-module (gnu packages xorg))
37bfb448 55
0160458b 56(define-public libsndfile
37bfb448
LC
57 (package
58 (name "libsndfile")
3cd959a4 59 (version "1.0.28")
37bfb448
LC
60 (source (origin
61 (method url-fetch)
62 (uri (string-append "http://www.mega-nerd.com/libsndfile/files/libsndfile-"
63 version ".tar.gz"))
d1a91408
RW
64 (patches (search-patches "libsndfile-armhf-type-checks.patch"
65 "libsndfile-CVE-2017-8361-8363-8365.patch"
1cbdfede
MW
66 "libsndfile-CVE-2017-8362.patch"
67 "libsndfile-CVE-2017-12562.patch"))
37bfb448
LC
68 (sha256
69 (base32
3cd959a4 70 "1afzm7jx34jhqn32clc5xghyjglccam2728yxlx37yj2y0lkkwqz"))))
37bfb448
LC
71 (build-system gnu-build-system)
72 (inputs
73 `(("libvorbis" ,libvorbis)
74 ("libogg" ,libogg)
d7e92b87
ML
75 ("flac" ,flac)))
76 (native-inputs
77 `(("pkg-config" ,pkg-config)))
37bfb448
LC
78 (home-page "http://www.mega-nerd.com/libsndfile/")
79 (synopsis "Reading and writing files containing sampled sound")
80 (description
81 "Libsndfile is a C library for reading and writing files containing
82sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format) through
83one standard library interface.
84
85It was designed to handle both little-endian (such as WAV) and
86big-endian (such as AIFF) data, and to compile and run correctly on
87little-endian (such as Intel and DEC/Compaq Alpha) processor systems as well
88as big-endian processor systems such as Motorola 68k, Power PC, MIPS and
89SPARC. Hopefully the design of the library will also make it easy to extend
90for reading and writing new sound file formats.")
91 (license l:gpl2+)))
92
0160458b 93(define-public libsamplerate
37bfb448
LC
94 (package
95 (name "libsamplerate") ; aka. Secret Rabbit Code (SRC)
e1f68c96 96 (version "0.1.9")
37bfb448
LC
97 (source (origin
98 (method url-fetch)
99 (uri (string-append "http://www.mega-nerd.com/SRC/libsamplerate-"
100 version ".tar.gz"))
101 (sha256
102 (base32
e1f68c96 103 "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha"))))
37bfb448 104 (build-system gnu-build-system)
d7e92b87
ML
105 (native-inputs
106 `(("pkg-config" ,pkg-config)))
37bfb448
LC
107 (propagated-inputs
108 `(("libsndfile" ,libsndfile)
109 ("fftw" ,fftw)))
110 (home-page "http://www.mega-nerd.com/SRC/index.html")
111 (synopsis "Audio sample rate conversion library")
112 (description
113 "Secret Rabbit Code (aka. libsamplerate) is a Sample Rate Converter for
114audio. One example of where such a thing would be useful is converting audio
115from the CD sample rate of 44.1kHz to the 48kHz sample rate used by DAT
116players.
117
118SRC is capable of arbitrary and time varying conversions; from downsampling by
119a factor of 256 to upsampling by the same factor. Arbitrary in this case means
120that the ratio of input and output sample rates can be an irrational
121number. The conversion ratio can also vary with time for speeding up and
122slowing down effects.
123
124SRC provides a small set of converters to allow quality to be traded off
125against computation cost. The current best converter provides a
126signal-to-noise ratio of 145dB with -3dB passband extending from DC to 96% of
127the theoretical best bandwidth for a given pair of input and output sample
e881752c 128rates.")
0802f3a0 129 (license l:bsd-2)))
37bfb448 130
0160458b 131(define-public pulseaudio
37bfb448
LC
132 (package
133 (name "pulseaudio")
4442d4dc 134 (version "13.0")
37bfb448
LC
135 (source (origin
136 (method url-fetch)
137 (uri (string-append
9dd61217
EF
138 "https://freedesktop.org/software/pulseaudio/releases/"
139 name "-" version ".tar.xz"))
37bfb448
LC
140 (sha256
141 (base32
4442d4dc 142 "0mw0ybrqj7hvf8lqs5gjzip464hfnixw453lr0mqzlng3b5266wn"))
3f9d63df
LC
143 (modules '((guix build utils)))
144 (snippet
145 ;; Disable console-kit support by default since it's deprecated
146 ;; anyway.
6cbee49d
MW
147 '(begin
148 (substitute* "src/daemon/default.pa.in"
149 (("load-module module-console-kit" all)
150 (string-append "#" all "\n")))
151 #t))
fc1adab1
AK
152 (patches (search-patches
153 "pulseaudio-fix-mult-test.patch"
154 "pulseaudio-longer-test-timeout.patch"))))
37bfb448
LC
155 (build-system gnu-build-system)
156 (arguments
5a74d239
LC
157 `(#:configure-flags (list "--localstatedir=/var" ;"--sysconfdir=/etc"
158 "--disable-oss-output"
de1b319d 159 "--enable-bluez5"
5a74d239
LC
160 (string-append "--with-udev-rules-dir="
161 (assoc-ref %outputs "out")
162 "/lib/udev/rules.d"))
277cf3dc
MB
163 #:phases (modify-phases %standard-phases
164 (add-before 'check 'pre-check
165 (lambda _
166 ;; 'tests/lock-autospawn-test.c' wants to create a file
167 ;; under ~/.config/pulse.
168 (setenv "HOME" (getcwd))
169 ;; 'thread-test' needs more time on hydra and on slower
170 ;; machines, so we set the default timeout to 120 seconds.
171 (setenv "CK_DEFAULT_TIMEOUT" "120")
172 #t)))))
37bfb448
LC
173 (inputs
174 ;; TODO: Add optional inputs (GTK+?).
de1b319d
RW
175 `(("alsa-lib" ,alsa-lib)
176 ("bluez" ,bluez)
177 ("sbc" ,sbc)
7136f3e6 178 ("speexdsp" ,speexdsp)
37bfb448 179 ("libsndfile" ,libsndfile)
d5e60a2a 180 ("jack" ,jack-1) ; For routing the output to jack.
37bfb448
LC
181 ("dbus" ,dbus)
182 ("glib" ,glib)
3246cc91 183 ("libltdl" ,libltdl)
7569c5cb 184 ("fftwf" ,fftwf)
37bfb448 185 ("avahi" ,avahi)
531b63eb
DNB
186
187 ;; For the optional X11 modules.
188 ("libice" ,libice)
189 ("libsm" ,libsm)
190 ("libxcb" ,libxcb)
191 ("libxtst" ,libxtst)
192
7136f3e6 193 ("eudev" ,eudev))) ;for the detection of hardware audio devices
d7e92b87 194 (native-inputs
7136f3e6
MB
195 `(("check" ,check)
196 ("glib:bin" ,glib "bin")
197 ("intltool" ,intltool)
198 ("m4" ,m4)
199 ("pkg-config" ,pkg-config)))
37bfb448
LC
200 (propagated-inputs
201 ;; 'libpulse*.la' contain `-lgdbm' and `-lcap', so propagate them.
09767fb5 202 `(("libcap" ,libcap)
37bfb448
LC
203 ("gdbm" ,gdbm)))
204 (home-page "http://www.pulseaudio.org/")
205 (synopsis "Sound server")
206 (description
e881752c
AK
207 "PulseAudio is a sound server. It is basically a proxy for your sound
208applications. It allows you to do advanced operations on your sound data as
209it passes between your application and your hardware. Things like
210transferring the audio to a different machine, changing the sample format or
211channel count and mixing several sounds into one are easily achieved using a
212sound server.")
37bfb448
LC
213
214 ;; PulseAudio is LGPLv2+, but some of the optional dependencies (GNU dbm,
215 ;; FFTW, etc.) are GPL'd, so the result is effectively GPLv2+. See
216 ;; 'LICENSE' for details.
217 (license l:gpl2+)))
66fb2d23
LC
218
219(define-public pavucontrol
220 (package
221 (name "pavucontrol")
08cc159a 222 (version "3.0")
66fb2d23
LC
223 (source (origin
224 (method url-fetch)
225 (uri (string-append
5cc3096c 226 "https://freedesktop.org/software/pulseaudio/pavucontrol/pavucontrol-"
66fb2d23
LC
227 version
228 ".tar.xz"))
229 (sha256
230 (base32
08cc159a 231 "14486c6lmmirkhscbfygz114f6yzf97h35n3h3pdr27w4mdfmlmk"))))
66fb2d23
LC
232 (build-system gnu-build-system)
233 (inputs
c4c4cc05 234 `(("libcanberra" ,libcanberra)
66fb2d23 235 ("gtkmm" ,gtkmm)
c4c4cc05
JD
236 ("pulseaudio" ,pulseaudio)))
237 (native-inputs
238 `(("intltool" ,intltool)
66fb2d23 239 ("pkg-config" ,pkg-config)))
57e7d748 240 (home-page "https://www.freedesktop.org/software/pulseaudio/pavucontrol/")
66fb2d23
LC
241 (synopsis "PulseAudio volume control")
242 (description
243 "PulseAudio Volume Control (pavucontrol) provides a GTK+
244graphical user interface to connect to a PulseAudio server and
245easily control the volume of all clients, sinks, etc.")
246 (license l:gpl2+)))
05bdb5e6
SR
247
248(define-public ponymix
249 (package
250 (name "ponymix")
251 (version "5")
252 (source (origin
253 (method url-fetch)
254 (uri (string-append "https://github.com/falconindy/ponymix/"
255 "archive/" version ".tar.gz"))
256 (sha256
257 (base32
258 "1c0ch98zry3c4ixywwynjid1n1nh4xl4l1p548giq2w3zwflaghn"))
259 (file-name (string-append name "-" version ".tar.gz"))))
260 (build-system gnu-build-system)
261 (arguments
262 `(#:tests? #f ; There is no test suite.
263 #:make-flags (let ((out (assoc-ref %outputs "out")))
264 (list (string-append "DESTDIR=" out)))
265 #:phases
266 (modify-phases %standard-phases
267 (add-after 'unpack 'patch-paths
268 (lambda _
269 (substitute* "Makefile"
270 (("/usr") ""))))
271 (delete 'configure)))) ; There's no configure phase.
272 (inputs
273 `(("pulseaudio" ,pulseaudio)))
274 (native-inputs
275 `(("pkg-config" ,pkg-config)))
276 (home-page "https://github.com/falconindy/ponymix")
277 (synopsis "Console-based PulseAudio mixer")
278 (description "Ponymix is a PulseAudio mixer and volume controller with a
279command-line interface. In addition, it is possible to use named sources and
280sinks.")
281 (license l:expat)))
df71c88c
LF
282
283(define-public pulsemixer
284 (package
285 (name "pulsemixer")
27a976ed 286 (version "1.4.0")
df71c88c
LF
287 (source (origin
288 (method url-fetch)
289 (uri (string-append "https://github.com/GeorgeFilipkin/"
290 "pulsemixer/archive/" version ".tar.gz"))
f45ceced 291 (file-name (string-append name "-" version ".tar.gz"))
df71c88c
LF
292 (sha256
293 (base32
27a976ed 294 "1lpad90ifr2xfldyf39sbwx1v85rif2gm9w774gwwpjv53zfgk1g"))))
df71c88c
LF
295 (build-system python-build-system)
296 (arguments
297 `(#:phases
298 (modify-phases %standard-phases
299 (add-after 'unpack 'patch-path
300 (lambda* (#:key inputs #:allow-other-keys)
301 (let ((pulse (assoc-ref inputs "pulseaudio")))
302 (substitute* "pulsemixer"
303 (("libpulse.so.0")
304 (string-append pulse "/lib/libpulse.so.0")))
305 #t))))))
306 (inputs
307 `(("pulseaudio" ,pulseaudio)))
308 (home-page "https://github.com/GeorgeFilipkin/pulsemixer/")
309 (synopsis "Command-line and curses mixer for PulseAudio")
310 (description "Pulsemixer is a PulseAudio mixer with command-line and
311curses-style interfaces.")
312 (license l:expat)))
e2332dec
AG
313
314(define-public pulseaudio-dlna
315 ;; The last release was in 2016; use a more recent commit.
316 (let ((commit "4472928dd23f274193f14289f59daec411023ab0")
317 (revision "1"))
318 (package
319 (name "pulseaudio-dlna")
320 (version (git-version "0.5.2" revision commit))
321 (source
322 (origin
323 (method git-fetch)
324 (uri (git-reference
325 (url "https://github.com/masmu/pulseaudio-dlna.git")
326 (commit commit)))
327 (file-name (git-file-name name version))
328 (sha256
329 (base32
330 "1dfn7036vrq49kxv4an7rayypnm5dlawsf02pfsldw877hzdamqk"))))
331 (build-system python-build-system)
332 (arguments `(#:python ,python-2))
333 (inputs
334 `(("python2-chardet" ,python2-chardet)
335 ("python2-dbus" ,python2-dbus)
336 ("python2-docopt" ,python2-docopt)
337 ("python2-futures" ,python2-futures)
338 ("python2-pygobject" ,python2-pygobject)
339 ("python2-lxml" ,python2-lxml)
340 ("python2-netifaces" ,python2-netifaces)
341 ("python2-notify2" ,python2-notify2)
342 ("python2-protobuf" ,python2-protobuf)
343 ("python2-psutil" ,python2-psutil)
344 ("python2-requests" ,python2-requests)
345 ("python2-pyroute2" ,python2-pyroute2)
346 ("python2-setproctitle" ,python2-setproctitle)
347 ("python2-zeroconf" ,python2-zeroconf)))
348 (home-page "https://github.com/masmu/pulseaudio-dlna")
349 (synopsis "Stream audio to DLNA/UPnP and Chromecast devices")
350 (description "This lightweight streaming server brings DLNA/UPnP and
351Chromecast support to PulseAudio. It can stream your current PulseAudio
352playback to different UPnP devices (UPnP Media Renderers, including Sonos
353devices and some Smart TVs) or Chromecasts in your network. You should also
354install one or more of the following packages alongside pulseaudio-dlna:
355
356@itemize
357@item ffmpeg - transcoding support for multiple codecs
358@item flac - FLAC transcoding support
359@item lame - MP3 transcoding support
360@item opus-tools - Opus transcoding support
361@item sox - WAV transcoding support
362@item vorbis-tools - Vorbis transcoding support
363@end itemize")
364 (license l:gpl3+))))