1*4882a593SmuzhiyunSUMMARY = "Sound server for Linux and Unix-like operating systems" 2*4882a593SmuzhiyunDESCRIPTION = "A general purpose sound server intended to run as a middleware \ 3*4882a593Smuzhiyunbetween your applications and your hardware devices, either using ALSA or OSS." 4*4882a593SmuzhiyunHOMEPAGE = "http://www.pulseaudio.org" 5*4882a593SmuzhiyunAUTHOR = "Lennart Poettering" 6*4882a593SmuzhiyunSECTION = "libs/multimedia" 7*4882a593Smuzhiyun 8*4882a593Smuzhiyun# Most of PulseAudio code is under LGPL-2.1-or-later. There are a few 9*4882a593Smuzhiyun# exceptions: 10*4882a593Smuzhiyun# 11*4882a593Smuzhiyun# The "adrian" echo canceller variant has code under a non-standard permissive 12*4882a593Smuzhiyun# license. See src/modules/echo-cancel/adrian-license.txt for details. This 13*4882a593Smuzhiyun# recipe disables the adrian echo canceller to avoid hassle with the unusual 14*4882a593Smuzhiyun# license. 15*4882a593Smuzhiyun# 16*4882a593Smuzhiyun# The src/modules/reserve* and src/pulsecore/rtkit* files are under the MIT 17*4882a593Smuzhiyun# license. 18*4882a593Smuzhiyun# 19*4882a593Smuzhiyun# The src/pulsecore/filter/ directory contains code under the 3-clause BSD 20*4882a593Smuzhiyun# license. 21*4882a593Smuzhiyun# 22*4882a593Smuzhiyun# People who distribute PulseAudio binaries need to also consider that there 23*4882a593Smuzhiyun# are some dependencies to GPL libraries. LGPL code that depends on GPL 24*4882a593Smuzhiyun# libraries probably becomes effectively GPL-licensed (at compile-time? or at 25*4882a593Smuzhiyun# at link-time?). I'm not a lawyer, though, so I'm not sure of the exact 26*4882a593Smuzhiyun# implications. The GPL dependencies only affect the server, not the client 27*4882a593Smuzhiyun# library, with the exception of libdbus that affects both. These are the GPL 28*4882a593Smuzhiyun# library dependencies: 29*4882a593Smuzhiyun# 30*4882a593Smuzhiyun# One of the resampler implementations uses libsamplerate. This recipe doesn't 31*4882a593Smuzhiyun# enable that resampler, however. 32*4882a593Smuzhiyun# 33*4882a593Smuzhiyun# One of the database implementations uses gdbm. This recipe doesn't enable 34*4882a593Smuzhiyun# that database implementation, however. 35*4882a593Smuzhiyun# 36*4882a593Smuzhiyun# module-lirc (enabled by PACKAGECONFIG[lirc]) uses LIRC. 37*4882a593Smuzhiyun# 38*4882a593Smuzhiyun# module-equalizer-sink uses FFTW. This recipe disables that, however. 39*4882a593Smuzhiyun# 40*4882a593Smuzhiyun# The dependency with the most complicated licensing considerations is libdbus. 41*4882a593Smuzhiyun# When PACKAGECONFIG[dbus] is enabled (like it is by default), libdbus will be 42*4882a593Smuzhiyun# used by both the server and the client library (libpulse). Does this affect 43*4882a593Smuzhiyun# applications that use libpulse? It should also be noted that libdbus is 44*4882a593Smuzhiyun# dual-licensed: either GPL-2.0-or-later or AFL-2.0 terms apply. Whose decision 45*4882a593Smuzhiyun# is it which of the licenses apply? What a mess. Some people hold the view that 46*4882a593Smuzhiyun# libdbus is a system library that is covered by the "special exception" in 47*4882a593Smuzhiyun# GPLv2's section 3, and therefore libdbus's GPL license doesn't affect 48*4882a593Smuzhiyun# PulseAudio. 49*4882a593SmuzhiyunLICENSE = "LGPL-2.1-or-later & MIT & BSD-3-Clause" 50*4882a593Smuzhiyun 51*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://LICENSE;md5=0e5cd938de1a7a53ea5adac38cc10c39 \ 52*4882a593Smuzhiyun file://GPL;md5=4325afd396febcb659c36b49533135d4 \ 53*4882a593Smuzhiyun file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \ 54*4882a593Smuzhiyun file://src/modules/echo-cancel/adrian-license.txt;md5=abbab006a561fbffccedf1c3531f34ab \ 55*4882a593Smuzhiyun file://src/pulsecore/filter/LICENSE.WEBKIT;md5=49defbaffddf8c51faf606ff7fc3b1f7 \ 56*4882a593Smuzhiyun file://src/pulsecore/resampler.h;beginline=4;endline=21;md5=09794012ae16912c0270f3280cc8ff84 \ 57*4882a593Smuzhiyun file://src/modules/reserve.h;beginline=6;endline=28;md5=0e23094760367d51b6609750e9b31fbb \ 58*4882a593Smuzhiyun file://src/pulsecore/rtkit.h;beginline=6;endline=29;md5=3f00ff966716ae0817c31576d1473528 \ 59*4882a593Smuzhiyun file://src/modules/echo-cancel/adrian-aec.h;beginline=3;endline=12;md5=d3ed4fad1c073f8b06f37495dc5d1026 \ 60*4882a593Smuzhiyun file://src/pulsecore/filter/biquad.h;beginline=1;endline=4;md5=6d46d1365206528a20137355924233c1 \ 61*4882a593Smuzhiyun" 62*4882a593Smuzhiyun 63*4882a593Smuzhiyun# libtool is needed for libltdl, used in module loading. 64*4882a593SmuzhiyunDEPENDS = "m4-native libatomic-ops libsndfile1 libtool" 65*4882a593Smuzhiyun# optional 66*4882a593SmuzhiyunDEPENDS += "udev alsa-lib glib-2.0" 67*4882a593SmuzhiyunDEPENDS += "speexdsp libxml-parser-perl-native libcap" 68*4882a593Smuzhiyun 69*4882a593Smuzhiyuninherit bash-completion meson pkgconfig useradd gettext perlnative systemd manpages gsettings 70*4882a593Smuzhiyun 71*4882a593Smuzhiyun# *.desktop rules wont be generated during configure and build will fail 72*4882a593Smuzhiyun# if using --disable-nls 73*4882a593SmuzhiyunUSE_NLS = "yes" 74*4882a593Smuzhiyun 75*4882a593SmuzhiyunEXTRA_OEMESON = "\ 76*4882a593Smuzhiyun -Dhal-compat=false \ 77*4882a593Smuzhiyun -Dorc=disabled \ 78*4882a593Smuzhiyun -Daccess_group=audio \ 79*4882a593Smuzhiyun -Dopenssl=disabled \ 80*4882a593Smuzhiyun -Ddatabase=simple \ 81*4882a593Smuzhiyun -Dzshcompletiondir=no \ 82*4882a593Smuzhiyun -Dudevrulesdir=`pkg-config --variable=udevdir udev`/rules.d \ 83*4882a593Smuzhiyun -Dvalgrind=disabled \ 84*4882a593Smuzhiyun -Dtests=false \ 85*4882a593Smuzhiyun -Drunning-from-build-tree=false \ 86*4882a593Smuzhiyun" 87*4882a593Smuzhiyun 88*4882a593Smuzhiyun# soxr (the SoX Resampler library) doesn't seem to be currently packaged in 89*4882a593Smuzhiyun# oe-core nor meta-oe, so let's not add a PACKAGECONFIG entry for it for now. 90*4882a593SmuzhiyunEXTRA_OEMESON += "-Dsoxr=disabled" 91*4882a593Smuzhiyun 92*4882a593Smuzhiyun# The FFTW dependency (for module-equalizer-sink) was removed in commit 93*4882a593Smuzhiyun# ddbd713293 without explaining why it was not made a PACKAGECONFIG item 94*4882a593Smuzhiyun# instead. Oh well, let's keep it disabled until someone expresses some 95*4882a593Smuzhiyun# interest in having it enabled. 96*4882a593SmuzhiyunEXTRA_OEMESON += "-Dfftw=disabled" 97*4882a593Smuzhiyun 98*4882a593Smuzhiyun# The "adrian" echo canceller implementation has a non-standard license 99*4882a593Smuzhiyun# (src/modules/echo-cancel/adrian-license.txt). It's a permissive license, so 100*4882a593Smuzhiyun# the licensing terms are probably not problematic, but it would be an extra 101*4882a593Smuzhiyun# hassle to add the license to OE-Core's set of licenses. The canceller isn't 102*4882a593Smuzhiyun# very good anyway, better alternatives exist (such as the webrtc canceller). 103*4882a593SmuzhiyunEXTRA_OEMESON += "-Dadrian-aec=false" 104*4882a593Smuzhiyun 105*4882a593SmuzhiyunPACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez5', '', d)} \ 106*4882a593Smuzhiyun ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ 107*4882a593Smuzhiyun ${@bb.utils.contains('DISTRO_FEATURES', '3g', 'ofono', '', d)} \ 108*4882a593Smuzhiyun ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd x11', d)} \ 109*4882a593Smuzhiyun dbus gsettings \ 110*4882a593Smuzhiyun " 111*4882a593Smuzhiyun 112*4882a593SmuzhiyunPACKAGECONFIG[dbus] = "-Ddbus=enabled,-Ddbus=disabled,dbus" 113*4882a593SmuzhiyunPACKAGECONFIG[bluez5] = "-Dbluez5=enabled,-Dbluez5=disabled,bluez5 sbc" 114*4882a593SmuzhiyunPACKAGECONFIG[gsettings] = "-Dgsettings=enabled,-Dgsettings=disabled,glib-2.0-native glib-2.0" 115*4882a593SmuzhiyunPACKAGECONFIG[ofono] = "-Dbluez5-ofono-headset=true,-Dbluez5-ofono-headset=false,ofono" 116*4882a593SmuzhiyunPACKAGECONFIG[gtk] = "-Dgtk=enabled,-Dgtk=disabled,gtk+3" 117*4882a593SmuzhiyunPACKAGECONFIG[systemd] = "-Dsystemd=enabled -Dsystemduserunitdir=${systemd_user_unitdir},-Dsystemd=disabled,systemd" 118*4882a593SmuzhiyunPACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 libxtst libice libsm libxcb" 119*4882a593SmuzhiyunPACKAGECONFIG[avahi] = "-Davahi=enabled,-Davahi=disabled,avahi" 120*4882a593SmuzhiyunPACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack" 121*4882a593Smuzhiyun# Since many embedded systems don't have non-root users, it's useful to be 122*4882a593Smuzhiyun# able to use pulseaudio autospawn for root as well. 123*4882a593SmuzhiyunPACKAGECONFIG[autospawn-for-root] = ",,," 124*4882a593SmuzhiyunPACKAGECONFIG[lirc] = "-Dlirc=enabled,-Dlirc=disabled,lirc" 125*4882a593SmuzhiyunPACKAGECONFIG[webrtc] = "-Dwebrtc-aec=enabled,-Dwebrtc-aec=disabled,webrtc-audio-processing" 126*4882a593SmuzhiyunPACKAGECONFIG[ipv6] = "-Dipv6=true,-Dipv6=false," 127*4882a593SmuzhiyunPACKAGECONFIG[manpages] = "-Dman=true,-Dman=false," 128*4882a593Smuzhiyun 129*4882a593Smuzhiyunexport TARGET_PFPU = "${TARGET_FPU}" 130*4882a593Smuzhiyun 131*4882a593Smuzhiyunset_cfg_value () { 132*4882a593Smuzhiyun sed -i -e "s/\(; *\)\?$2 =.*/$2 = $3/" "$1" 133*4882a593Smuzhiyun if ! grep -q "^$2 = $3\$" "$1"; then 134*4882a593Smuzhiyun die "Use of sed to set '$2' to '$3' in '$1' failed" 135*4882a593Smuzhiyun fi 136*4882a593Smuzhiyun} 137*4882a593Smuzhiyun 138*4882a593Smuzhiyundo_compile:append () { 139*4882a593Smuzhiyun if ${@bb.utils.contains('PACKAGECONFIG', 'autospawn-for-root', 'true', 'false', d)}; then 140*4882a593Smuzhiyun set_cfg_value src/pulse/client.conf allow-autospawn-for-root yes 141*4882a593Smuzhiyun fi 142*4882a593Smuzhiyun} 143*4882a593Smuzhiyun 144*4882a593Smuzhiyundo_install:append() { 145*4882a593Smuzhiyun install -d ${D}${sysconfdir}/default/volatiles 146*4882a593Smuzhiyun install -m 0644 ${WORKDIR}/volatiles.04_pulse ${D}${sysconfdir}/default/volatiles/04_pulse 147*4882a593Smuzhiyun} 148*4882a593Smuzhiyun 149*4882a593SmuzhiyunUSERADD_PACKAGES = "pulseaudio-server" 150*4882a593SmuzhiyunGROUPADD_PARAM:pulseaudio-server = "--system pulse" 151*4882a593SmuzhiyunUSERADD_PARAM:pulseaudio-server = "--system --home /var/run/pulse \ 152*4882a593Smuzhiyun --no-create-home --shell /bin/false \ 153*4882a593Smuzhiyun --groups audio,pulse --gid pulse pulse" 154*4882a593Smuzhiyun 155*4882a593SmuzhiyunPACKAGES =+ "\ 156*4882a593Smuzhiyun libpulse \ 157*4882a593Smuzhiyun libpulse-mainloop-glib \ 158*4882a593Smuzhiyun libpulse-simple \ 159*4882a593Smuzhiyun libpulsecommon \ 160*4882a593Smuzhiyun libpulsecore \ 161*4882a593Smuzhiyun ${PN}-pa-info \ 162*4882a593Smuzhiyun ${PN}-server \ 163*4882a593Smuzhiyun ${PN}-misc \ 164*4882a593Smuzhiyun " 165*4882a593Smuzhiyun 166*4882a593Smuzhiyun# The console-kit module is included here explicitly so bitbake can map to the 167*4882a593Smuzhiyun# RDEPENDS we define for it in this recipe, and thereby ensure that when 168*4882a593Smuzhiyun# adding the console-kit module to an image, we also get the necessary 169*4882a593Smuzhiyun# consolekit package produced. 170*4882a593SmuzhiyunPACKAGES =+ "${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'pulseaudio-module-console-kit', '', d)}" 171*4882a593Smuzhiyun 172*4882a593Smuzhiyun#upgrade path: 173*4882a593SmuzhiyunRREPLACES:pulseaudio-server = "libpulse-bin libpulse-conf" 174*4882a593Smuzhiyun 175*4882a593SmuzhiyunPACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*" 176*4882a593Smuzhiyun 177*4882a593SmuzhiyunFILES:libpulsecore = "${libdir}/pulseaudio/libpulsecore*.so" 178*4882a593SmuzhiyunFILES:libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so" 179*4882a593Smuzhiyun 180*4882a593Smuzhiyun# client.conf configures the behaviour of libpulse, so it belongs in the same 181*4882a593Smuzhiyun# package. 182*4882a593SmuzhiyunFILES:libpulse = "${libdir}/libpulse.so.* ${sysconfdir}/pulse/client.conf" 183*4882a593Smuzhiyun 184*4882a593SmuzhiyunFILES:libpulse-simple = "${libdir}/libpulse-simple.so.*" 185*4882a593SmuzhiyunFILES:libpulse-mainloop-glib = "${libdir}/libpulse-mainloop-glib.so.*" 186*4882a593Smuzhiyun 187*4882a593SmuzhiyunFILES:${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la ${datadir}/vala" 188*4882a593SmuzhiyunFILES:${PN}-bin += "${sysconfdir}/default/volatiles/04_pulse" 189*4882a593SmuzhiyunFILES:${PN}-pa-info = "${bindir}/pa-info" 190*4882a593SmuzhiyunFILES:${PN}-server = "${bindir}/pulseaudio ${bindir}/start-* ${sysconfdir} ${bindir}/pactl */udev/rules.d/*.rules */*/udev/rules.d/*.rules ${systemd_user_unitdir}/*" 191*4882a593Smuzhiyun 192*4882a593Smuzhiyun#SYSTEMD_PACKAGES = "${PN}-server" 193*4882a593SmuzhiyunSYSTEMD_SERVICE:${PN}-server = "pulseaudio.service" 194*4882a593Smuzhiyun 195*4882a593SmuzhiyunFILES:${PN}-misc = "${bindir}/* ${libdir}/pulseaudio/libpulsedsp.so" 196*4882a593Smuzhiyun 197*4882a593Smuzhiyun# Allow the pulseaudio package to be created empty as a placeholder (-dbg and -dev depend on it) 198*4882a593SmuzhiyunFILES:${PN} = "" 199*4882a593SmuzhiyunALLOW_EMPTY:${PN} = "1" 200*4882a593Smuzhiyun 201*4882a593SmuzhiyunCONFFILES:libpulse = "${sysconfdir}/pulse/client.conf" 202*4882a593Smuzhiyun 203*4882a593SmuzhiyunCONFFILES:pulseaudio-server = "\ 204*4882a593Smuzhiyun ${sysconfdir}/pulse/default.pa \ 205*4882a593Smuzhiyun ${sysconfdir}/pulse/daemon.conf \ 206*4882a593Smuzhiyun ${sysconfdir}/pulse/system.pa \ 207*4882a593Smuzhiyun " 208*4882a593Smuzhiyun 209*4882a593Smuzhiyunpkg_postinst:${PN}-server() { 210*4882a593Smuzhiyun if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then 211*4882a593Smuzhiyun ${sysconfdir}/init.d/populate-volatile.sh update 212*4882a593Smuzhiyun fi 213*4882a593Smuzhiyun} 214*4882a593Smuzhiyun 215*4882a593Smuzhiyunpython populate_packages:prepend() { 216*4882a593Smuzhiyun plugindir = d.expand('${libdir}/pulse-${PV}/modules/') 217*4882a593Smuzhiyun do_split_packages(d, plugindir, r'^module-(.*)\.so$', '${PN}-module-%s', 'PulseAudio module for %s', extra_depends='', prepend=True) 218*4882a593Smuzhiyun do_split_packages(d, plugindir, r'^lib(.*)\.so$', '${PN}-lib-%s', 'PulseAudio library for %s', extra_depends='', prepend=True) 219*4882a593Smuzhiyun} 220*4882a593Smuzhiyun 221*4882a593Smuzhiyun# pa-info is a bash script that collects information about the audio setup. 222*4882a593Smuzhiyun# It's primarily useful for attaching an information dump when reporting bugs. 223*4882a593SmuzhiyunRDEPENDS:${PN}-pa-info = "\ 224*4882a593Smuzhiyun alsa-utils-amixer \ 225*4882a593Smuzhiyun alsa-utils-aplay \ 226*4882a593Smuzhiyun alsa-utils-scripts \ 227*4882a593Smuzhiyun bash \ 228*4882a593Smuzhiyun ${PN}-server \ 229*4882a593Smuzhiyun " 230*4882a593Smuzhiyun 231*4882a593SmuzhiyunRDEPENDS:pulseaudio-server = " \ 232*4882a593Smuzhiyun pulseaudio-module-filter-apply \ 233*4882a593Smuzhiyun pulseaudio-module-filter-heuristics \ 234*4882a593Smuzhiyun pulseaudio-module-udev-detect \ 235*4882a593Smuzhiyun pulseaudio-module-null-sink \ 236*4882a593Smuzhiyun pulseaudio-module-device-restore \ 237*4882a593Smuzhiyun pulseaudio-module-stream-restore \ 238*4882a593Smuzhiyun pulseaudio-module-card-restore \ 239*4882a593Smuzhiyun pulseaudio-module-augment-properties \ 240*4882a593Smuzhiyun pulseaudio-module-detect \ 241*4882a593Smuzhiyun pulseaudio-module-alsa-sink \ 242*4882a593Smuzhiyun pulseaudio-module-alsa-source \ 243*4882a593Smuzhiyun pulseaudio-module-alsa-card \ 244*4882a593Smuzhiyun pulseaudio-module-native-protocol-unix \ 245*4882a593Smuzhiyun pulseaudio-module-default-device-restore \ 246*4882a593Smuzhiyun pulseaudio-module-intended-roles \ 247*4882a593Smuzhiyun pulseaudio-module-rescue-streams \ 248*4882a593Smuzhiyun pulseaudio-module-always-sink \ 249*4882a593Smuzhiyun pulseaudio-module-suspend-on-idle \ 250*4882a593Smuzhiyun pulseaudio-module-position-event-sounds \ 251*4882a593Smuzhiyun pulseaudio-module-role-cork \ 252*4882a593Smuzhiyun pulseaudio-module-switch-on-port-available" 253*4882a593Smuzhiyun 254*4882a593Smuzhiyun# If the server is installed, it's usually desirable to make ALSA applications 255*4882a593Smuzhiyun# use PulseAudio. alsa-plugins-pulseaudio-conf will install the configuration 256*4882a593Smuzhiyun# that makes the PulseAudio plugin the default ALSA device. 257*4882a593SmuzhiyunRDEPENDS:pulseaudio-server += "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'alsa-plugins-pulseaudio-conf', '', d)}" 258*4882a593Smuzhiyun 259*4882a593Smuzhiyun# pulseaudio-module-console-kit is built whenever dbus is enabled by PACKAGECONFIG 260*4882a593Smuzhiyun# but consolekit depends on libx11 and is available only for DISTRO with x11 in DISTRO_FEATURES 261*4882a593SmuzhiyunRDEPENDS:pulseaudio-module-console-kit =+ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)}" 262*4882a593SmuzhiyunRDEPENDS:pulseaudio-misc += "pulseaudio-module-cli-protocol-unix" 263*4882a593Smuzhiyun 264*4882a593SmuzhiyunFILES:${PN}-module-alsa-card += "${datadir}/pulseaudio/alsa-mixer" 265*4882a593Smuzhiyun 266*4882a593SmuzhiyunGSETTINGS_PACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'gsettings', '${PN}-module-gsettings', '', d)}" 267*4882a593SmuzhiyunFILES:${PN}-module-gsettings += "${libexecdir}/pulse/gsettings-helper ${datadir}/GConf/gsettings ${datadir}/glib-2.0/schemas" 268*4882a593Smuzhiyun 269*4882a593Smuzhiyun# The console-kit module is good to have on X11 systems (it keeps PulseAudio 270*4882a593Smuzhiyun# running for the duration of the user login session). The device-manager and 271*4882a593Smuzhiyun# x11-* modules are referenced from the start-pulseaudio-x11 script, so those 272*4882a593Smuzhiyun# modules must be installed when X11 is enabled. 273*4882a593SmuzhiyunRDEPENDS:pulseaudio-server += "\ 274*4882a593Smuzhiyun ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '\ 275*4882a593Smuzhiyun pulseaudio-module-device-manager \ 276*4882a593Smuzhiyun pulseaudio-module-x11-cork-request \ 277*4882a593Smuzhiyun pulseaudio-module-x11-publish \ 278*4882a593Smuzhiyun pulseaudio-module-x11-xsmp \ 279*4882a593Smuzhiyun ', '', d)}" 280*4882a593Smuzhiyun 281*4882a593SmuzhiyunRDEPENDS:pulseaudio-server += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', \ 282*4882a593Smuzhiyun bb.utils.contains('DISTRO_FEATURES', 'systemd', 'pulseaudio-module-systemd-login', 'pulseaudio-module-console-kit', d), \ 283*4882a593Smuzhiyun '', d)}" 284