diff --git a/alsa-lib-1.0.21.tar.bz2 b/alsa-lib-1.0.21.tar.bz2 new file mode 100644 index 0000000..bf157d5 --- /dev/null +++ b/alsa-lib-1.0.21.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab6c40e4f694284d249841075458bbef77ffa0d06561fd847548c28082a79925 +size 808252 diff --git a/alsa-lib-1.0.22.tar.bz2 b/alsa-lib-1.0.22.tar.bz2 deleted file mode 100644 index 653ef83..0000000 --- a/alsa-lib-1.0.22.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:03c3e1410e68bae9b8c0d2ef1023b5416b4fd1c7191d52615d633def71e019bb -size 808534 diff --git a/alsa-lib-dmix-snd_pcm_info-fix.diff b/alsa-lib-dmix-snd_pcm_info-fix.diff new file mode 100644 index 0000000..41be156 --- /dev/null +++ b/alsa-lib-dmix-snd_pcm_info-fix.diff @@ -0,0 +1,33 @@ +From da237814e7409b38baedab64d6b4b18928b32404 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Mon, 28 Sep 2009 11:59:50 +0200 +Subject: [PATCH] dmix - Fix snd_pcm_info() + +Call the slave snd_pcm_info() as long as possible in the direct plugins +(i.e. when the PCM device could be opened with O_APPEND mode). +This allows dmix/dsnoop as a salve for PCM hook controls. + +Signed-off-by: Takashi Iwai +--- + src/pcm/pcm_direct.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/src/pcm/pcm_direct.c b/src/pcm/pcm_direct.c +index 82cc126..d9e596e 100644 +--- a/src/pcm/pcm_direct.c ++++ b/src/pcm/pcm_direct.c +@@ -591,7 +591,10 @@ int snd_pcm_direct_poll_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned in + + int snd_pcm_direct_info(snd_pcm_t *pcm, snd_pcm_info_t * info) + { +- // snd_pcm_direct_t *dmix = pcm->private_data; ++ snd_pcm_direct_t *dmix = pcm->private_data; ++ ++ if (dmix->spcm && !dmix->shmptr->use_server) ++ return snd_pcm_info(dmix->spcm, info); + + memset(info, 0, sizeof(*info)); + info->stream = pcm->stream; +-- +1.6.4.2 + diff --git a/alsa-lib-fix-namehint-corruption.diff b/alsa-lib-fix-namehint-corruption.diff new file mode 100644 index 0000000..86379d3 --- /dev/null +++ b/alsa-lib-fix-namehint-corruption.diff @@ -0,0 +1,64 @@ +From e1c7dd261347f6a0b9ad56e52bb86dfe057cfb9a Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 3 Nov 2009 08:57:10 +0100 +Subject: [PATCH] Fix corruption after snd_device_name_hint() + +snd_device_name_hint() corrupts the config name space after its call. +This results in the error from the suceeding calls of snd_pcm_open() +after snd_device_name_hint(). + +The bug is in try_config() in namehint.c; it calls snd_config_delete(res) +but res can be two different objects in the function. One is the object +obtained via snd_config_search_definition(), and another is the one from +snd_config_search_alias_hooks(). The former is the expanded objects, +thus it should be freed. But, the latter is a reference, and must not be +freed. + +This patch adds the check to free or not. + +Reported-by: John Lindgren +Signed-off-by: Takashi Iwai +--- + src/control/namehint.c | 5 ++++- + 1 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/src/control/namehint.c b/src/control/namehint.c +index e878f83..a134ed7 100644 +--- a/src/control/namehint.c ++++ b/src/control/namehint.c +@@ -219,6 +219,7 @@ static int try_config(struct hint_list *list, + const char *str; + int err = 0, level; + long dev = list->device; ++ int cleanup_res = 0; + + list->device_input = -1; + list->device_output = -1; +@@ -244,6 +245,7 @@ static int try_config(struct hint_list *list, + snd_lib_error_set_handler(eh); + if (err < 0) + goto __skip_add; ++ cleanup_res = 1; + err = -EINVAL; + if (snd_config_get_type(res) != SND_CONFIG_TYPE_COMPOUND) + goto __cleanup; +@@ -330,6 +332,7 @@ static int try_config(struct hint_list *list, + goto __hint; + snd_config_delete(res); + res = NULL; ++ cleanup_res = 0; + if (strchr(buf, ':') != NULL) + goto __ok; + /* find, if all parameters have a default, */ +@@ -379,7 +382,7 @@ static int try_config(struct hint_list *list, + err = hint_list_add(list, buf, buf1); + } + __skip_add: +- if (res) ++ if (res && cleanup_res) + snd_config_delete(res); + if (buf1) + free(buf1); +-- +1.6.4.2 + diff --git a/alsa-lib-fix-pcm-hw-delay.diff b/alsa-lib-fix-pcm-hw-delay.diff new file mode 100644 index 0000000..431e390 --- /dev/null +++ b/alsa-lib-fix-pcm-hw-delay.diff @@ -0,0 +1,55 @@ +From ecf4b5af8632a17af3c84cfceeaaf0a1609e2928 Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Fri, 11 Sep 2009 01:07:21 +0300 +Subject: [PATCH] pcm_hw: Always use delay ioctl in snd_pcm_delay() + +As the result of snd_pcm_delay() is affected not only by hw_ptr +and appl_ptr, but also by 'runtime->delay' property, +either SNDRV_PCM_IOCTL_DELAY or SNDRV_PCM_IOCTL_STATUS ioctl +must be used to get the correct result. + +Previously 'runtime->delay' was ignored in case 'hw->sync_ptr' +was used. + +Signed-off-by: Kai Vehmanen +Signed-off-by: Takashi Iwai +--- + src/pcm/pcm_hw.c | 22 ---------------------- + 1 files changed, 0 insertions(+), 22 deletions(-) + +diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c +index c46d14f..8abb204 100644 +--- a/src/pcm/pcm_hw.c ++++ b/src/pcm/pcm_hw.c +@@ -507,28 +507,6 @@ static int snd_pcm_hw_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp) + { + snd_pcm_hw_t *hw = pcm->private_data; + int fd = hw->fd, err; +- if (hw->sync_ptr) { +- err = sync_ptr1(hw, SNDRV_PCM_SYNC_PTR_HWSYNC); +- if (err < 0) +- return err; +- switch (FAST_PCM_STATE(hw)) { +- case SNDRV_PCM_STATE_RUNNING: +- case SNDRV_PCM_STATE_DRAINING: +- case SNDRV_PCM_STATE_PAUSED: +- case SNDRV_PCM_STATE_PREPARED: +- case SNDRV_PCM_STATE_SUSPENDED: +- break; +- case SNDRV_PCM_STATE_XRUN: +- return -EPIPE; +- default: +- return -EBADFD; +- } +- if (pcm->stream == SND_PCM_STREAM_PLAYBACK) +- *delayp = snd_pcm_mmap_playback_hw_avail(pcm); +- else +- *delayp = snd_pcm_mmap_capture_avail(pcm); +- return 0; +- } + if (ioctl(fd, SNDRV_PCM_IOCTL_DELAY, delayp) < 0) { + err = -errno; + SYSMSG("SNDRV_PCM_IOCTL_DELAY failed"); +-- +1.6.4.2 + diff --git a/alsa-lib-git-fixes.diff b/alsa-lib-git-fixes.diff new file mode 100644 index 0000000..79b3976 --- /dev/null +++ b/alsa-lib-git-fixes.diff @@ -0,0 +1,149 @@ +diff --git a/configure.in b/configure.in +index e96058b..3cd6366 100644 +--- a/configure.in ++++ b/configure.in +@@ -12,7 +12,7 @@ dnl add API = c+1:0:a+1 + dnl remove API = c+1:0:0 + dnl ************************************************* + AC_CANONICAL_HOST +-AM_INIT_AUTOMAKE(alsa-lib, 1.0.21) ++AM_INIT_AUTOMAKE(alsa-lib, 1.0.21a) + eval LIBTOOL_VERSION_INFO="2:0:0" + dnl ************************************************* + AM_CONDITIONAL(INSTALL_M4, test -n "${ACLOCAL}") +diff --git a/src/conf.c b/src/conf.c +index 3f0dfe1..570c90f 100644 +--- a/src/conf.c ++++ b/src/conf.c +@@ -3477,8 +3477,9 @@ int snd_config_hook_load_for_all_cards(snd_config_t *root, snd_config_t *config, + err = snd_determine_driver(card, &fdriver); + if (err < 0) + return err; +- if (snd_config_search(root, fdriver, &n) >= 0 && +- snd_config_get_string(n, &driver) >= 0) { ++ if (snd_config_search(root, fdriver, &n) >= 0) { ++ if (snd_config_get_string(n, &driver) < 0) ++ goto __err; + assert(driver); + while (1) { + char *s = strchr(driver, '.'); +diff --git a/src/conf/pcm/dmix.conf b/src/conf/pcm/dmix.conf +index 4108ddb..e62cb29 100644 +--- a/src/conf/pcm/dmix.conf ++++ b/src/conf/pcm/dmix.conf +@@ -63,12 +63,12 @@ pcm.!dmix { + name { + @func concat + strings [ +- "cards." ++ "defaults.dmix." + { + @func card_driver + card $CARD + } +- ".pcm.dmix.period_size" ++ ".period_size" + ] + } + default 1024 +@@ -78,12 +78,12 @@ pcm.!dmix { + name { + @func concat + strings [ +- "cards." ++ "defaults.dmix." + { + @func card_driver + card $CARD + } +- ".pcm.dmix.period_time" ++ ".period_time" + ] + } + default -1 +@@ -93,12 +93,12 @@ pcm.!dmix { + name { + @func concat + strings [ +- "cards." ++ "defaults.dmix." + { + @func card_driver + card $CARD + } +- ".pcm.dmix.periods" ++ ".periods" + ] + } + default 16 +diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c +index 4802200..9259a08 100644 +--- a/src/mixer/simple_none.c ++++ b/src/mixer/simple_none.c +@@ -134,6 +134,7 @@ static int get_compare_weight(const char *name, unsigned int idx) + static const char *const names[] = { + "Master", + "Headphone", ++ "Speaker", + "Tone", + "Bass", + "Treble", +@@ -158,6 +159,7 @@ static int get_compare_weight(const char *name, unsigned int idx) + "I2S", + "IEC958", + "PC Speaker", ++ "Beep", + "Aux", + "Mono", + "Playback", +diff --git a/src/pcm/pcm_params.c b/src/pcm/pcm_params.c +index 80b3fd2..0e1c3fc 100644 +--- a/src/pcm/pcm_params.c ++++ b/src/pcm/pcm_params.c +@@ -1081,6 +1081,7 @@ int snd_pcm_hw_param_never_eq(const snd_pcm_hw_params_t *params, + static int snd_pcm_hw_params_choose(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) + { + int err; ++ const char *compat = getenv("LIBASOUND_COMPAT"); + #ifdef CHOOSE_DEBUG + snd_output_t *log; + snd_output_stdio_attach(&log, stderr, 0); +@@ -1103,15 +1104,29 @@ static int snd_pcm_hw_params_choose(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) + err = snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_RATE, NULL, 0); + if (err < 0) + return err; +- err = snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_PERIOD_TIME, NULL, 0); +- if (err < 0) +- return err; +- err = snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_PERIOD_SIZE, NULL, 0); +- if (err < 0) +- return err; +- err = snd_pcm_hw_param_set_last(pcm, params, SND_PCM_HW_PARAM_BUFFER_SIZE, NULL, 0); +- if (err < 0) +- return err; ++ if (compat && *compat) { ++ /* old mode */ ++ err = snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_PERIOD_TIME, NULL, 0); ++ if (err < 0) ++ return err; ++ err = snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_PERIOD_SIZE, NULL, 0); ++ if (err < 0) ++ return err; ++ err = snd_pcm_hw_param_set_last(pcm, params, SND_PCM_HW_PARAM_BUFFER_SIZE, NULL, 0); ++ if (err < 0) ++ return err; ++ } else { ++ /* determine buffer size first */ ++ err = snd_pcm_hw_param_set_last(pcm, params, SND_PCM_HW_PARAM_BUFFER_SIZE, NULL, 0); ++ if (err < 0) ++ return err; ++ err = snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_PERIOD_SIZE, NULL, 0); ++ if (err < 0) ++ return err; ++ err = snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_PERIOD_TIME, NULL, 0); ++ if (err < 0) ++ return err; ++ } + err = snd_pcm_hw_param_set_first(pcm, params, SND_PCM_HW_PARAM_TICK_TIME, NULL, 0); + if (err < 0) + return err; diff --git a/alsa-lib-hcontrol-fix-compare-default.diff b/alsa-lib-hcontrol-fix-compare-default.diff new file mode 100644 index 0000000..01d689c --- /dev/null +++ b/alsa-lib-hcontrol-fix-compare-default.diff @@ -0,0 +1,51 @@ +From 0110d62043589f0e3344d7af7ed33ac52da6b596 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 6 Oct 2009 10:46:54 +0200 +Subject: [PATCH] hcontrol: fix compare_default function to handle also id.device and id.subdevice + +In case when kcontrol differs only by device or subdevice numbers, the +find function can give wrong results. + +Signed-off-by: Jaroslav Kysela +--- + src/control/hcontrol.c | 14 ++++++++++---- + 1 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/src/control/hcontrol.c b/src/control/hcontrol.c +index 181e767..1bfc015 100644 +--- a/src/control/hcontrol.c ++++ b/src/control/hcontrol.c +@@ -471,8 +471,9 @@ int snd_hctl_compare_fast(const snd_hctl_elem_t *c1, + static int snd_hctl_compare_default(const snd_hctl_elem_t *c1, + const snd_hctl_elem_t *c2) + { +- int res; +- int d = c1->id.iface - c2->id.iface; ++ int res, d; ++ ++ d = c1->id.iface - c2->id.iface; + if (d != 0) + return d; + if (c1->id.iface == SNDRV_CTL_ELEM_IFACE_MIXER) { +@@ -480,11 +481,16 @@ static int snd_hctl_compare_default(const snd_hctl_elem_t *c1, + if (d != 0) + return d; + } ++ d = c1->id.device - c2->id.device; ++ if (d != 0) ++ return d; ++ d = c1->id.subdevice - c2->id.subdevice; ++ if (d != 0) ++ return d; + res = strcmp((const char *)c1->id.name, (const char *)c2->id.name); + if (res != 0) + return res; +- d = c1->id.index - c2->id.index; +- return d; ++ return c1->id.index - c2->id.index; + } + + /** +-- +1.6.4.2 + diff --git a/alsa.changes b/alsa.changes index 67fd465..01dac4d 100644 --- a/alsa.changes +++ b/alsa.changes @@ -1,20 +1,3 @@ -------------------------------------------------------------------- -Fri Dec 18 17:36:49 CET 2009 - tiwai@suse.de - -- set AUTOMAKE_JOBS for parallel automake - -------------------------------------------------------------------- -Fri Dec 18 17:18:17 CET 2009 - tiwai@suse.de - -- updated to version 1.0.22: - * including previous fixes - * a few fixes for alsactl init - -------------------------------------------------------------------- -Wed Dec 16 09:59:50 CET 2009 - jengelh@medozas.de - -- add baselibs.conf as a source - ------------------------------------------------------------------- Tue Nov 3 09:13:13 CET 2009 - tiwai@suse.de diff --git a/alsa.spec b/alsa.spec index fb6284f..637f518 100644 --- a/alsa.spec +++ b/alsa.spec @@ -1,5 +1,5 @@ # -# spec file for package alsa (Version 1.0.22) +# spec file for package alsa (Version 1.0.21) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -20,7 +20,7 @@ Name: alsa BuildRequires: doxygen -%define package_version 1.0.22 +%define package_version 1.0.21 License: GPL v2 or later Group: System/Libraries Requires: alsa-utils @@ -33,10 +33,9 @@ Obsoletes: alsa-64bit %endif # Summary: Advanced Linux Sound Architecture -Version: 1.0.22 +Version: 1.0.21 Release: 4 Source: ftp://ftp.alsa-project.org/pub/lib/alsa-lib-%{package_version}.tar.bz2 -Source2: baselibs.conf Source8: 40-alsa.rules Source11: alsasound Source12: sysconfig.sound @@ -51,7 +50,11 @@ Source31: all_notes_off.bin Source32: all_notes_off.mid Source33: alsa-info.sh Source34: alsa-init.sh -# Patch: alsa-lib-git-fixes.diff +Patch: alsa-lib-git-fixes.diff +Patch1: alsa-lib-fix-pcm-hw-delay.diff +Patch2: alsa-lib-dmix-snd_pcm_info-fix.diff +Patch3: alsa-lib-hcontrol-fix-compare-default.diff +Patch4: alsa-lib-fix-namehint-corruption.diff Url: http://www.alsa-project.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -126,7 +129,11 @@ Authors: %prep %setup -q -n alsa-lib-%{package_version} -# %patch -p1 +%patch -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 # hack to fix build on older distros %if %suse_version < 1100 %ifarch %ix86 @@ -136,7 +143,6 @@ sed -i -e'/recommends.*alsa-oss/d' $RPM_SOURCE_DIR/baselibs.conf %endif %build -export AUTOMAKE_JOBS=%{?jobs:%jobs} # build alsa-lib autoreconf -fi %configure \