[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.16-test6-48-g46b9ca7

Lennart Poettering gitmailer-noreply at 0pointer.de
Mon Aug 31 19:55:49 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  dfe3f90b377a9cb2b158088c529a691086490afa (commit)

- Log -----------------------------------------------------------------
46b9ca7 alsa: by default increase watermarks only on real underruns, don't try to be smart
6b6d146 alsa: distuingish real underruns from left_to_play=0
-----------------------------------------------------------------------

Summary of changes:
 src/modules/alsa/alsa-sink.c   |    9 +++++++--
 src/modules/alsa/alsa-source.c |    6 ++++--
 2 files changed, 11 insertions(+), 4 deletions(-)

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

commit 6b6d14626d5ae8b49edd1abe8ecc2432262358c9
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Sep 1 04:54:18 2009 +0200

    alsa: distuingish real underruns from left_to_play=0

diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 07d5388..afea8e0 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -410,6 +410,7 @@ static int try_recover(struct userdata *u, const char *call, int err) {
 
 static size_t check_left_to_play(struct userdata *u, size_t n_bytes, pa_bool_t on_timeout) {
     size_t left_to_play;
+    pa_bool_t underrun = FALSE;
 
     /* We use <= instead of < for this check here because an underrun
      * only happens after the last sample was processed, not already when
@@ -422,6 +423,7 @@ static size_t check_left_to_play(struct userdata *u, size_t n_bytes, pa_bool_t o
 
         /* We got a dropout. What a mess! */
         left_to_play = 0;
+        underrun = TRUE;
 
 #ifdef DEBUG_TIMING
         PA_DEBUG_TRAP;
@@ -443,7 +445,7 @@ static size_t check_left_to_play(struct userdata *u, size_t n_bytes, pa_bool_t o
         pa_bool_t reset_not_before = TRUE;
 
         if (!u->first && !u->after_rewind) {
-            if (left_to_play < u->watermark_inc_threshold)
+            if (underrun || left_to_play < u->watermark_inc_threshold)
                 increase_watermark(u);
             else if (left_to_play > u->watermark_dec_threshold) {
                 reset_not_before = FALSE;
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 165b2e3..643566b 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -406,6 +406,7 @@ static int try_recover(struct userdata *u, const char *call, int err) {
 static size_t check_left_to_record(struct userdata *u, size_t n_bytes, pa_bool_t on_timeout) {
     size_t left_to_record;
     size_t rec_space = u->hwbuf_size - u->hwbuf_unused;
+    pa_bool_t overrun = FALSE;
 
     /* We use <= instead of < for this check here because an overrun
      * only happens after the last sample was processed, not already when
@@ -418,6 +419,7 @@ static size_t check_left_to_record(struct userdata *u, size_t n_bytes, pa_bool_t
 
         /* We got a dropout. What a mess! */
         left_to_record = 0;
+        overrun = TRUE;
 
 #ifdef DEBUG_TIMING
         PA_DEBUG_TRAP;
@@ -434,7 +436,7 @@ static size_t check_left_to_record(struct userdata *u, size_t n_bytes, pa_bool_t
     if (u->use_tsched) {
         pa_bool_t reset_not_before = TRUE;
 
-        if (left_to_record < u->watermark_inc_threshold)
+        if (overrun || left_to_record < u->watermark_inc_threshold)
             increase_watermark(u);
         else if (left_to_record > u->watermark_dec_threshold) {
             reset_not_before = FALSE;

commit 46b9ca7fd5747d1ddbb7f2d18d2b572ddb785dc6
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Sep 1 04:55:05 2009 +0200

    alsa: by default increase watermarks only on real underruns, don't try to be smart

diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index afea8e0..195bdf6 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -69,9 +69,12 @@
 #define TSCHED_WATERMARK_INC_STEP_USEC (10*PA_USEC_PER_MSEC)       /* 10ms  -- On underrun, increase watermark by this */
 #define TSCHED_WATERMARK_DEC_STEP_USEC (5*PA_USEC_PER_MSEC)        /* 5ms   -- When everything's great, decrease watermark by this */
 #define TSCHED_WATERMARK_VERIFY_AFTER_USEC (20*PA_USEC_PER_SEC)    /* 20s   -- How long after a drop out recheck if things are good now */
-#define TSCHED_WATERMARK_INC_THRESHOLD_USEC (1*PA_USEC_PER_MSEC)   /* 3ms   -- If the buffer level ever below this theshold, increase the watermark */
+#define TSCHED_WATERMARK_INC_THRESHOLD_USEC (0*PA_USEC_PER_MSEC)   /* 0ms   -- If the buffer level ever below this theshold, increase the watermark */
 #define TSCHED_WATERMARK_DEC_THRESHOLD_USEC (100*PA_USEC_PER_MSEC) /* 100ms -- If the buffer level didn't drop below this theshold in the verification time, decrease the watermark */
 
+/* Note that TSCHED_WATERMARK_INC_THRESHOLD_USEC == 0 means tht we
+ * will increase the watermark only if we hit a real underrun. */
+
 #define TSCHED_MIN_SLEEP_USEC (10*PA_USEC_PER_MSEC)                /* 10ms  -- Sleep at least 10ms on each iteration */
 #define TSCHED_MIN_WAKEUP_USEC (4*PA_USEC_PER_MSEC)                /* 4ms   -- Wakeup at least this long before the buffer runs empty*/
 
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 643566b..f42d354 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -66,7 +66,7 @@
 #define TSCHED_WATERMARK_INC_STEP_USEC (10*PA_USEC_PER_MSEC)       /* 10ms  */
 #define TSCHED_WATERMARK_DEC_STEP_USEC (5*PA_USEC_PER_MSEC)        /* 5ms */
 #define TSCHED_WATERMARK_VERIFY_AFTER_USEC (20*PA_USEC_PER_SEC)    /* 20s */
-#define TSCHED_WATERMARK_INC_THRESHOLD_USEC (1*PA_USEC_PER_MSEC)   /* 3ms */
+#define TSCHED_WATERMARK_INC_THRESHOLD_USEC (0*PA_USEC_PER_MSEC)   /* 0ms */
 #define TSCHED_WATERMARK_DEC_THRESHOLD_USEC (100*PA_USEC_PER_MSEC) /* 100ms */
 #define TSCHED_WATERMARK_STEP_USEC (10*PA_USEC_PER_MSEC)           /* 10ms */
 

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list