[pulseaudio-commits] 7 commits - configure.ac src/modules src/pulse src/pulsecore src/utils vala/libpulse.vapi

Arun Raghavan arun at kemper.freedesktop.org
Fri Jan 22 00:01:36 PST 2016


 configure.ac                  |    7 +++++++
 src/modules/module-solaris.c  |   12 +++++++++---
 src/pulse/format.c            |    8 +++++++-
 src/pulse/sample.h            |    2 +-
 src/pulsecore/source-output.c |   23 ++++++++++-------------
 src/utils/padsp.c             |    6 ++++++
 vala/libpulse.vapi            |   15 +++++++++++++++
 7 files changed, 55 insertions(+), 18 deletions(-)

New commits:
commit a1191874fe73e016cf292356e620ded59a7a9acf
Author: Kamil Rytarowski <n54 at gmx.com>
Date:   Mon Dec 21 04:10:35 2015 +0100

    solaris: Illumos does not ship with SOUND_PCM* functionality
    
    Code reference:
    https://github.com/joyent/illumos-joyent/blob/master/usr/src/uts/common/sys/audio/audio_oss.h
    
    Add autoconf checks for:
    - SOUND_PCM_READ_RATE
    - SOUND_PCM_READ_CHANNELS
    - SOUND_PCM_READ_BITS
    
    Some platforms like SunOS (Illumos) may ship without SOUND_PCM_* functionality
    
    Thanks to Jonathan Perkin (Joyent) for Illumos code reference.

diff --git a/configure.ac b/configure.ac
index 9250c05..dcd0110 100644
--- a/configure.ac
+++ b/configure.ac
@@ -780,6 +780,13 @@ AM_CONDITIONAL([HAVE_OSS_WRAPPER], [test "x$HAVE_OSS_WRAPPER" = "x1"])
 AS_IF([test "x$HAVE_OSS_OUTPUT" = "x1"], AC_DEFINE([HAVE_OSS_OUTPUT], 1, [Have OSS output?]))
 AS_IF([test "x$HAVE_OSS_WRAPPER" = "x1"], AC_DEFINE([HAVE_OSS_WRAPPER], 1, [Have OSS wrapper (padsp)?]))
 
