blob: 7b1ca2ee15b7aacc3fbf46887449b03226073869 [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001SUMMARY = "ALSA Plugins"
2DESCRIPTION = "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."
5HOMEPAGE = "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+"
19LIC_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 "
24
25SRC_URI = "https://www.alsa-project.org/files/pub/plugins/${BP}.tar.bz2"
26SRC_URI[sha256sum] = "068818a4b55d8c029daa00015d853d45113f56b224b7c64e1e117988c825b2a0"
27
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.
52FILES:${PN} = ""
53ALLOW_EMPTY:${PN} = "1"
54
55do_install:append() {
56 rm -f ${D}${libdir}/alsa-lib/*.la
57
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
68python populate_packages:prepend() {
69 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=''))
71 d.setVar("RDEPENDS:alsa-plugins", packages)
72}
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).
87FILES:${MLPREFIX}libasound-module-ctl-arcam-av += "\
88 ${datadir}/alsa/alsa.conf.d/50-arcam-av-ctl.conf \
89 ${sysconfdir}/alsa/conf.d/50-arcam-av-ctl.conf \
90"
91FILES:${MLPREFIX}libasound-module-pcm-a52 += "\
92 ${datadir}/alsa/alsa.conf.d/60-a52-encoder.conf \
93 ${sysconfdir}/alsa/conf.d/60-a52-encoder.conf \
94"
95FILES:${MLPREFIX}libasound-module-pcm-alsa-dsp += "\
96 ${datadir}/alsa/alsa.conf.d/98-maemo.conf \
97 ${sysconfdir}/alsa/conf.d/98-maemo.conf \
98"
99FILES:${MLPREFIX}libasound-module-pcm-jack += "\
100 ${datadir}/alsa/alsa.conf.d/50-jack.conf \
101 ${sysconfdir}/alsa/conf.d/50-jack.conf \
102"
103FILES:${MLPREFIX}libasound-module-pcm-oss += "\
104 ${datadir}/alsa/alsa.conf.d/50-oss.conf \
105 ${sysconfdir}/alsa/conf.d/50-oss.conf \
106"
107FILES:${MLPREFIX}libasound-module-pcm-speex += "\
108 ${datadir}/alsa/alsa.conf.d/60-speex.conf \
109 ${sysconfdir}/alsa/conf.d/60-speex.conf \
110"
111FILES:${MLPREFIX}libasound-module-pcm-upmix += "\
112 ${datadir}/alsa/alsa.conf.d/60-upmix.conf \
113 ${sysconfdir}/alsa/conf.d/60-upmix.conf \
114"
115FILES:${MLPREFIX}libasound-module-pcm-usb-stream += "\
116 ${datadir}/alsa/alsa.conf.d/98-usb-stream.conf \
117 ${sysconfdir}/alsa/conf.d/98-usb-stream.conf \
118"
119FILES:${MLPREFIX}libasound-module-pcm-vdownmix += "\
120 ${datadir}/alsa/alsa.conf.d/60-vdownmix.conf \
121 ${sysconfdir}/alsa/conf.d/60-vdownmix.conf \
122"
123FILES:${MLPREFIX}libasound-module-rate-lavrate += "\
124 ${datadir}/alsa/alsa.conf.d/10-rate-lav.conf \
125 ${sysconfdir}/alsa/conf.d/10-rate-lav.conf \
126"
127FILES:${MLPREFIX}libasound-module-rate-samplerate += "\
128 ${datadir}/alsa/alsa.conf.d/10-samplerate.conf \
129 ${sysconfdir}/alsa/conf.d/10-samplerate.conf \
130"
131FILES:${MLPREFIX}libasound-module-rate-speexrate += "\
132 ${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.
152FILES:${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"
158
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.
163FILES:${PN}-pulseaudio-conf += "\
164 ${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
170RDEPENDS:${PN}-pulseaudio-conf += "\
171 ${MLPREFIX}libasound-module-conf-pulse \
172 ${MLPREFIX}libasound-module-ctl-pulse \
173 ${MLPREFIX}libasound-module-pcm-pulse \
174"