]> code.delx.au - pulseaudio/commitdiff
When returning from a suspend, pass exactly the same flags as originally when
authorLennart Poettering <lennart@poettering.net>
Mon, 8 Sep 2008 21:10:54 +0000 (00:10 +0300)
committerLennart Poettering <lennart@poettering.net>
Mon, 8 Sep 2008 21:10:54 +0000 (00:10 +0300)
we opened the device.

src/modules/module-alsa-sink.c
src/modules/module-alsa-source.c

index 6f0d783026ab9bc476834c6088df58759286d691..24ae7234f68cd4b3611b28837dd63ca741495fef 100644 (file)
@@ -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;
     }
index fca05006170553db8ad32ed2a9741c08130b7eef..86e08f7ba16bff6a2d79ce21204206182e883aca 100644 (file)
@@ -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;
     }