[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.13-273-g4a13763

Lennart Poettering gitmailer-noreply at 0pointer.de
Fri Jan 16 09:40:03 PST 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  4d4956ea2f8df5f770f2137d8576afc6e5f161dd (commit)

- Log -----------------------------------------------------------------
4a13763... Add support for 24bit samples encoded in the LSB of 32 bit words
6dc76d1... add support for 24bit packed samples
9955398... fix version info in protocol history
-----------------------------------------------------------------------

Summary of changes:
 PROTOCOL                        |    2 +-
 src/modules/alsa/alsa-util.c    |   16 +++
 src/modules/oss/oss-util.c      |    4 +
 src/pulse/sample.c              |   26 ++++-
 src/pulse/sample.h              |   54 ++++++++--
 src/pulse/stream.c              |    2 +
 src/pulsecore/endianmacros.h    |   38 ++++++
 src/pulsecore/envelope.c        |    1 -
 src/pulsecore/protocol-native.c |    7 +
 src/pulsecore/resampler.c       |    6 +-
 src/pulsecore/sample-util.c     |  243 +++++++++++++++++++++++++++++++++++++++
 src/pulsecore/sconv-s16be.c     |   30 +++++-
 src/pulsecore/sconv-s16be.h     |   30 +++--
 src/pulsecore/sconv-s16le.c     |  225 ++++++++++++++++++++++++++++++++++++-
 src/pulsecore/sconv-s16le.h     |   30 +++--
 src/pulsecore/sconv.c           |   16 +++
 16 files changed, 694 insertions(+), 36 deletions(-)

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

commit 9955398fdafc58f23a86fc05f4832b5846b3b040
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jan 16 03:13:42 2009 +0100

    fix version info in protocol history

diff --git a/PROTOCOL b/PROTOCOL
index 80a0c33..37f289a 100644
--- a/PROTOCOL
+++ b/PROTOCOL
@@ -155,7 +155,7 @@ PA_COMMAND_SET_RECORD_STREAM_BUFFER_ATTR at the end:
   early_requests (bool)
 
 
-### v15, implemented by >= 0.9.14
+### v15, implemented by >= 0.9.15
 
 PA_COMMAND_CREATE_PLAYBACK_STREAM
 

commit 6dc76d11583979ba73dbe4bbf54f52fc1af901e2
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jan 16 03:15:39 2009 +0100

    add support for 24bit packed samples

diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 871471f..7616ad1 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -232,6 +232,8 @@ static int set_format(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t *hwparams, pa_s
         [PA_SAMPLE_FLOAT32BE] = SND_PCM_FORMAT_FLOAT_BE,
         [PA_SAMPLE_S32LE] = SND_PCM_FORMAT_S32_LE,
         [PA_SAMPLE_S32BE] = SND_PCM_FORMAT_S32_BE,
+        [PA_SAMPLE_S24LE] = SND_PCM_FORMAT_S24_3LE,
+        [PA_SAMPLE_S24BE] = SND_PCM_FORMAT_S24_3BE,
     };
 
     static const pa_sample_format_t try_order[] = {
@@ -239,6 +241,8 @@ static int set_format(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t *hwparams, pa_s
         PA_SAMPLE_FLOAT32RE,
         PA_SAMPLE_S32NE,
         PA_SAMPLE_S32RE,
+        PA_SAMPLE_S24NE,
+        PA_SAMPLE_S24RE,
         PA_SAMPLE_S16NE,
         PA_SAMPLE_S16RE,
         PA_SAMPLE_ALAW,
@@ -259,6 +263,10 @@ static int set_format(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t *hwparams, pa_s
         *f = PA_SAMPLE_FLOAT32LE;
     else if (*f == PA_SAMPLE_FLOAT32LE)
         *f = PA_SAMPLE_FLOAT32BE;
+    else if (*f == PA_SAMPLE_S24BE)
+        *f = PA_SAMPLE_S24LE;
+    else if (*f == PA_SAMPLE_S24LE)
+        *f = PA_SAMPLE_S24BE;
     else if (*f == PA_SAMPLE_S16BE)
         *f = PA_SAMPLE_S16LE;
     else if (*f == PA_SAMPLE_S16LE)
diff --git a/src/modules/oss/oss-util.c b/src/modules/oss/oss-util.c
index f766030..fbe930c 100644
--- a/src/modules/oss/oss-util.c
+++ b/src/modules/oss/oss-util.c
@@ -164,6 +164,8 @@ int pa_oss_auto_format(int fd, pa_sample_spec *ss) {
         [PA_SAMPLE_FLOAT32BE] = AFMT_QUERY, /* not supported */
         [PA_SAMPLE_S32LE] = AFMT_QUERY, /* not supported */
         [PA_SAMPLE_S32BE] = AFMT_QUERY, /* not supported */
+        [PA_SAMPLE_S24LE] = AFMT_QUERY, /* not supported */
+        [PA_SAMPLE_S24BE] = AFMT_QUERY, /* not supported */
     };
 
     pa_assert(fd >= 0);
diff --git a/src/pulse/sample.c b/src/pulse/sample.c
index 2950159..8228a9b 100644
--- a/src/pulse/sample.c
+++ b/src/pulse/sample.c
@@ -48,6 +48,8 @@ size_t pa_sample_size(const pa_sample_spec *spec) {
         [PA_SAMPLE_FLOAT32BE] = 4,
         [PA_SAMPLE_S32LE] = 4,
         [PA_SAMPLE_S32BE] = 4,
+        [PA_SAMPLE_S24LE] = 3,
+        [PA_SAMPLE_S24BE] = 3
     };
 
     pa_assert(spec);
@@ -125,6 +127,8 @@ const char *pa_sample_format_to_string(pa_sample_format_t f) {
         [PA_SAMPLE_FLOAT32BE] = "float32be",
         [PA_SAMPLE_S32LE] = "s32le",
         [PA_SAMPLE_S32BE] = "s32be",
+        [PA_SAMPLE_S24LE] = "s24le",
+        [PA_SAMPLE_S24BE] = "s24be",
     };
 
     if (f < 0 || f >= PA_SAMPLE_MAX)
@@ -194,8 +198,16 @@ pa_sample_format_t pa_parse_sample_format(const char *format) {
         return PA_SAMPLE_S32BE;
     else if (strcasecmp(format, "s32ne") == 0 || strcasecmp(format, "s32") == 0 || strcasecmp(format, "32") == 0)
         return PA_SAMPLE_S32NE;
-    else if (strcasecmp(format, "s32re") == 0)
-        return PA_SAMPLE_S32RE;
+    else if (strcasecmp(format, "s24re") == 0)
+        return PA_SAMPLE_S24RE;
+    else if (strcasecmp(format, "s24le") == 0)
+        return PA_SAMPLE_S24LE;
+    else if (strcasecmp(format, "s24be") == 0)
+        return PA_SAMPLE_S24BE;
+    else if (strcasecmp(format, "s24ne") == 0 || strcasecmp(format, "s24") == 0 || strcasecmp(format, "24") == 0)
+        return PA_SAMPLE_S24NE;
+    else if (strcasecmp(format, "s24re") == 0)
+        return PA_SAMPLE_S24RE;
 
     return -1;
 }
diff --git a/src/pulse/sample.h b/src/pulse/sample.h
index 3c7dd0e..8d09d32 100644
--- a/src/pulse/sample.h
+++ b/src/pulse/sample.h
@@ -51,6 +51,8 @@
  * \li PA_SAMPLE_ULAW - 8 bit mu-Law.
  * \li PA_SAMPLE_S32LE - Signed 32 bit integer PCM, little endian.
  * \li PA_SAMPLE_S32BE - Signed 32 bit integer PCM, big endian.
+ * \li PA_SAMPLE_242LE - Signed 24 bit integer PCM packed, little endian.
+ * \li PA_SAMPLE_242BE - Signed 24 bit integer PCM packed, big endian.
  *
  * The floating point sample formats have the range from -1.0 to 1.0.
  *
@@ -145,7 +147,13 @@ typedef enum pa_sample_format {
     /**< Signed 32 Bit PCM, little endian (PC) */
 
     PA_SAMPLE_S32BE,
-    /**< Signed 32 Bit PCM, big endian (PC) */
+    /**< Signed 32 Bit PCM, big endian */
+
+    PA_SAMPLE_S24LE,
+    /**< Signed 24 Bit PCM packed, little endian (PC) */
+
+    PA_SAMPLE_S24BE,
+    /**< Signed 24 Bit PCM packed, big endian */
 
     PA_SAMPLE_MAX,
     /**< Upper limit of valid sample types */
@@ -161,12 +169,16 @@ typedef enum pa_sample_format {
 #define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32BE
 /** Signed 32 Bit PCM, native endian */
 #define PA_SAMPLE_S32NE PA_SAMPLE_S32BE
+/** Signed 24 Bit PCM packed, native endian */
+#define PA_SAMPLE_S24NE PA_SAMPLE_S24BE
 /** Signed 16 Bit PCM reverse endian */
 #define PA_SAMPLE_S16RE PA_SAMPLE_S16LE
 /** 32 Bit IEEE floating point, reverse endian */
 #define PA_SAMPLE_FLOAT32RE PA_SAMPLE_FLOAT32LE
-/** Signed 32 Bit PCM reverse endian */
+/** Signed 32 Bit PCM, reverse endian */
 #define PA_SAMPLE_S32RE PA_SAMPLE_S32LE
+/** Signed 24 Bit PCM, packed reverse endian */
+#define PA_SAMPLE_S24RE PA_SAMPLE_242LE
 #else
 /** Signed 16 Bit PCM, native endian */
 #define PA_SAMPLE_S16NE PA_SAMPLE_S16LE
@@ -174,12 +186,16 @@ typedef enum pa_sample_format {
 #define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32LE
 /** Signed 32 Bit PCM, native endian */
 #define PA_SAMPLE_S32NE PA_SAMPLE_S32LE
-/** Signed 16 Bit PCM reverse endian */
+/** Signed 24 Bit PCM packed, native endian */
+#define PA_SAMPLE_S24NE PA_SAMPLE_S24LE
+/** Signed 16 Bit PCM, reverse endian */
 #define PA_SAMPLE_S16RE PA_SAMPLE_S16BE
 /** 32 Bit IEEE floating point, reverse endian */
 #define PA_SAMPLE_FLOAT32RE PA_SAMPLE_FLOAT32BE
-/** Signed 32 Bit PCM reverse endian */
+/** Signed 32 Bit PCM, reverse endian */
 #define PA_SAMPLE_S32RE PA_SAMPLE_S32BE
+/** Signed 24 Bit PCM packed, reverse endian */
+#define PA_SAMPLE_S24RE PA_SAMPLE_S24BE
 #endif
 
 /** A Shortcut for PA_SAMPLE_FLOAT32NE */
@@ -196,6 +212,8 @@ typedef enum pa_sample_format {
 #define PA_SAMPLE_FLOAT32BE PA_SAMPLE_FLOAT32BE
 #define PA_SAMPLE_S32LE PA_SAMPLE_S32LE
 #define PA_SAMPLE_S32BE PA_SAMPLE_S32BE
+#define PA_SAMPLE_S24LE PA_SAMPLE_S24LE
+#define PA_SAMPLE_S24BE PA_SAMPLE_S24BE
 /** \endcond */
 
 /** A sample format and attribute specification */
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index c0ae4ac..2a958e0 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -87,6 +87,7 @@ pa_stream *pa_stream_new_with_proplist(
 
     PA_CHECK_VALIDITY_RETURN_NULL(c, ss && pa_sample_spec_valid(ss), PA_ERR_INVALID);
     PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 12 || (ss->format != PA_SAMPLE_S32LE && ss->format != PA_SAMPLE_S32BE), PA_ERR_NOTSUPPORTED);
+    PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 15 || (ss->format != PA_SAMPLE_S24LE && ss->format != PA_SAMPLE_S24BE), PA_ERR_NOTSUPPORTED);
     PA_CHECK_VALIDITY_RETURN_NULL(c, !map || (pa_channel_map_valid(map) && map->channels == ss->channels), PA_ERR_INVALID);
     PA_CHECK_VALIDITY_RETURN_NULL(c, name || (p && pa_proplist_contains(p, PA_PROP_MEDIA_NAME)), PA_ERR_INVALID);
 
diff --git a/src/pulsecore/endianmacros.h b/src/pulsecore/endianmacros.h
index 85bebd6..eea1c74 100644
--- a/src/pulsecore/endianmacros.h
+++ b/src/pulsecore/endianmacros.h
@@ -45,6 +45,32 @@
 #define PA_UINT32_SWAP(x) ( (uint32_t) ( ((uint32_t) (x) >> 24) | ((uint32_t) (x) << 24) | (((uint32_t) (x) & 0xFF00) << 8) | ((((uint32_t) (x)) >> 8) & 0xFF00) ) )
 #endif
 
+static inline uint32_t PA_READ24LE(const uint8_t *p) {
+    return
+        ((uint32_t) p[0] << 16) |
+        ((uint32_t) p[1] << 8) |
+        ((uint32_t) p[2]);
+}
+
+static inline uint32_t PA_READ24BE(const uint8_t *p) {
+    return
+        ((uint32_t) p[2] << 16) |
+        ((uint32_t) p[1] << 8) |
+        ((uint32_t) p[0]);
+}
+
+static inline void PA_WRITE24LE(uint8_t *p, uint32_t u) {
+    p[0] = (uint8_t) (u >> 16);
+    p[1] = (uint8_t) (u >> 8);
+    p[2] = (uint8_t) u;
+}
+
+static inline void PA_WRITE24BE(uint8_t *p, uint32_t u) {
+    p[2] = (uint8_t) (u >> 16);
+    p[1] = (uint8_t) (u >> 8);
+    p[0] = (uint8_t) u;
+}
+
 static inline float PA_FLOAT32_SWAP(float x) {
     union {
         float f;
@@ -91,6 +117,12 @@ static inline float PA_FLOAT32_SWAP(float x) {
 
  #define PA_FLOAT32_TO_LE(x) PA_FLOAT32_SWAP(x)
  #define PA_FLOAT32_TO_BE(x) ((float) (x))
+
+ #define PA_READ24NE(x) PA_READ24BE(x)
+ #define PA_WRITE24NE(x,y) PA_WRITE24BE((x),(y))
+
+ #define PA_READ24RE(x) PA_READ24LE(x)
+ #define PA_WRITE24RE(x,y) PA_WRITE24LE((x),(y))
 #else
  #define PA_INT16_FROM_LE(x) ((int16_t)(x))
  #define PA_INT16_FROM_BE(x) PA_INT16_SWAP(x)
@@ -118,6 +150,12 @@ static inline float PA_FLOAT32_SWAP(float x) {
 
  #define PA_FLOAT32_TO_LE(x) ((float) (x))
  #define PA_FLOAT32_TO_BE(x) PA_FLOAT32_SWAP(x)
+
+ #define PA_READ24NE(x) PA_READ24LE(x)
+ #define PA_WRITE24NE(x,y) PA_WRITE24LE((x),(y))
+
+ #define PA_READ24RE(x) PA_READ24BE(x)
+ #define PA_WRITE24RE(x,y) PA_WRITE24BE((x),(y))
 #endif
 
 #endif
diff --git a/src/pulsecore/envelope.c b/src/pulsecore/envelope.c
index 7f2252e..f872d34 100644
--- a/src/pulsecore/envelope.c
+++ b/src/pulsecore/envelope.c
@@ -600,7 +600,6 @@ void pa_envelope_apply(pa_envelope *e, pa_memchunk *chunk) {
         switch (e->sample_spec.format) {
 
 
-
             case PA_SAMPLE_U8: {
                 uint8_t *t;
 
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index af013da..b1ef64f 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -2640,6 +2640,13 @@ static void fixup_sample_spec(pa_native_connection *c, pa_sample_spec *fixed, co
         if (fixed->format == PA_SAMPLE_S32BE)
             fixed->format = PA_SAMPLE_FLOAT32BE;
     }
+
+    if (c->version < 15) {
+        if (fixed->format == PA_SAMPLE_S24LE)
+            fixed->format = PA_SAMPLE_FLOAT32LE;
+        if (fixed->format == PA_SAMPLE_S24BE)
+            fixed->format = PA_SAMPLE_FLOAT32BE;
+    }
 }
 
 static void sink_fill_tagstruct(pa_native_connection *c, pa_tagstruct *t, pa_sink *sink) {
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index f0515eb..67c3758 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -257,8 +257,10 @@ pa_resampler* pa_resampler_new(
 
             if (a->format == PA_SAMPLE_S32NE || a->format == PA_SAMPLE_S32RE ||
                 a->format == PA_SAMPLE_FLOAT32NE || a->format == PA_SAMPLE_FLOAT32RE ||
+                a->format == PA_SAMPLE_S24NE || a->format == PA_SAMPLE_S24RE ||
                 b->format == PA_SAMPLE_S32NE || b->format == PA_SAMPLE_S32RE ||
-                b->format == PA_SAMPLE_FLOAT32NE || b->format == PA_SAMPLE_FLOAT32RE)
+                b->format == PA_SAMPLE_FLOAT32NE || b->format == PA_SAMPLE_FLOAT32RE ||
+                b->format == PA_SAMPLE_S24NE || b->format == PA_SAMPLE_S24RE)
                 r->work_format = PA_SAMPLE_FLOAT32NE;
             else
                 r->work_format = PA_SAMPLE_S16NE;
diff --git a/src/pulsecore/sample-util.c b/src/pulsecore/sample-util.c
index 3be08ef..533181b 100644
--- a/src/pulsecore/sample-util.c
+++ b/src/pulsecore/sample-util.c
@@ -83,6 +83,8 @@ static uint8_t silence_byte(pa_sample_format_t format) {
         case PA_SAMPLE_S32BE:
         case PA_SAMPLE_FLOAT32LE:
         case PA_SAMPLE_FLOAT32BE:
+        case PA_SAMPLE_S24LE:
+        case PA_SAMPLE_S24BE:
             return 0;
         case PA_SAMPLE_ALAW:
             return 0xd5;
@@ -340,6 +342,78 @@ size_t pa_mix(
             break;
         }
 
+        case PA_SAMPLE_S24NE: {
+            unsigned channel = 0;
+
+            calc_linear_integer_stream_volumes(streams, nstreams, volume, spec);
+
+            while (data < end) {
+                int64_t sum = 0;
+                unsigned i;
+
+                for (i = 0; i < nstreams; i++) {
+                    pa_mix_info *m = streams + i;
+                    int32_t cv = m->linear[channel].i;
+                    int64_t v;
+
+                    if (PA_UNLIKELY(cv <= 0))
+                        continue;
+
+                    v = (int32_t) (PA_READ24NE(m->ptr) << 8);
+                    v = (v * cv) / 0x10000;
+                    sum += v;
+
+                    m->ptr = (uint8_t*) m->ptr + 3;
+                }
+
+                sum = PA_CLAMP_UNLIKELY(sum, -0x80000000LL, 0x7FFFFFFFLL);
+                PA_WRITE24NE(data, ((uint32_t) sum) >> 8);
+
+                data = (uint8_t*) data + 3;
+
+                if (PA_UNLIKELY(++channel >= spec->channels))
+                    channel = 0;
+            }
+
+            break;
+        }
+
+        case PA_SAMPLE_S24RE: {
+            unsigned channel = 0;
+
+            calc_linear_integer_stream_volumes(streams, nstreams, volume, spec);
+
+            while (data < end) {
+                int64_t sum = 0;
+                unsigned i;
+
+                for (i = 0; i < nstreams; i++) {
+                    pa_mix_info *m = streams + i;
+                    int32_t cv = m->linear[channel].i;
+                    int64_t v;
+
+                    if (PA_UNLIKELY(cv <= 0))
+                        continue;
+
+                    v = (int32_t) (PA_READ24RE(m->ptr) << 8);
+                    v = (v * cv) / 0x10000;
+                    sum += v;
+
+                    m->ptr = (uint8_t*) m->ptr + 3;
+                }
+
+                sum = PA_CLAMP_UNLIKELY(sum, -0x80000000LL, 0x7FFFFFFFLL);
+                PA_WRITE24RE(data, ((uint32_t) sum) >> 8);
+
+                data = (uint8_t*) data + 3;
+
+                if (PA_UNLIKELY(++channel >= spec->channels))
+                    channel = 0;
+            }
+
+            break;
+        }
+
         case PA_SAMPLE_U8: {
             unsigned channel = 0;
 
@@ -642,7 +716,52 @@ void pa_volume_memchunk(
                 if (PA_UNLIKELY(++channel >= spec->channels))
                     channel = 0;
             }
+            break;
+        }
+
+        case PA_SAMPLE_S24NE: {
+            uint8_t *d, *e;
+            unsigned channel;
+            int32_t linear[PA_CHANNELS_MAX];
+
+            calc_linear_integer_volume(linear, volume);
+
+            e = (uint8_t*) ptr + c->length/3;
+
+            for (channel = 0, d = ptr; d < e; d++) {
+                int64_t t;
 
+                t = (int64_t)((int32_t) (PA_READ24NE(d) << 8));
+                t = (t * linear[channel]) / 0x10000;
+                t = PA_CLAMP_UNLIKELY(t, -0x80000000LL, 0x7FFFFFFFLL);
+                PA_WRITE24NE(d, ((uint32_t) (int32_t) t) >> 8);
+
+                if (PA_UNLIKELY(++channel >= spec->channels))
+                    channel = 0;
+            }
+            break;
+        }
+
+        case PA_SAMPLE_S24RE: {
+            uint8_t *d, *e;
+            unsigned channel;
+            int32_t linear[PA_CHANNELS_MAX];
+
+            calc_linear_integer_volume(linear, volume);
+
+            e = (uint8_t*) ptr + c->length/3;
+
+            for (channel = 0, d = ptr; d < e; d++) {
+                int64_t t;
+
+                t = (int64_t)((int32_t) (PA_READ24RE(d) << 8));
+                t = (t * linear[channel]) / 0x10000;
+                t = PA_CLAMP_UNLIKELY(t, -0x80000000LL, 0x7FFFFFFFLL);
+                PA_WRITE24RE(d, ((uint32_t) (int32_t) t) >> 8);
+
+                if (PA_UNLIKELY(++channel >= spec->channels))
+                    channel = 0;
+            }
             break;
         }
 
@@ -900,12 +1019,16 @@ pa_memchunk* pa_silence_memchunk_get(pa_silence_cache *cache, pa_mempool *pool,
             case PA_SAMPLE_S16BE:
             case PA_SAMPLE_S32LE:
             case PA_SAMPLE_S32BE:
+            case PA_SAMPLE_S24LE:
+            case PA_SAMPLE_S24BE:
             case PA_SAMPLE_FLOAT32LE:
             case PA_SAMPLE_FLOAT32BE:
                 cache->blocks[PA_SAMPLE_S16LE] = b = silence_memblock_new(pool, 0);
                 cache->blocks[PA_SAMPLE_S16BE] = pa_memblock_ref(b);
                 cache->blocks[PA_SAMPLE_S32LE] = pa_memblock_ref(b);
                 cache->blocks[PA_SAMPLE_S32BE] = pa_memblock_ref(b);
+                cache->blocks[PA_SAMPLE_S24LE] = pa_memblock_ref(b);
+                cache->blocks[PA_SAMPLE_S24BE] = pa_memblock_ref(b);
                 cache->blocks[PA_SAMPLE_FLOAT32LE] = pa_memblock_ref(b);
                 cache->blocks[PA_SAMPLE_FLOAT32BE] = pa_memblock_ref(b);
                 break;
diff --git a/src/pulsecore/sconv-s16be.c b/src/pulsecore/sconv-s16be.c
index e7e1449..d6137d3 100644
--- a/src/pulsecore/sconv-s16be.c
+++ b/src/pulsecore/sconv-s16be.c
@@ -31,24 +31,34 @@
 #define INT32_FROM PA_INT32_FROM_BE
 #define INT32_TO PA_INT32_TO_BE
 
+#define READ24 PA_READ24BE
+#define WRITE24 PA_WRITE24BE
+
 #define pa_sconv_s16le_to_float32ne pa_sconv_s16be_to_float32ne
 #define pa_sconv_s16le_from_float32ne pa_sconv_s16be_from_float32ne
-
 #define pa_sconv_s16le_to_float32re pa_sconv_s16be_to_float32re
 #define pa_sconv_s16le_from_float32re pa_sconv_s16be_from_float32re
 
 #define pa_sconv_s32le_to_float32ne pa_sconv_s32be_to_float32ne
 #define pa_sconv_s32le_from_float32ne pa_sconv_s32be_from_float32ne
-
 #define pa_sconv_s32le_to_float32re pa_sconv_s32be_to_float32re
 #define pa_sconv_s32le_from_float32re pa_sconv_s32be_from_float32re
 
+#define pa_sconv_s24le_to_float32ne pa_sconv_s24be_to_float32ne
+#define pa_sconv_s24le_from_float32ne pa_sconv_s24be_from_float32ne
+#define pa_sconv_s24le_to_float32re pa_sconv_s24be_to_float32re
+#define pa_sconv_s24le_from_float32re pa_sconv_s24be_from_float32re
+
 #define pa_sconv_s32le_to_s16ne pa_sconv_s32be_to_s16ne
 #define pa_sconv_s32le_from_s16ne pa_sconv_s32be_from_s16ne
-
 #define pa_sconv_s32le_to_s16re pa_sconv_s32be_to_s16re
 #define pa_sconv_s32le_from_s16re pa_sconv_s32be_from_s16re
 
+#define pa_sconv_s24le_to_s16ne pa_sconv_s24be_to_s16ne
+#define pa_sconv_s24le_from_s16ne pa_sconv_s24be_from_s16ne
+#define pa_sconv_s24le_to_s16re pa_sconv_s24be_to_s16re
+#define pa_sconv_s24le_from_s16re pa_sconv_s24be_from_s16re
+
 #ifdef WORDS_BIGENDIAN
 #define SWAP_WORDS 0
 #else
diff --git a/src/pulsecore/sconv-s16be.h b/src/pulsecore/sconv-s16be.h
index 6058081..1b88fd4 100644
--- a/src/pulsecore/sconv-s16be.h
+++ b/src/pulsecore/sconv-s16be.h
@@ -34,26 +34,26 @@ void pa_sconv_s32be_from_float32ne(unsigned n, const float *a, int32_t *b);
 void pa_sconv_s32be_to_float32re(unsigned n, const int32_t *a, float *b);
 void pa_sconv_s32be_from_float32re(unsigned n, const float *a, int32_t *b);
 
+void pa_sconv_s24be_to_float32ne(unsigned n, const uint8_t *a, float *b);
+void pa_sconv_s24be_from_float32ne(unsigned n, const float *a, uint8_t *b);
+void pa_sconv_s24be_to_float32re(unsigned n, const uint8_t *a, float *b);
+void pa_sconv_s24be_from_float32re(unsigned n, const float *a, uint8_t *b);
+
 void pa_sconv_s32be_to_s16ne(unsigned n, const int32_t *a, int16_t *b);
 void pa_sconv_s32be_from_s16ne(unsigned n, const int16_t *a, int32_t *b);
 void pa_sconv_s32be_to_s16re(unsigned n, const int32_t *a, int16_t *b);
 void pa_sconv_s32be_from_s16re(unsigned n, const int16_t *a, int32_t *b);
 
+void pa_sconv_s24be_to_s16ne(unsigned n, const uint8_t *a, int16_t *b);
+void pa_sconv_s24be_from_s16ne(unsigned n, const int16_t *a, uint8_t *b);
+void pa_sconv_s24be_to_s16re(unsigned n, const uint8_t *a, int16_t *b);
+void pa_sconv_s24be_from_s16re(unsigned n, const int16_t *a, uint8_t *b);
+
 #ifdef WORDS_BIGENDIAN
 #define pa_sconv_float32be_to_s16ne pa_sconv_s16be_from_float32ne
 #define pa_sconv_float32be_from_s16ne pa_sconv_s16be_to_float32ne
 #define pa_sconv_float32le_to_s16ne pa_sconv_s16be_from_float32re
 #define pa_sconv_float32le_from_s16ne pa_sconv_s16be_to_float32re
-
-#define pa_sconv_float32be_to_s32ne pa_sconv_s32be_from_float32ne
-#define pa_sconv_float32be_from_s32ne pa_sconv_s32be_to_float32ne
-#define pa_sconv_float32le_to_s32ne pa_sconv_s32be_from_float32re
-#define pa_sconv_float32le_from_s32ne pa_sconv_s32be_to_float32re
-
-#define pa_sconv_s16be_to_s32ne pa_sconv_s32be_from_s16ne
-#define pa_sconv_s16be_from_s32ne pa_sconv_s32be_to_s16ne
-#define pa_sconv_s16le_to_s32ne pa_sconv_s32be_from_s16re
-#define pa_sconv_s16le_from_s32ne pa_sconv_s32be_to_s16re
 #endif
 
 #endif
diff --git a/src/pulsecore/sconv-s16le.c b/src/pulsecore/sconv-s16le.c
index 159c465..37ebc98 100644
--- a/src/pulsecore/sconv-s16le.c
+++ b/src/pulsecore/sconv-s16le.c
@@ -23,7 +23,7 @@
 #include <config.h>
 #endif
 
-/* Despite the name of this file we implement S32 handling here, too. */
+/* Despite the name of this file we implement S32 and S24 handling here, too. */
 
 #include <inttypes.h>
 #include <stdio.h>
@@ -54,6 +54,14 @@
 #define INT32_TO PA_INT32_TO_LE
 #endif
 
+#ifndef READ24
+#define READ24 PA_READ24LE
+#endif
+
+#ifndef WRITE24
+#define WRITE24 PA_WRITE24LE
+#endif
+
 #ifndef SWAP_WORDS
 #ifdef WORDS_BIGENDIAN
 #define SWAP_WORDS 1
@@ -243,3 +251,105 @@ void pa_sconv_s32le_from_s16re(unsigned n, const int16_t *a, int32_t *b) {
         b++;
     }
 }
+
+void pa_sconv_s24le_to_s16ne(unsigned n, const uint8_t *a, int16_t *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        *b = (int16_t) (READ24(a) >> 8);
+        a += 3;
+        b++;
+    }
+}
+
+void pa_sconv_s24le_from_s16ne(unsigned n, const int16_t *a, uint8_t *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        WRITE24(b, ((uint32_t) *a) << 8);
+        a++;
+        b += 3;
+    }
+}
+
+void pa_sconv_s24le_to_s16re(unsigned n, const uint8_t *a, int16_t *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        int16_t s = (int16_t) (READ24(a) >> 8);
+        *b = PA_INT16_SWAP(s);
+        a += 3;
+        b++;
+    }
+}
+
+void pa_sconv_s24le_from_s16re(unsigned n, const int16_t *a, uint8_t *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        uint32_t s = ((uint32_t) PA_INT16_SWAP(*a)) << 8;
+        WRITE24(b, s);
+        a++;
+        b += 3;
+    }
+}
+
+void pa_sconv_s24le_to_float32ne(unsigned n, const uint8_t *a, float *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        int32_t s = READ24(a) << 8;
+        *b = ((float) s) / 0x7FFFFFFF;
+        a += 3;
+        b ++;
+    }
+}
+
+void pa_sconv_s24le_from_float32ne(unsigned n, const float *a, uint8_t *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        int32_t s;
+        float v = *a;
+        v = PA_CLAMP_UNLIKELY(v, -1.0f, 1.0f);
+        s = (int32_t) lrint((double) v * (double) 0x7FFFFFFF);
+        WRITE24(b, ((uint32_t) s) >> 8);
+        a++;
+        b+=3;
+    }
+}
+
+void pa_sconv_s24le_to_float32re(unsigned n, const uint8_t *a, float *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        int32_t s = READ24(a) << 8;
+        float k = ((float) s) / 0x7FFFFFFF;
+        *b = PA_FLOAT32_SWAP(k);
+        a += 3;
+        b ++;
+    }
+}
+
+void pa_sconv_s24le_from_float32re(unsigned n, const float *a, uint8_t *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        int32_t s;
+        float v = *a;
+        v = PA_FLOAT32_SWAP(v);
+        v = PA_CLAMP_UNLIKELY(v, -1.0f, 1.0f);
+        s = (int32_t) lrint((double) v * (double) 0x7FFFFFFF);
+        WRITE24(b, ((uint32_t) s) >> 8);
+        a++;
+        b+=3;
+    }
+}
diff --git a/src/pulsecore/sconv-s16le.h b/src/pulsecore/sconv-s16le.h
index 8d4c87c..b853515 100644
--- a/src/pulsecore/sconv-s16le.h
+++ b/src/pulsecore/sconv-s16le.h
@@ -34,26 +34,26 @@ void pa_sconv_s32le_from_float32ne(unsigned n, const float *a, int32_t *b);
 void pa_sconv_s32le_to_float32re(unsigned n, const int32_t *a, float *b);
 void pa_sconv_s32le_from_float32re(unsigned n, const float *a, int32_t *b);
 
+void pa_sconv_s24le_to_float32ne(unsigned n, const uint8_t *a, float *b);
+void pa_sconv_s24le_from_float32ne(unsigned n, const float *a, uint8_t *b);
+void pa_sconv_s24le_to_float32re(unsigned n, const uint8_t *a, float *b);
+void pa_sconv_s24le_from_float32re(unsigned n, const float *a, uint8_t *b);
+
 void pa_sconv_s32le_to_s16ne(unsigned n, const int32_t *a, int16_t *b);
 void pa_sconv_s32le_from_s16ne(unsigned n, const int16_t *a, int32_t *b);
 void pa_sconv_s32le_to_s16re(unsigned n, const int32_t *a, int16_t *b);
 void pa_sconv_s32le_from_s16re(unsigned n, const int16_t *a, int32_t *b);
 
+void pa_sconv_s24le_to_s16ne(unsigned n, const uint8_t *a, int16_t *b);
+void pa_sconv_s24le_from_s16ne(unsigned n, const int16_t *a, uint8_t *b);
+void pa_sconv_s24le_to_s16re(unsigned n, const uint8_t *a, int16_t *b);
+void pa_sconv_s24le_from_s16re(unsigned n, const int16_t *a, uint8_t *b);
+
 #ifndef WORDS_BIGENDIAN
 #define pa_sconv_float32be_to_s16ne pa_sconv_s16le_from_float32re
 #define pa_sconv_float32be_from_s16ne pa_sconv_s16le_to_float32re
 #define pa_sconv_float32le_to_s16ne pa_sconv_s16le_from_float32ne
 #define pa_sconv_float32le_from_s16ne pa_sconv_s16le_to_float32ne
-
-#define pa_sconv_float32be_to_s32ne pa_sconv_s32le_from_float32re
-#define pa_sconv_float32be_from_s32ne pa_sconv_s32le_to_float32re
-#define pa_sconv_float32le_to_s32ne pa_sconv_s32le_from_float32ne
-#define pa_sconv_float32le_from_s32ne pa_sconv_s32le_to_float32ne
-
-#define pa_sconv_s16be_to_s32ne pa_sconv_s32le_from_s16re
-#define pa_sconv_s16be_from_s32ne pa_sconv_s32le_to_s16re
-#define pa_sconv_s16le_to_s32ne pa_sconv_s32le_from_s16ne
-#define pa_sconv_s16le_from_s32ne pa_sconv_s32le_to_s16ne
 #endif
 
 #endif
diff --git a/src/pulsecore/sconv.c b/src/pulsecore/sconv.c
index 6c4d420..13700c1 100644
--- a/src/pulsecore/sconv.c
+++ b/src/pulsecore/sconv.c
@@ -198,6 +198,8 @@ pa_convert_func_t pa_get_convert_to_float32ne_function(pa_sample_format_t f) {
         [PA_SAMPLE_S16BE]     = (pa_convert_func_t) pa_sconv_s16be_to_float32ne,
         [PA_SAMPLE_S32LE]     = (pa_convert_func_t) pa_sconv_s32le_to_float32ne,
         [PA_SAMPLE_S32BE]     = (pa_convert_func_t) pa_sconv_s32be_to_float32ne,
+        [PA_SAMPLE_S24LE]     = (pa_convert_func_t) pa_sconv_s24le_to_float32ne,
+        [PA_SAMPLE_S24BE]     = (pa_convert_func_t) pa_sconv_s24be_to_float32ne,
         [PA_SAMPLE_FLOAT32NE] = (pa_convert_func_t) float32ne_to_float32ne,
         [PA_SAMPLE_FLOAT32RE] = (pa_convert_func_t) float32re_to_float32ne,
     };
@@ -216,6 +218,8 @@ pa_convert_func_t pa_get_convert_from_float32ne_function(pa_sample_format_t f) {
         [PA_SAMPLE_S16BE]     = (pa_convert_func_t) pa_sconv_s16be_from_float32ne,
         [PA_SAMPLE_S32LE]     = (pa_convert_func_t) pa_sconv_s32le_from_float32ne,
         [PA_SAMPLE_S32BE]     = (pa_convert_func_t) pa_sconv_s32be_from_float32ne,
+        [PA_SAMPLE_S24LE]     = (pa_convert_func_t) pa_sconv_s24le_from_float32ne,
+        [PA_SAMPLE_S24BE]     = (pa_convert_func_t) pa_sconv_s24be_from_float32ne,
         [PA_SAMPLE_FLOAT32NE] = (pa_convert_func_t) float32ne_to_float32ne,
         [PA_SAMPLE_FLOAT32RE] = (pa_convert_func_t) float32re_to_float32ne,
         [PA_SAMPLE_ALAW]      = (pa_convert_func_t) alaw_from_float32ne,
@@ -238,6 +242,8 @@ pa_convert_func_t pa_get_convert_to_s16ne_function(pa_sample_format_t f) {
         [PA_SAMPLE_FLOAT32LE] = (pa_convert_func_t) pa_sconv_float32le_to_s16ne,
         [PA_SAMPLE_S32BE]     = (pa_convert_func_t) pa_sconv_s32be_to_s16ne,
         [PA_SAMPLE_S32LE]     = (pa_convert_func_t) pa_sconv_s32le_to_s16ne,
+        [PA_SAMPLE_S24BE]     = (pa_convert_func_t) pa_sconv_s24be_to_s16ne,
+        [PA_SAMPLE_S24LE]     = (pa_convert_func_t) pa_sconv_s24le_to_s16ne,
         [PA_SAMPLE_ALAW]      = (pa_convert_func_t) alaw_to_s16ne,
         [PA_SAMPLE_ULAW]      = (pa_convert_func_t) ulaw_to_s16ne
     };
@@ -258,6 +264,8 @@ pa_convert_func_t pa_get_convert_from_s16ne_function(pa_sample_format_t f) {
         [PA_SAMPLE_FLOAT32LE] = (pa_convert_func_t) pa_sconv_float32le_from_s16ne,
         [PA_SAMPLE_S32BE]     = (pa_convert_func_t) pa_sconv_s32be_from_s16ne,
         [PA_SAMPLE_S32LE]     = (pa_convert_func_t) pa_sconv_s32le_from_s16ne,
+        [PA_SAMPLE_S24BE]     = (pa_convert_func_t) pa_sconv_s24be_from_s16ne,
+        [PA_SAMPLE_S24LE]     = (pa_convert_func_t) pa_sconv_s24le_from_s16ne,
         [PA_SAMPLE_ALAW]      = (pa_convert_func_t) alaw_from_s16ne,
         [PA_SAMPLE_ULAW]      = (pa_convert_func_t) ulaw_from_s16ne,
     };

commit 4a137637976360e94dfc304c291b3166b3c03970
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jan 16 18:39:36 2009 +0100

    Add support for 24bit samples encoded in the LSB of 32 bit words

diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 7616ad1..04d23e0 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -234,6 +234,8 @@ static int set_format(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t *hwparams, pa_s
         [PA_SAMPLE_S32BE] = SND_PCM_FORMAT_S32_BE,
         [PA_SAMPLE_S24LE] = SND_PCM_FORMAT_S24_3LE,
         [PA_SAMPLE_S24BE] = SND_PCM_FORMAT_S24_3BE,
+        [PA_SAMPLE_S24_32LE] = SND_PCM_FORMAT_S24_LE,
+        [PA_SAMPLE_S24_32BE] = SND_PCM_FORMAT_S24_BE,
     };
 
     static const pa_sample_format_t try_order[] = {
@@ -241,6 +243,8 @@ static int set_format(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t *hwparams, pa_s
         PA_SAMPLE_FLOAT32RE,
         PA_SAMPLE_S32NE,
         PA_SAMPLE_S32RE,
+        PA_SAMPLE_S24_32NE,
+        PA_SAMPLE_S24_32RE,
         PA_SAMPLE_S24NE,
         PA_SAMPLE_S24RE,
         PA_SAMPLE_S16NE,
@@ -267,6 +271,10 @@ static int set_format(snd_pcm_t *pcm_handle, snd_pcm_hw_params_t *hwparams, pa_s
         *f = PA_SAMPLE_S24LE;
     else if (*f == PA_SAMPLE_S24LE)
         *f = PA_SAMPLE_S24BE;
+    else if (*f == PA_SAMPLE_S24_32BE)
+        *f = PA_SAMPLE_S24_32LE;
+    else if (*f == PA_SAMPLE_S24_32LE)
+        *f = PA_SAMPLE_S24_32BE;
     else if (*f == PA_SAMPLE_S16BE)
         *f = PA_SAMPLE_S16LE;
     else if (*f == PA_SAMPLE_S16LE)
diff --git a/src/modules/oss/oss-util.c b/src/modules/oss/oss-util.c
index fbe930c..f8e11fd 100644
--- a/src/modules/oss/oss-util.c
+++ b/src/modules/oss/oss-util.c
@@ -166,6 +166,8 @@ int pa_oss_auto_format(int fd, pa_sample_spec *ss) {
         [PA_SAMPLE_S32BE] = AFMT_QUERY, /* not supported */
         [PA_SAMPLE_S24LE] = AFMT_QUERY, /* not supported */
         [PA_SAMPLE_S24BE] = AFMT_QUERY, /* not supported */
+        [PA_SAMPLE_S24_32LE] = AFMT_QUERY, /* not supported */
+        [PA_SAMPLE_S24_32BE] = AFMT_QUERY, /* not supported */
     };
 
     pa_assert(fd >= 0);
diff --git a/src/pulse/sample.c b/src/pulse/sample.c
index 8228a9b..a6c7734 100644
--- a/src/pulse/sample.c
+++ b/src/pulse/sample.c
@@ -49,7 +49,9 @@ size_t pa_sample_size(const pa_sample_spec *spec) {
         [PA_SAMPLE_S32LE] = 4,
         [PA_SAMPLE_S32BE] = 4,
         [PA_SAMPLE_S24LE] = 3,
-        [PA_SAMPLE_S24BE] = 3
+        [PA_SAMPLE_S24BE] = 3,
+        [PA_SAMPLE_S24_32LE] = 4,
+        [PA_SAMPLE_S24_32BE] = 4
     };
 
     pa_assert(spec);
@@ -129,6 +131,8 @@ const char *pa_sample_format_to_string(pa_sample_format_t f) {
         [PA_SAMPLE_S32BE] = "s32be",
         [PA_SAMPLE_S24LE] = "s24le",
         [PA_SAMPLE_S24BE] = "s24be",
+        [PA_SAMPLE_S24_32LE] = "s24-32le",
+        [PA_SAMPLE_S24_32BE] = "s24-32be",
     };
 
     if (f < 0 || f >= PA_SAMPLE_MAX)
@@ -198,7 +202,7 @@ pa_sample_format_t pa_parse_sample_format(const char *format) {
         return PA_SAMPLE_S32BE;
     else if (strcasecmp(format, "s32ne") == 0 || strcasecmp(format, "s32") == 0 || strcasecmp(format, "32") == 0)
         return PA_SAMPLE_S32NE;
-    else if (strcasecmp(format, "s24re") == 0)
+    else if (strcasecmp(format, "s32re") == 0)
         return PA_SAMPLE_S24RE;
     else if (strcasecmp(format, "s24le") == 0)
         return PA_SAMPLE_S24LE;
@@ -208,6 +212,14 @@ pa_sample_format_t pa_parse_sample_format(const char *format) {
         return PA_SAMPLE_S24NE;
     else if (strcasecmp(format, "s24re") == 0)
         return PA_SAMPLE_S24RE;
+    else if (strcasecmp(format, "s24-32le") == 0)
+        return PA_SAMPLE_S24LE;
+    else if (strcasecmp(format, "s24-32be") == 0)
+        return PA_SAMPLE_S24BE;
+    else if (strcasecmp(format, "s24-32ne") == 0 || strcasecmp(format, "s24-32") == 0)
+        return PA_SAMPLE_S24NE;
+    else if (strcasecmp(format, "s24-32re") == 0)
+        return PA_SAMPLE_S24RE;
 
     return -1;
 }
diff --git a/src/pulse/sample.h b/src/pulse/sample.h
index 8d09d32..3ba13db 100644
--- a/src/pulse/sample.h
+++ b/src/pulse/sample.h
@@ -51,8 +51,10 @@
  * \li PA_SAMPLE_ULAW - 8 bit mu-Law.
  * \li PA_SAMPLE_S32LE - Signed 32 bit integer PCM, little endian.
  * \li PA_SAMPLE_S32BE - Signed 32 bit integer PCM, big endian.
- * \li PA_SAMPLE_242LE - Signed 24 bit integer PCM packed, little endian.
- * \li PA_SAMPLE_242BE - Signed 24 bit integer PCM packed, big endian.
+ * \li PA_SAMPLE_S24LE - Signed 24 bit integer PCM packed, little endian.
+ * \li PA_SAMPLE_S24BE - Signed 24 bit integer PCM packed, big endian.
+ * \li PA_SAMPLE_S24_32LE - Signed 24 bit integer PCM in LSB of 32 bit words, little endian.
+ * \li PA_SAMPLE_S24_32BE - Signed 24 bit integer PCM in LSB of 32 bit words, big endian.
  *
  * The floating point sample formats have the range from -1.0 to 1.0.
  *
@@ -61,14 +63,14 @@
  *
  * \section rate_sec Sample Rates
  *
- * PulseAudio supports any sample rate between 1 Hz and 4 GHz. There is no
+ * PulseAudio supports any sample rate between 1 Hz and 192000 Hz. There is no
  * point trying to exceed the sample rate of the output device though as the
  * signal will only get downsampled, consuming CPU on the machine running the
  * server.
  *
  * \section chan_sec Channels
  *
- * PulseAudio supports up to 16 individiual channels. The order of the
+ * PulseAudio supports up to 32 individiual channels. The order of the
  * channels is up to the application, but they must be continous. To map
  * channels to speakers, see \ref channelmap.
  *
@@ -138,10 +140,10 @@ typedef enum pa_sample_format {
     /**< Signed 16 Bit PCM, big endian */
 
     PA_SAMPLE_FLOAT32LE,
-    /**< 32 Bit IEEE floating point, little endian, range -1 to 1 */
+    /**< 32 Bit IEEE floating point, little endian (PC), range -1.0 to 1.0 */
 
     PA_SAMPLE_FLOAT32BE,
-    /**< 32 Bit IEEE floating point, big endian, range -1 to 1 */
+    /**< 32 Bit IEEE floating point, big endian, range -1.0 to 1.0 */
 
     PA_SAMPLE_S32LE,
     /**< Signed 32 Bit PCM, little endian (PC) */
@@ -150,10 +152,16 @@ typedef enum pa_sample_format {
     /**< Signed 32 Bit PCM, big endian */
 
     PA_SAMPLE_S24LE,
-    /**< Signed 24 Bit PCM packed, little endian (PC) */
+    /**< Signed 24 Bit PCM packed, little endian (PC). \since 0.9.15 */
 
     PA_SAMPLE_S24BE,
-    /**< Signed 24 Bit PCM packed, big endian */
+    /**< Signed 24 Bit PCM packed, big endian. \since 0.9.15 */
+
+    PA_SAMPLE_S24_32LE,
+    /**< Signed 24 Bit PCM in LSB of 32 Bit words, little endian (PC). \since 0.9.15 */
+
+    PA_SAMPLE_S24_32BE,
+    /**< Signed 24 Bit PCM in LSB of 32 Bit words, big endian. \since 0.9.15 */
 
     PA_SAMPLE_MAX,
     /**< Upper limit of valid sample types */
@@ -169,16 +177,21 @@ typedef enum pa_sample_format {
 #define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32BE
 /** Signed 32 Bit PCM, native endian */
 #define PA_SAMPLE_S32NE PA_SAMPLE_S32BE
-/** Signed 24 Bit PCM packed, native endian */
+/** Signed 24 Bit PCM packed, native endian. \since 0.9.15 */
 #define PA_SAMPLE_S24NE PA_SAMPLE_S24BE
+/** Signed 24 Bit PCM in LSB of 32 Bit words, native endian. \since 0.9.15 */
+#define PA_SAMPLE_S24_32NE PA_SAMPLE_S24_32BE
+
 /** Signed 16 Bit PCM reverse endian */
 #define PA_SAMPLE_S16RE PA_SAMPLE_S16LE
 /** 32 Bit IEEE floating point, reverse endian */
 #define PA_SAMPLE_FLOAT32RE PA_SAMPLE_FLOAT32LE
 /** Signed 32 Bit PCM, reverse endian */
 #define PA_SAMPLE_S32RE PA_SAMPLE_S32LE
-/** Signed 24 Bit PCM, packed reverse endian */
-#define PA_SAMPLE_S24RE PA_SAMPLE_242LE
+/** Signed 24 Bit PCM, packed reverse endian. \since 0.9.15 */
+#define PA_SAMPLE_S24RE PA_SAMPLE_S24LE
+/** Signed 24 Bit PCM, in LSB of 32 Bit words, reverse endian. \since 0.9.15 */
+#define PA_SAMPLE_S24_32RE PA_SAMPLE_S24_32LE
 #else
 /** Signed 16 Bit PCM, native endian */
 #define PA_SAMPLE_S16NE PA_SAMPLE_S16LE
@@ -186,16 +199,21 @@ typedef enum pa_sample_format {
 #define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32LE
 /** Signed 32 Bit PCM, native endian */
 #define PA_SAMPLE_S32NE PA_SAMPLE_S32LE
-/** Signed 24 Bit PCM packed, native endian */
+/** Signed 24 Bit PCM packed, native endian. \since 0.9.15 */
 #define PA_SAMPLE_S24NE PA_SAMPLE_S24LE
+/** Signed 24 Bit PCM in LSB of 32 Bit words, native endian. \since 0.9.15 */
+#define PA_SAMPLE_S24_32NE PA_SAMPLE_S24_32LE
+
 /** Signed 16 Bit PCM, reverse endian */
 #define PA_SAMPLE_S16RE PA_SAMPLE_S16BE
 /** 32 Bit IEEE floating point, reverse endian */
 #define PA_SAMPLE_FLOAT32RE PA_SAMPLE_FLOAT32BE
 /** Signed 32 Bit PCM, reverse endian */
 #define PA_SAMPLE_S32RE PA_SAMPLE_S32BE
-/** Signed 24 Bit PCM packed, reverse endian */
+/** Signed 24 Bit PCM, packed reverse endian. \since 0.9.15 */
 #define PA_SAMPLE_S24RE PA_SAMPLE_S24BE
+/** Signed 24 Bit PCM, in LSB of 32 Bit words, reverse endian. \since 0.9.15 */
+#define PA_SAMPLE_S24_32RE PA_SAMPLE_S24_32BE
 #endif
 
 /** A Shortcut for PA_SAMPLE_FLOAT32NE */
@@ -214,6 +232,8 @@ typedef enum pa_sample_format {
 #define PA_SAMPLE_S32BE PA_SAMPLE_S32BE
 #define PA_SAMPLE_S24LE PA_SAMPLE_S24LE
 #define PA_SAMPLE_S24BE PA_SAMPLE_S24BE
+#define PA_SAMPLE_S24_32LE PA_SAMPLE_S24_32LE
+#define PA_SAMPLE_S24_32BE PA_SAMPLE_S24_32BE
 /** \endcond */
 
 /** A sample format and attribute specification */
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index 2a958e0..5a29bd6 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -88,6 +88,7 @@ pa_stream *pa_stream_new_with_proplist(
     PA_CHECK_VALIDITY_RETURN_NULL(c, ss && pa_sample_spec_valid(ss), PA_ERR_INVALID);
     PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 12 || (ss->format != PA_SAMPLE_S32LE && ss->format != PA_SAMPLE_S32BE), PA_ERR_NOTSUPPORTED);
     PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 15 || (ss->format != PA_SAMPLE_S24LE && ss->format != PA_SAMPLE_S24BE), PA_ERR_NOTSUPPORTED);
+    PA_CHECK_VALIDITY_RETURN_NULL(c, c->version >= 15 || (ss->format != PA_SAMPLE_S24_32LE && ss->format != PA_SAMPLE_S24_32BE), PA_ERR_NOTSUPPORTED);
     PA_CHECK_VALIDITY_RETURN_NULL(c, !map || (pa_channel_map_valid(map) && map->channels == ss->channels), PA_ERR_INVALID);
     PA_CHECK_VALIDITY_RETURN_NULL(c, name || (p && pa_proplist_contains(p, PA_PROP_MEDIA_NAME)), PA_ERR_INVALID);
 
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index b1ef64f..5412267 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -2642,9 +2642,9 @@ static void fixup_sample_spec(pa_native_connection *c, pa_sample_spec *fixed, co
     }
 
     if (c->version < 15) {
-        if (fixed->format == PA_SAMPLE_S24LE)
+        if (fixed->format == PA_SAMPLE_S24LE || fixed->format == PA_SAMPLE_S24_32LE)
             fixed->format = PA_SAMPLE_FLOAT32LE;
-        if (fixed->format == PA_SAMPLE_S24BE)
+        if (fixed->format == PA_SAMPLE_S24BE || fixed->format == PA_SAMPLE_S24_32BE)
             fixed->format = PA_SAMPLE_FLOAT32BE;
     }
 }
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index 67c3758..6b3836e 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -258,9 +258,11 @@ pa_resampler* pa_resampler_new(
             if (a->format == PA_SAMPLE_S32NE || a->format == PA_SAMPLE_S32RE ||
                 a->format == PA_SAMPLE_FLOAT32NE || a->format == PA_SAMPLE_FLOAT32RE ||
                 a->format == PA_SAMPLE_S24NE || a->format == PA_SAMPLE_S24RE ||
+                a->format == PA_SAMPLE_S24_32NE || a->format == PA_SAMPLE_S24_32RE ||
                 b->format == PA_SAMPLE_S32NE || b->format == PA_SAMPLE_S32RE ||
                 b->format == PA_SAMPLE_FLOAT32NE || b->format == PA_SAMPLE_FLOAT32RE ||
-                b->format == PA_SAMPLE_S24NE || b->format == PA_SAMPLE_S24RE)
+                b->format == PA_SAMPLE_S24NE || b->format == PA_SAMPLE_S24RE ||
+                b->format == PA_SAMPLE_S24_32NE || b->format == PA_SAMPLE_S24_32RE)
                 r->work_format = PA_SAMPLE_FLOAT32NE;
             else
                 r->work_format = PA_SAMPLE_S16NE;
diff --git a/src/pulsecore/sample-util.c b/src/pulsecore/sample-util.c
index 533181b..cf7b4d5 100644
--- a/src/pulsecore/sample-util.c
+++ b/src/pulsecore/sample-util.c
@@ -85,6 +85,8 @@ static uint8_t silence_byte(pa_sample_format_t format) {
         case PA_SAMPLE_FLOAT32BE:
         case PA_SAMPLE_S24LE:
         case PA_SAMPLE_S24BE:
+        case PA_SAMPLE_S24_32LE:
+        case PA_SAMPLE_S24_32BE:
             return 0;
         case PA_SAMPLE_ALAW:
             return 0xd5;
@@ -414,6 +416,78 @@ size_t pa_mix(
             break;
         }
 
+        case PA_SAMPLE_S24_32NE: {
+            unsigned channel = 0;
+
+            calc_linear_integer_stream_volumes(streams, nstreams, volume, spec);
+
+            while (data < end) {
+                int64_t sum = 0;
+                unsigned i;
+
+                for (i = 0; i < nstreams; i++) {
+                    pa_mix_info *m = streams + i;
+                    int32_t cv = m->linear[channel].i;
+                    int64_t v;
+
+                    if (PA_UNLIKELY(cv <= 0))
+                        continue;
+
+                    v = (int32_t) (*((uint32_t*)m->ptr) << 8);
+                    v = (v * cv) / 0x10000;
+                    sum += v;
+
+                    m->ptr = (uint8_t*) m->ptr + sizeof(int32_t);
+                }
+
+                sum = PA_CLAMP_UNLIKELY(sum, -0x80000000LL, 0x7FFFFFFFLL);
+                *((uint32_t*) data) = ((uint32_t) (int32_t) sum) >> 8;
+
+                data = (uint8_t*) data + sizeof(uint32_t);
+
+                if (PA_UNLIKELY(++channel >= spec->channels))
+                    channel = 0;
+            }
+
+            break;
+        }
+
+        case PA_SAMPLE_S24_32RE: {
+            unsigned channel = 0;
+
+            calc_linear_integer_stream_volumes(streams, nstreams, volume, spec);
+
+            while (data < end) {
+                int64_t sum = 0;
+                unsigned i;
+
+                for (i = 0; i < nstreams; i++) {
+                    pa_mix_info *m = streams + i;
+                    int32_t cv = m->linear[channel].i;
+                    int64_t v;
+
+                    if (PA_UNLIKELY(cv <= 0))
+                        continue;
+
+                    v = (int32_t) (PA_UINT32_SWAP(*((uint32_t*) m->ptr)) << 8);
+                    v = (v * cv) / 0x10000;
+                    sum += v;
+
+                    m->ptr = (uint8_t*) m->ptr + 3;
+                }
+
+                sum = PA_CLAMP_UNLIKELY(sum, -0x80000000LL, 0x7FFFFFFFLL);
+                *((uint32_t*) data) = PA_INT32_SWAP(((uint32_t) (int32_t) sum) >> 8);
+
+                data = (uint8_t*) data + sizeof(uint32_t);
+
+                if (PA_UNLIKELY(++channel >= spec->channels))
+                    channel = 0;
+            }
+
+            break;
+        }
+
         case PA_SAMPLE_U8: {
             unsigned channel = 0;
 
@@ -765,6 +839,52 @@ void pa_volume_memchunk(
             break;
         }
 
+        case PA_SAMPLE_S24_32NE: {
+            uint32_t *d, *e;
+            unsigned channel;
+            int32_t linear[PA_CHANNELS_MAX];
+
+            calc_linear_integer_volume(linear, volume);
+
+            e = (uint32_t*) ptr + c->length/sizeof(uint32_t);
+
+            for (channel = 0, d = ptr; d < e; d++) {
+                int64_t t;
+
+                t = (int64_t) ((int32_t) (*d << 8));
+                t = (t * linear[channel]) / 0x10000;
+                t = PA_CLAMP_UNLIKELY(t, -0x80000000LL, 0x7FFFFFFFLL);
+                *d = ((uint32_t) ((int32_t) t)) >> 8;
+
+                if (PA_UNLIKELY(++channel >= spec->channels))
+                    channel = 0;
+            }
+            break;
+        }
+
+        case PA_SAMPLE_S24_32RE: {
+            uint32_t *d, *e;
+            unsigned channel;
+            int32_t linear[PA_CHANNELS_MAX];
+
+            calc_linear_integer_volume(linear, volume);
+
+            e = (uint32_t*) ptr + c->length/sizeof(uint32_t);
+
+            for (channel = 0, d = ptr; d < e; d++) {
+                int64_t t;
+
+                t = (int64_t) ((int32_t) (PA_UINT32_SWAP(*d) << 8));
+                t = (t * linear[channel]) / 0x10000;
+                t = PA_CLAMP_UNLIKELY(t, -0x80000000LL, 0x7FFFFFFFLL);
+                *d = PA_UINT32_SWAP(((uint32_t) ((int32_t) t)) >> 8);
+
+                if (PA_UNLIKELY(++channel >= spec->channels))
+                    channel = 0;
+            }
+            break;
+        }
+
         case PA_SAMPLE_U8: {
             uint8_t *d, *e;
             unsigned channel;
diff --git a/src/pulsecore/sconv-s16be.c b/src/pulsecore/sconv-s16be.c
index d6137d3..0d5146a 100644
--- a/src/pulsecore/sconv-s16be.c
+++ b/src/pulsecore/sconv-s16be.c
@@ -27,9 +27,13 @@
 
 #define INT16_FROM PA_INT16_FROM_BE
 #define INT16_TO PA_INT16_TO_BE
+#define UINT16_FROM PA_UINT16_FROM_BE
+#define UINT16_TO PA_UINT16_TO_BE
 
 #define INT32_FROM PA_INT32_FROM_BE
 #define INT32_TO PA_INT32_TO_BE
+#define UINT32_FROM PA_UINT32_FROM_BE
+#define UINT32_TO PA_UINT32_TO_BE
 
 #define READ24 PA_READ24BE
 #define WRITE24 PA_WRITE24BE
@@ -49,6 +53,11 @@
 #define pa_sconv_s24le_to_float32re pa_sconv_s24be_to_float32re
 #define pa_sconv_s24le_from_float32re pa_sconv_s24be_from_float32re
 
+#define pa_sconv_s24_32le_to_float32ne pa_sconv_s24_32be_to_float32ne
+#define pa_sconv_s24_32le_from_float32ne pa_sconv_s24_32be_from_float32ne
+#define pa_sconv_s24_32le_to_float32re pa_sconv_s24_32be_to_float32re
+#define pa_sconv_s24_32le_from_float32re pa_sconv_s24_32be_from_float32re
+
 #define pa_sconv_s32le_to_s16ne pa_sconv_s32be_to_s16ne
 #define pa_sconv_s32le_from_s16ne pa_sconv_s32be_from_s16ne
 #define pa_sconv_s32le_to_s16re pa_sconv_s32be_to_s16re
@@ -59,6 +68,11 @@
 #define pa_sconv_s24le_to_s16re pa_sconv_s24be_to_s16re
 #define pa_sconv_s24le_from_s16re pa_sconv_s24be_from_s16re
 
+#define pa_sconv_s24_32le_to_s16ne pa_sconv_s24_32be_to_s16ne
+#define pa_sconv_s24_32le_from_s16ne pa_sconv_s24_32be_from_s16ne
+#define pa_sconv_s24_32le_to_s16re pa_sconv_s24_32be_to_s16re
+#define pa_sconv_s24_32le_from_s16re pa_sconv_s24_32be_from_s16re
+
 #ifdef WORDS_BIGENDIAN
 #define SWAP_WORDS 0
 #else
diff --git a/src/pulsecore/sconv-s16be.h b/src/pulsecore/sconv-s16be.h
index 1b88fd4..0263333 100644
--- a/src/pulsecore/sconv-s16be.h
+++ b/src/pulsecore/sconv-s16be.h
@@ -39,6 +39,11 @@ void pa_sconv_s24be_from_float32ne(unsigned n, const float *a, uint8_t *b);
 void pa_sconv_s24be_to_float32re(unsigned n, const uint8_t *a, float *b);
 void pa_sconv_s24be_from_float32re(unsigned n, const float *a, uint8_t *b);
 
+void pa_sconv_s24_32be_to_float32ne(unsigned n, const uint8_t *a, float *b);
+void pa_sconv_s24_32be_from_float32ne(unsigned n, const float *a, uint8_t *b);
+void pa_sconv_s24_32be_to_float32re(unsigned n, const uint8_t *a, float *b);
+void pa_sconv_s24_32be_from_float32re(unsigned n, const float *a, uint8_t *b);
+
 void pa_sconv_s32be_to_s16ne(unsigned n, const int32_t *a, int16_t *b);
 void pa_sconv_s32be_from_s16ne(unsigned n, const int16_t *a, int32_t *b);
 void pa_sconv_s32be_to_s16re(unsigned n, const int32_t *a, int16_t *b);
@@ -49,6 +54,11 @@ void pa_sconv_s24be_from_s16ne(unsigned n, const int16_t *a, uint8_t *b);
 void pa_sconv_s24be_to_s16re(unsigned n, const uint8_t *a, int16_t *b);
 void pa_sconv_s24be_from_s16re(unsigned n, const int16_t *a, uint8_t *b);
 
+void pa_sconv_s24_32be_to_s16ne(unsigned n, const uint8_t *a, int16_t *b);
+void pa_sconv_s24_32be_from_s16ne(unsigned n, const int16_t *a, uint8_t *b);
+void pa_sconv_s24_32be_to_s16re(unsigned n, const uint8_t *a, int16_t *b);
+void pa_sconv_s24_32be_from_s16re(unsigned n, const int16_t *a, uint8_t *b);
+
 #ifdef WORDS_BIGENDIAN
 #define pa_sconv_float32be_to_s16ne pa_sconv_s16be_from_float32ne
 #define pa_sconv_float32be_from_s16ne pa_sconv_s16be_to_float32ne
diff --git a/src/pulsecore/sconv-s16le.c b/src/pulsecore/sconv-s16le.c
index 37ebc98..79f0391 100644
--- a/src/pulsecore/sconv-s16le.c
+++ b/src/pulsecore/sconv-s16le.c
@@ -41,23 +41,34 @@
 #ifndef INT16_FROM
 #define INT16_FROM PA_INT16_FROM_LE
 #endif
+#ifndef UINT16_FROM
+#define UINT16_FROM PA_UINT16_FROM_LE
+#endif
 
 #ifndef INT16_TO
 #define INT16_TO PA_INT16_TO_LE
 #endif
+#ifndef UINT16_TO
+#define UINT16_TO PA_UINT16_TO_LE
+#endif
 
 #ifndef INT32_FROM
 #define INT32_FROM PA_INT32_FROM_LE
 #endif
+#ifndef UINT32_FROM
+#define UINT32_FROM PA_UINT32_FROM_LE
+#endif
 
 #ifndef INT32_TO
 #define INT32_TO PA_INT32_TO_LE
 #endif
+#ifndef UINT32_TO
+#define UINT32_TO PA_UINT32_TO_LE
+#endif
 
 #ifndef READ24
 #define READ24 PA_READ24LE
 #endif
-
 #ifndef WRITE24
 #define WRITE24 PA_WRITE24LE
 #endif
@@ -353,3 +364,105 @@ void pa_sconv_s24le_from_float32re(unsigned n, const float *a, uint8_t *b) {
         b+=3;
     }
 }
+
+void pa_sconv_s24_32le_to_s16ne(unsigned n, const uint32_t *a, int16_t *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        *b = (int16_t) ((int32_t) (UINT32_FROM(*a) << 8) >> 16);
+        a++;
+        b++;
+    }
+}
+
+void pa_sconv_s24_32le_to_s16re(unsigned n, const uint32_t *a, int16_t *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        int16_t s = (int16_t) ((int32_t) (UINT32_FROM(*a) << 8) >> 16);
+        *b = PA_INT16_SWAP(s);
+        a++;
+        b++;
+    }
+}
+
+void pa_sconv_s24_32le_from_s16ne(unsigned n, const int16_t *a, uint32_t *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        *b = UINT32_TO(((uint32_t) ((int32_t) *a << 16)) >> 8);
+        a++;
+        b++;
+    }
+}
+
+void pa_sconv_s24_32le_from_s16re(unsigned n, const int16_t *a, uint32_t *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        uint32_t s = ((uint32_t) ((int32_t) PA_INT16_SWAP(*a) << 16)) >> 8;
+        *b = UINT32_TO(s);
+        a++;
+        b++;
+    }
+}
+
+void pa_sconv_s24_32le_to_float32ne(unsigned n, const uint32_t *a, float *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        int32_t s = (int16_t) ((int32_t) (UINT32_FROM(*a) << 8));
+        *b = ((float) s) / 0x7FFFFFFF;
+        a ++;
+        b ++;
+    }
+}
+
+void pa_sconv_s24_32le_to_float32re(unsigned n, const uint32_t *a, float *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        int32_t s = (int16_t) ((int32_t) (UINT32_FROM(*a) << 8));
+        float k = ((float) s) / 0x7FFFFFFF;
+        *b = PA_FLOAT32_SWAP(k);
+        a ++;
+        b ++;
+    }
+}
+
+void pa_sconv_s24_32le_from_float32ne(unsigned n, const float *a, uint32_t *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        int32_t s;
+        float v = *a;
+        v = PA_CLAMP_UNLIKELY(v, -1.0f, 1.0f);
+        s = (int32_t) lrint((double) v * (double) 0x7FFFFFFF);
+        *b = UINT32_TO(((uint32_t) s) >> 8);
+        a++;
+        b++;
+    }
+}
+
+void pa_sconv_s24_32le_from_float32re(unsigned n, const float *a, uint32_t *b) {
+    pa_assert(a);
+    pa_assert(b);
+
+    for (; n > 0; n--) {
+        int32_t s;
+        float v = *a;
+        v = PA_FLOAT32_SWAP(v);
+        v = PA_CLAMP_UNLIKELY(v, -1.0f, 1.0f);
+        s = (int32_t) lrint((double) v * (double) 0x7FFFFFFF);
+        *b = UINT32_TO(((uint32_t) s) >> 8);
+        a++;
+        b++;
+    }
+}
diff --git a/src/pulsecore/sconv-s16le.h b/src/pulsecore/sconv-s16le.h
index b853515..f7b0064 100644
--- a/src/pulsecore/sconv-s16le.h
+++ b/src/pulsecore/sconv-s16le.h
@@ -39,6 +39,11 @@ void pa_sconv_s24le_from_float32ne(unsigned n, const float *a, uint8_t *b);
 void pa_sconv_s24le_to_float32re(unsigned n, const uint8_t *a, float *b);
 void pa_sconv_s24le_from_float32re(unsigned n, const float *a, uint8_t *b);
 
+void pa_sconv_s24_32le_to_float32ne(unsigned n, const uint32_t *a, float *b);
+void pa_sconv_s24_32le_from_float32ne(unsigned n, const float *a, uint32_t *b);
+void pa_sconv_s24_32le_to_float32re(unsigned n, const uint32_t *a, float *b);
+void pa_sconv_s24_32le_from_float32re(unsigned n, const float *a, uint32_t *b);
+
 void pa_sconv_s32le_to_s16ne(unsigned n, const int32_t *a, int16_t *b);
 void pa_sconv_s32le_from_s16ne(unsigned n, const int16_t *a, int32_t *b);
 void pa_sconv_s32le_to_s16re(unsigned n, const int32_t *a, int16_t *b);
@@ -49,6 +54,11 @@ void pa_sconv_s24le_from_s16ne(unsigned n, const int16_t *a, uint8_t *b);
 void pa_sconv_s24le_to_s16re(unsigned n, const uint8_t *a, int16_t *b);
 void pa_sconv_s24le_from_s16re(unsigned n, const int16_t *a, uint8_t *b);
 
+void pa_sconv_s24_32le_to_s16ne(unsigned n, const uint32_t *a, int16_t *b);
+void pa_sconv_s24_32le_from_s16ne(unsigned n, const int16_t *a, uint32_t *b);
+void pa_sconv_s24_32le_to_s16re(unsigned n, const uint32_t *a, int16_t *b);
+void pa_sconv_s24_32le_from_s16re(unsigned n, const int16_t *a, uint32_t *b);
+
 #ifndef WORDS_BIGENDIAN
 #define pa_sconv_float32be_to_s16ne pa_sconv_s16le_from_float32re
 #define pa_sconv_float32be_from_s16ne pa_sconv_s16le_to_float32re
diff --git a/src/pulsecore/sconv.c b/src/pulsecore/sconv.c
index 13700c1..fcd0309 100644
--- a/src/pulsecore/sconv.c
+++ b/src/pulsecore/sconv.c
@@ -200,6 +200,8 @@ pa_convert_func_t pa_get_convert_to_float32ne_function(pa_sample_format_t f) {
         [PA_SAMPLE_S32BE]     = (pa_convert_func_t) pa_sconv_s32be_to_float32ne,
         [PA_SAMPLE_S24LE]     = (pa_convert_func_t) pa_sconv_s24le_to_float32ne,
         [PA_SAMPLE_S24BE]     = (pa_convert_func_t) pa_sconv_s24be_to_float32ne,
+        [PA_SAMPLE_S24_32LE]  = (pa_convert_func_t) pa_sconv_s24_32le_to_float32ne,
+        [PA_SAMPLE_S24_32BE]  = (pa_convert_func_t) pa_sconv_s24_32be_to_float32ne,
         [PA_SAMPLE_FLOAT32NE] = (pa_convert_func_t) float32ne_to_float32ne,
         [PA_SAMPLE_FLOAT32RE] = (pa_convert_func_t) float32re_to_float32ne,
     };
@@ -220,6 +222,8 @@ pa_convert_func_t pa_get_convert_from_float32ne_function(pa_sample_format_t f) {
         [PA_SAMPLE_S32BE]     = (pa_convert_func_t) pa_sconv_s32be_from_float32ne,
         [PA_SAMPLE_S24LE]     = (pa_convert_func_t) pa_sconv_s24le_from_float32ne,
         [PA_SAMPLE_S24BE]     = (pa_convert_func_t) pa_sconv_s24be_from_float32ne,
+        [PA_SAMPLE_S24_32LE]  = (pa_convert_func_t) pa_sconv_s24_32le_from_float32ne,
+        [PA_SAMPLE_S24_32BE]  = (pa_convert_func_t) pa_sconv_s24_32be_from_float32ne,
         [PA_SAMPLE_FLOAT32NE] = (pa_convert_func_t) float32ne_to_float32ne,
         [PA_SAMPLE_FLOAT32RE] = (pa_convert_func_t) float32re_to_float32ne,
         [PA_SAMPLE_ALAW]      = (pa_convert_func_t) alaw_from_float32ne,
@@ -244,6 +248,8 @@ pa_convert_func_t pa_get_convert_to_s16ne_function(pa_sample_format_t f) {
         [PA_SAMPLE_S32LE]     = (pa_convert_func_t) pa_sconv_s32le_to_s16ne,
         [PA_SAMPLE_S24BE]     = (pa_convert_func_t) pa_sconv_s24be_to_s16ne,
         [PA_SAMPLE_S24LE]     = (pa_convert_func_t) pa_sconv_s24le_to_s16ne,
+        [PA_SAMPLE_S24_32BE]  = (pa_convert_func_t) pa_sconv_s24_32be_to_s16ne,
+        [PA_SAMPLE_S24_32LE]  = (pa_convert_func_t) pa_sconv_s24_32le_to_s16ne,
         [PA_SAMPLE_ALAW]      = (pa_convert_func_t) alaw_to_s16ne,
         [PA_SAMPLE_ULAW]      = (pa_convert_func_t) ulaw_to_s16ne
     };
@@ -266,6 +272,8 @@ pa_convert_func_t pa_get_convert_from_s16ne_function(pa_sample_format_t f) {
         [PA_SAMPLE_S32LE]     = (pa_convert_func_t) pa_sconv_s32le_from_s16ne,
         [PA_SAMPLE_S24BE]     = (pa_convert_func_t) pa_sconv_s24be_from_s16ne,
         [PA_SAMPLE_S24LE]     = (pa_convert_func_t) pa_sconv_s24le_from_s16ne,
+        [PA_SAMPLE_S24_32BE]  = (pa_convert_func_t) pa_sconv_s24_32be_from_s16ne,
+        [PA_SAMPLE_S24_32LE]  = (pa_convert_func_t) pa_sconv_s24_32le_from_s16ne,
         [PA_SAMPLE_ALAW]      = (pa_convert_func_t) alaw_from_s16ne,
         [PA_SAMPLE_ULAW]      = (pa_convert_func_t) ulaw_from_s16ne,
     };

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list