xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-multimedia/alsa/alsa-plugins_1.2.6.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "ALSA Plugins"
2*4882a593SmuzhiyunDESCRIPTION = "Used to create virtual devices that can be used like normal \
3*4882a593Smuzhiyunhardware devices but cause extra processing of the sound stream to take place. \
4*4882a593SmuzhiyunThey are used while configuring ALSA in the .asoundrc file."
5*4882a593SmuzhiyunHOMEPAGE = "http://alsa-project.org"
6*4882a593SmuzhiyunBUGTRACKER = "http://alsa-project.org/main/index.php/Bug_Tracking"
7*4882a593SmuzhiyunSECTION = "multimedia"
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun# The primary license of alsa-plugins is LGPL-2.1-only.
10*4882a593Smuzhiyun#
11*4882a593Smuzhiyun# m4/attributes.m4 is licensed under GPL-2.0-or-later. m4/attributes.m4 is part
12*4882a593Smuzhiyun# of the build system, and doesn't affect the licensing of the build result.
13*4882a593Smuzhiyun#
14*4882a593Smuzhiyun# The samplerate plugin source code is licensed under GPL-2.0-or-later to be
15*4882a593Smuzhiyun# consistent with the libsamplerate license. However, if the licensee has a
16*4882a593Smuzhiyun# commercial license for libsamplerate, the samplerate plugin may be used under
17*4882a593Smuzhiyun# the terms of LGPL-2.1-only like the rest of the plugins.
18*4882a593SmuzhiyunLICENSE = "LGPL-2.1-only & GPL-2.0-or-later"
19*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7 \
20*4882a593Smuzhiyun                    file://COPYING.GPL;md5=59530bdf33659b29e73d4adb9f9f6552 \
21*4882a593Smuzhiyun                    file://m4/attributes.m4;endline=33;md5=bb8c6b2a67ac15156961e242fec33e50 \
22*4882a593Smuzhiyun                    file://rate/rate_samplerate.c;endline=35;md5=fd77bce85f4a338c0e8ab18430b69fae \
23*4882a593Smuzhiyun                    "
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunSRC_URI = "https://www.alsa-project.org/files/pub/plugins/${BP}.tar.bz2"
26*4882a593SmuzhiyunSRC_URI[sha256sum] = "068818a4b55d8c029daa00015d853d45113f56b224b7c64e1e117988c825b2a0"
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunDEPENDS += "alsa-lib"
29*4882a593Smuzhiyun
30*4882a593Smuzhiyuninherit autotools pkgconfig
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunPACKAGECONFIG ??= "\
33*4882a593Smuzhiyun        samplerate \
34*4882a593Smuzhiyun        speexdsp \
35*4882a593Smuzhiyun        ${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)} \
36*4882a593Smuzhiyun"
37*4882a593SmuzhiyunPACKAGECONFIG[aaf] = "--enable-aaf,--disable-aaf,libavtp"
38*4882a593SmuzhiyunPACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
39*4882a593SmuzhiyunPACKAGECONFIG[libav] = "--enable-libav,--disable-libav,libav"
40*4882a593SmuzhiyunPACKAGECONFIG[maemo-plugin] = "--enable-maemo-plugin,--disable-maemo-plugin"
41*4882a593SmuzhiyunPACKAGECONFIG[maemo-resource-manager] = "--enable-maemo-resource-manager,--disable-maemo-resource-manager,dbus"
42*4882a593SmuzhiyunPACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
43*4882a593SmuzhiyunPACKAGECONFIG[samplerate] = "--enable-samplerate,--disable-samplerate,libsamplerate0"
44*4882a593SmuzhiyunPACKAGECONFIG[speexdsp] = "--with-speex=lib,--with-speex=no,speexdsp"
45*4882a593Smuzhiyun
46*4882a593SmuzhiyunPACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'alsa-plugins-pulseaudio-conf', '', d)}"
47*4882a593Smuzhiyun
48*4882a593SmuzhiyunPACKAGES_DYNAMIC = "^libasound-module-.*"
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun# The alsa-plugins package doesn't itself contain anything, it just depends on
51*4882a593Smuzhiyun# all built plugins.
52*4882a593SmuzhiyunFILES:${PN} = ""
53*4882a593SmuzhiyunALLOW_EMPTY:${PN} = "1"
54*4882a593Smuzhiyun
55*4882a593Smuzhiyundo_install:append() {
56*4882a593Smuzhiyun	rm -f ${D}${libdir}/alsa-lib/*.la
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun	if [ "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'yes', 'no', d)}" = "yes" ]; then
59*4882a593Smuzhiyun		# We use the example as is. Upstream installs the file under
60*4882a593Smuzhiyun		# /etc, but we move it under /usr/share and add a symlink under
61*4882a593Smuzhiyun		# /etc to be consistent with other installed configuration
62*4882a593Smuzhiyun		# files.
63*4882a593Smuzhiyun		mv ${D}${sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf.example ${D}${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf
64*4882a593Smuzhiyun		ln -s ${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf ${D}${sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf
65*4882a593Smuzhiyun	fi
66*4882a593Smuzhiyun}
67*4882a593Smuzhiyun
68*4882a593Smuzhiyunpython populate_packages:prepend() {
69*4882a593Smuzhiyun    plugindir = d.expand('${libdir}/alsa-lib/')
70*4882a593Smuzhiyun    packages = " ".join(do_split_packages(d, plugindir, r'^libasound_module_(.*)\.so$', 'libasound-module-%s', 'Alsa plugin for %s', extra_depends=''))
71*4882a593Smuzhiyun    d.setVar("RDEPENDS:alsa-plugins", packages)
72*4882a593Smuzhiyun}
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun# Many plugins have a configuration file (plus a symlink in /etc) associated
75*4882a593Smuzhiyun# with them. We put the plugin and it's configuration usually in the same
76*4882a593Smuzhiyun# package, but that's problematic when the configuration file is related to
77*4882a593Smuzhiyun# multiple plugins, as is the case with the pulse, oss and maemo plugins. In
78*4882a593Smuzhiyun# case of the pulse plugins, we have a separate alsa-plugins-pulseaudio-conf
79*4882a593Smuzhiyun# package that depends on all the pulse plugins, which ensures that all plugins
80*4882a593Smuzhiyun# that the configuration references are installed. The oss and maemo
81*4882a593Smuzhiyun# configuration files, on the other hand, are in the respective pcm plugin
82*4882a593Smuzhiyun# packages. Therefore it's possible to install the configuration file without
83*4882a593Smuzhiyun# the ctl plugin that the configuration file references. This is unlikely to
84*4882a593Smuzhiyun# cause big problems, but some kind of improvement to the packaging could
85*4882a593Smuzhiyun# probably be done here (at least it would be good to handle the different
86*4882a593Smuzhiyun# plugins in a consistent way).
87*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-ctl-arcam-av += "\
88*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/50-arcam-av-ctl.conf \
89*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/50-arcam-av-ctl.conf \
90*4882a593Smuzhiyun"
91*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-pcm-a52 += "\
92*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/60-a52-encoder.conf \
93*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/60-a52-encoder.conf \
94*4882a593Smuzhiyun"
95*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-pcm-alsa-dsp += "\
96*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/98-maemo.conf \
97*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/98-maemo.conf \
98*4882a593Smuzhiyun"
99*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-pcm-jack += "\
100*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/50-jack.conf \
101*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/50-jack.conf \
102*4882a593Smuzhiyun"
103*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-pcm-oss += "\
104*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/50-oss.conf \
105*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/50-oss.conf \
106*4882a593Smuzhiyun"
107*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-pcm-speex += "\
108*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/60-speex.conf \
109*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/60-speex.conf \
110*4882a593Smuzhiyun"
111*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-pcm-upmix += "\
112*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/60-upmix.conf \
113*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/60-upmix.conf \
114*4882a593Smuzhiyun"
115*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-pcm-usb-stream += "\
116*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/98-usb-stream.conf \
117*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/98-usb-stream.conf \
118*4882a593Smuzhiyun"
119*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-pcm-vdownmix += "\
120*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/60-vdownmix.conf \
121*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/60-vdownmix.conf \
122*4882a593Smuzhiyun"
123*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-rate-lavrate += "\
124*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/10-rate-lav.conf \
125*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/10-rate-lav.conf \
126*4882a593Smuzhiyun"
127*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-rate-samplerate += "\
128*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/10-samplerate.conf \
129*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/10-samplerate.conf \
130*4882a593Smuzhiyun"
131*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-rate-speexrate += "\
132*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/10-speexrate.conf \
133*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/10-speexrate.conf \
134*4882a593Smuzhiyun"
135*4882a593Smuzhiyun
136*4882a593Smuzhiyun# The rate plugins create some symlinks. For example, the samplerate plugin
137*4882a593Smuzhiyun# creates these links to the main plugin file:
138*4882a593Smuzhiyun#
139*4882a593Smuzhiyun#   libasound_module_rate_samplerate_best.so
140*4882a593Smuzhiyun#   libasound_module_rate_samplerate_linear.so
141*4882a593Smuzhiyun#   libasound_module_rate_samplerate_medium.so
142*4882a593Smuzhiyun#   libasound_module_rate_samplerate_order.so
143*4882a593Smuzhiyun#
144*4882a593Smuzhiyun# The other rate plugins create similar links. We have to add the links to
145*4882a593Smuzhiyun# FILES manually, because do_split_packages() skips the links (which is good,
146*4882a593Smuzhiyun# because we wouldn't want do_split_packages() to create separate packages for
147*4882a593Smuzhiyun# the symlinks).
148*4882a593Smuzhiyun#
149*4882a593Smuzhiyun# The symlinks cause QA errors, because usually it's a bug if a non
150*4882a593Smuzhiyun# -dev/-dbg/-nativesdk package contains links to .so files, but in this case
151*4882a593Smuzhiyun# the errors are false positives, so we disable the QA checks.
152*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-rate-lavrate += "${libdir}/alsa-lib/*rate_lavrate_*.so"
153*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-rate-samplerate += "${libdir}/alsa-lib/*rate_samplerate_*.so"
154*4882a593SmuzhiyunFILES:${MLPREFIX}libasound-module-rate-speexrate += "${libdir}/alsa-lib/*rate_speexrate_*.so"
155*4882a593SmuzhiyunINSANE_SKIP:${MLPREFIX}libasound-module-rate-lavrate = "dev-so"
156*4882a593SmuzhiyunINSANE_SKIP:${MLPREFIX}libasound-module-rate-samplerate = "dev-so"
157*4882a593SmuzhiyunINSANE_SKIP:${MLPREFIX}libasound-module-rate-speexrate = "dev-so"
158*4882a593Smuzhiyun
159*4882a593Smuzhiyun# 50-pulseaudio.conf defines a device named "pulse" that applications can use
160*4882a593Smuzhiyun# if they explicitly want to use the PulseAudio plugin.
161*4882a593Smuzhiyun# 99-pulseaudio-default.conf configures the "default" device to use the
162*4882a593Smuzhiyun# PulseAudio plugin.
163*4882a593SmuzhiyunFILES:${PN}-pulseaudio-conf += "\
164*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/50-pulseaudio.conf \
165*4882a593Smuzhiyun        ${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf \
166*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/50-pulseaudio.conf \
167*4882a593Smuzhiyun        ${sysconfdir}/alsa/conf.d/99-pulseaudio-default.conf \
168*4882a593Smuzhiyun"
169*4882a593Smuzhiyun
170*4882a593SmuzhiyunRDEPENDS:${PN}-pulseaudio-conf += "\
171*4882a593Smuzhiyun        ${MLPREFIX}libasound-module-conf-pulse \
172*4882a593Smuzhiyun        ${MLPREFIX}libasound-module-ctl-pulse \
173*4882a593Smuzhiyun        ${MLPREFIX}libasound-module-pcm-pulse \
174*4882a593Smuzhiyun"
175