+# Some platforms like SunOS (Illumos) may ship without SOUND_PCM_* functionality
+if test "x$HAVE_OSS" = "x1"; then
+    AC_CHECK_DECLS([SOUND_PCM_READ_RATE], [], [], [[#include <sys/soundcard.h>]])
+    AC_CHECK_DECLS([SOUND_PCM_READ_CHANNELS], [], [], [[#include <sys/soundcard.h>]])
+    AC_CHECK_DECLS([SOUND_PCM_READ_BITS], [], [], [[#include <sys/soundcard.h>]])
+fi
+
 #### CoreAudio support (optional) ####
 
 AC_ARG_ENABLE([coreaudio-output],
diff --git a/src/utils/padsp.c b/src/utils/padsp.c
index 5e336bb..943479b 100644
--- a/src/utils/padsp.c
+++ b/src/utils/padsp.c
@@ -2278,6 +2278,7 @@ static int dsp_ioctl(fd_info *i, unsigned long request, void*argp, int *_errno)
             break;
         }
 
+#if HAVE_DECL_SOUND_PCM_READ_RATE
         case SOUND_PCM_READ_RATE:
             debug(DEBUG_LEVEL_NORMAL, __FILE__": SOUND_PCM_READ_RATE\n");
 
@@ -2285,7 +2286,9 @@ static int dsp_ioctl(fd_info *i, unsigned long request, void*argp, int *_errno)
             *(int*) argp = i->sample_spec.rate;
             pa_threaded_mainloop_unlock(i->mainloop);
             break;
+#endif
 
+#if HAVE_DECL_SOUND_PCM_READ_CHANNELS
         case SOUND_PCM_READ_CHANNELS:
             debug(DEBUG_LEVEL_NORMAL, __FILE__": SOUND_PCM_READ_CHANNELS\n");
 
@@ -2293,7 +2296,9 @@ static int dsp_ioctl(fd_info *i, unsigned long request, void*argp, int *_errno)
             *(int*) argp = i->sample_spec.channels;
             pa_threaded_mainloop_unlock(i->mainloop);
             break;
+#endif
 
+#if HAVE_DECL_SOUND_PCM_READ_BITS
         case SOUND_PCM_READ_BITS:
             debug(DEBUG_LEVEL_NORMAL, __FILE__": SOUND_PCM_READ_BITS\n");
 
@@ -2301,6 +2306,7 @@ static int dsp_ioctl(fd_info *i, unsigned long request, void*argp, int *_errno)
             *(int*) argp = pa_sample_size(&i->sample_spec)*8;
             pa_threaded_mainloop_unlock(i->mainloop);
             break;
+#endif
 
         case SNDCTL_DSP_GETOPTR: {
             count_info *info;

commit 68216e8ff804dcbf1f5aad07eeae86403324435c
Author: Jonathan Perkin <jperkin at joyent.com>
Date:   Mon Dec 21 04:10:34 2015 +0100

    solaris: Catch up with newer API
    
    Patch upstreamed from pkgsrc by Kamil Rytarowski <n54 at gmx.com>.
    
    See commit e4a7625ba884c5cce20468d75937857343751c35 for why this was
    originally done.

diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index c79918a..2fa0bff 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -412,10 +412,12 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
                         pa_smoother_resume(u->smoother, pa_rtclock_now(), true);
 
                         if (!u->source || u->source_suspended) {
+                            bool mute;
                             if (unsuspend(u) < 0)
                                 return -1;
                             u->sink->get_volume(u->sink);
-                            u->sink->get_mute(u->sink);
+                            if (u->sink->get_mute(u->sink, &mute) >= 0)
+                                pa_sink_set_mute(u->sink, mute, false);
                         }
                         u->sink_suspended = false;
                     }
@@ -1033,8 +1035,12 @@ int pa__init(pa_module *m) {
 
         if (sink_new_data.muted_is_set)
             u->sink->set_mute(u->sink);
-        else
-            u->sink->get_mute(u->sink);
+        else {
+            bool mute;
+
+            if (u->sink->get_mute(u->sink, &mute) >= 0)
+                pa_sink_set_mute(u->sink, mute, false);
+        }
 
         pa_sink_put(u->sink);
     }

commit 81d3eb84672726e61d46dcb429a73422f43b691c
Author: Marcin Lewandowski <marcin at radiokit.org>
Date:   Sat Jan 16 15:42:34 2016 +0100

    vala: Added cnames to callback delegates in Vala VAPI

diff --git a/vala/libpulse.vapi b/vala/libpulse.vapi
index 345e284..207cedf 100644
--- a/vala/libpulse.vapi
+++ b/vala/libpulse.vapi
@@ -956,20 +956,35 @@ namespace PulseAudio {
                         TYPE_MASK
                 }
 
+                [CCode (cname = "pa_context_notify_cb_t")]
                 public delegate void NotifyCb(Context c);
+                [CCode (cname = "pa_context_success_cb_t")]
                 public delegate void SuccessCb(Context c, int success);
+                [CCode (cname = "pa_context_event_cb_t")]
                 public delegate void EventCb(Context c, string name, Proplist? proplist);
+                [CCode (cname = "pa_context_subscribe_cb_t")]
                 public delegate void SubscribeCb(Context c, SubscriptionEventType t, uint32 idx);
+                [CCode (cname = "pa_sink_info_cb_t")]
                 public delegate void SinkInfoCb(Context c, SinkInfo? i, int eol);
+                [CCode (cname = "pa_source_info_cb_t")]
                 public delegate void SourceInfoCb(Context c, SourceInfo? i, int eol);
+                [CCode (cname = "pa_card_info_cb_t")]
                 public delegate void CardInfoCb(Context c, CardInfo? i, int eol);
+                [CCode (cname = "pa_sink_input_info_cb_t")]
                 public delegate void SinkInputInfoCb(Context c, SinkInputInfo? i, int eol);
+                [CCode (cname = "pa_source_output_info_cb_t")]
                 public delegate void SourceOutputInfoCb(Context c, SourceOutputInfo? i, int eol);
+                [CCode (cname = "pa_server_info_cb_t")]
                 public delegate void ServerInfoCb(Context c, ServerInfo? i);
+                [CCode (cname = "pa_stat_info_cb_t")]
                 public delegate void StatInfoCb(Context c, ServerInfo? i);
+                [CCode (cname = "pa_module_info_cb_t")]
                 public delegate void ModuleInfoCb(Context c, ModuleInfo? i, int eol);
+                [CCode (cname = "pa_client_info_cb_t")]
                 public delegate void ClientInfoCb(Context c, ClientInfo? i, int eol);
+                [CCode (cname = "pa_sample_info_cb_t")]
                 public delegate void SampleInfoCb(Context c, SampleInfo? i, int eol);
+                [CCode (cname = "pa_context_index_cb_t")]
                 public delegate void IndexCb(Context c, uint32 idx);
 
                 [CCode (cname="pa_context_new_with_proplist")]

commit 6a754ad4a975de8f7b4d6520a6f6c5f43f6f786b
Author: Tanu Kaskinen <tanuk at iki.fi>
Date:   Thu Jan 7 15:25:41 2016 +0200

    source-output: remap volume_factor_source when starting move
    
    This gets rid of an error message from the debug log. If
    volume_factor_source would actually be used somewhere, this bug would
    have caused more severe problems.
    
    volume_factor_source should have the source's channel map. When moving
    the stream, the volume needs to be remapped from the old source's
    channel map to the new source's map. However, when the stream is being
    moved, there is a period where the old source has already been
    forgotten and the new source isn't yet known, so the remapping can't
    be done directly between the two channel maps. Instead, the volume is
    remapped from the old source's map to the stream's own map when the
    move starts, and again remapped from the stream's map to the new
    source's map when the move finishes.
    
    The first remapping was missing, causing the second remapping fail and
    print an error to the log.
    
    (I checked the sink input code as well. It didn't have this bug.)

diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 66a0341..9217ad4 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -1244,6 +1244,9 @@ int pa_source_output_start_move(pa_source_output *o) {
     pa_assert_se(pa_asyncmsgq_send(o->source->asyncmsgq, PA_MSGOBJECT(o->source), PA_SOURCE_MESSAGE_REMOVE_OUTPUT, o, 0, NULL) == 0);
 
     pa_source_update_status(o->source);
+
+    pa_cvolume_remap(&o->volume_factor_source, &o->source->channel_map, &o->channel_map);
+
     o->source = NULL;
 
     pa_source_output_unref(o);

commit b2e7cf65212a1abfbff282965e582f8fc56a964a
Author: Tanu Kaskinen <tanuk at iki.fi>
Date:   Thu Jan 7 15:25:40 2016 +0200

    source-output: do volume_factor_source application before resampling
    
    Applying the volume after resampling means mismatch between the volume
    channel map and the data channel map.
    
    volume_factor_source is not currently used anywhere, so this bug
    hasn't been causing any problems. I noticed it while reading the code.

diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index c73c548..66a0341 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -792,14 +792,14 @@ void pa_source_output_push(pa_source_output *o, const pa_memchunk *chunk) {
                 pa_volume_memchunk(&qchunk, &o->source->sample_spec, &o->thread_info.soft_volume);
         }
 
-        if (!o->thread_info.resampler) {
-            if (nvfs) {
-                pa_memchunk_make_writable(&qchunk, 0);
-                pa_volume_memchunk(&qchunk, &o->thread_info.sample_spec, &o->volume_factor_source);
-            }
+        if (nvfs) {
+            pa_memchunk_make_writable(&qchunk, 0);
+            pa_volume_memchunk(&qchunk, &o->source->sample_spec, &o->volume_factor_source);
+        }
 
+        if (!o->thread_info.resampler)
             o->push(o, &qchunk);
-        } else {
+        else {
             pa_memchunk rchunk;
 
             if (mbs == 0)
@@ -810,14 +810,8 @@ void pa_source_output_push(pa_source_output *o, const pa_memchunk *chunk) {
 
             pa_resampler_run(o->thread_info.resampler, &qchunk, &rchunk);
 
-            if (rchunk.length > 0) {
-                if (nvfs) {
-                    pa_memchunk_make_writable(&rchunk, 0);
-                    pa_volume_memchunk(&rchunk, &o->thread_info.sample_spec, &o->volume_factor_source);
-                }
-
+            if (rchunk.length > 0)
                 o->push(o, &rchunk);
-            }
 
             if (rchunk.memblock)
                 pa_memblock_unref(rchunk.memblock);

commit a958297fc878bee63a32ddc1b8af2b7c9f73a49e
Author: Arun Raghavan <git at arunraghavan.net>
Date:   Thu Dec 31 09:28:28 2015 +0530

    pulse: Bump PA_RATE_MAX to 384 kHz
    
    This will likely be needed in the future when we start supporting high
    bitrate passthrough, and there actually seem to be people 352/384 kHz
    out there (potentially as an intermediate production step).

diff --git a/src/pulse/sample.h b/src/pulse/sample.h
index 7cf50d6..4299eec 100644
--- a/src/pulse/sample.h
+++ b/src/pulse/sample.h
@@ -128,7 +128,7 @@ PA_C_DECL_BEGIN
 #define PA_CHANNELS_MAX 32U
 
 /** Maximum allowed sample rate */
-#define PA_RATE_MAX (48000U*4U)
+#define PA_RATE_MAX (48000U*8U)
 
 /** Sample format */
 typedef enum pa_sample_format {

commit 12a202c510dcacbd2b85fcc1170484eb16fef491
Author: Arun Raghavan <git at arunraghavan.net>
Date:   Thu Dec 31 09:27:56 2015 +0530

    format: Make pa_format_info_valid() stricter for PCM
    
    We should do stricter validation when we can.

diff --git a/src/pulse/format.c b/src/pulse/format.c
index c2a1552..b07940a 100644
--- a/src/pulse/format.c
+++ b/src/pulse/format.c
@@ -101,7 +101,13 @@ void pa_format_info_free(pa_format_info *f) {
 }
 
 int pa_format_info_valid(const pa_format_info *f) {
-    return (f->encoding >= 0 && f->encoding < PA_ENCODING_MAX && f->plist != NULL);
+    pa_sample_spec ss;
+
+    if (pa_format_info_is_pcm(f)) {
+        pa_format_info_to_sample_spec(f, &ss, NULL);
+        return pa_sample_spec_valid(&ss);
+    } else
+        return (f->encoding >= 0 && f->encoding < PA_ENCODING_MAX && f->plist != NULL);
 }
 
 int pa_format_info_is_pcm(const pa_format_info *f) {



More information about the pulseaudio-commits mailing list