[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.11-176-g82ea8dd

Lennart Poettering gitmailer-noreply at 0pointer.de
Sun Aug 31 17:41:21 PDT 2008


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  1c4ad4b64be168d13a31c8147505b88967be4afb (commit)

- Log -----------------------------------------------------------------
82ea8dd... avoid rounding errors on requested buffering metrics
002e7a7... output relative timestamps in addition to absolute timestamps when logging
a1c857a... include more build info in debug output
-----------------------------------------------------------------------

Summary of changes:
 src/daemon/main.c               |   13 +++++++++++++
 src/pulsecore/log.c             |   18 ++++++++++++++----
 src/pulsecore/protocol-native.c |   29 ++++++++++++++++++-----------
 3 files changed, 45 insertions(+), 15 deletions(-)

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

commit a1c857a6a89b148e0ad786acc75a78377c045171
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Sep 1 02:38:32 2008 +0200

    include more build info in debug output

diff --git a/src/daemon/main.c b/src/daemon/main.c
index 1d2aa03..c8eda39 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -779,6 +779,19 @@ int main(int argc, char *argv[]) {
 
     pa_log_info(_("This is PulseAudio %s"), PACKAGE_VERSION);
     pa_log_debug(_("Compilation CFLAGS: %s"), PA_CFLAGS);
+
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+    pa_log_debug(_("Compiled with Valgrind support: yes"));
+#else
+    pa_log_debug(_("Compiled with Valgrind support: no"));
+#endif
+
+#ifdef __OPTIMIZE__
+    pa_log_debug(_("Optimized build: yes"));
+#else
+    pa_log_debug(_("Optimized build: no"));
+#endif
+
     pa_log_info(_("Page size is %lu bytes"), (unsigned long) PA_PAGE_SIZE);
 
     if (!(s = pa_machine_id())) {

commit 002e7a703accee39cf6e31855e9d6f35476d1751
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Sep 1 02:39:27 2008 +0200

    output relative timestamps in addition to absolute timestamps when logging

diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c
index 5b79999..d731808 100644
--- a/src/pulsecore/log.c
+++ b/src/pulsecore/log.c
@@ -139,18 +139,28 @@ void pa_log_levelv_meta(
         location[0] = 0;
 
     if (getenv(ENV_LOGTIME)) {
-        static pa_usec_t start;
-        pa_usec_t u;
+        static pa_usec_t start, last;
+        pa_usec_t u, a, r;
 
         u = pa_rtclock_usec();
 
         PA_ONCE_BEGIN {
             start = u;
+            last = u;
         } PA_ONCE_END;
 
-        u -= start;
+        r = u - last;
+        a = u - start;
 
-        pa_snprintf(timestamp, sizeof(timestamp), "(%4llu.%03llu) ", (unsigned long long) (u / PA_USEC_PER_SEC), (unsigned long long) (((u / PA_USEC_PER_MSEC)) % 1000));
+        /* This is not thread safe, but this is a debugging tool only
+         * anyway. */
+        last = u;
+
+        pa_snprintf(timestamp, sizeof(timestamp), "(%4llu.%03llu|%4llu.%03llu) ",
+                    (unsigned long long) (a / PA_USEC_PER_SEC),
+                    (unsigned long long) (((a / PA_USEC_PER_MSEC)) % 1000),
+                    (unsigned long long) (r / PA_USEC_PER_SEC),
+                    (unsigned long long) (((r / PA_USEC_PER_MSEC)) % 1000));
 
     } else
         timestamp[0] = 0;

commit 82ea8dde8abc51165a781c69bc3b38034d62d969
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Sep 1 02:41:03 2008 +0200

    avoid rounding errors on requested buffering metrics

diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 1ee7a97..8ceea80 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -485,14 +485,14 @@ static void fix_record_buffer_attr_pre(record_stream *s, pa_bool_t adjust_latenc
         *fragsize = (uint32_t) pa_frame_size(&s->source_output->sample_spec);
 
     if (adjust_latency) {
-        pa_usec_t fragsize_usec;
+        pa_usec_t orig_fragsize_usec, fragsize_usec;
 
         /* So, the user asked us to adjust the latency according to
          * what the source can provide. Half the latency will be
          * spent on the hw buffer, half of it in the async buffer
          * queue we maintain for each client. */
 
-        fragsize_usec = pa_bytes_to_usec(*fragsize, &s->source_output->sample_spec);
+        orig_fragsize_usec = fragsize_usec = pa_bytes_to_usec(*fragsize, &s->source_output->sample_spec);
 
         s->source_latency = pa_source_output_set_requested_latency(s->source_output, fragsize_usec/2);
 
@@ -501,7 +501,10 @@ static void fix_record_buffer_attr_pre(record_stream *s, pa_bool_t adjust_latenc
         else
             fragsize_usec = s->source_latency;
 
-        *fragsize = (uint32_t) pa_usec_to_bytes(fragsize_usec, &s->source_output->sample_spec);
+        if (pa_usec_to_bytes(orig_fragsize_usec, &s->source_output->sample_spec) !=
+            pa_usec_to_bytes(fragsize_usec, &s->source_output->sample_spec))
+
+            *fragsize = (uint32_t) pa_usec_to_bytes(fragsize_usec, &s->source_output->sample_spec);
     } else
         s->source_latency = 0;
 }
@@ -736,7 +739,7 @@ static int playback_stream_process_msg(pa_msgobject *o, int code, void*userdata,
 
 static void fix_playback_buffer_attr_pre(playback_stream *s, pa_bool_t adjust_latency, uint32_t *maxlength, uint32_t *tlength, uint32_t* prebuf, uint32_t* minreq) {
     size_t frame_size;
-    pa_usec_t tlength_usec, minreq_usec, sink_usec;
+    pa_usec_t orig_tlength_usec, tlength_usec, orig_minreq_usec, minreq_usec, sink_usec;
 
     pa_assert(s);
     pa_assert(maxlength);
@@ -752,20 +755,20 @@ static void fix_playback_buffer_attr_pre(playback_stream *s, pa_bool_t adjust_la
         *maxlength = (uint32_t) frame_size;
 
     if (*tlength == (uint32_t) -1)
-        *tlength = (uint32_t) pa_usec_to_bytes(DEFAULT_TLENGTH_MSEC*PA_USEC_PER_MSEC, &s->sink_input->sample_spec);
+        *tlength = (uint32_t) pa_usec_to_bytes_round_up(DEFAULT_TLENGTH_MSEC*PA_USEC_PER_MSEC, &s->sink_input->sample_spec);
     if (*tlength <= 0)
         *tlength = (uint32_t) frame_size;
 
     if (*minreq == (uint32_t) -1)
-        *minreq = (uint32_t) pa_usec_to_bytes(DEFAULT_PROCESS_MSEC*PA_USEC_PER_MSEC, &s->sink_input->sample_spec);
+        *minreq = (uint32_t) pa_usec_to_bytes_round_up(DEFAULT_PROCESS_MSEC*PA_USEC_PER_MSEC, &s->sink_input->sample_spec);
     if (*minreq <= 0)
         *minreq = (uint32_t) frame_size;
 
     if (*tlength < *minreq+frame_size)
         *tlength = *minreq+(uint32_t) frame_size;
 
-    tlength_usec = pa_bytes_to_usec(*tlength, &s->sink_input->sample_spec);
-    minreq_usec = pa_bytes_to_usec(*minreq, &s->sink_input->sample_spec);
+    orig_tlength_usec = tlength_usec = pa_bytes_to_usec(*tlength, &s->sink_input->sample_spec);
+    orig_minreq_usec = minreq_usec = pa_bytes_to_usec(*minreq, &s->sink_input->sample_spec);
 
     pa_log_info("Requested tlength=%0.2f ms, minreq=%0.2f ms",
                 (double) tlength_usec / PA_USEC_PER_MSEC,
@@ -823,8 +826,13 @@ static void fix_playback_buffer_attr_pre(playback_stream *s, pa_bool_t adjust_la
     if (tlength_usec < s->sink_latency + 2*minreq_usec)
         tlength_usec = s->sink_latency + 2*minreq_usec;
 
-    *tlength = (uint32_t) pa_usec_to_bytes(tlength_usec, &s->sink_input->sample_spec);
-    *minreq = (uint32_t) pa_usec_to_bytes(minreq_usec, &s->sink_input->sample_spec);
+    if (pa_usec_to_bytes_round_up(orig_tlength_usec, &s->sink_input->sample_spec) !=
+        pa_usec_to_bytes_round_up(tlength_usec, &s->sink_input->sample_spec))
+        *tlength = (uint32_t) pa_usec_to_bytes_round_up(tlength_usec, &s->sink_input->sample_spec);
+
+    if (pa_usec_to_bytes(orig_minreq_usec, &s->sink_input->sample_spec) !=
+        pa_usec_to_bytes(minreq_usec, &s->sink_input->sample_spec))
+        *minreq = (uint32_t) pa_usec_to_bytes(minreq_usec, &s->sink_input->sample_spec);
 
     if (*minreq <= 0) {
         *minreq += (uint32_t) frame_size;
@@ -982,7 +990,6 @@ static playback_stream* playback_stream_new(
     return s;
 }
 
-
 /* Called from thread context */
 static void playback_stream_request_bytes(playback_stream *s) {
     size_t m, previous_missing;

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list