Permalink
Browse files

FL-366, FL-579: fix pulseaudio dbus start error

  • Loading branch information...
1 parent 082b5e3 commit 6b4ae1e42e08ff57f499e5654df21ba57258cc82 @angryvincent angryvincent committed Jun 13, 2013
@@ -0,0 +1,3 @@
+DIST pulseaudio-2.1.tar.xz 1355004 SHA256 ef6b347bf47abfb98080795f1583018ac959b4aeb4df916b879f9e1eaba0ca7f SHA512 56b672968ae32dcaa5520b8199ed603f4f1223c7884ee6ad1ddf0ee796b1859784c262eef749504f996638f68bf2b213dd0ad1e9cddfb342e2795300ff9972b6 WHIRLPOOL cf4e38d868b67e1cf3fe610d8759a922c7a71040d923844ea0168b00b756b51882580504a7d876e470d0a6ad523a643ddb1559424d8786bc4d9ce457b4a855ea
+DIST pulseaudio-3.0.tar.xz 1367468 SHA256 c90bfda29605942d08e3e218ef10e3c660506a06651a616bfbb6a6df8392836d SHA512 965d6f2472f1b15b600b4578cfbfcb6bbe6be2e7661c0672216141118e34caba3046a026aed69d4fc6ae82b7190bc64e00cf03fb638a872b5d0d25c7c3e10514 WHIRLPOOL 79813545993c7a6291550a471d5e32826438c72060ca07051a455a23c8695de5e1d30d104bec01ec29552e5e8d72448f393536d5b81c50d6371e29567ba937bc
+DIST pulseaudio-4.0.tar.xz 1392072 SHA256 35ceb36bb1822fe54f0b5e4863b4f486769fdfb8ff2111f01fd8778928f9cdae SHA512 7cfb57b15943ec5239f23b90637ab7ab421ac57cf05312030bb348ee7d72a70343716b9bf79035b2426e820984cf8179285548b8acf0b7232defcd8b9ad32e83 WHIRLPOOL 41b69fa34648b484beb3fd81cd4756bdc8bbedf4e102d792e2f48b57f62e532f496e9f0146feabbfe37bd91f0d4f7402105a56d58a9b053bb0de3ac6ad233467
@@ -0,0 +1,102 @@
+From e5b136fc0fde751df3a94cd64855a74732dd4cc7 Mon Sep 17 00:00:00 2001
+From: Arun Raghavan <arun.raghavan@collabora.co.uk>
+Date: Fri, 26 Nov 2010 11:55:57 +0530
+Subject: [PATCH] volume: Add explicit checks for ARMv6 instructions
+
+This ensures that the build does not fail if the ssat and pkhbt
+instructions are not available (armv5te and below).
+
+Fixes: http://www.pulseaudio.org/ticket/790
+---
+ configure.ac | 33 ++++++++++++++++++++++++++++++++-
+ src/pulsecore/svolume_arm.c | 8 ++++----
+ 2 files changed, 36 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7ab42dc..3df8c6b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -230,7 +230,7 @@ else
+ [pulseaudio_cv_support_arm_atomic_ops=no])
+ ])
+ AS_IF([test "$pulseaudio_cv_support_arm_atomic_ops" = "yes"], [
+- AC_DEFINE([ATOMIC_ARM_INLINE_ASM], 1, [Have ARMv6 instructions.])
++ AC_DEFINE([ATOMIC_ARM_INLINE_ASM], 1, [Have ARM atomic instructions.])
+ need_libatomic_ops=no
+ ])
+ fi
+@@ -249,6 +249,37 @@ else
+ esac
+ fi
+
++# If we're on ARM, check for the ARMV6 instructions we need */
++case $host in
++ arm*)
++ AC_CACHE_CHECK([support for required armv6 instructions],
++ pulseaudio_cv_support_armv6,
++ [AC_COMPILE_IFELSE(
++ AC_LANG_PROGRAM([],
++ [[volatile int a = -60000, b = 0xaaaabbbb, c = 0xccccdddd;
++ asm volatile ("ldr r0, %2 \n"
++ "ldr r2, %3 \n"
++ "ldr r3, %4 \n"
++ "ssat r1, #8, r0 \n"
++ "str r1, %0 \n"
++ "pkhbt r1, r3, r2, LSL #8 \n"
++ "str r1, %1 \n"
++ : "=m" (a), "=m" (b)
++ : "m" (a), "m" (b), "m" (c)
++ : "r0", "r1", "r2", "r3", "cc");
++ return (a == -128 && b == 0xaabbdddd) ? 0 : -1;
++ ]]),
++ [pulseaudio_cv_support_armv6=yes],
++ [pulseaudio_cv_support_armv6=no])
++ ])
++ AS_IF([test "$pulseaudio_cv_support_armv6" = "yes"], [
++ AC_DEFINE([HAVE_ARMV6], 1, [Have ARMv6 instructions.])
++ ])
++ ;;
++ *)
++ ;;
++esac
++
+ CC_CHECK_TLS
+
+ AC_CACHE_CHECK([whether $CC knows _Bool],
+diff --git a/src/pulsecore/svolume_arm.c b/src/pulsecore/svolume_arm.c
+index fdd8f09..3973e51 100644
+--- a/src/pulsecore/svolume_arm.c
++++ b/src/pulsecore/svolume_arm.c
+@@ -35,7 +35,7 @@
+ #include "sample-util.h"
+ #include "endianmacros.h"
+
+-#if defined (__arm__)
++#if defined (__arm__) && defined (HAVE_ARMV6)
+
+ #define MOD_INC() \
+ " subs r0, r6, %2 \n\t" \
+@@ -182,11 +182,11 @@ static void run_test (void) {
+ }
+ #endif
+
+-#endif /* defined (__arm__) */
++#endif /* defined (__arm__) && defined (HAVE_ARMV6) */
+
+
+ void pa_volume_func_init_arm (pa_cpu_arm_flag_t flags) {
+-#if defined (__arm__)
++#if defined (__arm__) && defined (HAVE_ARMV6)
+ pa_log_info("Initialising ARM optimized functions.");
+
+ #ifdef RUN_TEST
+@@ -194,5 +194,5 @@ void pa_volume_func_init_arm (pa_cpu_arm_flag_t flags) {
+ #endif
+
+ pa_set_volume_func (PA_SAMPLE_S16NE, (pa_do_volume_func_t) pa_volume_s16ne_arm);
+-#endif /* defined (__arm__) */
++#endif /* defined (__arm__) && defined (HAVE_ARMV6) */
+ }
+--
+1.7.3.2
+
@@ -0,0 +1,124 @@
+From b72fc9b4f158bafb66a7de28ce038986d96ce850 Mon Sep 17 00:00:00 2001
+From: Arnaud Fontaine <arnau@debian.org>
+Date: Tue, 29 Mar 2011 22:56:28 +0159
+Subject: [PATCH] x11: More XCB fixes.
+
+Commit 65ef80b fixed building with xcb-util >= 0.3.8, but the reply is never
+checked (possible SIGSEGV if the reply is NULL) nor freed (memory leak at each
+call of the functions).
+
+Also, remove include and dependencies on xcb-atom, as it was only meaningful
+for xcb_atom_get() and STRING, and depend instead on xcb >= 1.6 for
+XCB_ATOM_STRING.
+---
+ configure.ac | 2 +-
+ src/pulsecore/x11prop.c | 38 +++++++++++++++++++++++++-------------
+ 2 files changed, 26 insertions(+), 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 299dd49..ed9bd17 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -547,7 +547,7 @@ AC_ARG_ENABLE([x11],
+ [x11=auto])
+
+ if test "x${x11}" != xno ; then
+- PKG_CHECK_MODULES(X11, [ x11-xcb ice sm xtst xcb-atom ],
++ PKG_CHECK_MODULES(X11, [ x11-xcb xcb >= 1.6 ice sm xtst ],
+ HAVE_X11=1,
+ [
+ HAVE_X11=0
+diff --git a/src/pulsecore/x11prop.c b/src/pulsecore/x11prop.c
+index d66c48f..8fca219 100644
+--- a/src/pulsecore/x11prop.c
++++ b/src/pulsecore/x11prop.c
+@@ -30,7 +30,6 @@
+ #include <pulsecore/macro.h>
+
+ #include <xcb/xproto.h>
+-#include <xcb/xcb_atom.h>
+
+ #define PA_XCB_FORMAT 8
+
+@@ -50,7 +49,6 @@ static xcb_screen_t *screen_of_display(xcb_connection_t *xcb, int screen)
+
+ void pa_x11_set_prop(xcb_connection_t *xcb, int screen, const char *name, const char *data) {
+ xcb_screen_t *xs;
+- xcb_intern_atom_cookie_t cookie;
+ xcb_intern_atom_reply_t *reply;
+
+ pa_assert(xcb);
+@@ -58,26 +56,36 @@ void pa_x11_set_prop(xcb_connection_t *xcb, int screen, const char *name, const
+ pa_assert(data);
+
+ if ((xs = screen_of_display(xcb, screen))) {
+- cookie = xcb_intern_atom(xcb, 0, strlen(name), name);
+- reply = xcb_intern_atom_reply(xcb, cookie, NULL);
++ reply = xcb_intern_atom_reply(xcb,
++ xcb_intern_atom(xcb, 0, strlen(name), name),
++ NULL);
+
+- xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, reply->atom, XCB_ATOM_STRING, PA_XCB_FORMAT, (int) strlen(data), (const void*) data);
++ if (reply) {
++ xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, reply->atom,
++ XCB_ATOM_STRING, PA_XCB_FORMAT,
++ (int) strlen(data), (const void*) data);
++
++ free(reply);
++ }
+ }
+ }
+
+ void pa_x11_del_prop(xcb_connection_t *xcb, int screen, const char *name) {
+ xcb_screen_t *xs;
+- xcb_intern_atom_cookie_t cookie;
+ xcb_intern_atom_reply_t *reply;
+
+ pa_assert(xcb);
+ pa_assert(name);
+
+ if ((xs = screen_of_display(xcb, screen))) {
+- cookie = xcb_intern_atom(xcb, 0, strlen(name), name);
+- reply = xcb_intern_atom_reply(xcb, cookie, NULL);
+-
+- xcb_delete_property(xcb, xs->root, reply->atom);
++ reply = xcb_intern_atom_reply(xcb,
++ xcb_intern_atom(xcb, 0, strlen(name), name),
++ NULL);
++
++ if (reply) {
++ xcb_delete_property(xcb, xs->root, reply->atom);
++ free(reply);
++ }
+ }
+ }
+
+@@ -87,7 +95,6 @@ char* pa_x11_get_prop(xcb_connection_t *xcb, int screen, const char *name, char
+ xcb_get_property_cookie_t req;
+ xcb_get_property_reply_t* prop = NULL;
+ xcb_screen_t *xs;
+- xcb_intern_atom_cookie_t cookie;
+ xcb_intern_atom_reply_t *reply;
+
+ pa_assert(xcb);
+@@ -106,10 +113,15 @@ char* pa_x11_get_prop(xcb_connection_t *xcb, int screen, const char *name, char
+ xs = screen_of_display(xcb, 0);
+
+ if (xs) {
+- cookie = xcb_intern_atom(xcb, 0, strlen(name), name);
+- reply = xcb_intern_atom_reply(xcb, cookie, NULL);
++ reply = xcb_intern_atom_reply(xcb,
++ xcb_intern_atom(xcb, 0, strlen(name), name),
++ NULL);
++
++ if (!reply)
++ goto finish;
+
+ req = xcb_get_property(xcb, 0, xs->root, reply->atom, XCB_ATOM_STRING, 0, (uint32_t)(l-1));
++ free(reply);
+ prop = xcb_get_property_reply(xcb, req, NULL);
+
+ if (!prop)
+--
+1.6.3.3
+
@@ -0,0 +1,83 @@
+From 9cee2891e8ccd4b26b16449c120ac17e01aa1b36 Mon Sep 17 00:00:00 2001
+From: Maciej Grela <maciej.grela@gmail.com>
+Date: Tue, 29 Mar 2011 22:56:28 +0159
+Subject: [PATCH] x11: Fix build errors with newest xcb-util.
+
+The xcb_atom_get functions were removed from xcb-util. Changed these to
+xcb_intern_atom/xcb_intern_atom_reply. Also, STRING is now
+XCB_ATOM_STRING.
+---
+ src/pulsecore/x11prop.c | 26 +++++++++++++++++---------
+ 1 files changed, 17 insertions(+), 9 deletions(-)
+
+diff --git a/src/pulsecore/x11prop.c b/src/pulsecore/x11prop.c
+index 8df3278..99ea55d 100644
+--- a/src/pulsecore/x11prop.c
++++ b/src/pulsecore/x11prop.c
+@@ -49,28 +49,34 @@ static xcb_screen_t *screen_of_display(xcb_connection_t *xcb, int screen) {
+
+ void pa_x11_set_prop(xcb_connection_t *xcb, int screen, const char *name, const char *data) {
+ xcb_screen_t *xs;
+- xcb_atom_t a;
++ xcb_intern_atom_cookie_t cookie;
++ xcb_intern_atom_reply_t *reply;
+
+ pa_assert(xcb);
+ pa_assert(name);
+ pa_assert(data);
+
+ if ((xs = screen_of_display(xcb, screen))) {
+- a = xcb_atom_get(xcb, name);
+- xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, a, STRING, PA_XCB_FORMAT, (int) strlen(data), (const void*) data);
++ cookie = xcb_intern_atom(xcb, 0, strlen(name), name);
++ reply = xcb_intern_atom_reply(xcb, cookie, NULL);
++
++ xcb_change_property(xcb, XCB_PROP_MODE_REPLACE, xs->root, reply->atom, XCB_ATOM_STRING, PA_XCB_FORMAT, (int) strlen(data), (const void*) data);
+ }
+ }
+
+ void pa_x11_del_prop(xcb_connection_t *xcb, int screen, const char *name) {
+ xcb_screen_t *xs;
+- xcb_atom_t a;
++ xcb_intern_atom_cookie_t cookie;
++ xcb_intern_atom_reply_t *reply;
+
+ pa_assert(xcb);
+ pa_assert(name);
+
+ if ((xs = screen_of_display(xcb, screen))) {
+- a = xcb_atom_get(xcb, name);
+- xcb_delete_property(xcb, xs->root, a);
++ cookie = xcb_intern_atom(xcb, 0, strlen(name), name);
++ reply = xcb_intern_atom_reply(xcb, cookie, NULL);
++
++ xcb_delete_property(xcb, xs->root, reply->atom);
+ }
+ }
+
+@@ -80,7 +86,8 @@ char* pa_x11_get_prop(xcb_connection_t *xcb, int screen, const char *name, char
+ xcb_get_property_cookie_t req;
+ xcb_get_property_reply_t* prop = NULL;
+ xcb_screen_t *xs;
+- xcb_atom_t a;
++ xcb_intern_atom_cookie_t cookie;
++ xcb_intern_atom_reply_t *reply;
+
+ pa_assert(xcb);
+ pa_assert(name);
+@@ -98,9 +105,10 @@ char* pa_x11_get_prop(xcb_connection_t *xcb, int screen, const char *name, char
+ xs = screen_of_display(xcb, 0);
+
+ if (xs) {
+- a = xcb_atom_get(xcb, name);
++ cookie = xcb_intern_atom(xcb, 0, strlen(name), name);
++ reply = xcb_intern_atom_reply(xcb, cookie, NULL);
+
+- req = xcb_get_property(xcb, 0, xs->root, a, STRING, 0, (uint32_t)(l-1));
++ req = xcb_get_property(xcb, 0, xs->root, reply->atom, XCB_ATOM_STRING, 0, (uint32_t)(l-1));
+ prop = xcb_get_property_reply(xcb, req, NULL);
+
+ if (!prop)
+--
+1.7.4.1
+
@@ -0,0 +1,42 @@
+commit 42881d277014d3bf3bb1b4e660c80378b4081a52
+Author: Arun Raghavan <arun.raghavan@collabora.co.uk>
+Date: Mon Nov 14 13:42:21 2011 +0530
+
+ core: Look up /etc/machine-id if D-Bus machine-id is not found
+
+ It appears that this is currently the fallback for early boot and other
+ such cases where /var might not be available. Relevant upstream commit:
+
+ http://cgit.freedesktop.org/dbus/dbus/commit/?id=66e52541d5bdd4927a5c702963749760643313f4
+
+ Thanks to Samuli Suominen <ssuominen@gentoo.org> for pointing this out
+ in https://bugs.gentoo.org/show_bug.cgi?id=390287
+
+diff --git a/configure.ac b/configure.ac
+index 324e32e..1f65dd5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -935,6 +935,9 @@ AS_IF([test "x$HAVE_DBUS" = "x1"], AC_DEFINE([HAVE_DBUS], 1, [Have D-Bus.]))
+
+ PA_MACHINE_ID="${localstatedir}/lib/dbus/machine-id"
+ AX_DEFINE_DIR(PA_MACHINE_ID, PA_MACHINE_ID, [D-Bus machine-id file])
++PA_MACHINE_ID_FALLBACK="${sysconfdir}/machine-id"
++AX_DEFINE_DIR(PA_MACHINE_ID_FALLBACK, PA_MACHINE_ID_FALLBACK,
++ [Fallback machine-id file])
+
+ #### HAL support (optional), dependant on D-Bus ####
+
+diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
+index 79c8e08..0173135 100644
+--- a/src/pulsecore/core-util.c
++++ b/src/pulsecore/core-util.c
+@@ -2717,7 +2717,8 @@ char *pa_machine_id(void) {
+ * since it fits perfectly our needs and is not as volatile as the
+ * hostname which might be set from dhcp. */
+
+- if ((f = pa_fopen_cloexec(PA_MACHINE_ID, "r"))) {
++ if ((f = pa_fopen_cloexec(PA_MACHINE_ID, "r")) ||
++ (f = pa_fopen_cloexec(PA_MACHINE_ID_FALLBACK, "r"))) {
+ char ln[34] = "", *r;
+
+ r = fgets(ln, sizeof(ln)-1, f);
Oops, something went wrong.

0 comments on commit 6b4ae1e

Please sign in to comment.