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  ba95b1939d581bc6f647616bd12bd673370f3be5 (commit)

- Log -----------------------------------------------------------------
6daf112 alsa: fix minor sampling rate deviations before adjusting the buffer 
size
bd3467f alsa: fix log output when the audio device refuses to give us again the 
same period settings we had before
-----------------------------------------------------------------------

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

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

commit bd3467ff2f982c87db4618cc6ac98780bef407cc
Author: Lennart Poettering <[email protected]>
Date:   Fri Nov 20 20:00:26 2009 +0100

    alsa: fix log output when the audio device refuses to give us again the 
same period settings we had before

diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 856adb1..ed16c83 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -983,7 +983,7 @@ static int unsuspend(struct userdata *u) {
         buffer_size*u->frame_size != u->hwbuf_size) {
         pa_log_warn("Resume failed, couldn't restore original fragment 
settings. (Old: %lu/%lu, New %lu/%lu)",
                     (unsigned long) u->hwbuf_size, (unsigned long) 
u->fragment_size,
-                    (unsigned long) (buffer_size*u->fragment_size), (unsigned 
long) (period_size*u->frame_size));
+                    (unsigned long) (buffer_size*u->frame_size), (unsigned 
long) (period_size*u->frame_size));
         goto fail;
     }
 
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index e775b20..157698e 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -930,7 +930,7 @@ static int unsuspend(struct userdata *u) {
         buffer_size*u->frame_size != u->hwbuf_size) {
         pa_log_warn("Resume failed, couldn't restore original fragment 
settings. (Old: %lu/%lu, New %lu/%lu)",
                     (unsigned long) u->hwbuf_size, (unsigned long) 
u->fragment_size,
-                    (unsigned long) (buffer_size*u->fragment_size), (unsigned 
long) (period_size*u->frame_size));
+                    (unsigned long) (buffer_size*u->frame_size), (unsigned 
long) (period_size*u->frame_size));
         goto fail;
     }
 

commit 6daf112ce0116e7edacd83c538e5c3099c90a774
Author: Lennart Poettering <[email protected]>
Date:   Fri Nov 20 20:27:03 2009 +0100

    alsa: fix minor sampling rate deviations before adjusting the buffer size

diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index b8d1357..52f1259 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -259,6 +259,10 @@ int pa_alsa_set_hw_params(
         goto finish;
     }
 
+    /* We ignore very small sampling rate deviations */
+    if (_ss.rate >= ss->rate*.95 && _ss.rate <= ss->rate*1.05)
+        _ss.rate = ss->rate;
+
     if (require_exact_channel_number) {
         if ((ret = snd_pcm_hw_params_set_channels(pcm_handle, hwparams, 
_ss.channels)) < 0) {
             pa_log_debug("snd_pcm_hw_params_set_channels(%u) failed: %s", 
_ss.channels, pa_alsa_strerror(ret));
@@ -303,7 +307,7 @@ int pa_alsa_set_hw_params(
             if (set_buffer_size(pcm_handle, hwparams_copy, _buffer_size) >= 0 
&&
                 set_period_size(pcm_handle, hwparams_copy, _period_size) >= 0 
&&
                 snd_pcm_hw_params(pcm_handle, hwparams_copy) >= 0) {
-                pa_log_debug("Set buffer size first, period size second.");
+                pa_log_debug("Set buffer size first (to %lu samples), period 
size second (to %lu samples).", (unsigned long) _buffer_size, (unsigned long) 
_period_size);
                 goto success;
             }
 
@@ -311,7 +315,7 @@ int pa_alsa_set_hw_params(
             if (set_period_size(pcm_handle, hwparams_copy, _period_size) >= 0 
&&
                 set_buffer_size(pcm_handle, hwparams_copy, _buffer_size) >= 0 
&&
                 snd_pcm_hw_params(pcm_handle, hwparams_copy) >= 0) {
-                pa_log_debug("Set period size first, buffer size second.");
+                pa_log_debug("Set period size first (to %lu samples), buffer 
size second (to %lu samples).", (unsigned long) _period_size, (unsigned long) 
_buffer_size);
                 goto success;
             }
         }
@@ -322,7 +326,7 @@ int pa_alsa_set_hw_params(
             /* Third try: set only buffer size */
             if (set_buffer_size(pcm_handle, hwparams_copy, _buffer_size) >= 0 
&&
                 snd_pcm_hw_params(pcm_handle, hwparams_copy) >= 0) {
-                pa_log_debug("Set only buffer size second.");
+                pa_log_debug("Set only buffer size (to %lu samples).", 
(unsigned long) _buffer_size);
                 goto success;
             }
         }
@@ -333,7 +337,7 @@ int pa_alsa_set_hw_params(
             /* Fourth try: set only period size */
             if (set_period_size(pcm_handle, hwparams_copy, _period_size) >= 0 
&&
                 snd_pcm_hw_params(pcm_handle, hwparams_copy) >= 0) {
-                pa_log_debug("Set only period size second.");
+                pa_log_debug("Set only period size (to %lu samples).", 
(unsigned long) _period_size);
                 goto success;
             }
         }
@@ -374,9 +378,7 @@ success:
         goto finish;
     }
 
-    /* If the sample rate deviates too much, we need to resample */
-    if (_ss.rate < ss->rate*.95 || _ss.rate > ss->rate*1.05)
-        ss->rate = _ss.rate;
+    ss->rate = _ss.rate;
     ss->channels = _ss.channels;
     ss->format = _ss.format;
 

-- 
hooks/post-receive
PulseAudio Sound Server
_______________________________________________
pulseaudio-commits mailing list
[email protected]
https://tango.0pointer.de/mailman/listinfo/pulseaudio-commits

Reply via email to