[polypaudio-commits] r1024 - /trunk/src/modules/alsa-util.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sat Jun 17 16:36:04 PDT 2006


Author: lennart
Date: Sun Jun 18 01:36:03 2006
New Revision: 1024

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1024&root=polypaudio&view=rev
Log:
* make hw param settings easier to debug by splitting up long if
* actually set the sample rate
* disable resampling done by ALSA

Modified:
    trunk/src/modules/alsa-util.c

Modified: trunk/src/modules/alsa-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/alsa-util.c?rev=1024&root=polypaudio&r1=1023&r2=1024&view=diff
==============================================================================
--- trunk/src/modules/alsa-util.c (original)
+++ trunk/src/modules/alsa-util.c Sun Jun 18 01:36:03 2006
@@ -323,12 +323,24 @@
     
     if ((ret = snd_pcm_hw_params_malloc(&hwparams)) < 0 ||
         (ret = snd_pcm_hw_params_any(pcm_handle, hwparams)) < 0 ||
-    	(ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0 ||
-        (ret = set_format(pcm_handle, hwparams, &f)) < 0 ||
-        (ret = snd_pcm_hw_params_set_channels_near(pcm_handle, hwparams, &c)) < 0 || 
-        (*period_size > 0 && (ret = snd_pcm_hw_params_set_period_size_near(pcm_handle, hwparams, period_size, NULL)) < 0) ||
-        (*periods > 0 && (ret = snd_pcm_hw_params_set_buffer_size_near(pcm_handle, hwparams, &buffer_size)) < 0) ||
-        (ret = snd_pcm_hw_params(pcm_handle, hwparams)) < 0)
+        (ret = snd_pcm_hw_params_set_rate_resample(pcm_handle, hwparams, 0)) < 0 ||
+    	(ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0)
+        goto finish;
+
+    if ((ret = set_format(pcm_handle, hwparams, &f)) < 0)
+        goto finish;
+
+    if ((ret = snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &r, NULL)) < 0)
+        goto finish;
+
+    if ((ret = snd_pcm_hw_params_set_channels_near(pcm_handle, hwparams, &c)) < 0)
+        goto finish;
+
+    if ((*period_size > 0 && (ret = snd_pcm_hw_params_set_period_size_near(pcm_handle, hwparams, period_size, NULL)) < 0) ||
+        (*periods > 0 && (ret = snd_pcm_hw_params_set_buffer_size_near(pcm_handle, hwparams, &buffer_size)) < 0))
+        goto finish;
+
+    if  ((ret = snd_pcm_hw_params(pcm_handle, hwparams)) < 0)
         goto finish;
 
     if (ss->rate != r) {




More information about the pulseaudio-commits mailing list