[pulseaudio-commits] 3 commits - src/modules src/pulse src/pulsecore

Arun Raghavan arun at kemper.freedesktop.org
Sun Nov 13 21:24:24 PST 2011


 src/modules/alsa/alsa-sink.c |   10 +++++++---
 src/pulse/stream.c           |    2 +-
 src/pulsecore/rtpoll.h       |    8 +-------
 3 files changed, 9 insertions(+), 11 deletions(-)

New commits:
commit bcee830007594fb283f1d7c80355a9805b02d756
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Thu Oct 13 20:54:17 2011 +0200

    rtpoll: Update comment
    
    to reflect changes made in
    32e2cd6d3216f780c4cffed0f8eb3c30f2c8d732
    core: get rid of rt sig/timer handling since modern Linux' ppoll() is finally fixed for granularity

diff --git a/src/pulsecore/rtpoll.h b/src/pulsecore/rtpoll.h
index bb3c860..1c8f8b0 100644
--- a/src/pulsecore/rtpoll.h
+++ b/src/pulsecore/rtpoll.h
@@ -34,13 +34,7 @@
  * yet another wrapper around poll(). However it has certain
  * advantages over pa_mainloop and suchlike:
  *
- * 1) It uses timer_create() and POSIX real time signals to guarantee
- * optimal high-resolution timing. Starting with Linux 2.6.21 hrtimers
- * are available, and since right now only nanosleep() and the POSIX
- * clock and timer interfaces have been ported to hrtimers (and not
- * ppoll/pselect!) we have to combine ppoll() with timer_create(). The
- * fact that POSIX timers and POSIX rt signals are used internally is
- * completely hidden.
+ * 1) High resolution timers are used
  *
  * 2) It allows raw access to the pollfd data to users
  *

commit 7d05ac606bd5a86c94ab13f8d6c898ad86b6b78a
Author: Antti-Ville Jansson <antti-ville.jansson at digia.com>
Date:   Fri Nov 11 16:22:24 2011 +0200

    stream: Fix upload samples' cleanup
    
    In pa_create_stream_callback, a stream is inserted into
    s->context->record_streams only if it's a record stream. Otherwise it's
    inserted into s->context->playback_streams. However, in stream_unlink the
    stream is removed from s->context->playback_streams only if it's a playback
    stream and otherwise it's removed from s->context->record_streams.
    
    Thus, if the stream is an upload stream, we first insert it into
    s->context->playback_streams in pa_create_stream_callback and then try to
    remove it unsuccessfully from s->context->record_streams in stream_unlink. This
    means that we are leaking hashmap entries until the context is freed,
    constantly consuming more memory with applications that upload and unload a
    large number of samples through one context.
    
    Of course, this begs the question whether upload streams even belong in either
    of those hashmaps. I don't want to mess around with the code too much at this
    point though, so this patch should be a sufficient improvement.

diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index 3bf2d96..5433abf 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -258,7 +258,7 @@ static void stream_unlink(pa_stream *s) {
         pa_pdispatch_unregister_reply(s->context->pdispatch, s);
 
     if (s->channel_valid) {
-        pa_hashmap_remove((s->direction == PA_STREAM_PLAYBACK) ? s->context->playback_streams : s->context->record_streams, PA_UINT32_TO_PTR(s->channel));
+        pa_hashmap_remove((s->direction == PA_STREAM_RECORD) ? s->context->record_streams : s->context->playback_streams, PA_UINT32_TO_PTR(s->channel));
         s->channel = 0;
         s->channel_valid = FALSE;
     }

commit d320ae029b136bb54fcd19f9c29fa033106ca1b8
Author: Arun Raghavan <arun.raghavan at collabora.co.uk>
Date:   Sat Nov 12 11:18:25 2011 +0530

    alsa: Minor debug code cleanup
    
    Remove a trap on underrun and uncomment a couple of useful debug prints
    (still enabled only when DEBUG_TIMING is defined).

diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 1386196..93ecb28 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -457,7 +457,7 @@ static size_t check_left_to_play(struct userdata *u, size_t n_bytes, pa_bool_t o
         left_to_play = 0;
         underrun = TRUE;
 
-#ifdef DEBUG_TIMING
+#if 0
         PA_DEBUG_TRAP;
 #endif
 
@@ -1727,13 +1727,17 @@ static void thread_func(void *userdata) {
 
                 /* OK, the playback buffer is now full, let's
                  * calculate when to wake up next */
-/*                 pa_log_debug("Waking up in %0.2fms (sound card clock).", (double) sleep_usec / PA_USEC_PER_MSEC); */
+#ifdef DEBUG_TIMING
+                pa_log_debug("Waking up in %0.2fms (sound card clock).", (double) sleep_usec / PA_USEC_PER_MSEC);
+#endif
 
                 /* Convert from the sound card time domain to the
                  * system time domain */
                 cusec = pa_smoother_translate(u->smoother, pa_rtclock_now(), sleep_usec);
 
-/*                 pa_log_debug("Waking up in %0.2fms (system clock).", (double) cusec / PA_USEC_PER_MSEC); */
+#ifdef DEBUG_TIMING
+                pa_log_debug("Waking up in %0.2fms (system clock).", (double) cusec / PA_USEC_PER_MSEC);
+#endif
 
                 /* We don't trust the conversion, so we wake up whatever comes first */
                 rtpoll_sleep = PA_MIN(sleep_usec, cusec);



More information about the pulseaudio-commits mailing list