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