Hello community,

here is the log from the commit of package alsa-plugins for openSUSE:Factory
checked in at Fri Jul 29 16:49:23 CEST 2011.



--------
--- alsa-plugins/alsa-plugins.changes   2011-01-31 17:26:38.000000000 +0100
+++ /mounts/work_src_done/STABLE/alsa-plugins/alsa-plugins.changes      
2011-07-27 09:41:13.000000000 +0200
@@ -1,0 +2,19 @@
+Wed Jul 27 09:38:06 CEST 2011 - ti...@suse.de
+
+- Add PA_CONTEXT_NOAUTOSPAWN flag when fallback is set for pulse
+  plugins
+
+-------------------------------------------------------------------
+Tue Jul 26 15:44:06 CEST 2011 - ti...@suse.de
+
+- Add fallback option to pulse plugin
+- Enable the fallback to the system-default in asound-pulse.conf
+
+-------------------------------------------------------------------
+Tue Apr 26 16:43:32 CEST 2011 - ti...@suse.de
+
+- Upstream fixes:
+  * Fix build of a52 plugin (not used in this package, though)
+  * Fix bogus snd_pcm_avail() zero return in pulse plugin
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


New:
----
  0001-a52-Fix-a52-codec-with-recent-libavcodec-updates.patch
  0002-Pulse-Fix-snd_pcm_avail-returning-0-in-some-cases.patch
  0003-pulse-Add-fallback-option.patch
  0004-pulse-Set-PA_CONTEXT_NOAUTOSPAWN-when-fallback-is-av.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ alsa-plugins.spec ++++++
--- /var/tmp/diff_new_pack.1ubGE4/_old  2011-07-29 16:48:34.000000000 +0200
+++ /var/tmp/diff_new_pack.1ubGE4/_new  2011-07-29 16:48:34.000000000 +0200
@@ -38,7 +38,7 @@
 Url:            http://www.alsa-project.org/
 Summary:        Extra Plug-Ins for the ALSA Library
 Version:        1.0.24
-Release:        1
+Release:        9
 License:        LGPLv2.1+
 Group:          System/Libraries
 AutoReqProv:    on
@@ -49,6 +49,10 @@
 Source1:        asound-pulse.conf
 Source2:        alsa-pulse.conf
 Source3:        baselibs.conf
+Patch1:         0001-a52-Fix-a52-codec-with-recent-libavcodec-updates.patch
+Patch2:         0002-Pulse-Fix-snd_pcm_avail-returning-0-in-some-cases.patch
+Patch3:         0003-pulse-Add-fallback-option.patch
+Patch4:         0004-pulse-Set-PA_CONTEXT_NOAUTOSPAWN-when-fallback-is-av.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -163,6 +167,10 @@
 
 %prep
 %setup -q -n %{name}-%{package_version}
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %build
 export AUTOMAKE_JOBS=%{?jobs:%jobs}

++++++ 0001-a52-Fix-a52-codec-with-recent-libavcodec-updates.patch ++++++
>From 40c129a160f37fe9488b2828d6299f99c269703e Mon Sep 17 00:00:00 2001
From: Joerg Reuter <jreu...@suse.de>
Date: Wed, 6 Apr 2011 16:36:11 +0200
Subject: [PATCH 1/2] a52 - Fix a52 codec with recent libavcodec updates

The recent libavcodec is changed to accept only float input, but
the old ac3 encoder is still somehow working with a different name.
This patch makes it working again.

Signed-off-by: Takashi Iwai <ti...@suse.de>
---
 a52/pcm_a52.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c
index ed491b3..76f21cd 100644
--- a/a52/pcm_a52.c
+++ b/a52/pcm_a52.c
@@ -436,6 +436,7 @@ static int a52_prepare(snd_pcm_ioplug_t *io)
        rec->avctx->bit_rate = rec->bitrate * 1000;
        rec->avctx->sample_rate = io->rate;
        rec->avctx->channels = io->channels;
+       rec->avctx->sample_fmt = AV_SAMPLE_FMT_S16;
 #if LIBAVCODEC_VERSION_MAJOR > 52 || (LIBAVCODEC_VERSION_MAJOR == 52 && 
