summaryrefslogtreecommitdiff
path: root/poky/meta/recipes-multimedia/pulseaudio
diff options
context:
space:
mode:
authorDave Cobbley <david.j.cobbley@linux.intel.com>2018-08-14 20:05:37 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-23 04:26:31 +0300
commiteb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch)
treede291a73dc37168da6370e2cf16c347d1eba9df8 /poky/meta/recipes-multimedia/pulseaudio
parent9c3cf826d853102535ead04cebc2d6023eff3032 (diff)
downloadopenbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers content to the top level. Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/recipes-multimedia/pulseaudio')
-rw-r--r--poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc272
-rw-r--r--poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch97
-rw-r--r--poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch66
-rw-r--r--poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch70
-rw-r--r--poky/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse2
-rw-r--r--poky/meta/recipes-multimedia/pulseaudio/pulseaudio_11.1.bb15
6 files changed, 522 insertions, 0 deletions
diff --git a/poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
new file mode 100644
index 000000000..8189a569e
--- /dev/null
+++ b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
@@ -0,0 +1,272 @@
+SUMMARY = "Sound server for Linux and Unix-like operating systems"
+HOMEPAGE = "http://www.pulseaudio.org"
+AUTHOR = "Lennart Poettering"
+SECTION = "libs/multimedia"
+
+# Most of PulseAudio code is under LGPLv2.1+. There are a few exceptions:
+#
+# The "adrian" echo canceller variant has code under a non-standard permissive
+# license. See src/modules/echo-cancel/adrian-license.txt for details. This
+# recipe disables the adrian echo canceller to avoid hassle with the unusual
+# license.
+#
+# The src/modules/reserve* and src/pulsecore/rtkit* files are under the MIT
+# license.
+#
+# The src/pulsecore/filter/ directory contains code under the 3-clause BSD
+# license.
+#
+# src/utils/qpaeq is licensed under AGPL. qpaeq is not installed by this
+# recipe, however, which is why AGPL is not mentioned in LICENSE.
+#
+# People who distribute PulseAudio binaries need to also consider that there
+# are some dependencies to GPL libraries. LGPL code that depends on GPL
+# libraries probably becomes effectively GPL-licensed (at compile-time? or at
+# at link-time?). I'm not a lawyer, though, so I'm not sure of the exact
+# implications. The GPL dependencies only affect the server, not the client
+# library, with the exception of libdbus that affects both. These are the GPL
+# library dependencies:
+#
+# One of the resampler implementations uses libsamplerate. This recipe doesn't
+# enable that resampler, however.
+#
+# One of the database implementations uses gdbm. This recipe doesn't enable
+# that database implementation, however.
+#
+# module-lirc (enabled by PACKAGECONFIG[lirc]) uses LIRC.
+#
+# module-equalizer-sink uses FFTW. This recipe disables that, however.
+#
+# The dependency with the most complicated licensing considerations is libdbus.
+# When PACKAGECONFIG[dbus] is enabled (like it is by default), libdbus will be
+# used by both the server and the client library (libpulse). Does this affect
+# applications that use libpulse? It should be also noted that libdbus is
+# dual-licensed: either GPLv2+ or AFL-2 terms apply. Whose decision is it which
+# of the licenses apply? What a mess. Some people hold the view that libdbus is
+# a system library that is covered by the "special exception" in GPLv2's
+# section 3, and therefore libdbus's GPL license doesn't affect PulseAudio.
+LICENSE = "LGPLv2.1+ & MIT & BSD-3-Clause"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a848e8d03f04976778eab2348b59ed2b \
+ file://GPL;md5=4325afd396febcb659c36b49533135d4 \
+ file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+ file://AGPL;md5=73f1eb20517c55bf9493b7dd6e480788 \
+ file://src/modules/echo-cancel/adrian-license.txt;md5=abbab006a561fbffccedf1c3531f34ab \
+ file://src/pulsecore/filter/LICENSE.WEBKIT;md5=49defbaffddf8c51faf606ff7fc3b1f7 \
+ file://src/pulsecore/resampler.h;beginline=4;endline=21;md5=09794012ae16912c0270f3280cc8ff84 \
+ file://src/modules/reserve.h;beginline=6;endline=28;md5=0e23094760367d51b6609750e9b31fbb \
+ file://src/pulsecore/rtkit.h;beginline=6;endline=29;md5=3f00ff966716ae0817c31576d1473528 \
+ file://src/utils/qpaeq;beginline=2;endline=16;md5=7f62515a4762f0c3fc3d4201858bb964 \
+ file://src/modules/echo-cancel/adrian-aec.h;beginline=3;endline=12;md5=d3ed4fad1c073f8b06f37495dc5d1026 \
+ file://src/pulsecore/filter/biquad.h;beginline=1;endline=4;md5=6d46d1365206528a20137355924233c1 \
+"
+
+DEPENDS = "libatomic-ops libsndfile1 libtool intltool-native"
+# optional
+DEPENDS += "udev alsa-lib glib-2.0 gconf"
+DEPENDS += "speexdsp libxml-parser-perl-native libcap"
+
+inherit autotools bash-completion pkgconfig useradd gettext perlnative bluetooth systemd manpages
+
+# *.desktop rules wont be generated during configure and build will fail
+# if using --disable-nls
+USE_NLS = "yes"
+
+EXTRA_OECONF = "\
+ --disable-hal-compat \
+ --disable-orc \
+ --enable-tcpwrap=no \
+ --with-access-group=audio \
+ --disable-openssl \
+ --with-database=simple \
+ --without-zsh-completion-dir \
+ --with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d \
+ ac_cv_header_valgrind_memcheck_h=no \
+ --disable-tests \
+"
+
+# soxr (the SoX Resampler library) doesn't seem to be currently packaged in
+# oe-core nor meta-oe, so let's not add a PACKAGECONFIG entry for it for now.
+EXTRA_OECONF += "--without-soxr"
+
+# The FFTW dependency (for module-equalizer-sink) was removed in commit
+# ddbd713293 without explaining why it was not made a PACKAGECONFIG item
+# instead. Oh well, let's keep it disabled until someone expresses some
+# interest in having it enabled.
+#
+# One nice thing about disabling this is that it also prevents qpaeq from
+# being installed, so we avoid adding AGPL to the list of licenses (nothing
+# else in PulseAudio is licensed under AGPL).
+EXTRA_OECONF += "--without-fftw"
+
+# The "adrian" echo canceller implementation has a non-standard license
+# (src/modules/echo-cancel/adrian-license.txt). It's a permissive license, so
+# the licensing terms are probably not problematic, but it would be an extra
+# hassle to add the license to OE-Core's set of licenses. The canceller isn't
+# very good anyway, better alternatives exist (such as the webrtc canceller).
+EXTRA_OECONF += "--disable-adrian-aec"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', '3g', 'ofono', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd x11', d)} \
+ dbus \
+ "
+
+PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
+PACKAGECONFIG[bluez4] = "--enable-bluez4,--disable-bluez4,bluez4 sbc"
+PACKAGECONFIG[bluez5] = "--enable-bluez5,--disable-bluez5,bluez5 sbc"
+PACKAGECONFIG[ofono] = "--enable-bluez5-ofono-headset,--disable-bluez5-ofono-headset,ofono"
+PACKAGECONFIG[gtk] = "--enable-gtk3,--disable-gtk3,gtk+3"
+PACKAGECONFIG[systemd] = "--enable-systemd-daemon --enable-systemd-login --enable-systemd-journal --with-systemduserunitdir=${systemd_user_unitdir},--disable-systemd-daemon --disable-systemd-login --disable-systemd-journal,systemd"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxtst libice libsm libxcb"
+PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
+PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
+# Since many embedded systems don't have non-root users, it's useful to be
+# able to use pulseaudio autospawn for root as well.
+PACKAGECONFIG[autospawn-for-root] = ",,,"
+PACKAGECONFIG[lirc] = "--enable-lirc,--disable-lirc,lirc"
+PACKAGECONFIG[webrtc] = "--enable-webrtc-aec,--disable-webrtc-aec,webrtc-audio-processing"
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, "
+
+EXTRA_OECONF_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
+EXTRA_OECONF_append_armeb = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
+
+
+export TARGET_PFPU = "${TARGET_FPU}"
+
+# TODO: Use more fine granular version
+#OE_LT_RPATH_ALLOW=":${libdir}/pulse-0.9:"
+OE_LT_RPATH_ALLOW = "any"
+OE_LT_RPATH_ALLOW[export]="1"
+
+set_cfg_value () {
+ sed -i -e "s/\(; *\)\?$2 =.*/$2 = $3/" "$1"
+ if ! grep -q "^$2 = $3\$" "$1"; then
+ die "Use of sed to set '$2' to '$3' in '$1' failed"
+ fi
+}
+
+do_compile_append () {
+ if ${@bb.utils.contains('PACKAGECONFIG', 'autospawn-for-root', 'true', 'false', d)}; then
+ set_cfg_value src/client.conf allow-autospawn-for-root yes
+ fi
+}
+
+do_install_append() {
+ install -d ${D}${sysconfdir}/default/volatiles
+ install -m 0644 ${WORKDIR}/volatiles.04_pulse ${D}${sysconfdir}/default/volatiles/volatiles.04_pulse
+}
+
+USERADD_PACKAGES = "pulseaudio-server"
+GROUPADD_PARAM_pulseaudio-server = "--system pulse"
+USERADD_PARAM_pulseaudio-server = "--system --home /var/run/pulse \
+ --no-create-home --shell /bin/false \
+ --groups audio,pulse --gid pulse pulse"
+
+# The console-kit module is included here explicitly so bitbake can map to the
+# RDEPENDS we define for it in this recipe, and thereby ensure that when
+# adding the console-kit module to an image, we also get the necessary
+# consolekit package produced.
+PACKAGES =+ "libpulsecore libpulsecommon libpulse libpulse-simple libpulse-mainloop-glib \
+ pulseaudio-server pulseaudio-misc ${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'pulseaudio-module-console-kit', '', d)}"
+
+#upgrade path:
+RREPLACES_pulseaudio-server = "libpulse-bin libpulse-conf"
+
+PACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*"
+
+FILES_libpulsecore = "${libdir}/pulseaudio/libpulsecore*.so"
+FILES_libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so"
+
+# client.conf configures the behaviour of libpulse, so it belongs in the same
+# package.
+FILES_libpulse = "${libdir}/libpulse.so.* ${sysconfdir}/pulse/client.conf"
+
+FILES_libpulse-simple = "${libdir}/libpulse-simple.so.*"
+FILES_libpulse-mainloop-glib = "${libdir}/libpulse-mainloop-glib.so.*"
+
+FILES_${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la ${datadir}/vala ${libdir}/cmake"
+FILES_${PN}-conf = "${sysconfdir}"
+FILES_${PN}-bin += "${sysconfdir}/default/volatiles/volatiles.04_pulse"
+FILES_${PN}-server = "${bindir}/pulseaudio ${bindir}/start-* ${sysconfdir} ${bindir}/pactl */udev/rules.d/*.rules */*/udev/rules.d/*.rules ${systemd_user_unitdir}/*"
+
+#SYSTEMD_PACKAGES = "${PN}-server"
+SYSTEMD_SERVICE_${PN}-server = "pulseaudio.service"
+
+FILES_${PN}-misc = "${bindir}/* ${libdir}/pulseaudio/libpulsedsp.so"
+
+# Allow the pulseaudio package to be created empty as a placeholder (-dbg and -dev depend on it)
+ALLOW_EMPTY_${PN} = "1"
+
+CONFFILES_libpulse = "${sysconfdir}/pulse/client.conf"
+
+CONFFILES_pulseaudio-server = "\
+ ${sysconfdir}/pulse/default.pa \
+ ${sysconfdir}/pulse/daemon.conf \
+ ${sysconfdir}/pulse/system.pa \
+ "
+
+pkg_postinst_${PN}-server() {
+ if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
+ ${sysconfdir}/init.d/populate-volatile.sh update
+ fi
+}
+
+python populate_packages_prepend() {
+ #d.setVar('PKG_pulseaudio', 'pulseaudio')
+
+ plugindir = d.expand('${libdir}/pulse-${PV}/modules/')
+ do_split_packages(d, plugindir, '^module-(.*)\.so$', 'pulseaudio-module-%s', 'PulseAudio module for %s', extra_depends='', prepend=True)
+ do_split_packages(d, plugindir, '^lib(.*)\.so$', 'pulseaudio-lib-%s', 'PulseAudio library for %s', extra_depends='', prepend=True)
+}
+
+RDEPENDS_pulseaudio-server = " \
+ pulseaudio-module-filter-apply \
+ pulseaudio-module-filter-heuristics \
+ pulseaudio-module-udev-detect \
+ pulseaudio-module-null-sink \
+ pulseaudio-module-device-restore \
+ pulseaudio-module-stream-restore \
+ pulseaudio-module-card-restore \
+ pulseaudio-module-augment-properties \
+ pulseaudio-module-detect \
+ pulseaudio-module-alsa-sink \
+ pulseaudio-module-alsa-source \
+ pulseaudio-module-alsa-card \
+ pulseaudio-module-native-protocol-unix \
+ pulseaudio-module-default-device-restore \
+ pulseaudio-module-intended-roles \
+ pulseaudio-module-rescue-streams \
+ pulseaudio-module-always-sink \
+ pulseaudio-module-suspend-on-idle \
+ pulseaudio-module-position-event-sounds \
+ pulseaudio-module-role-cork \
+ pulseaudio-module-switch-on-port-available"
+
+# If the server is installed, it's usually desirable to make ALSA applications
+# use PulseAudio. alsa-plugins-pulseaudio-conf will install the configuration
+# that makes the PulseAudio plugin the default ALSA device.
+RDEPENDS_pulseaudio-server += "alsa-plugins-pulseaudio-conf"
+
+# pulseaudio-module-console-kit is built whenever dbus is enabled by PACKAGECONFIG
+# but consolekit depends on libx11 and is available only for DISTRO with x11 in DISTRO_FEATURES
+RDEPENDS_pulseaudio-module-console-kit =+ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)}"
+RDEPENDS_pulseaudio-misc += "pulseaudio-module-cli-protocol-unix"
+
+FILES_pulseaudio-module-gconf += "${libexecdir}/pulse/gconf-helper"
+FILES_pulseaudio-module-alsa-card += "${datadir}/pulseaudio/alsa-mixer"
+
+# The console-kit module is good to have on X11 systems (it keeps PulseAudio
+# running for the duration of the user login session). The device-manager and
+# x11-* modules are referenced from the start-pulseaudio-x11 script, so those
+# modules must be installed when X11 is enabled.
+RDEPENDS_pulseaudio-server += "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '\
+ pulseaudio-module-console-kit \
+ pulseaudio-module-device-manager \
+ pulseaudio-module-x11-cork-request \
+ pulseaudio-module-x11-publish \
+ pulseaudio-module-x11-xsmp \
+ ', '', d)}"
diff --git a/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
new file mode 100644
index 000000000..33f7709ae
--- /dev/null
+++ b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
@@ -0,0 +1,97 @@
+From babec3a50dd710d26b72f6c6d43bd79b04e954a6 Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+Date: Tue, 28 Apr 2015 14:32:43 +0300
+Subject: [PATCH] client-conf: Add allow-autospawn-for-root
+
+Usually autospawning for root is a bad idea, since it can easily
+interfere with other users' PulseAudio instances, but in embedded
+environments where only root exists, autospawning is fine.
+
+Upstream-Status: Denied [Upstream hasn't so far been convinced that
+this feature is needed. The view is that running the graphical session
+as root doesn't make sense even on embedded systems, or if it does,
+running PulseAudio in the system mode should be a good solution for
+that use case. If someone can prove otherwise, the patch would
+probably be accepted.]
+
+Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+---
+ man/pulse-client.conf.5.xml.in | 9 +++++++++
+ src/pulse/client-conf.c | 1 +
+ src/pulse/client-conf.h | 1 +
+ src/pulse/client.conf.in | 1 +
+ src/pulse/context.c | 2 +-
+ 5 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/man/pulse-client.conf.5.xml.in b/man/pulse-client.conf.5.xml.in
+index b88898c..e737c96 100644
+--- a/man/pulse-client.conf.5.xml.in
++++ b/man/pulse-client.conf.5.xml.in
+@@ -82,6 +82,15 @@ License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
+ </option>
+
+ <option>
++ <p><opt>allow-autospawn-for-root=</opt> Allow autospawning also for root.
++ Takes a boolean value, defaults to <opt>no</opt>. If the <opt>autospawn
++ </opt> option is disabled, this option has no effect. Autospawning for
++ root is disabled by default, because running PulseAudio as root will
++ interfere with regular users' PulseAudio instances. This option should be
++ enabled only in environments where there are no regular users at all.</p>
++ </option>
++
++ <option>
+ <p><opt>daemon-binary=</opt> Path to the PulseAudio daemon to
+ run when autospawning. Defaults to a path configured at compile
+ time.</p>
+diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
+index a3c9486..9f68ee5 100644
+--- a/src/pulse/client-conf.c
++++ b/src/pulse/client-conf.c
+@@ -138,6 +138,7 @@ void pa_client_conf_load(pa_client_conf *c, bool load_from_x11, bool load_from_e
+ { "default-server", pa_config_parse_string, &c->default_server, NULL },
+ { "default-dbus-server", pa_config_parse_string, &c->default_dbus_server, NULL },
+ { "autospawn", pa_config_parse_bool, &c->autospawn, NULL },
++ { "allow-autospawn-for-root", pa_config_parse_bool, &c->allow_autospawn_for_root, NULL },
+ { "cookie-file", pa_config_parse_string, &c->cookie_file_from_client_conf, NULL },
+ { "disable-shm", pa_config_parse_bool, &c->disable_shm, NULL },
+ { "enable-shm", pa_config_parse_not_bool, &c->disable_shm, NULL },
+diff --git a/src/pulse/client-conf.h b/src/pulse/client-conf.h
+index 7691ec7..19db7ed 100644
+--- a/src/pulse/client-conf.h
++++ b/src/pulse/client-conf.h
+@@ -38,6 +38,7 @@ typedef struct pa_client_conf {
+ char *cookie_file_from_application;
+ char *cookie_file_from_client_conf;
+ bool autospawn, disable_shm, disable_memfd, auto_connect_localhost, auto_connect_display;
++ bool allow_autospawn_for_root;
+ size_t shm_size;
+ } pa_client_conf;
+
+diff --git a/src/pulse/client.conf.in b/src/pulse/client.conf.in
+index 26b7790..69830ef 100644
+--- a/src/pulse/client.conf.in
++++ b/src/pulse/client.conf.in
+@@ -23,6 +23,7 @@
+ ; default-dbus-server =
+
+ ; autospawn = yes
++; allow-autospawn-for-root = no
+ ; daemon-binary = @PA_BINARY@
+ ; extra-arguments = --log-target=syslog
+
+diff --git a/src/pulse/context.c b/src/pulse/context.c
+index 69be5f4..d6e13e8 100644
+--- a/src/pulse/context.c
++++ b/src/pulse/context.c
+@@ -1027,7 +1027,7 @@ int pa_context_connect(
+ if (!(flags & PA_CONTEXT_NOAUTOSPAWN) && c->conf->autospawn) {
+
+ #ifdef HAVE_GETUID
+- if (getuid() == 0)
++ if (!c->conf->allow_autospawn_for_root && getuid() == 0)
+ pa_log_debug("Not doing autospawn since we are root.");
+ else {
+ c->do_autospawn = true;
+--
+2.8.1
+
diff --git a/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch
new file mode 100644
index 000000000..0391f3785
--- /dev/null
+++ b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch
@@ -0,0 +1,66 @@
+From 0cb66c0c5aafd48b63a755860746e70afb332c8d Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanuk@iki.fi>
+Date: Wed, 24 Jan 2018 03:51:49 +0200
+Subject: [PATCH] memfd-wrappers: only define memfd_create() if not already
+ defined
+
+glibc 2.27 is to be released soon, and it will provide memfd_create().
+If glibc provides the function, we must not define it ourselves,
+otherwise building fails due to conflict between the two implementations
+of the same function.
+
+BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=104733
+---
+Upstream-Status: Submitted [https://bugs.freedesktop.org/attachment.cgi?id=136927]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ configure.ac | 3 +++
+ src/pulsecore/memfd-wrappers.h | 7 ++++---
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 77b5ff5..3a71fd8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -607,6 +607,9 @@ AS_IF([test "x$enable_memfd" = "xyes" && test "x$HAVE_MEMFD" = "x0"],
+ [AC_MSG_ERROR([*** Your Linux kernel does not support memfd shared memory.
+ *** Use linux v3.17 or higher for such a feature.])])
+
++AS_IF([test "x$HAVE_MEMFD" = "x1"],
++ AC_CHECK_FUNCS([memfd_create]))
++
+ AC_SUBST(HAVE_MEMFD)
+ AM_CONDITIONAL([HAVE_MEMFD], [test "x$HAVE_MEMFD" = x1])
+ AS_IF([test "x$HAVE_MEMFD" = "x1"], AC_DEFINE([HAVE_MEMFD], 1, [Have memfd shared memory.]))
+diff --git a/src/pulsecore/memfd-wrappers.h b/src/pulsecore/memfd-wrappers.h
+index 3bed9b2..c7aadfd 100644
+--- a/src/pulsecore/memfd-wrappers.h
++++ b/src/pulsecore/memfd-wrappers.h
+@@ -20,13 +20,14 @@
+ License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
+ ***/
+
+-#ifdef HAVE_MEMFD
++#if defined(HAVE_MEMFD) && !defined(HAVE_MEMFD_CREATE)
+
+ #include <sys/syscall.h>
+ #include <fcntl.h>
+
+ /*
+- * No glibc wrappers exist for memfd_create(2), so provide our own.
++ * Before glibc version 2.27 there was no wrapper for memfd_create(2),
++ * so we have to provide our own.
+ *
+ * Also define memfd fcntl sealing macros. While they are already
+ * defined in the kernel header file <linux/fcntl.h>, that file as
+@@ -63,6 +64,6 @@ static inline int memfd_create(const char *name, unsigned int flags) {
+ #define F_SEAL_WRITE 0x0008 /* prevent writes */
+ #endif
+
+-#endif /* HAVE_MEMFD */
++#endif /* HAVE_MEMFD && !HAVE_MEMFD_CREATE */
+
+ #endif
+--
+2.16.1
+
diff --git a/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch
new file mode 100644
index 000000000..85559950e
--- /dev/null
+++ b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch
@@ -0,0 +1,70 @@
+From f6ab3c3aa7a1841c8add04828029356d2a8c88e7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Apr 2015 21:56:31 -0700
+Subject: [PATCH] padsp: Make it compile on musl
+
+break assumptions on glibc and there is no stat64 on non
+glibc C libraries
+
+See pulseaudio bug
+
+https://bugs.freedesktop.org/show_bug.cgi?id=85319
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/utils/padsp.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/src/utils/padsp.c b/src/utils/padsp.c
+index e61373c..684721a 100644
+--- a/src/utils/padsp.c
++++ b/src/utils/padsp.c
+@@ -2368,7 +2368,7 @@ fail:
+ return ret;
+ }
+
+-#ifdef sun
++#ifndef __GLIBC__
+ int ioctl(int fd, int request, ...) {
+ #else
+ int ioctl(int fd, unsigned long request, ...) {
+@@ -2508,10 +2508,13 @@ int stat(const char *pathname, struct stat *buf) {
+
+ return 0;
+ }
+-
+ #ifdef HAVE_OPEN64
+-
++#undef stat64
++#ifdef __GLIBC__
+ int stat64(const char *pathname, struct stat64 *buf) {
++#else
++int stat64(const char *pathname, struct stat *buf) {
++#endif
+ struct stat oldbuf;
+ int ret;
+
+@@ -2544,7 +2547,7 @@ int stat64(const char *pathname, struct stat64 *buf) {
+
+ return 0;
+ }
+-
++#undef open64
+ int open64(const char *filename, int flags, ...) {
+ va_list args;
+ mode_t mode = 0;
+@@ -2670,8 +2673,8 @@ FILE* fopen(const char *filename, const char *mode) {
+ }
+
+ #ifdef HAVE_OPEN64
+-
+-FILE *fopen64(const char *filename, const char *mode) {
++#undef fopen64
++FILE *fopen64(const char *__restrict filename, const char *__restrict mode) {
+
+ debug(DEBUG_LEVEL_VERBOSE, __FILE__": fopen64(%s)\n", filename?filename:"NULL");
+
+--
+2.1.4
+
diff --git a/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse
new file mode 100644
index 000000000..5b1998032
--- /dev/null
+++ b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse
@@ -0,0 +1,2 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d pulse pulse 0755 /var/run/pulse none
diff --git a/poky/meta/recipes-multimedia/pulseaudio/pulseaudio_11.1.bb b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio_11.1.bb
new file mode 100644
index 000000000..245302d2b
--- /dev/null
+++ b/poky/meta/recipes-multimedia/pulseaudio/pulseaudio_11.1.bb
@@ -0,0 +1,15 @@
+require pulseaudio.inc
+
+SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \
+ file://0001-padsp-Make-it-compile-on-musl.patch \
+ file://0001-client-conf-Add-allow-autospawn-for-root.patch \
+ file://volatiles.04_pulse \
+ file://0001-memfd-wrappers-only-define-memfd_create-if-not-alrea.patch \
+ "
+SRC_URI[md5sum] = "390de38231d5cdd6b43ada8939eb74f1"
+SRC_URI[sha256sum] = "f2521c525a77166189e3cb9169f75c2ee2b82fa3fcf9476024fbc2c3a6c9cd9e"
+
+do_compile_prepend() {
+ mkdir -p ${S}/libltdl
+ cp ${STAGING_LIBDIR}/libltdl* ${S}/libltdl
+}