[pulseaudio-commits] 8 commits - configure.ac LICENSE src/modules src/pulsecore

Colin Guthrie colin at kemper.freedesktop.org
Sun Nov 27 07:06:01 PST 2011


 LICENSE                                |   20 ++++++++++----------
 configure.ac                           |    3 +++
 src/modules/bluetooth/bluetooth-util.c |    2 +-
 src/pulsecore/device-port.h            |    6 +++---
 src/pulsecore/pstream.c                |    7 +++++--
 src/pulsecore/resampler.c              |   25 ++++++++++++++++---------
 6 files changed, 38 insertions(+), 25 deletions(-)

New commits:
commit e199077eca9b56ba43897fe25dffb224519f67fa
Author: Mikel Astiz <mikel.astiz at bmw-carit.de>
Date:   Wed Nov 23 17:08:11 2011 +0100

    bluetooth: Fix property reply handling for hfgw

diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index 2e4d93c..c5befe3 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -484,7 +484,7 @@ static void get_properties_reply(DBusPendingCall *pending, void *userdata) {
                     goto finish;
 
             }  else if (dbus_message_has_interface(p->message, "org.bluez.HandsfreeGateway")) {
-                if (parse_audio_property(y, &d->hfgw_state, &arg_i) < 0)
+                if (parse_audio_property(y, &d->hfgw_state, &dict_i) < 0)
                     goto finish;
 
             }

commit 8539fe9765e5713f9863ab15d0c5b42189f98ae2
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Wed Nov 23 11:40:08 2011 +0100

    resamplers: Optimize trivial resampler
    
    This improves the performance of a typical s16 2ch resampling by 88%.

diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index 32a6071..c432a6f 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -1376,6 +1376,7 @@ static void trivial_resample(pa_resampler *r, const pa_memchunk *input, unsigned
     pa_assert(input);
     pa_assert(output);
     pa_assert(out_n_frames);
+    pa_assert(r->i_ss.channels == r->o_ss.channels);
 
     fz = r->w_sz * r->o_ss.channels;
 
@@ -1391,7 +1392,16 @@ static void trivial_resample(pa_resampler *r, const pa_memchunk *input, unsigned
 
         pa_assert_fp(o_index * fz < pa_memblock_get_length(output->memblock));
 
-        memcpy((uint8_t*) dst + fz * o_index, (uint8_t*) src + fz * i_index, (int) fz);
+        /* Directly assign some common sample sizes, use memcpy as fallback */
+        if (r->w_sz == 2) {
+            for (unsigned c = 0; c < r->o_ss.channels; c++)
+                ((uint16_t *) dst)[o_index+c] = ((uint16_t *) src)[i_index+c];
+        } else if (r->w_sz == 4) {
+            for (unsigned c = 0; c < r->o_ss.channels; c++)
+                ((uint32_t *) dst)[o_index+c] = ((uint32_t *) src)[i_index+c];
+        } else {
+            memcpy((uint8_t *) dst + fz * o_index, (uint8_t *) src + fz * i_index, (int) fz);
+        }
     }
 
     pa_memblock_release(input->memblock);

commit 61890ae20d823f0e64b6f88654a470bd0f334248
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Wed Nov 23 11:40:07 2011 +0100

    resamplers: Use better variable name in trivial resampler

diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index c3b6df1..32a6071 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -1369,7 +1369,7 @@ static int speex_init(pa_resampler *r) {
 
 static void trivial_resample(pa_resampler *r, const pa_memchunk *input, unsigned in_n_frames, pa_memchunk *output, unsigned *out_n_frames) {
     size_t fz;
-    unsigned o_index;
+    unsigned i_index, o_index;
     void *src, *dst;
 
     pa_assert(r);
@@ -1383,18 +1383,15 @@ static void trivial_resample(pa_resampler *r, const pa_memchunk *input, unsigned
     dst = (uint8_t*) pa_memblock_acquire(output->memblock) + output->index;
 
     for (o_index = 0;; o_index++, r->trivial.o_counter++) {
-        unsigned j;
-
-        j = ((r->trivial.o_counter * r->i_ss.rate) / r->o_ss.rate);
-        j = j > r->trivial.i_counter ? j - r->trivial.i_counter : 0;
+        i_index = (r->trivial.o_counter * r->i_ss.rate) / r->o_ss.rate;
+        i_index = i_index > r->trivial.i_counter ? i_index - r->trivial.i_counter : 0;
 
-        if (j >= in_n_frames)
+        if (i_index >= in_n_frames)
             break;
 
         pa_assert_fp(o_index * fz < pa_memblock_get_length(output->memblock));
 
-        memcpy((uint8_t*) dst + fz * o_index,
-                   (uint8_t*) src + fz * j, (int) fz);
+        memcpy((uint8_t*) dst + fz * o_index, (uint8_t*) src + fz * i_index, (int) fz);
     }
 
     pa_memblock_release(input->memblock);

commit 3e4513290a0d6ca52d90f18b320173eb555b4c45
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Wed Nov 23 11:40:06 2011 +0100

    build-sys: Disable fastpath asserts by default

diff --git a/configure.ac b/configure.ac
index 60ecd0b..b15b1e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -157,6 +157,9 @@ AX_APPEND_COMPILE_FLAGS(
     [-Wall -W -Wextra -pipe -Wno-long-long -Wvla -Wno-overlength-strings -Wunsafe-loop-optimizations -Wundef -Wformat=2 -Wlogical-op -Wsign-compare -Wformat-security -Wmissing-include-dirs -Wformat-nonliteral -Wold-style-definition -Wpointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls -Wmissing-declarations -Wmissing-noreturn -Wshadow -Wendif-labels -Wcast-align -Wstrict-aliasing -Wwrite-strings -Wno-unused-parameter -ffast-math -Wp,-D_FORTIFY_SOURCE=2 -fno-common -fdiagnostics-show-option],
     [], [-pedantic -Werror])
 
+# Only enable fastpath asserts when doing a debug build, e.g. from bootstrap.sh.
+AS_CASE([" $CFLAGS "], [*" -O0 "*], [], [AX_APPEND_FLAG(["-DFASTPATH"], [CPPFLAGS])])
+
 
 #### Linker flags ####
 

commit 761fbee66393c20fca3d2a6ad381ed9a2bb862bd
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Wed Nov 23 11:40:05 2011 +0100

    resamplers: Use fastpath assert in trivial resampler
    
    When the assert is disabled, the trivial resampler gets a 35% performance boost.

diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index d4a7204..c3b6df1 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -1391,7 +1391,7 @@ static void trivial_resample(pa_resampler *r, const pa_memchunk *input, unsigned
         if (j >= in_n_frames)
             break;
 
-        pa_assert(o_index * fz < pa_memblock_get_length(output->memblock));
+        pa_assert_fp(o_index * fz < pa_memblock_get_length(output->memblock));
 
         memcpy((uint8_t*) dst + fz * o_index,
                    (uint8_t*) src + fz * j, (int) fz);

commit 5aedb9b7d3422b9d38a79500d9fbe3a813bc6050
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Tue Nov 22 16:09:18 2011 +0100

    pulsecore: Hardcode FRAME_SIZE_MAX_ALLOW
    
    Instead of using PA_SCACHE_ENTRY_SIZE_MAX, the size for FRAME_SIZE_MAX_ALLOW is
    set directly to the same value.  This removes the need for the core-scache.h
    include, which caused an unwanted dependency of libpulsecommon on libpulsecore.
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=41539

diff --git a/src/pulsecore/pstream.c b/src/pulsecore/pstream.c
index 3e59fc4..b08f6a6 100644
--- a/src/pulsecore/pstream.c
+++ b/src/pulsecore/pstream.c
@@ -37,7 +37,6 @@
 #include <pulsecore/socket.h>
 #include <pulsecore/queue.h>
 #include <pulsecore/log.h>
-#include <pulsecore/core-scache.h>
 #include <pulsecore/creds.h>
 #include <pulsecore/refcnt.h>
 #include <pulsecore/flist.h>
@@ -74,7 +73,11 @@ enum {
 typedef uint32_t pa_pstream_descriptor[PA_PSTREAM_DESCRIPTOR_MAX];
 
 #define PA_PSTREAM_DESCRIPTOR_SIZE (PA_PSTREAM_DESCRIPTOR_MAX*sizeof(uint32_t))
-#define FRAME_SIZE_MAX_ALLOW PA_SCACHE_ENTRY_SIZE_MAX /* allow uploading a single sample in one frame at max */
+
+/* To allow uploading a single sample in one frame, this value should be the
+ * same size (16 MB) as PA_SCACHE_ENTRY_SIZE_MAX from pulsecore/core-scache.h.
+ */
+#define FRAME_SIZE_MAX_ALLOW (1024*1024*16)
 
 PA_STATIC_FLIST_DECLARE(items, 0, pa_xfree);
 

commit ba2dee08ba36d8b3922d76b2761480ca8e17e462
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Tue Nov 22 16:08:48 2011 +0100

    Update LICENSE
    
    Mention gdbm, lirc and fftw there.

diff --git a/LICENSE b/LICENSE
index b312c44..cd5e42f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -2,16 +2,16 @@ All PulseAudio source files are licensed under the GNU Lesser General Public
 License. (see file LGPL for details)
 
 However, the server side has optional GPL dependencies.  These include the
-libsamplerate (for core libraries) and bluez (for the bluetooth proximity helper
-program) libraries, although others may also be included in the future.  If
-PulseAudio is compiled with these optional components, this effectively
-downgrades the license of the server part to GPL (see file GPL for details),
-exercising section 3 of the LGPL. In such circumstances, you should treat the
-client library (libpulse) of PulseAudio as being LGPL licensed and the server
-part (libpulsecore) as being GPL licensed. Since the PulseAudio daemon, tests,
-various utilities/helpers and the modules link to libpulsecore and/or the
-afore mentioned optional GPL dependencies they are of course also GPL licensed
-also in this scenario.
+libsamplerate and gdbm (core libraries), LIRC (lirc module), FFTW (equalizer
+module) and bluez (bluetooth proximity helper program) libraries, although
+others may also be included in the future.  If PulseAudio is compiled with these
+optional components, this effectively downgrades the license of the server part
+to GPL (see the file GPL for details), exercising section 3 of the LGPL.  In
+such circumstances, you should treat the client library (libpulse) of PulseAudio
+as being LGPL licensed and the server part (libpulsecore) as being GPL licensed.
+Since the PulseAudio daemon, tests, various utilities/helpers and the modules
+link to libpulsecore and/or the afore mentioned optional GPL dependencies they
+are of course also GPL licensed also in this scenario.
 
 Andre Adrian's echo cancellation implementation is licensed under a less
 restrictive license - see src/modules/echo-cancel/adrian-license.txt for

commit c95650b929e488b9122a2d63a5aba9d957521ddc
Author: Colin Guthrie <colin at mageia.org>
Date:   Sun Nov 27 14:19:57 2011 +0000

    pulsecore: Fix issue with circuilar definitions.
    
    Without this fix, errors about previous definitions are generated in
    numerous locations.
    
    Example of error:
    
      CC     libpulsecore_1.98_la-auth-cookie.lo
    In file included from ../../src/pulsecore/source.h:46:0,
                     from ../../src/pulsecore/sink.h:40,
                     from ../../src/pulsecore/core.h:50,
                     from ../../src/pulsecore/shared.h:25,
                     from ../../src/pulsecore/auth-cookie.c:33:
    ../../src/pulsecore/device-port.h:40:24: error: redefinition of typedef
    'pa_core'
    ../../src/pulsecore/core.h:29:24: note: previous declaration of
    'pa_core' was here
    make[3]: *** [libpulsecore_1.98_la-auth-cookie.lo] Error 1
    
    Overall it would be nicer if we could avoid this kind of fix, but it
    would require further reorganisation that I'm not prepared to undertake
    right now.

diff --git a/src/pulsecore/device-port.h b/src/pulsecore/device-port.h
index f387021..7e7ed8d 100644
--- a/src/pulsecore/device-port.h
+++ b/src/pulsecore/device-port.h
@@ -37,13 +37,13 @@
 
 /* Note: Including core.h here leads to circular references
    (device-port.h -> core.h -> sink.h -> device-port.h), hence the line below instead */
-typedef struct pa_core pa_core;
+struct pa_core;
 
 typedef struct pa_device_port pa_device_port;
 
 struct pa_device_port {
     pa_object parent; /* Needed for reference counting */
-    pa_core *core;
+    struct pa_core *core;
 
     char *name;
     char *description;
@@ -63,7 +63,7 @@ PA_DECLARE_PUBLIC_CLASS(pa_device_port);
 
 #define PA_DEVICE_PORT_DATA(d) ((void*) ((uint8_t*) d + PA_ALIGN(sizeof(pa_device_port))))
 
-pa_device_port *pa_device_port_new(pa_core *c, const char *name, const char *description, size_t extra);
+pa_device_port *pa_device_port_new(struct pa_core *c, const char *name, const char *description, size_t extra);
 
 void pa_device_port_hashmap_free(pa_hashmap *h);
 



More information about the pulseaudio-commits mailing list