[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v1.0-dev-37-ga37e096

Colin Guthrie gitmailer-noreply at 0pointer.de
Tue Jan 11 03:39:19 PST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  95ccbf73466529e4c65460010955c355452aa0b1 (commit)

- Log -----------------------------------------------------------------
a37e096 build-sys: Make --disable-dbus actually work.
0fae3ad build-sys: Put in specific warnings when there is no udev or DBUS support
1b54599 console-kit: Console Kit support is dependent on DBUS and is thus optional.
4bb8a83 padsp: wrap __open_2 and __open64_2
-----------------------------------------------------------------------

Summary of changes:
 configure.ac             |   95 +++++++++++++++++++++++++++++++--------------
 src/daemon/default.pa.in |    2 +
 src/utils/padsp.c        |   61 +++++++++++++++++++++++++----
 3 files changed, 119 insertions(+), 39 deletions(-)

-----------------------------------------------------------------------

commit 4bb8a83c623dc9aa55b2f16bcb6c225b845ce4d2
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Sat Jan 8 16:25:15 2011 +0100

    padsp: wrap __open_2 and __open64_2
    
    These functions are used in OSS programs where the "flags" parameter for
    open() is not a build-time constant and the build has _FORTIFY_SOURCE
    enabled.

diff --git a/src/utils/padsp.c b/src/utils/padsp.c
index fb756d3..ec0c46d 100644
--- a/src/utils/padsp.c
+++ b/src/utils/padsp.c
@@ -118,6 +118,7 @@ static PA_LLIST_HEAD(fd_info, fd_infos) = NULL;
 static int (*_ioctl)(int, int, void*) = NULL;
 static int (*_close)(int) = NULL;
 static int (*_open)(const char *, int, mode_t) = NULL;
+static int (*___open_2)(const char *, int) = NULL;
 static FILE* (*_fopen)(const char *path, const char *mode) = NULL;
 static int (*_stat)(const char *, struct stat *) = NULL;
 #ifdef _STAT_VER
@@ -125,6 +126,7 @@ static int (*___xstat)(int, const char *, struct stat *) = NULL;
 #endif
 #ifdef HAVE_OPEN64
 static int (*_open64)(const char *, int, mode_t) = NULL;
+static int (*___open64_2)(const char *, int) = NULL;
 static FILE* (*_fopen64)(const char *path, const char *mode) = NULL;
 static int (*_stat64)(const char *, struct stat64 *) = NULL;
 #ifdef _STAT_VER
@@ -157,6 +159,14 @@ do { \
     pthread_mutex_unlock(&func_mutex); \
 } while(0)
 
+#define LOAD___OPEN_2_FUNC() \
+do { \
+    pthread_mutex_lock(&func_mutex); \
+    if (!___open_2) \
+        ___open_2 = (int (*)(const char *, int)) dlsym_fn(RTLD_NEXT, "__open_2"); \
+    pthread_mutex_unlock(&func_mutex); \
+} while(0)
+
 #define LOAD_OPEN64_FUNC() \
 do { \
     pthread_mutex_lock(&func_mutex); \
@@ -165,6 +175,14 @@ do { \
     pthread_mutex_unlock(&func_mutex); \
 } while(0)
 
+#define LOAD___OPEN64_2_FUNC() \
+do { \
+    pthread_mutex_lock(&func_mutex); \
+    if (!___open64_2) \
+        ___open64_2 = (int (*)(const char *, int)) dlsym_fn(RTLD_NEXT, "__open64_2"); \
+    pthread_mutex_unlock(&func_mutex); \
+} while(0)
+
 #define LOAD_CLOSE_FUNC() \
 do { \
     pthread_mutex_lock(&func_mutex); \
@@ -1494,6 +1512,27 @@ int open(const char *filename, int flags, ...) {
     return real_open(filename, flags, mode);
 }
 
+static pa_bool_t is_audio_device_node(const char *path) {
+    return
+        pa_streq(path, "/dev/dsp") ||
+        pa_streq(path, "/dev/adsp") ||
+        pa_streq(path, "/dev/audio") ||
+        pa_streq(path, "/dev/sndstat") ||
+        pa_streq(path, "/dev/mixer");
+}
+
+int __open_2(const char *filename, int flags) {
+    debug(DEBUG_LEVEL_VERBOSE, __FILE__": __open_2(%s)\n", filename?filename:"NULL");
+
+    if ((flags & O_CREAT) ||
+        !filename ||
+        !is_audio_device_node(filename)) {
+        LOAD___OPEN_2_FUNC();
+        return ___open_2(filename, flags);
+    }
+    return real_open(filename, flags, 0);
+}
+
 static int mixer_ioctl(fd_info *i, unsigned long request, void*argp, int *_errno) {
     int ret = -1;
 
@@ -2383,15 +2422,6 @@ int close(int fd) {
     return 0;
 }
 
-static pa_bool_t is_audio_device_node(const char *path) {
-    return
-        pa_streq(path, "/dev/dsp") ||
-        pa_streq(path, "/dev/adsp") ||
-        pa_streq(path, "/dev/audio") ||
-        pa_streq(path, "/dev/sndstat") ||
-        pa_streq(path, "/dev/mixer");
-}
-
 int access(const char *pathname, int mode) {
 
     debug(DEBUG_LEVEL_VERBOSE, __FILE__": access(%s)\n", pathname?pathname:"NULL");
@@ -2527,6 +2557,19 @@ int open64(const char *filename, int flags, ...) {
     return real_open(filename, flags, mode);
 }
 
+int __open64_2(const char *filename, int flags) {
+    debug(DEBUG_LEVEL_VERBOSE, __FILE__": __open64_2(%s)\n", filename?filename:"NULL");
+
+    if ((flags & O_CREAT) ||
+        !filename ||
+        !is_audio_device_node(filename)) {
+        LOAD___OPEN64_2_FUNC();
+        return ___open64_2(filename, flags);
+    }
+
+    return real_open(filename, flags, 0);
+}
+
 #endif
 
 #ifdef _STAT_VER

commit 1b545997adf46e5961ab896f92dece2ee02aee36
Author: Colin Guthrie <cguthrie at mandriva.org>
Date:   Tue Jan 11 10:09:42 2011 +0000

    console-kit: Console Kit support is dependent on DBUS and is thus optional.
    
    Therefore, we must reflect this in the default.pa. Several users
    have reported an error with consolekit when starting a self-built PA
    due to the default config not working properly. This works around the
    issue but we should include a warning on configure about the lack of
    DBUS and udev support as this is a common mistake.

diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in
index f9b9ead..ace0f09 100755
--- a/src/daemon/default.pa.in
+++ b/src/daemon/default.pa.in
@@ -111,7 +111,9 @@ load-module module-suspend-on-idle
 
 ### If autoexit on idle is enabled we want to make sure we only quit
 ### when no local session needs us anymore.
+.ifexists module-console-kit at PA_SOEXT@
 load-module module-console-kit
+.endif
 
 ### Enable positioned event sounds
 load-module module-position-event-sounds

commit 0fae3ad2f8bc05efeff649951427e97e36b6e84f
Author: Colin Guthrie <cguthrie at mandriva.org>
Date:   Tue Jan 11 10:28:02 2011 +0000

    build-sys: Put in specific warnings when there is no udev or DBUS support
    
    Users have often come to me when their build doesn't work and typically
    this is when they do not have dev headers for DBUS and udev installed
    when building. Put in some specific warnings about these optional,
    but critical, elements.
    
    This will likely display this message on platforms where they are not
    available, so patches welcome to hide them in a semi-intelligent way.

diff --git a/configure.ac b/configure.ac
index 5216c01..2f80a42 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1690,3 +1690,27 @@ echo "
     Force preopen:                 ${FORCE_PREOPEN}
     Preopened modules:             ${PREOPEN_MODS}
 "
+
+if test "${ENABLE_DBUS}" = "no" ; then
+   echo "
+===== WARNING WARNING WARNING WARNING WARNING WARNING WARNING =====
+You do not have DBUS support enabled. It is strongly recommended
+that you enable DBUS support if you platform supports it.
+Many parts of PulseAudio use udev, from Console Kit interaction
+to the Device Reservation Protocol to speak to JACK, Bluetooth
+support and even a native control protocol for communicating and
+controling the PulseAudio daemon itself.
+===== WARNING WARNING WARNING WARNING WARNING WARNING WARNING =====
+"
+fi
+
+if test "${ENABLE_UDEV}" = "no" ; then
+   echo "
+===== WARNING WARNING WARNING WARNING WARNING WARNING WARNING =====
+You do not have udev support enabled. It is strongly recommended
+that you enable udev support if you platform supports it as it is
+the primary method used to detect hardware audio devices (on Linux)
+and is thus a critical part of PulseAudio on that platform.
+===== WARNING WARNING WARNING WARNING WARNING WARNING WARNING =====
+"
+fi

commit a37e0963efbdd9ef22561f9c1ab386ee2c09280d
Author: Colin Guthrie <cguthrie at mandriva.org>
Date:   Tue Jan 11 11:26:48 2011 +0000

    build-sys: Make --disable-dbus actually work.
    
    Previously this argument passed to configure only worked if --disable-hal and
    --disable-bluez was also passed which wasn't immediately obvious to the
    untrained compiler.
    
    This change simply makes --disable-dbus disable the other two as well
    and errors out of specific, incompatible --enable/--disable flags
    are provided.
    
    The summary table is also adjusted and intended to try and show the
    dependency relationship a little.

diff --git a/configure.ac b/configure.ac
index 2f80a42..0cffdc1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1188,28 +1188,6 @@ AC_SUBST(UDEV_LIBS)
 AC_SUBST(HAVE_UDEV)
 AM_CONDITIONAL([HAVE_UDEV], [test "x$HAVE_UDEV" = x1])
 
-#### HAL compat support (optional) ####
-
-AC_ARG_ENABLE([hal-compat],
-    AS_HELP_STRING([--disable-hal-compat],[Disable optional HAL->udev transition compatibility support]),
-        [
-            case "${enableval}" in
-                yes) halcompat=yes ;;
-                no) halcompat=no ;;
-                *) AC_MSG_ERROR(bad value ${enableval} for --disable-hal-compat) ;;
-            esac
-        ],
-        [halcompat=auto])
-if test "x${halcompat}" != xno -a "x$HAVE_HAL" = "x0" -a "x$HAVE_UDEV" = "x1" ; then
-    HAVE_HAL_COMPAT=1
-    AC_DEFINE([HAVE_HAL_COMPAT], 1, [Have HAL compatibility.])
-else
-    HAVE_HAL_COMPAT=0
-fi
-
-AC_SUBST(HAVE_HAL_COMPAT)
-AM_CONDITIONAL([HAVE_HAL_COMPAT], [test "x$HAVE_HAL_COMPAT" = x1])
-
 #### BlueZ support (optional) ####
 
 AC_ARG_ENABLE([bluez],
@@ -1253,11 +1231,7 @@ AC_ARG_ENABLE([dbus],
         ],
         [dbus=auto])
 
-if test "x$HAVE_HAL" = x1 ; then
-   dbus=yes
-fi
-
-if test "x${dbus}" != xno || test "x${bluez}" != xno || test "x${hal}" != xno ; then
+if test "x${dbus}" != xno ; then
 
     PKG_CHECK_MODULES(DBUS, [ dbus-1 >= 1.0.0 ],
         [
@@ -1284,6 +1258,43 @@ AC_SUBST(DBUS_LIBS)
 AC_SUBST(HAVE_DBUS)
 AM_CONDITIONAL([HAVE_DBUS], [test "x$HAVE_DBUS" = x1])
 
+
+# udev and HAL depend on DBUS: So double check if they were explicitly enabled.
+if test "x$HAVE_DBUS" != "x1" ; then
+    HAVE_HAL=0
+    if test "x${hal}" = xyes ; then
+        AC_MSG_ERROR([*** D-Bus support is required by HAL])
+    fi
+
+    HAVE_BLUEZ=0
+    if test "x${bluez}" = xyes ; then
+        AC_MSG_ERROR([*** D-Bus support is required by BLUEZ])
+    fi
+fi
+
+
+#### HAL compat support (optional) ####
+
+AC_ARG_ENABLE([hal-compat],
+    AS_HELP_STRING([--disable-hal-compat],[Disable optional HAL->udev transition compatibility support]),
+        [
+            case "${enableval}" in
+                yes) halcompat=yes ;;
+                no) halcompat=no ;;
+                *) AC_MSG_ERROR(bad value ${enableval} for --disable-hal-compat) ;;
+            esac
+        ],
+        [halcompat=auto])
+if test "x${halcompat}" != xno -a "x$HAVE_HAL" = "x0" -a "x$HAVE_UDEV" = "x1" ; then
+    HAVE_HAL_COMPAT=1
+    AC_DEFINE([HAVE_HAL_COMPAT], 1, [Have HAL compatibility.])
+else
+    HAVE_HAL_COMPAT=0
+fi
+
+AC_SUBST(HAVE_HAL_COMPAT)
+AM_CONDITIONAL([HAVE_HAL_COMPAT], [test "x$HAVE_HAL_COMPAT" = x1])
+
 ### IPv6 connection support (optional) ###
 
 AC_ARG_ENABLE([ipv6],
@@ -1669,10 +1680,10 @@ echo "
     Enable Async DNS:              ${ENABLE_LIBASYNCNS}
     Enable LIRC:                   ${ENABLE_LIRC}
     Enable DBUS:                   ${ENABLE_DBUS}
-    Enable HAL:                    ${ENABLE_HAL}
+      Enable HAL:                  ${ENABLE_HAL}
+      Enable BlueZ:                ${ENABLE_BLUEZ}
     Enable udev:                   ${ENABLE_UDEV}
-    Enable HAL->udev compat:       ${ENABLE_HAL_COMPAT}
-    Enable BlueZ:                  ${ENABLE_BLUEZ}
+      Enable HAL->udev compat:     ${ENABLE_HAL_COMPAT}
     Enable TCP Wrappers:           ${ENABLE_TCPWRAP}
     Enable libsamplerate:          ${ENABLE_LIBSAMPLERATE}
     Enable IPv6:                   ${ENABLE_IPV6}

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list