LIBAVCODEC_VERSION_MINOR >= 3)
        switch (io->channels) {
        case 2:
@@ -699,8 +700,13 @@ SND_PCM_PLUGIN_DEFINE_FUNC(a52)
 
        avcodec_init();
        avcodec_register_all();
-       rec->codec = avcodec_find_encoder(CODEC_ID_AC3);
-       if (! rec->codec) {
+
+       rec->codec = avcodec_find_encoder_by_name("ac3_fixed");
+       if (rec->codec == NULL)
+               rec->codec = avcodec_find_encoder_by_name("ac3");
+       if (rec->codec == NULL) 
+               rec->codec = avcodec_find_encoder(CODEC_ID_AC3);
+       if (rec->codec == NULL) {
                SNDERR("Cannot find codec engine");
                err = -EINVAL;
                goto error;
-- 
1.7.4.2

++++++ 0002-Pulse-Fix-snd_pcm_avail-returning-0-in-some-cases.patch ++++++
>From e1661e3daa22cfed67c4b74099bcd97b433af24b Mon Sep 17 00:00:00 2001
From: David Henningsson <david.hennings...@canonical.com>
Date: Thu, 21 Apr 2011 15:10:19 +0200
Subject: [PATCH 2/2] Pulse: Fix snd_pcm_avail returning 0 in some cases

Due to a round-off error, snd_pcm_avail could in some cases
return 0 even though more data could be written to the stream.

Reported-by: Maarten Lankhorst <m.b.lankho...@gmail.com>
Signed-off-by: David Henningsson <david.hennings...@canonical.com>
Signed-off-by: Takashi Iwai <ti...@suse.de>
---
 pulse/pcm_pulse.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c
index 2df0a80..9105d4d 100644
--- a/pulse/pcm_pulse.c
+++ b/pulse/pcm_pulse.c
@@ -92,8 +92,8 @@ static int update_ptr(snd_pcm_pulse_t *pcm)
                size -= pcm->offset;
 
        /* Prevent accidental overrun of the fake ringbuffer */
-       if (size >= pcm->buffer_attr.tlength)
-               size = pcm->buffer_attr.tlength-1;
+       if (size > pcm->buffer_attr.tlength - pcm->frame_size)
+               size = pcm->buffer_attr.tlength - pcm->frame_size;
 
        if (size > pcm->last_size) {
                pcm->ptr += size - pcm->last_size;
-- 
1.7.4.2

++++++ 0003-pulse-Add-fallback-option.patch ++++++
>From 5f5cde50d9de7b63aa6f1a7a86c31eeb2a4e9950 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <ti...@suse.de>
Date: Tue, 26 Jul 2011 14:26:26 +0200
Subject: [PATCH] pulse: Add fallback option

Added "fallback" option to give the PCM / controller name as a fallback
when connecting to PA server fails.

Signed-off-by: Takashi Iwai <ti...@suse.de>
---
 doc/README-pulse  |   19 +++++++++++++++++++
 pulse/ctl_pulse.c |   17 ++++++++++++++++-
 pulse/pcm_pulse.c |   17 ++++++++++++++++-
 pulse/pulse.c     |    7 ++++---
 pulse/pulse.h     |    2 +-
 5 files changed, 56 insertions(+), 6 deletions(-)

diff --git a/doc/README-pulse b/doc/README-pulse
index d5431b4..5b119f9 100644
--- a/doc/README-pulse
+++ b/doc/README-pulse
@@ -39,3 +39,22 @@ you need to do this with PCM:s then specify two PCM:s with 
different "device".
 
 If you do not specify any source and/or sink, then the server's defaults will
 be used.
+
+When "fallback" option is set, the plugin will try to open the given PCM
+(or control) automatically when connecting to PA server fails.  Typically,
+it should point to "sysdefault", which was introduced recently in alsa-lib,
+so that the system-default setup is used even when you overwrite "default"
+PCM and control definitions.
+
+    pcm.pulse {
+        type pulse
+        fallback "sysdefault"
+    }
+
+    ctl.pulse {
+        type pulse
+        fallback "sysdefault"
+    }
+
+   pcm.!default "pulse"
+   ctl.!default "pulse"
diff --git a/pulse/ctl_pulse.c b/pulse/ctl_pulse.c
index 85863ed..8b5ff9e 100644
--- a/pulse/ctl_pulse.c
+++ b/pulse/ctl_pulse.c
@@ -647,6 +647,7 @@ SND_CTL_PLUGIN_DEFINE_FUNC(pulse)
        const char *device = NULL;
        const char *source = NULL;
        const char *sink = NULL;
+       const char *fallback_name = NULL;
        int err;
        snd_ctl_pulse_t *ctl;
        pa_operation *o;
@@ -687,10 +688,20 @@ SND_CTL_PLUGIN_DEFINE_FUNC(pulse)
                        }
                        continue;
                }
+               if (strcmp(id, "fallback") == 0) {
+                       if (snd_config_get_string(n, &fallback_name) < 0) {
+                               SNDERR("Invalid value for %s", id);
+                               return -EINVAL;
+                       }
+                       continue;
+               }
                SNDERR("Unknown field %s", id);
                return -EINVAL;
        }
 
+       if (fallback_name && name && !strcmp(name, fallback_name))
+               fallback_name = NULL; /* no fallback for the same name */
+
        ctl = calloc(1, sizeof(*ctl));
        if (!ctl)
                return -ENOMEM;
@@ -701,7 +712,7 @@ SND_CTL_PLUGIN_DEFINE_FUNC(pulse)
                goto error;
        }
 
