Hello community,

here is the log from the commit of package alsa for openSUSE:Factory
checked in at Tue Sep 27 16:16:01 CEST 2011.



--------
--- alsa/alsa.changes   2011-09-17 12:29:31.000000000 +0200
+++ /mounts/work_src_done/STABLE/alsa/alsa.changes      2011-09-27 
10:01:03.000000000 +0200
@@ -1,0 +2,11 @@
+Tue Sep 27 10:00:09 CEST 2011 - [email protected]
+
+- backport upstream fixes: fix noresample hw_params rule and a few
+  fixes for missing free()
+
+-------------------------------------------------------------------
+Tue Sep 20 09:45:12 CEST 2011 - [email protected]
+
+- Add support of /usr/share/alsa/conf.d/* files.
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


New:
----
  0030-conf-Allow-for-a-directory-to-be-given-as-a-config-f.patch
  0031-pcm-recalculate-all-rules-after-changing-hw_params-f.patch
  0032-src-pcm-pcm_rate.c-add-missing-free.patch
  0033-src-pcm-pcm_ladspa.c-add-missing-free.patch
  0034-src-pcm-pcm_multi.c-add-missing-free.patch
  0035-src-pcm-pcm_mmap.c-add-missing-free.patch

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

Other differences:
------------------
++++++ alsa.spec ++++++
--- /var/tmp/diff_new_pack.G4KDbC/_old  2011-09-27 16:15:56.000000000 +0200
+++ /var/tmp/diff_new_pack.G4KDbC/_new  2011-09-27 16:15:56.000000000 +0200
@@ -78,6 +78,12 @@
 Patch27:        0027-ucm-fix-seg-fault-in-execute_cset.patch
 Patch28:        0028-ucm-tivial-code-style-fix.patch
 Patch29:        0029-ucm-add-another-sequence-msleep.patch
+Patch30:        0030-conf-Allow-for-a-directory-to-be-given-as-a-config-f.patch
+Patch31:        0031-pcm-recalculate-all-rules-after-changing-hw_params-f.patch
+Patch32:        0032-src-pcm-pcm_rate.c-add-missing-free.patch
+Patch33:        0033-src-pcm-pcm_ladspa.c-add-missing-free.patch
+Patch34:        0034-src-pcm-pcm_multi.c-add-missing-free.patch
+Patch35:        0035-src-pcm-pcm_mmap.c-add-missing-free.patch
 Patch99:        alsa-lib-doxygen-avoid-crash-for-11.3.diff
 Url:            http://www.alsa-project.org/
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -154,6 +160,12 @@
 %patch27 -p1
 %patch28 -p1
 %patch29 -p1
+%patch30 -p1
+%patch31 -p1
+%patch32 -p1
+%patch33 -p1
+%patch34 -p1
+%patch35 -p1
 %if %suse_version == 1130
 %patch99 -p1
 %endif

++++++ 0030-conf-Allow-for-a-directory-to-be-given-as-a-config-f.patch ++++++
>From 7924500688fdfeac71e5968e5f5875726a8dce14 Mon Sep 17 00:00:00 2001
From: Colin Guthrie <[email protected]>
Date: Fri, 16 Sep 2011 10:04:26 +0100
Subject: [PATCH] conf: Allow for a directory to be given as a config file.

When this is done, *.conf files can be placed in that directory and they
will be processed by as if they were included directly.

A directory (typically /usr/share/alsa/alsa.conf.d/) has been
added into the distribution.

v2: Used existing conf syntax rather than processing via autotools
v3: Split file loading into separate function and made error handling
more consistent.

Signed-off-by: Colin Guthrie <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
---
 configure.in                     |    3 +-
 src/conf.c                       |   78 ++++++++++++++++++++++++++++++++-----
 src/conf/Makefile.am             |    2 +-
 src/conf/alsa.conf               |    7 +++
 src/conf/alsa.conf.d/Makefile.am |    8 ++++
 src/conf/alsa.conf.d/README      |    2 +
 6 files changed, 87 insertions(+), 13 deletions(-)
 create mode 100644 src/conf/alsa.conf.d/Makefile.am
 create mode 100644 src/conf/alsa.conf.d/README

diff --git a/configure.in b/configure.in
index 7ee0ccc..13e38b8 100644
--- a/configure.in
+++ b/configure.in
@@ -616,7 +616,8 @@ AC_OUTPUT(Makefile doc/Makefile doc/pictures/Makefile 
doc/doxygen.cfg \
          src/pcm/Makefile src/pcm/scopes/Makefile \
          src/rawmidi/Makefile src/timer/Makefile \
           src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile \
-          src/compat/Makefile src/alisp/Makefile src/conf/Makefile \
+          src/compat/Makefile src/alisp/Makefile \
+         src/conf/Makefile src/conf/alsa.conf.d/Makefile \
          src/conf/cards/Makefile \
          src/conf/pcm/Makefile \
          modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile 
\
diff --git a/src/conf.c b/src/conf.c
index ddefff6..5b1b5a6 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -417,6 +417,7 @@ beginning:</P>
 #include <stdarg.h>
 #include <limits.h>
 #include <sys/stat.h>
+#include <dirent.h>
 #include <locale.h>
 #include "local.h"
 #ifdef HAVE_LIBPTHREAD
@@ -3373,6 +3374,42 @@ static int snd_config_hooks(snd_config_t *config, 
snd_config_t *private_data)
        return err;
 }
 
+static int config_filename_filter(const struct dirent *dirent)
+{
+       size_t flen;
+
+       if (dirent == NULL)
+               return 0;
+       if (dirent->d_type == DT_DIR)
+               return 0;
+
+       flen = strlen(dirent->d_name);
+       if (flen <= 5)
+               return 0;
+
+       if (strncmp(&dirent->d_name[flen-5], ".conf", 5) == 0)
+               return 1;
+
+       return 0;
+}
+
+static int config_file_open(snd_config_t *root, const char *filename)
+{
+       snd_input_t *in;
+       int err;
+
+       err = snd_input_stdio_open(&in, filename, "r");
+       if (err >= 0) {
+               err = snd_config_load(root, in);
+               snd_input_close(in);
+               if (err < 0)
+                       SNDERR("%s may be old or corrupted: consider to remove 
or fix it", filename);
+       } else
+               SNDERR("cannot access file %s", filename);
+
+       return err;
+}
+
 /**
  * \brief Loads and parses the given configurations files.
  * \param[in] root Handle to the root configuration node.
@@ -3457,20 +3494,39 @@ int snd_config_hook_load(snd_config_t *root, 
snd_config_t *config, snd_config_t
                }
        } while (hit);
        for (idx = 0; idx < fi_count; idx++) {
-               snd_input_t *in;
+               struct stat st;
                if (!errors && access(fi[idx].name, R_OK) < 0)
                        continue;
-               err = snd_input_stdio_open(&in, fi[idx].name, "r");
-               if (err >= 0) {
-                       err = snd_config_load(root, in);
-                       snd_input_close(in);
-                       if (err < 0) {
-                               SNDERR("%s may be old or corrupted: consider to 
remove or fix it", fi[idx].name);
-                               goto _err;
-                       }
-               } else {
-                       SNDERR("cannot access file %s", fi[idx].name);
+               if (stat(fi[idx].name, &st) < 0) {
+                       SNDERR("cannot stat file/directory %s", fi[idx].name);
+                       continue;
                }
+               if (S_ISDIR(st.st_mode)) {
+                       struct dirent **namelist;
+                       int n;
+
+                       n = scandir(fi[idx].name, &namelist, 
config_filename_filter, versionsort);
+                       if (n > 0) {
+                               int j;
+                               err = 0;
+                               for (j = 0; j < n; ++j) {
+                                       if (err >= 0) {
+                                               int sl = strlen(fi[idx].name) + 
strlen(namelist[j]->d_name) + 2;
+                                               char *filename = malloc(sl);
+                                               snprintf(filename, sl, "%s/%s", 
fi[idx].name, namelist[j]->d_name);
+                                               filename[sl-1] = '\0';
+
+                                               err = config_file_open(root, 
filename);
+                                               free(filename);
+                                       }
+                                       free(namelist[j]);
+                               }
+                               free(namelist);
+                               if (err < 0)
+                                       goto _err;
+                       }
+               } else if (config_file_open(root, fi[idx].name) < 0)
+                       goto _err;
        }
        *dst = NULL;
        err = 0;
diff --git a/src/conf/Makefile.am b/src/conf/Makefile.am
index 2e5d0bf..456454f 100644
--- a/src/conf/Makefile.am
+++ b/src/conf/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS=cards pcm
+SUBDIRS=cards pcm alsa.conf.d
 
 cfg_files = alsa.conf
 if BUILD_ALISP
diff --git a/src/conf/alsa.conf b/src/conf/alsa.conf
index a33c24e..bc91df3 100644
--- a/src/conf/alsa.conf
+++ b/src/conf/alsa.conf
@@ -8,6 +8,13 @@
        {
                func load
                files [
+                       {
+                               @func concat
+                               strings [
+                                       { @func datadir }
+                                       "/alsa.conf.d/"
+                               ]
+                       }
                        "/etc/asound.conf"
                        "~/.asoundrc"
                ]
diff --git a/src/conf/alsa.conf.d/Makefile.am b/src/conf/alsa.conf.d/Makefile.am
new file mode 100644
index 0000000..c91661e
--- /dev/null
+++ b/src/conf/alsa.conf.d/Makefile.am
@@ -0,0 +1,8 @@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+alsadir = $(alsaconfigdir)/alsa.conf.d
+cfg_files = README
+
+alsa_DATA = $(cfg_files)
+
+EXTRA_DIST = \
+       $(cfg_files)
diff --git a/src/conf/alsa.conf.d/README b/src/conf/alsa.conf.d/README
new file mode 100644
index 0000000..9997884
--- /dev/null
+++ b/src/conf/alsa.conf.d/README
@@ -0,0 +1,2 @@
+You can place files named *.conf in this folder and they will be processed
+when initialising alsa-lib.
-- 
1.7.6.1

++++++ 0031-pcm-recalculate-all-rules-after-changing-hw_params-f.patch ++++++
>From 6dab1a91cbbd40d2f52a0c5a1bd961a1db7bb319 Mon Sep 17 00:00:00 2001
From: Clemens Ladisch <[email protected]>
Date: Wed, 21 Sep 2011 08:30:20 +0200
Subject: [PATCH 1/5] pcm: recalculate all rules after changing hw_params
 flags

The rules engine avoids recalculating rules that do not depend on
any changed parameter, but there is no mechanism to record changed
flags.  So when we change a flag, we have to ensure that all rules
depending on that flag are recalculated; the only method to do this
is to force recalculation of all rules.

So far, there have been no kernel drivers with rules depending
on flags, but rules to disable hardware SRCs by setting
SND_PCM_HW_PARAMS_NORESAMPLE are being introduced now.

Signed-off-by: Clemens Ladisch <[email protected]>
---
 src/pcm/pcm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 12f8cd0..bc5c6e4 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -4200,6 +4200,7 @@ int snd_pcm_hw_params_set_rate_resample(snd_pcm_t *pcm, 
snd_pcm_hw_params_t *par
                params->flags |= SND_PCM_HW_PARAMS_NORESAMPLE;
        else
                params->flags &= ~SND_PCM_HW_PARAMS_NORESAMPLE;
+       params->rmask = ~0;
        return snd_pcm_hw_refine(pcm, params);
 }
 
@@ -4231,6 +4232,7 @@ int snd_pcm_hw_params_set_export_buffer(snd_pcm_t *pcm, 
snd_pcm_hw_params_t *par
                params->flags |= SND_PCM_HW_PARAMS_EXPORT_BUFFER;
        else
                params->flags &= ~SND_PCM_HW_PARAMS_EXPORT_BUFFER;
+       params->rmask = ~0;
        return snd_pcm_hw_refine(pcm, params);
 }
 
@@ -4280,6 +4282,7 @@ int snd_pcm_hw_params_set_period_wakeup(snd_pcm_t *pcm, 
snd_pcm_hw_params_t *par
                params->flags |= SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP;
        } else
                params->flags &= ~SND_PCM_HW_PARAMS_NO_PERIOD_WAKEUP;
+       params->rmask = ~0;
 
        return snd_pcm_hw_refine(pcm, params);
 }
-- 
1.7.6.1

++++++ 0032-src-pcm-pcm_rate.c-add-missing-free.patch ++++++
>From 2a7f653b7f3bea6c8f0895f1921c2d706f40684f Mon Sep 17 00:00:00 2001
From: Julia Lawall <[email protected]>
Date: Sun, 18 Sep 2011 22:04:34 +0200
Subject: [PATCH 2/5] src/pcm/pcm_rate.c: add missing free

Something that is allocated using calloc is not freed on one
or more error paths.

Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Suman Saha <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
---
 src/pcm/pcm_rate.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/pcm/pcm_rate.c b/src/pcm/pcm_rate.c
index 70e30e5..eb35e4a 100644
--- a/src/pcm/pcm_rate.c
+++ b/src/pcm/pcm_rate.c
@@ -1392,11 +1392,13 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char 
*name,
        } else {
                SNDERR("Invalid type for rate converter");
                snd_pcm_close(pcm);
+               free(rate);
                return -EINVAL;
        }
        if (err < 0) {
                SNDERR("Cannot find rate converter");
                snd_pcm_close(pcm);
+               free(rate);
                return -ENOENT;
        }
 #else
@@ -1405,6 +1407,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
        err = open_func(SND_PCM_RATE_PLUGIN_VERSION, &rate->obj, &rate->ops);
        if (err < 0) {
                snd_pcm_close(pcm);
+               free(rate);
                return err;
        }
 #endif
@@ -1413,6 +1416,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
            ! rate->ops.input_frames || ! rate->ops.output_frames) {
                SNDERR("Inproper rate plugin %s initialization", type);
                snd_pcm_close(pcm);
+               free(rate);
                return err;
        }
 
-- 
1.7.6.1

++++++ 0033-src-pcm-pcm_ladspa.c-add-missing-free.patch ++++++
>From 03aa1a57c99460489815bf301e554c4d0a638bf6 Mon Sep 17 00:00:00 2001
From: Julia Lawall <[email protected]>
Date: Sun, 18 Sep 2011 22:04:36 +0200
Subject: [PATCH 3/5] src/pcm/pcm_ladspa.c: add missing free

Something that is allocated using calloc is not freed on some
error paths.

Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Suman Saha <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
---
 src/pcm/pcm_ladspa.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/pcm/pcm_ladspa.c b/src/pcm/pcm_ladspa.c
index c413c10..84ebaa5 100644
--- a/src/pcm/pcm_ladspa.c
+++ b/src/pcm/pcm_ladspa.c
@@ -750,8 +750,10 @@ static int snd_pcm_ladspa_allocate_memory(snd_pcm_t *pcm, 
snd_pcm_ladspa_t *lads
                         if (instance->input.data == NULL ||
                             instance->input.m_data == NULL ||
                             instance->output.data == NULL ||
-                            instance->output.m_data == NULL)
+                            instance->output.m_data == NULL) {
+                                free(pchannels);
                                 return -ENOMEM;
+                        }
                        for (idx = 0; idx < instance->input.channels.size; 
idx++) {
                                chn = instance->output.channels.array[idx];
                                if (pchannels[chn] == NULL && chn < ichannels) {
@@ -761,8 +763,10 @@ static int snd_pcm_ladspa_allocate_memory(snd_pcm_t *pcm, 
snd_pcm_ladspa_t *lads
                                instance->input.data[idx] = pchannels[chn];
                                if (instance->input.data[idx] == NULL) {
                                         instance->input.data[idx] = 
snd_pcm_ladspa_allocate_zero(ladspa, 0);
-                                        if (instance->input.data[idx] == NULL)
+                                        if (instance->input.data[idx] == NULL) 
{
+                                                free(pchannels);
                                                 return -ENOMEM;
+                                        }
                                 }
                         }
                         for (idx = 0; idx < instance->output.channels.size; 
idx++) {
@@ -770,8 +774,10 @@ static int snd_pcm_ladspa_allocate_memory(snd_pcm_t *pcm, 
snd_pcm_ladspa_t *lads
                                 /* FIXME/OPTIMIZE: check if we can remove 
double alloc */
                                 /* if LADSPA plugin has no broken inplace */
                                 instance->output.data[idx] = 
