[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.15-test5-138-g5348cc1

Lennart Poettering gitmailer-noreply at 0pointer.de
Tue Mar 31 15:36:24 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  4e8ceae064758bc5ea8b541e8c7ceb804fc48d5d (commit)

- Log -----------------------------------------------------------------
5348cc1 increase timing update interval exponentially
aa1ad0d in verbose mode log buffer attr changes
0aa99c4 add buffer_attr callback stuff to exported symbol list
-----------------------------------------------------------------------

Summary of changes:
 src/map-file         |    1 +
 src/pulse/internal.h |    1 +
 src/pulse/stream.c   |   17 +++++++++++++----
 src/utils/pacat.c    |    8 ++++++++
 4 files changed, 23 insertions(+), 4 deletions(-)

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

commit 0aa99c48d014d38347e8b9a85252ca9c450627bd
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Apr 1 00:33:40 2009 +0200

    add buffer_attr callback stuff to exported symbol list

diff --git a/src/map-file b/src/map-file
index d949659..d0102ae 100644
--- a/src/map-file
+++ b/src/map-file
@@ -233,6 +233,7 @@ pa_stream_proplist_update;
 pa_stream_readable_size;
 pa_stream_ref;
 pa_stream_set_buffer_attr;
+pa_stream_set_buffer_attr_callback;
 pa_stream_set_event_callback;
 pa_stream_set_latency_update_callback;
 pa_stream_set_monitor_stream;

commit aa1ad0df188f308f00a7b648d0d4b64322eaed64
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Apr 1 00:35:37 2009 +0200

    in verbose mode log buffer attr changes

diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index e886c15..180de48 100644
--- a/src/utils/pacat.c
+++ b/src/utils/pacat.c
@@ -238,6 +238,13 @@ static void stream_moved_callback(pa_stream *s, void *userdata) {
         fprintf(stderr, _("Stream moved to device %s (%u, %ssuspended).%s \n"), pa_stream_get_device_name(s), pa_stream_get_device_index(s), pa_stream_is_suspended(s) ? "" : _("not "),  CLEAR_LINE);
 }
 
+static void stream_buffer_attr_callback(pa_stream *s, void *userdata) {
+    assert(s);
+
+    if (verbose)
+        fprintf(stderr, _("Stream buffer attributes changed.%s \n"),  CLEAR_LINE);
+}
+
 static void stream_event_callback(pa_stream *s, const char *name, pa_proplist *pl, void *userdata) {
     char *t;
 
@@ -284,6 +291,7 @@ static void context_state_callback(pa_context *c, void *userdata) {
             pa_stream_set_overflow_callback(stream, stream_overflow_callback, NULL);
             pa_stream_set_started_callback(stream, stream_started_callback, NULL);
             pa_stream_set_event_callback(stream, stream_event_callback, NULL);
+            pa_stream_set_buffer_attr_callback(stream, stream_buffer_attr_callback, NULL);
 
             if (latency > 0) {
                 memset(&buffer_attr, 0, sizeof(buffer_attr));

commit 5348cc1275255fe423ca228f30c395a1e832811e
Author: Lennart Poettering <lennart at poettering.net>
Date:   Wed Apr 1 00:36:18 2009 +0200

    increase timing update interval exponentially

diff --git a/src/pulse/internal.h b/src/pulse/internal.h
index da94faa..cf362d9 100644
--- a/src/pulse/internal.h
+++ b/src/pulse/internal.h
@@ -166,6 +166,7 @@ struct pa_stream {
 
     /* Latency interpolation stuff */
     pa_time_event *auto_timing_update_event;
+    pa_usec_t auto_timing_interval_usec;
 
     pa_smoother *smoother;
 
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index bb53b19..16342ca 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -41,7 +41,8 @@
 #include "fork-detect.h"
 #include "internal.h"
 
-#define LATENCY_IPOL_INTERVAL_USEC (333*PA_USEC_PER_MSEC)
+#define AUTO_TIMING_INTERVAL_START_USEC (10*PA_USEC_PER_MSEC)
+#define AUTO_TIMING_INTERVAL_END_USEC (1500*PA_USEC_PER_MSEC)
 
 #define SMOOTHER_ADJUST_TIME (1000*PA_USEC_PER_MSEC)
 #define SMOOTHER_HISTORY_TIME (5000*PA_USEC_PER_MSEC)
@@ -161,6 +162,7 @@ pa_stream *pa_stream_new_with_proplist(
 
     s->auto_timing_update_event = NULL;
     s->auto_timing_update_requested = FALSE;
+    s->auto_timing_interval_usec = AUTO_TIMING_INTERVAL_START_USEC;
 
     reset_callbacks(s);
 
@@ -308,7 +310,7 @@ static void request_auto_timing_update(pa_stream *s, pa_bool_t force) {
         (force || !s->auto_timing_update_requested)) {
         pa_operation *o;
 
-/*         pa_log("automatically requesting new timing data"); */
+/*         pa_log("Automatically requesting new timing data"); */
 
         if ((o = pa_stream_update_timing_info(s, NULL, NULL))) {
             pa_operation_unref(o);
@@ -318,9 +320,15 @@ static void request_auto_timing_update(pa_stream *s, pa_bool_t force) {
 
     if (s->auto_timing_update_event) {
         struct timeval next;
+
+        if (force)
+            s->auto_timing_interval_usec = AUTO_TIMING_INTERVAL_START_USEC;
+
         pa_gettimeofday(&next);
-        pa_timeval_add(&next, LATENCY_IPOL_INTERVAL_USEC);
+        pa_timeval_add(&next, s->auto_timing_interval_usec);
         s->mainloop->time_restart(s->auto_timing_update_event, &next);
+
+        s->auto_timing_interval_usec = PA_MIN(AUTO_TIMING_INTERVAL_END_USEC, s->auto_timing_interval_usec*2);
     }
 }
 
@@ -823,7 +831,8 @@ static void create_stream_complete(pa_stream *s) {
     if (s->flags & PA_STREAM_AUTO_TIMING_UPDATE) {
         struct timeval tv;
         pa_gettimeofday(&tv);
-        tv.tv_usec += (suseconds_t) LATENCY_IPOL_INTERVAL_USEC; /* every 100 ms */
+        s->auto_timing_interval_usec = AUTO_TIMING_INTERVAL_START_USEC;
+        pa_timeval_add(&tv, s->auto_timing_interval_usec);
         pa_assert(!s->auto_timing_update_event);
         s->auto_timing_update_event = s->mainloop->time_new(s->mainloop, &tv, &auto_timing_update_callback, s);
 

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list