-       err = pulse_connect(ctl->p, server);
+       err = pulse_connect(ctl->p, server, !fallback_name);
        if (err < 0)
                goto error;
 
@@ -794,6 +805,10 @@ error:
        free(ctl->sink);
        free(ctl);
 
+       if (fallback_name)
+               return snd_ctl_open_fallback(handlep, root,
+                                            fallback_name, name, mode);
+
        return err;
 }
 
diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c
index 9105d4d..15b29e0 100644
--- a/pulse/pcm_pulse.c
+++ b/pulse/pcm_pulse.c
@@ -982,6 +982,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pulse)
        snd_config_iterator_t i, next;
        const char *server = NULL;
        const char *device = NULL;
+       const char *fallback_name = NULL;
        int handle_underrun = 0;
        int err;
        snd_pcm_pulse_t *pcm;
@@ -1016,10 +1017,20 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pulse)
                        handle_underrun = err;
                        continue;
                }
+               if (strcmp(id, "fallback") == 0) {
+                       if (snd_config_get_string(n, &fallback_name) < 0) {
+                               SNDERR("Invalid value for %s", id);
+                               return -EINVAL;
+                       }
+                       continue;
+               }
                SNDERR("Unknown field %s", id);
                return -EINVAL;
        }
 
+       if (fallback_name && name && !strcmp(name, fallback_name))
+               fallback_name = NULL; /* no fallback for the same name */
+
        pcm = calloc(1, sizeof(*pcm));
        if (!pcm)
                return -ENOMEM;
@@ -1041,7 +1052,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pulse)
 
        pcm->handle_underrun = handle_underrun;
 
-       err = pulse_connect(pcm->p, server);
+       err = pulse_connect(pcm->p, server, !fallback_name);
        if (err < 0)
                goto error;
 
@@ -1074,6 +1085,10 @@ error:
        free(pcm->device);
        free(pcm);
 
+       if (fallback_name)
+               return snd_pcm_open_fallback(pcmp, root, fallback_name, name,
+                                            stream, mode);
+
        return err;
 }
 
diff --git a/pulse/pulse.c b/pulse/pulse.c
index f26363a..6d9613d 100644
--- a/pulse/pulse.c
+++ b/pulse/pulse.c
@@ -188,7 +188,7 @@ void pulse_free(snd_pulse_t * p)
        free(p);
 }
 
-int pulse_connect(snd_pulse_t * p, const char *server)
+int pulse_connect(snd_pulse_t * p, const char *server, int show_error)
 {
        int err;
        pa_context_state_t state;
@@ -225,8 +225,9 @@ int pulse_connect(snd_pulse_t * p, const char *server)
        return 0;
 
       error:
-       SNDERR("PulseAudio: Unable to connect: %s\n",
-               pa_strerror(pa_context_errno(p->context)));
+       if (show_error)
+               SNDERR("PulseAudio: Unable to connect: %s\n",
+                      pa_strerror(pa_context_errno(p->context)));
 
        pa_threaded_mainloop_unlock(p->mainloop);
 
diff --git a/pulse/pulse.h b/pulse/pulse.h
index e98124f..9f32a7f 100644
--- a/pulse/pulse.h
+++ b/pulse/pulse.h
@@ -42,7 +42,7 @@ int pulse_wait_operation(snd_pulse_t * p, pa_operation * o);
 snd_pulse_t *pulse_new(void);
 void pulse_free(snd_pulse_t * p);
 
-int pulse_connect(snd_pulse_t * p, const char *server);
+int pulse_connect(snd_pulse_t * p, const char *server, int show_error);
 
 void pulse_poll_activate(snd_pulse_t * p);
 void pulse_poll_deactivate(snd_pulse_t * p);
-- 
1.7.6

++++++ 0004-pulse-Set-PA_CONTEXT_NOAUTOSPAWN-when-fallback-is-av.patch ++++++
>From 440e79153ffd3b38ba5494f92c7ba7767cd590b3 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <ti...@suse.de>
Date: Wed, 27 Jul 2011 09:32:12 +0200
Subject: [PATCH] pulse: Set PA_CONTEXT_NOAUTOSPAWN when fallback is available

Signed-off-by: Takashi Iwai <ti...@suse.de>
---
 pulse/ctl_pulse.c |    2 +-
 pulse/pcm_pulse.c |    2 +-
 pulse/pulse.c     |   12 +++++++++---
 pulse/pulse.h     |    2 +-
 4 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/pulse/ctl_pulse.c b/pulse/ctl_pulse.c
index 8b5ff9e..242b77d 100644
--- a/pulse/ctl_pulse.c
+++ b/pulse/ctl_pulse.c
@@ -712,7 +712,7 @@ SND_CTL_PLUGIN_DEFINE_FUNC(pulse)
                goto error;
        }
 
