[polypaudio-commits] r483 - in /trunk/polyp: module-alsa-sink.c module-alsa-source.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Wed Feb 15 17:15:32 PST 2006


Author: lennart
Date: Thu Feb 16 02:15:31 2006
New Revision: 483

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=483&root=polypaudio&view=rev
Log:
print ALSA error messages on failure

Modified:
    trunk/polyp/module-alsa-sink.c
    trunk/polyp/module-alsa-source.c

Modified: trunk/polyp/module-alsa-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/polyp/module-alsa-sink.c?rev=483&root=polypaudio&r1=482&r2=483&view=diff
==============================================================================
--- trunk/polyp/module-alsa-sink.c (original)
+++ trunk/polyp/module-alsa-sink.c Thu Feb 16 02:15:31 2006
@@ -182,6 +182,7 @@
     uint32_t periods, fragsize;
     snd_pcm_uframes_t period_size;
     size_t frame_size;
+    int err;
 
     if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
         pa_log(__FILE__": failed to parse module arguments\n");
@@ -208,13 +209,13 @@
     u->module = m;
     
     snd_config_update_free_global();
-    if (snd_pcm_open(&u->pcm_handle, dev = pa_modargs_get_value(ma, "device", DEFAULT_DEVICE), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK) < 0) {
-        pa_log(__FILE__": Error opening PCM device %s\n", dev);
-        goto fail;
-    }
-
-    if (pa_alsa_set_hw_params(u->pcm_handle, &ss, &periods, &period_size) < 0) {
-        pa_log(__FILE__": Failed to set hardware parameters\n");
+    if ((err = snd_pcm_open(&u->pcm_handle, dev = pa_modargs_get_value(ma, "device", DEFAULT_DEVICE), SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK)) < 0) {
+        pa_log(__FILE__": Error opening PCM device %s: %s\n", dev, snd_strerror(err));
+        goto fail;
+    }
+
+    if ((err = pa_alsa_set_hw_params(u->pcm_handle, &ss, &periods, &period_size)) < 0) {
+        pa_log(__FILE__": Failed to set hardware parameters: %s\n", snd_strerror(err));
         goto fail;
     }
 

Modified: trunk/polyp/module-alsa-source.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/polyp/module-alsa-source.c?rev=483&root=polypaudio&r1=482&r2=483&view=diff
==============================================================================
--- trunk/polyp/module-alsa-source.c (original)
+++ trunk/polyp/module-alsa-source.c Thu Feb 16 02:15:31 2006
@@ -173,6 +173,7 @@
     unsigned periods, fragsize;
     snd_pcm_uframes_t period_size;
     size_t frame_size;
+    int err;
     
     if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
         pa_log(__FILE__": failed to parse module arguments\n");
@@ -199,13 +200,13 @@
     u->module = m;
     
     snd_config_update_free_global();
-    if (snd_pcm_open(&u->pcm_handle, dev = pa_modargs_get_value(ma, "device", DEFAULT_DEVICE), SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK) < 0) {
-        pa_log(__FILE__": Error opening PCM device %s\n", dev);
-        goto fail;
-    }
-
-    if (pa_alsa_set_hw_params(u->pcm_handle, &ss, &periods, &period_size) < 0) {
-        pa_log(__FILE__": Failed to set hardware parameters\n");
+    if ((err = snd_pcm_open(&u->pcm_handle, dev = pa_modargs_get_value(ma, "device", DEFAULT_DEVICE), SND_PCM_STREAM_CAPTURE, SND_PCM_NONBLOCK)) < 0) {
+        pa_log(__FILE__": Error opening PCM device %s: %s\n", dev, snd_strerror(err));
+        goto fail;
+    }
+
+    if ((err = pa_alsa_set_hw_params(u->pcm_handle, &ss, &periods, &period_size)) < 0) {
+        pa_log(__FILE__": Failed to set hardware parameters: %s\n", snd_strerror(err));
         goto fail;
     }
 




More information about the pulseaudio-commits mailing list