blob: 0eac982e1afe5d6bbfe1002000030faeb51c117f [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "ALSA Plugins"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06002DESCRIPTION = "Used to create virtual devices that can be used like normal \
3hardware devices but cause extra processing of the sound stream to take place. \
4They are used while configuring ALSA in the .asoundrc file."
Andrew Geissler82c905d2020-04-13 13:39:40 -05005HOMEPAGE = "http://alsa-project.org"
6BUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
7SECTION = "multimedia"
8
9# The primary license of alsa-plugins is LGPLv2.1.
10#
11# m4/attributes.m4 is licensed under GPLv2+. m4/attributes.m4 is part of the
12# build system, and doesn't affect the licensing of the build result.
13#
14# The samplerate plugin source code is licensed under GPLv2+ to be consistent
15# with the libsamplerate license. However, if the licensee has a commercial
16# license for libsamplerate, the samplerate plugin may be used under the terms
17# of LGPLv2.1 like the rest of the plugins.
18LICENSE = "LGPLv2.1 & GPLv2+"
Andrew Geissler4ed12e12020-06-05 18:00:41 -050019LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7 \
20 file://COPYING.GPL;md5=59530bdf33659b29e73d4adb9f9f6552 \
21 file://m4/attributes.m4;endline=33;md5=bb8c6b2a67ac15156961e242fec33e50 \
22 file://rate/rate_samplerate.c;endline=35;md5=fd77bce85f4a338c0e8ab18430b69fae \
23 "
Andrew Geissler82c905d2020-04-13 13:39:40 -050024
25SRC_URI = "https://www.alsa-project.org/files/pub/plugins/${BP}.tar.bz2"
Andrew Geissler09036742021-06-25 14:25:14 -050026SRC_URI[sha256sum] = "42eef98433d2c8d11f1deeeb459643619215a75aa5a5bbdd06a794e4c413df20"
Andrew Geissler82c905d2020-04-13 13:39:40 -050027
28DEPENDS += "alsa-lib"
29
30inherit autotools pkgconfig
31
32PACKAGECONFIG ??= "\
33 samplerate \
34 speexdsp \
35 ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
36"
37PACKAGECONFIG[aaf] = "--enable-aaf,--disable-aaf,avtp"
38PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
39PACKAGECONFIG[libav] = "--enable-libav,--disable-libav,libav"
40PACKAGECONFIG[maemo-plugin] = "--enable-maemo-plugin,--disable-maemo-plugin"
41PACKAGECONFIG[maemo-resource-manager] = "--enable-maemo-resource-manager,--disable-maemo-resource-manager,dbus"
42PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
43PACKAGECONFIG[samplerate] = "--enable-samplerate,--disable-samplerate,libsamplerate0"
44PACKAGECONFIG[speexdsp] = "--with-speex=lib,--with-speex=no,speexdsp"
45
46PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'alsa-plugins-pulseaudio-conf', '', d)}"
47
48PACKAGES_DYNAMIC = "^libasound-module-.*"
49
50# The alsa-plugins package doesn't itself contain anything, it just depends on
51# all built plugins.
Patrick Williams213cb262021-08-07 19:21:33 -050052FILES:${PN} = ""
53ALLOW_EMPTY:${PN} = "1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050054
Patrick Williams213cb262021-08-07 19:21:33 -050055do_install:append() {
Andrew Geisslerc9f78652020-09-18 14:11:35 -050056 rm -f ${D}${libdir}/alsa-lib/*.la
Andrew Geissler82c905d2020-04-13 13:39:40 -050057
58 if [ "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'yes', 'no', d)}" = "yes" ]; then
59 # We use the example as is. Upstream installs the file under
60 # /etc, but we move it under /usr/share and add a symlink under
61 # /etc to be consistent with other installed configuration
62 # files.
63 mv ${D}${sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf.example ${D}${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf
64 ln -s ${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf ${D}${sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf
65 fi
66}
67
Patrick Williams213cb262021-08-07 19:21:33 -050068python populate_packages:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050069 plugindir = d.expand('${libdir}/alsa-lib/')
70 packages = " ".join(do_split_packages(d, plugindir, r'^libasound_module_(.*)\.so$', 'libasound-module-%s', 'Alsa plugin for %s', extra_depends=''))
Patrick Williams213cb262021-08-07 19:21:33 -050071 d.setVar("RDEPENDS:alsa-plugins", packages)
Andrew Geissler82c905d2020-04-13 13:39:40 -050072}
73
74# Many plugins have a configuration file (plus a symlink in /etc) associated
75# with them. We put the plugin and it's configuration usually in the same
76# package, but that's problematic when the configuration file is related to
77# multiple plugins, as is the case with the pulse, oss and maemo plugins. In
78# case of the pulse plugins, we have a separate alsa-plugins-pulseaudio-conf
79# package that depends on all the pulse plugins, which ensures that all plugins
80# that the configuration references are installed. The oss and maemo
81# configuration files, on the other hand, are in the respective pcm plugin
82# packages. Therefore it's possible to install the configuration file without
83# the ctl plugin that the configuration file references. This is unlikely to
84# cause big problems, but some kind of improvement to the packaging could
85# probably be done here (at least it would be good to handle the different
86# plugins in a consistent way).
Patrick Williams213cb262021-08-07 19:21:33 -050087FILES:${MLPREFIX}libasound-module-ctl-arcam-av += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -050088 ${datadir}/alsa/alsa.conf.d/50-arcam-av-ctl.conf \
89 ${sysconfdir}/alsa/conf.d/50-arcam-av-ctl.conf \
90"
Patrick Williams213cb262021-08-07 19:21:33 -050091FILES:${MLPREFIX}libasound-module-pcm-a52 += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -050092 ${datadir}/alsa/alsa.conf.d/60-a52-encoder.conf \
93 ${sysconfdir}/alsa/conf.d/60-a52-encoder.conf \
94"
Patrick Williams213cb262021-08-07 19:21:33 -050095FILES:${MLPREFIX}libasound-module-pcm-alsa-dsp += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -050096 ${datadir}/alsa/alsa.conf.d/98-maemo.conf \
97 ${sysconfdir}/alsa/conf.d/98-maemo.conf \
98"
Patrick Williams213cb262021-08-07 19:21:33 -050099FILES:${MLPREFIX}libasound-module-pcm-jack += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500100 ${datadir}/alsa/alsa.conf.d/50-jack.conf \
101 ${sysconfdir}/alsa/conf.d/50-jack.conf \
102"
Patrick Williams213cb262021-08-07 19:21:33 -0500103FILES:${MLPREFIX}libasound-module-pcm-oss += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500104 ${datadir}/alsa/alsa.conf.d/50-oss.conf \
105 ${sysconfdir}/alsa/conf.d/50-oss.conf \
106"
Patrick Williams213cb262021-08-07 19:21:33 -0500107FILES:${MLPREFIX}libasound-module-pcm-speex += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500108 ${datadir}/alsa/alsa.conf.d/60-speex.conf \
109 ${sysconfdir}/alsa/conf.d/60-speex.conf \
110"
Patrick Williams213cb262021-08-07 19:21:33 -0500111FILES:${MLPREFIX}libasound-module-pcm-upmix += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500112 ${datadir}/alsa/alsa.conf.d/60-upmix.conf \
113 ${sysconfdir}/alsa/conf.d/60-upmix.conf \
114"
Patrick Williams213cb262021-08-07 19:21:33 -0500115FILES:${MLPREFIX}libasound-module-pcm-usb-stream += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500116 ${datadir}/alsa/alsa.conf.d/98-usb-stream.conf \
117 ${sysconfdir}/alsa/conf.d/98-usb-stream.conf \
118"
Patrick Williams213cb262021-08-07 19:21:33 -0500119FILES:${MLPREFIX}libasound-module-pcm-vdownmix += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500120 ${datadir}/alsa/alsa.conf.d/60-vdownmix.conf \
121 ${sysconfdir}/alsa/conf.d/60-vdownmix.conf \
122"
Patrick Williams213cb262021-08-07 19:21:33 -0500123FILES:${MLPREFIX}libasound-module-rate-lavrate += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500124 ${datadir}/alsa/alsa.conf.d/10-rate-lav.conf \
125 ${sysconfdir}/alsa/conf.d/10-rate-lav.conf \
126"
Patrick Williams213cb262021-08-07 19:21:33 -0500127FILES:${MLPREFIX}libasound-module-rate-samplerate += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500128 ${datadir}/alsa/alsa.conf.d/10-samplerate.conf \
129 ${sysconfdir}/alsa/conf.d/10-samplerate.conf \
130"
Patrick Williams213cb262021-08-07 19:21:33 -0500131FILES:${MLPREFIX}libasound-module-rate-speexrate += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500132 ${datadir}/alsa/alsa.conf.d/10-speexrate.conf \
133 ${sysconfdir}/alsa/conf.d/10-speexrate.conf \
134"
135
136# The rate plugins create some symlinks. For example, the samplerate plugin
137# creates these links to the main plugin file:
138#
139# libasound_module_rate_samplerate_best.so
140# libasound_module_rate_samplerate_linear.so
141# libasound_module_rate_samplerate_medium.so
142# libasound_module_rate_samplerate_order.so
143#
144# The other rate plugins create similar links. We have to add the links to
145# FILES manually, because do_split_packages() skips the links (which is good,
146# because we wouldn't want do_split_packages() to create separate packages for
147# the symlinks).
148#
149# The symlinks cause QA errors, because usually it's a bug if a non
150# -dev/-dbg/-nativesdk package contains links to .so files, but in this case
151# the errors are false positives, so we disable the QA checks.
Patrick Williams213cb262021-08-07 19:21:33 -0500152FILES:${MLPREFIX}libasound-module-rate-lavrate += "${libdir}/alsa-lib/*rate_lavrate_*.so"
153FILES:${MLPREFIX}libasound-module-rate-samplerate += "${libdir}/alsa-lib/*rate_samplerate_*.so"
154FILES:${MLPREFIX}libasound-module-rate-speexrate += "${libdir}/alsa-lib/*rate_speexrate_*.so"
155INSANE_SKIP:${MLPREFIX}libasound-module-rate-lavrate = "dev-so"
156INSANE_SKIP:${MLPREFIX}libasound-module-rate-samplerate = "dev-so"
157INSANE_SKIP:${MLPREFIX}libasound-module-rate-speexrate = "dev-so"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500158
159# 50-pulseaudio.conf defines a device named "pulse" that applications can use
160# if they explicitly want to use the PulseAudio plugin.
161# 99-pulseaudio-default.conf configures the "default" device to use the
162# PulseAudio plugin.
Patrick Williams213cb262021-08-07 19:21:33 -0500163FILES:${PN}-pulseaudio-conf += "\
Andrew Geissler82c905d2020-04-13 13:39:40 -0500164 ${datadir}/alsa/alsa.conf.d/50-pulseaudio.conf \
165 ${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf \
166 ${sysconfdir}/alsa/conf.d/50-pulseaudio.conf \
167 ${sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf \
168"
169
Patrick Williams213cb262021-08-07 19:21:33 -0500170RDEPENDS:${PN}-pulseaudio-conf += "\
Andrew Geissler1e34c2d2020-05-29 16:02:59 -0500171 ${MLPREFIX}libasound-module-conf-pulse \
172 ${MLPREFIX}libasound-module-ctl-pulse \
173 ${MLPREFIX}libasound-module-pcm-pulse \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500174"