malloc(sizeof(LADSPA_Data) * ladspa->allocated);
-                                if (instance->output.data[idx] == NULL)
+                                if (instance->output.data[idx] == NULL) {
+                                        free(pchannels);
                                         return -ENOMEM;
+                                }
                                 pchannels[chn] = instance->output.m_data[idx] 
= instance->output.data[idx];
                         }
                }
@@ -793,8 +799,10 @@ static int snd_pcm_ladspa_allocate_memory(snd_pcm_t *pcm, 
snd_pcm_ladspa_t *lads
                                                 instance->output.data[idx] = 
NULL;
                                         } else {
                                                 instance->output.data[idx] = 
snd_pcm_ladspa_allocate_zero(ladspa, 1);
-                                                if (instance->output.data[idx] 
== NULL)
+                                                if (instance->output.data[idx] 
== NULL) {
+                                                        free(pchannels);
                                                         return -ENOMEM;
+                                                }
                                         }
                                 }
                         }
-- 
1.7.6.1

++++++ 0034-src-pcm-pcm_multi.c-add-missing-free.patch ++++++
>From c36f8c87ffb978d8cabbc4e5c489f14b6b276365 Mon Sep 17 00:00:00 2001
From: Julia Lawall <[email protected]>
Date: Sun, 18 Sep 2011 22:04:37 +0200
Subject: [PATCH 4/5] src/pcm/pcm_multi.c: add missing free

