[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.17-9-g231c17b

Lennart Poettering gitmailer-noreply at 0pointer.de
Wed Sep 16 16:33:46 PDT 2009


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  12f211105e843d8b10f7d2a85d0ef451b7becd9a (commit)

- Log -----------------------------------------------------------------
231c17b svolume_mmx: disable test accidentaly left on
4e6dce5 Merge remote branch 'wtay/optimize'
e63c867 alsa: correct assumptions about channels an element lacks
1a6974a pacat: use fully automatic buffer sizes if possible
e2899f8 memblock: make it easy to disable mempool usage with $PULSE_MEMPOOL_DISABLE
6b8fdc4 CANCELLED vs. CANCELED
3d5a572 svolume_mmx: optimize some more
d397a82 svolume_sse: fix comment
-----------------------------------------------------------------------

Summary of changes:
 src/modules/alsa/alsa-mixer.c |   12 ++----------
 src/pulse/def.h               |    5 +++--
 src/pulsecore/memblock.c      |    7 +++++++
 src/pulsecore/svolume_mmx.c   |   18 ++++++------------
 src/pulsecore/svolume_sse.c   |    2 +-
 src/utils/pacat.c             |   14 +++++++++-----
 6 files changed, 28 insertions(+), 30 deletions(-)

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

commit d397a82e14da192995ba8caee5c95e70e545df29
Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Sat Sep 12 12:02:40 2009 +0200

    svolume_sse: fix comment

diff --git a/src/pulsecore/svolume_sse.c b/src/pulsecore/svolume_sse.c
index bbd73a9..5276bda 100644
--- a/src/pulsecore/svolume_sse.c
+++ b/src/pulsecore/svolume_sse.c
@@ -45,7 +45,7 @@
       " movdqa "#s", %%xmm5          \n\t"                                              \
       " pmulhuw "#v", "#s"           \n\t" /* .. |    0  | vl*p0 | */                   \
       " psubd %%xmm4, "#s"           \n\t" /* .. |    0  | vl*p0 | + sign correct */    \
-      " psrld $16, "#v"              \n\t" /* .. |   p0  |    0  | */                   \
+      " psrld $16, "#v"              \n\t" /* .. |    0  |   vh  | */                   \
       " pmaddwd %%xmm5, "#v"         \n\t" /* .. |    p0 * vh    | */                   \
       " paddd "#s", "#v"             \n\t" /* .. |    p0 * v0    | */                   \
       " packssdw "#v", "#v"          \n\t" /* .. | p1*v1 | p0*v0 | */

commit 3d5a572694388008fd4cf522699fc6c431f97325
Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Sat Sep 12 12:02:59 2009 +0200

    svolume_mmx: optimize some more
    
    We can reorder the algortihm a bit like we do for sse so that we
    don't need the contants and masking instructions. Saves 2 instructions
    for the mmx code.

diff --git a/src/pulsecore/svolume_mmx.c b/src/pulsecore/svolume_mmx.c
index 74918e7..170f01d 100644
--- a/src/pulsecore/svolume_mmx.c
+++ b/src/pulsecore/svolume_mmx.c
@@ -57,14 +57,12 @@
       " punpcklwd %%mm4, "#s"        \n\t" /* .. |    0  |   p0  | */                   \
       " pcmpgtw "#v", %%mm4          \n\t" /* .. |    0  | s(vl) | */                   \
       " pand "#s", %%mm4             \n\t" /* .. |    0  |  (p0) |  (vl >> 15) & p */   \
-      " movq %%mm6, %%mm5            \n\t" /* .. |  ffff |   0   | */                   \
-      " pand "#v", %%mm5             \n\t" /* .. |   vh  |   0   | */                   \
-      " por %%mm5, %%mm4             \n\t" /* .. |   vh  |  (p0) | */                   \
-      " pmulhw "#s", "#v"            \n\t" /* .. |    0  | vl*p0 | */                   \
-      " paddw %%mm4, "#v"            \n\t" /* .. |   vh  | vl*p0 | vh + sign correct */ \
-      " pslld $16, "#s"              \n\t" /* .. |   p0  |    0  | */                   \
-      " por %%mm7, "#s"              \n\t" /* .. |   p0  |    1  | */                   \
-      " pmaddwd "#s", "#v"           \n\t" /* .. |    p0 * v0    | */                   \
+      " movq "#s", %%mm5             \n\t"                                              \
+      " pmulhw "#v", "#s"            \n\t" /* .. |    0  | vl*p0 | */                   \
+      " paddw %%mm4, "#s"            \n\t" /* .. |    0  | vl*p0 | + sign correct */    \
+      " psrld $16, "#v"              \n\t" /* .. |    0  |   vh  | */                   \
+      " pmaddwd %%mm5, "#v"          \n\t" /* .. |    p0 * vh    | */                   \
+      " paddd "#s", "#v"             \n\t" /* .. |    p0 * v0    | */                   \
       " packssdw "#v", "#v"          \n\t" /* .. | p1*v1 | p0*v0 | */
 
 /* approximately advances %3 = (%3 + a) % b. This function requires that
@@ -105,10 +103,6 @@ pa_volume_s16ne_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi
     __asm__ __volatile__ (
         " xor %3, %3                    \n\t"
         " sar $1, %2                    \n\t" /* length /= sizeof (int16_t) */
-        " pcmpeqw %%mm6, %%mm6          \n\t" /* .. |  ffff |  ffff | */
-        " pcmpeqw %%mm7, %%mm7          \n\t" /* .. |  ffff |  ffff | */
-        " pslld  $16, %%mm6             \n\t" /* .. |  ffff |     0 | */
-        " psrld  $31, %%mm7             \n\t" /* .. |     0 |     1 | */
 
         " test $1, %2                   \n\t" /* check for odd samples */
         " je 2f                         \n\t"
@@ -239,7 +233,7 @@ pa_volume_s16re_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi
     );
 }
 
