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

Lennart Poettering gitmailer-noreply at 0pointer.de
Mon Sep 8 14:15:10 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  c7a77657ffe00b6d52a0c7e3d29f4fcf8537af5f (commit)

- Log -----------------------------------------------------------------
3a46bbe... When returning from a suspend, pass exactly the same flags as originally when we opened the device.
25b200c... fix minor typo
f4c2f00... Work around presumable ALSA bug that treats the dir argument to snd_pcm_hw_params_set_periods_near() actually as > or < instead of >= and <=.
-----------------------------------------------------------------------

Summary of changes:
 src/modules/alsa-util.c             |   15 +++++++++++----
 src/modules/module-alsa-sink.c      |    6 +++++-
 src/modules/module-alsa-source.c    |    7 ++++++-
 src/modules/module-stream-restore.c |    2 +-
 4 files changed, 23 insertions(+), 7 deletions(-)

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

commit f4c2f00f78208057609293b189fd40d792b8a4e3
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Sep 9 00:04:50 2008 +0300

    Work around presumable ALSA bug that treats the dir argument to
    snd_pcm_hw_params_set_periods_near() actually as > or < instead of >= and <=.

diff --git a/src/modules/alsa-util.c b/src/modules/alsa-util.c
index 8fa405d..c3eb72f 100644
--- a/src/modules/alsa-util.c
+++ b/src/modules/alsa-util.c
@@ -370,11 +370,18 @@ int pa_alsa_set_hw_params(
         goto finish;
 
     if (_periods > 0) {
-        dir = 1;
+
+        /* First we pass 0 as direction to get exactly what we asked
+         * for. That this is necessary is presumably a bug in ALSA */
+
+        dir = 0;
         if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0) {
-            dir = -1;
-            if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0)
-                goto finish;
+            dir = 1;
+            if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0) {
+                dir = -1;
+                if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &_periods, &dir)) < 0)
+                    goto finish;
+            }
         }
     }
 

commit 25b200c08797b19fb3eb05d6259abee231650196
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Sep 9 00:06:12 2008 +0300

    fix minor typo

diff --git a/src/modules/module-stream-restore.c b/src/modules/module-stream-restore.c
index 47f5d83..fe79291 100644
--- a/src/modules/module-stream-restore.c
+++ b/src/modules/module-stream-restore.c
@@ -377,7 +377,7 @@ static pa_hook_result_t source_output_new_hook_callback(pa_core *c, pa_source_ou
                 pa_log_info("Restoring device for stream %s.", name);
                 new_data->source = s;
             } else
-                pa_log_info("Not restroing device for stream %s, because already set", name);
+                pa_log_info("Not restoring device for stream %s, because already set", name);
         }
 
         pa_xfree(e);

commit 3a46bbeba509ed68dfaf28d94be3efac88a2613b
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Sep 9 00:10:54 2008 +0300

    When returning from a suspend, pass exactly the same flags as originally when
    we opened the device.

diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c
index 6f0d783..24ae723 100644
--- a/src/modules/module-alsa-sink.c
+++ b/src/modules/module-alsa-sink.c
@@ -623,7 +623,11 @@ static int unsuspend(struct userdata *u) {
     pa_log_info("Trying resume...");
 
     snd_config_update_free_global();
-    if ((err = snd_pcm_open(&u->pcm_handle, u->device_name, SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK)) < 0) {
+    if ((err = snd_pcm_open(&u->pcm_handle, u->device_name, SND_PCM_STREAM_PLAYBACK,
+                            /*SND_PCM_NONBLOCK|*/
+                            SND_PCM_NO_AUTO_RESAMPLE|
+                            SND_PCM_NO_AUTO_CHANNELS|
+                            SND_PCM_NO_AUTO_FORMAT)) < 0) {
         pa_log("Error opening PCM device %s: %s", u->device_name, snd_strerror(err));
         goto fail;
     }
diff --git a/src/modules/module-alsa-source.c b/src/modules/module-alsa-source.c
index fca0500..86e08f7 100644
--- a/src/modules/module-alsa-source.c
+++ b/src/modules/module-alsa-source.c
@@ -565,7 +565,12 @@ static int unsuspend(struct userdata *u) {
     pa_log_info("Trying resume...");
 
     snd_config_update_free_global();
-    if ((err = snd_pcm_open(&u->pcm_handle, u->device_name, SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK)) < 0) {
+
+    if ((err = snd_pcm_open(&u->pcm_handle, u->device_name, SND_PCM_STREAM_CAPTURE,
+                            /*SND_PCM_NONBLOCK|*/
+                            SND_PCM_NO_AUTO_RESAMPLE|
+                            SND_PCM_NO_AUTO_CHANNELS|
+                            SND_PCM_NO_AUTO_FORMAT)) < 0) {
         pa_log("Error opening PCM device %s: %s", u->device_name, snd_strerror(err));
         goto fail;
     }

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list