-       err = pulse_connect(ctl->p, server, !fallback_name);
+       err = pulse_connect(ctl->p, server, fallback_name != NULL);
        if (err < 0)
                goto error;
 
diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c
index 15b29e0..d6c6792 100644
--- a/pulse/pcm_pulse.c
+++ b/pulse/pcm_pulse.c
@@ -1052,7 +1052,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(pulse)
 
        pcm->handle_underrun = handle_underrun;
 
-       err = pulse_connect(pcm->p, server, !fallback_name);
+       err = pulse_connect(pcm->p, server, fallback_name != NULL);
        if (err < 0)
                goto error;
 
diff --git a/pulse/pulse.c b/pulse/pulse.c
index 6d9613d..c34671b 100644
--- a/pulse/pulse.c
+++ b/pulse/pulse.c
@@ -188,13 +188,19 @@ void pulse_free(snd_pulse_t * p)
        free(p);
 }
 
-int pulse_connect(snd_pulse_t * p, const char *server, int show_error)
+int pulse_connect(snd_pulse_t * p, const char *server, int can_fallback)
 {
        int err;
+       pa_context_flags_t flags;
        pa_context_state_t state;
 
        assert(p);
 
+       if (can_fallback)
+               flags = PA_CONTEXT_NOAUTOSPAWN;
+       else
+               flags = 0;
+
        if (!p->context || !p->mainloop)
                return -EBADFD;
 
@@ -204,7 +210,7 @@ int pulse_connect(snd_pulse_t * p, const char *server, int 
show_error)
 
        pa_threaded_mainloop_lock(p->mainloop);
 
-       err = pa_context_connect(p->context, server, 0, NULL);
+       err = pa_context_connect(p->context, server, flags, NULL);
        if (err < 0)
                goto error;
 
@@ -225,7 +231,7 @@ int pulse_connect(snd_pulse_t * p, const char *server, int 
show_error)
        return 0;
 
       error:
-       if (show_error)
+       if (!can_fallback)
                SNDERR("PulseAudio: Unable to connect: %s\n",
                       pa_strerror(pa_context_errno(p->context)));
 
diff --git a/pulse/pulse.h b/pulse/pulse.h
index 9f32a7f..9b337bc 100644
--- a/pulse/pulse.h
+++ b/pulse/pulse.h
@@ -42,7 +42,7 @@ int pulse_wait_operation(snd_pulse_t * p, pa_operation * o);
 snd_pulse_t *pulse_new(void);
 void pulse_free(snd_pulse_t * p);
 
-int pulse_connect(snd_pulse_t * p, const char *server, int show_error);
+int pulse_connect(snd_pulse_t * p, const char *server, int can_fallback);
 
 void pulse_poll_activate(snd_pulse_t * p);
 void pulse_poll_deactivate(snd_pulse_t * p);
-- 
1.7.6

++++++ asound-pulse.conf ++++++
--- /var/tmp/diff_new_pack.1ubGE4/_old  2011-07-29 16:48:34.000000000 +0200
+++ /var/tmp/diff_new_pack.1ubGE4/_new  2011-07-29 16:48:34.000000000 +0200
@@ -4,21 +4,15 @@
 
 pcm.pulse {
     type pulse
+    fallback "sysdefault"
 }
 
 ctl.pulse {
     type pulse
+    fallback "sysdefault"
 }
 
 # Let's make it the default!
 
-pcm.!default {
-    type plug
-    slave.pcm {
-       type pulse
-    }
-}
-
-ctl.!default {
-    type pulse
-}
+pcm.!default "pulse"
+ctl.!default "pulse"


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to