-#undef RUN_TEST
+#define RUN_TEST
 
 #ifdef RUN_TEST
 #define CHANNELS 2

commit 6b8fdc41693a710a29c4d3851a8c870031f1af88
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Sep 17 01:19:55 2009 +0200

    CANCELLED vs. CANCELED
    
    Define CANCELLED as alias for CANCELED

diff --git a/src/pulse/def.h b/src/pulse/def.h
index 1a7da97..e839bd9 100644
--- a/src/pulse/def.h
+++ b/src/pulse/def.h
@@ -95,13 +95,14 @@ static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) {
 typedef enum pa_operation_state {
     PA_OPERATION_RUNNING,      /**< The operation is still running */
     PA_OPERATION_DONE,         /**< The operation has been completed */
-    PA_OPERATION_CANCELED      /**< The operation has been canceled */
+    PA_OPERATION_CANCELLED     /**< The operation has been cancelled. Before 0.9.18 this was called PA_OPERATION_CANCELED. That name is still available for compatibility. */
 } pa_operation_state_t;
 
 /** \cond fulldocs */
 #define PA_OPERATION_RUNNING PA_OPERATION_RUNNING
 #define PA_OPERATION_DONE PA_OPERATION_DONE
-#define PA_OPERATION_CANCELED PA_OPERATION_CANCELED
+#define PA_OPERATION_CANCELED PA_OPERATION_CANCELLED
+#define PA_OPERATION_CANCELLED PA_OPERATION_CANCELLED
 /** \endcond */
 
 /** An invalid index */

commit e2899f8bf331d4cc89e2fa4ef3d17924fb91f922
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Sep 17 01:21:56 2009 +0200

    memblock: make it easy to disable mempool usage with $PULSE_MEMPOOL_DISABLE

diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c
index 0e40d12..47f298a 100644
--- a/src/pulsecore/memblock.c
+++ b/src/pulsecore/memblock.c
@@ -303,10 +303,17 @@ static struct mempool_slot* mempool_slot_by_ptr(pa_mempool *p, void *ptr) {
 pa_memblock *pa_memblock_new_pool(pa_mempool *p, size_t length) {
     pa_memblock *b = NULL;
     struct mempool_slot *slot;
+    static int mempool_disable = 0;
 
     pa_assert(p);
     pa_assert(length);
 
+    if (mempool_disable == 0)
+        mempool_disable = getenv("PULSE_MEMPOOL_DISABLE") ? 1 : -1;
+
+    if (mempool_disable > 0)
+        return NULL;
+
     /* If -1 is passed as length we choose the size for the caller: we
      * take the largest size that fits in one of our slots. */
 

commit 1a6974a1e2f013e6ae522bc404adf24724f3127b
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Sep 17 01:22:48 2009 +0200

    pacat: use fully automatic buffer sizes if possible

diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index 781bfa3..5f29ba3 100644
--- a/src/utils/pacat.c
+++ b/src/utils/pacat.c
@@ -430,14 +430,18 @@ static void context_state_callback(pa_context *c, void *userdata) {
             pa_stream_set_event_callback(stream, stream_event_callback, NULL);
             pa_stream_set_buffer_attr_callback(stream, stream_buffer_attr_callback, NULL);
 
+            pa_zero(buffer_attr);
+            buffer_attr.maxlength = (uint32_t) -1;
+            buffer_attr.prebuf = (uint32_t) -1;
+
             if (latency > 0) {
-                memset(&buffer_attr, 0, sizeof(buffer_attr));
-                buffer_attr.tlength = (uint32_t) latency;
+                buffer_attr.fragsize = buffer_attr.tlength = (uint32_t) latency;
                 buffer_attr.minreq = (uint32_t) process_time;
-                buffer_attr.maxlength = (uint32_t) -1;
-                buffer_attr.prebuf = (uint32_t) -1;
-                buffer_attr.fragsize = (uint32_t) latency;
                 flags |= PA_STREAM_ADJUST_LATENCY;
+            } else {
+                buffer_attr.tlength = (uint32_t) -1;
+                buffer_attr.minreq = (uint32_t) -1;
+                buffer_attr.fragsize = (uint32_t) -1;
             }
 
             if (mode == PLAYBACK) {

commit e63c867f8714a790e157c5e6f834b421cc82ae33
Author: Vladimir Kokarev <matrix47 at gmail.com>
Date:   Thu Sep 17 01:26:18 2009 +0200

    alsa: correct assumptions about channels an element lacks
    
    If an element does not control some channels assume they are 0dB in
    comparison to the other elements, i.e. do not influence the volume at
    all. Previously we were assuming they were as high as the highest of the
    channels we do control.

diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index 685169b..8d54d58 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -479,7 +479,6 @@ static int element_get_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann
     snd_mixer_elem_t *me;
     snd_mixer_selem_channel_id_t c;
     pa_channel_position_mask_t mask = 0;
-    pa_volume_t max_channel_volume = PA_VOLUME_MUTED;
     unsigned k;
 
     pa_assert(m);
@@ -546,9 +545,6 @@ static int element_get_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann
             f = from_alsa_volume(value, e->min_volume, e->max_volume);
         }
 
-        if (f > max_channel_volume)
-            max_channel_volume = f;
-
         for (k = 0; k < cm->channels; k++)
             if (e->masks[c][e->n_channels-1] & PA_CHANNEL_POSITION_MASK(cm->map[k]))
                 if (v->values[k] < f)
@@ -559,7 +555,7 @@ static int element_get_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann
 
     for (k = 0; k < cm->channels; k++)
         if (!(mask & PA_CHANNEL_POSITION_MASK(cm->map[k])))
-            v->values[k] = max_channel_volume;
+            v->values[k] = PA_VOLUME_NORM;
 
     return 0;
 }
@@ -681,7 +677,6 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann
     snd_mixer_elem_t *me;
     snd_mixer_selem_channel_id_t c;
     pa_channel_position_mask_t mask = 0;
-    pa_volume_t max_channel_volume = PA_VOLUME_MUTED;
     unsigned k;
 
     pa_assert(m);
@@ -771,9 +766,6 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann
             f = from_alsa_volume(value, e->min_volume, e->max_volume);
         }
 
-        if (f > max_channel_volume)
-            max_channel_volume = f;
-
         for (k = 0; k < cm->channels; k++)
             if (e->masks[c][e->n_channels-1] & PA_CHANNEL_POSITION_MASK(cm->map[k]))
                 if (rv.values[k] < f)
@@ -784,7 +776,7 @@ static int element_set_volume(pa_alsa_element *e, snd_mixer_t *m, const pa_chann
 
     for (k = 0; k < cm->channels; k++)
         if (!(mask & PA_CHANNEL_POSITION_MASK(cm->map[k])))
-            rv.values[k] = max_channel_volume;
+            rv.values[k] = PA_VOLUME_NORM;
 
     *v = rv;
     return 0;

commit 4e6dce593f555eda262568c5218ed3a3b6e315c4
Merge: e63c867 3d5a572
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Sep 17 01:32:03 2009 +0200

    Merge remote branch 'wtay/optimize'


commit 231c17be0330a3621f5249c5c7ea0ce521085c61
Author: Lennart Poettering <lennart at poettering.net>
Date:   Thu Sep 17 01:34:02 2009 +0200

    svolume_mmx: disable test accidentaly left on

diff --git a/src/pulsecore/svolume_mmx.c b/src/pulsecore/svolume_mmx.c
index 170f01d..62f3397 100644
--- a/src/pulsecore/svolume_mmx.c
+++ b/src/pulsecore/svolume_mmx.c
@@ -233,7 +233,7 @@ pa_volume_s16re_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi
     );
 }
 
-#define RUN_TEST
+#undef RUN_TEST
 
 #ifdef RUN_TEST
 #define CHANNELS 2

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list