Something that is allocated using calloc is not freed on an error path.

Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Suman Saha <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
---
 src/pcm/pcm_multi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/pcm/pcm_multi.c b/src/pcm/pcm_multi.c
index 68f2d68..6b39c7a 100644
--- a/src/pcm/pcm_multi.c
+++ b/src/pcm/pcm_multi.c
@@ -886,6 +886,8 @@ int snd_pcm_multi_open(snd_pcm_t **pcmp, const char *name,
        err = snd_pcm_new(&pcm, SND_PCM_TYPE_MULTI, name, stream,
                          multi->slaves[0].pcm->mode);
        if (err < 0) {
+               free(multi->slaves);
+               free(multi->channels);
                free(multi);
                return err;
        }
-- 
1.7.6.1

++++++ 0035-src-pcm-pcm_mmap.c-add-missing-free.patch ++++++
>From fef6e6fd580073e0c0696105f808145561990b75 Mon Sep 17 00:00:00 2001
From: Julia Lawall <[email protected]>
Date: Thu, 22 Sep 2011 13:59:31 +0200
Subject: [PATCH 5/5] src/pcm/pcm_mmap.c: add missing free

The mmap_channels and running_areas fields are allocated using calloc, but
are not freed on an error path.

Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Suman Saha <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
---
 src/pcm/pcm_mmap.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/pcm/pcm_mmap.c b/src/pcm/pcm_mmap.c
index 4621fe6..6b44050 100644
--- a/src/pcm/pcm_mmap.c
+++ b/src/pcm/pcm_mmap.c
@@ -320,8 +320,13 @@ int snd_pcm_mmap(snd_pcm_t *pcm)
                snd_pcm_channel_info_t *i = &pcm->mmap_channels[c];
                i->channel = c;
                err = snd_pcm_channel_info(pcm, i);
-               if (err < 0)
+               if (err < 0) {
+                       free(pcm->mmap_channels);
+                       free(pcm->running_areas);
+                       pcm->mmap_channels = NULL;
+                       pcm->running_areas = NULL;
                        return err;
+               }
        }
        for (c = 0; c < pcm->channels; ++c) {
                snd_pcm_channel_info_t *i = &pcm->mmap_channels[c];
-- 
1.7.6.1





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



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to