From e4a3bf11b3fcc572668706e436ed54e732b0b81b Mon Sep 17 00:00:00 2001 From: Diskmaster Date: Thu, 14 Aug 2008 04:44:40 -0500 Subject: [PATCH] Alsa git updates for alsa-{driver,utils}, uploaded initial -zendisk1 for rc3 --- media-sound/alsa-driver/Manifest | 5 +- ...0.17-r1.ebuild => alsa-driver-1.0.17-r2.ebuild} | 0 media-sound/alsa-driver/alsa-driver-1.0.17.ebuild | 185 -- media-sound/alsa-driver/files/git-update.patch | 2066 +++++++++++++++++++- media-sound/alsa-utils/Manifest | 6 +- media-sound/alsa-utils/alsa-utils-1.0.17-r4.ebuild | 99 - ....0.17-r3.ebuild => alsa-utils-1.0.17-r5.ebuild} | 2 +- media-sound/alsa-utils/files/git-update-2.patch | 147 -- .../files/{git-update-1.patch => git-update.patch} | 444 ++++- sys-kernel/zendisk-sources/Manifest | 3 + .../zendisk-sources-2.6.27_rc3-r10.ebuild | 6 + 11 files changed, 2410 insertions(+), 553 deletions(-) rename media-sound/alsa-driver/{alsa-driver-1.0.17-r1.ebuild => alsa-driver-1.0.17-r2.ebuild} (100%) delete mode 100644 media-sound/alsa-driver/alsa-driver-1.0.17.ebuild delete mode 100644 media-sound/alsa-utils/alsa-utils-1.0.17-r4.ebuild rename media-sound/alsa-utils/{alsa-utils-1.0.17-r3.ebuild => alsa-utils-1.0.17-r5.ebuild} (98%) delete mode 100644 media-sound/alsa-utils/files/git-update-2.patch rename media-sound/alsa-utils/files/{git-update-1.patch => git-update.patch} (89%) create mode 100644 sys-kernel/zendisk-sources/zendisk-sources-2.6.27_rc3-r10.ebuild diff --git a/media-sound/alsa-driver/Manifest b/media-sound/alsa-driver/Manifest index 84e0f7c..bb3526c 100644 --- a/media-sound/alsa-driver/Manifest +++ b/media-sound/alsa-driver/Manifest @@ -1,5 +1,4 @@ -AUX git-update.patch 15472 RMD160 142eceb7d7cc7bfd3f6b3b80ca109d0735c505a0 SHA1 6a52da2af7593de3e36dda7ca4fb3d981dd0a7e6 SHA256 f934416625ee43a9d0b05ea9574000c247019856f40a1e219a472315a9b55b02 +AUX git-update.patch 78883 RMD160 141415f4b6e8cd2c54380cfcbaa13ccb03fd1adf SHA1 86b447c818c41cd2087fcb973d539c4db8f283d4 SHA256 3ca3c137d117aba61996fefc969375a8fb2501ca2dac697311266106e6bc4ae1 DIST alsa-driver-1.0.17.tar.bz2 2725803 RMD160 e9e33ef8be8d808c66cc93e6bf124d16636c805c SHA1 82fc35333a43f834e5e4b16c425e3ee49d137ae8 SHA256 7695cc9c8c42b3d4fe4f918d24a751deb36b2fbb0ff2aaa2b1605c8ce11d4c9f -EBUILD alsa-driver-1.0.17-r1.ebuild 7396 RMD160 f683f8aaf308d244185ad945d18c5c4e66b1ccd8 SHA1 539101bc2deaf64c9d53f179006726f5f646cbeb SHA256 f841766d82003e440ba0dd8bf59263ca70d5300b55e6a4c13504cbc064fc7231 -EBUILD alsa-driver-1.0.17.ebuild 7397 RMD160 ddb12bd4eb6cb79a82a80509793e255498bb8d48 SHA1 316e28c651264a14614f748c2dca6068070a9397 SHA256 acd44ed47695b2fb97f1ed598b84a64179f8c32a7b94ef75d8137e0cd699a73e +EBUILD alsa-driver-1.0.17-r2.ebuild 7396 RMD160 f683f8aaf308d244185ad945d18c5c4e66b1ccd8 SHA1 539101bc2deaf64c9d53f179006726f5f646cbeb SHA256 f841766d82003e440ba0dd8bf59263ca70d5300b55e6a4c13504cbc064fc7231 MISC metadata.xml 221 RMD160 848fcfc4919cdb7c9e9a86ca0a08b6a5249f7eaa SHA1 016299ad61b87d43b563a8c190e12a960b08bd48 SHA256 847e71bb827dbbdd370b3cf3c2820860013420127f454ba822d24a70c0b61cf3 diff --git a/media-sound/alsa-driver/alsa-driver-1.0.17-r1.ebuild b/media-sound/alsa-driver/alsa-driver-1.0.17-r2.ebuild similarity index 100% rename from media-sound/alsa-driver/alsa-driver-1.0.17-r1.ebuild rename to media-sound/alsa-driver/alsa-driver-1.0.17-r2.ebuild diff --git a/media-sound/alsa-driver/alsa-driver-1.0.17.ebuild b/media-sound/alsa-driver/alsa-driver-1.0.17.ebuild deleted file mode 100644 index 3352ab4..0000000 --- a/media-sound/alsa-driver/alsa-driver-1.0.17.ebuild +++ /dev/null @@ -1,185 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/alsa-driver-1.0.16.ebuild,v 1.1 2008/04/14 02:47:04 beandog Exp $ - -inherit autotools linux-mod flag-o-matic eutils multilib linux-info - -MY_P="${P/_rc/rc}" -S="${WORKDIR}/${MY_P}" - -DESCRIPTION="Advanced Linux Sound Architecture kernel modules" -HOMEPAGE="http://www.alsa-project.org/" - -if [[ ${MY_P} == ${MY_P/_p*/} ]]; then - SRC_URI="mirror://alsaproject/driver/${MY_P}.tar.bz2" -else # Gentoo snapshots - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2" -fi - -LICENSE="GPL-2 LGPL-2.1" -SLOT="0" - -KEYWORDS="~amd64 ~x86" -IUSE="oss debug midi" - -IUSE_CARDS="seq-dummy dummy virmidi mtpav mts64 serial-u16550 mpu401 -loopback portman2x4 pcsp ad1848-lib adlib ad1816a ad1848 -als100 azt2320 cmi8330 cs4231 cs4232 cs4236 dt019x es968 es1688 es18xx -gusclassic gusextreme gusmax interwave interwave-stb opl3sa2 -opti92x-ad1848 opti92x-cs4231 opti93x miro sb8 sb16 sbawe sgalaxy -sscape wavefront pc98-cs4232 msnd-pinnacle ad1889 als300 als4000 -ali5451 atiixp atiixp-modem au8810 au8820 au8830 azt3328 bt87x ca0106 -cmipci cs4281 cs46xx cs5535audio darla20 gina20 layla20 darla24 gina24 -layla24 mona mia echo3g indigo indigoio indigodj emu10k1 emu10k1x -ens1370 ens1371 es1938 es1968 fm801 fm801-tea575x hda-intel hdsp hdspm -ice1712 ice1724 intel8x0 intel8x0m korg1212 maestro3 mixart nm256 -pcxhr riptide rme32 rme96 rme9652 sonicvibes trident via82xx -via82xx-modem vx222 ymfpci pdplus asihpi powermac aoa -aoa-fabric-layout aoa-onyx aoa-tas aoa-toonie aoa-soundbus -aoa-soundbus-i2s sa11xx-uda1341 armaaci s3c2410 pxa2xx-i2sound au1x00 -usb-audio usb-usx2y vxpocket pdaudiocf sun-amd7930 sun-cs4231 sun-dbri -harmony soc at91-soc at91-soc-eti-b1-wm8731 pxa2xx-soc -pxa2xx-soc-corgi pxa2xx-soc-spitz pxa2xx-soc-poodle pxa2xx-soc-tosa hifier -ml403-ac97cr oxygen pxa2xx-soc-e800 sis7019 virtuoso" - -for iuse_card in ${IUSE_CARDS}; do - IUSE="${IUSE} alsa_cards_${iuse_card}" -done - -RDEPEND="virtual/modutils - !media-sound/snd-aoa" -DEPEND="${RDEPEND} - >=media-sound/alsa-headers-1.0.16 - virtual/linux-sources - sys-apps/debianutils" - -PROVIDE="virtual/alsa" - -pkg_setup() { - # By default, drivers for all supported cards will be compiled. - # If you want to only compile for specific card(s), set ALSA_CARDS - # environment to a space-separated list of drivers that you want to build. - # For example: - # - # env ALSA_CARDS='emu10k1 intel8x0 ens1370' emerge alsa-driver - # - ALSA_CARDS=${ALSA_CARDS:-${IUSE_ALSA_CARDS}} - - local PNP_DRIVERS="interwave interwave-stb" - local PNP_ERROR="Some of the drivers you selected require PnP support in your kernel (${PNP_DRIVERS}). Either enable PnP in your kernel or trim which drivers get compiled using ALSA_CARDS in /etc/make.conf." - - local ISA_DRIVERS="cs4232 msnd-pinnacle adlib ad1816a ad1848 als100 azt2320 - cmi8330 cs4231 cs4236 dt019x es968 es1688 es18xx gusclassic gusextreme gusmax - interwave interwave-stb opl3sa2 opti92x-ad1848 opti92x-cs4231 opti93x miro sb8 - sb16 sbawe sb16_csp sgalaxy sscape wavefront" - local ISA_ERROR="Some of the drivers you selected require ISA support in your kernel ($(echo $ISA_DRIVERS)). Either enable ISA in your kernel or trim which drivers get compiled using ALSA_CARDS in /etc/make.conf." - - local FW_DRIVERS="darla20 gina20 layla20 darla24 gina24 layla24 mona mia echo3g indigo - indigoio indigodj emu10k1 korg1212 maestro3 riptide ymfpci asihpi" - local FW_LOADER_ERROR="Some of the drivers you selected require 'Userspace firmware loading support' in your kernel (${FW_DRIVERS}). Either enable that feature or trim which drivers get compiled using ALSA_CARDS in /etc/make.conf." - - local PARPORT_DRIVERS="portman2x4" - local PARPORT_ERROR="Some if the drivers you selected require Parallel Port support (${PARPORT_DRIVERS}). Either enable that feature or trim which drivers get compiled using ALSA_CARDS in /etc/make.conf." - - local TMP_ALSA_CARDS - local CHECK_PNP - local CHECK_ISA - local CHECK_FW - local CHECK_PARPORT - for card in ${ALSA_CARDS}; do - if has alsa_cards_${card} ${IUSE} && use alsa_cards_${card}; then - TMP_ALSA_CARDS="${TMP_ALSA_CARDS} ${card}" - has ${card} ${PNP_DRIVERS} && CHECK_PNP="PNP" - has ${card} ${ISA_DRIVERS} && CHECK_ISA="ISA" - has ${card} ${FW_DRIVERS} && CHECK_FW="FW_LOADER" - has ${card} ${PARPORT_DRIVERS} && CHECK_PARPORT="PARPORT" - fi - done - ALSA_CARDS="${TMP_ALSA_CARDS}" - - local CONFIG_CHECK="!SND SOUND ${CHECK_PNP} ${CHECK_ISA} ${CHECK_FW} ${CHECK_PARPORT}" - local SND_ERROR="ALSA is already compiled into the kernel. This is the recommended configuration, don't emerge alsa-driver." - local SOUND_ERROR="Your kernel doesn't have sound support enabled." - local SOUND_PRIME_ERROR="Your kernel is configured to use the deprecated OSS drivers. Please disable them and re-emerge alsa-driver." - - linux-mod_pkg_setup - - if [[ ${PROFILE_ARCH} == "sparc64" ]] ; then - export CBUILD=${CBUILD-${CHOST}} - export CHOST="sparc64-unknown-linux-gnu" - fi -} - -src_unpack() { - unpack ${A} - - cd "${S}" - - #kernel_is 2 4 && epatch "${FILESDIR}"/alsa-driver-1.0.15-linux-2.4.patch - # use firmwarefix && epatch "${FILESDIR}"/alsa-driver-1.0.17-gitupdate.patch - # use firmwarefix && epatch "${FILESDIR}"/alsa-driver-1.0.17-sb16-csp-cleanup.patch - # use firmwarefix && epatch "${FILESDIR}"/alsa-driver-1.0.17-maestro3-cleanup.patch - # Previous lines were cruft from trying to patch something that didn't really need patched. - #epatch "${FILESDIR}"/git-update.patch - convert_to_m "${S}/Makefile" - sed -i -e 's:\(.*depmod\):#\1:' "${S}/Makefile" - eautoconf -} - -src_compile() { - local myABI=${ABI:-${DEFAULT_ABI}} - - # Should fix bug #46901 - is-flag "-malign-double" && filter-flags "-fomit-frame-pointer" - append-flags "-I${KV_DIR}/arch/$(tc-arch-kernel)/include" - - econf $(use_with oss) \ - $(use_with debug debug full) \ - --with-kernel="${KV_DIR}" \ - --with-build="${KV_OUT_DIR}" \ - --with-isapnp=yes \ - $(use_with midi sequencer) \ - --with-cards="${ALSA_CARDS}" || die "econf failed" - - # linux-mod_src_compile doesn't work well with alsa - - ARCH=$(tc-arch-kernel) - ABI=${KERNEL_ABI} - emake LDFLAGS="$(raw-ldflags)" HOSTCC="$(tc-getBUILD_CC)" CC="$(tc-getCC)" || die "Make Failed" - ARCH=$(tc-arch) - ABI=${myABI} -} - -src_install() { - emake DESTDIR="${D}" install-modules || die "make install failed" - - dodoc CARDS-STATUS FAQ README WARNING TODO SUPPORTED_KERNELS - - if kernel_is 2 6; then - # mv the drivers somewhere they won't be killed by the kernel's make modules_install - mv "${D}/lib/modules/${KV_FULL}/kernel/sound" "${D}/lib/modules/${KV_FULL}/${PN}" - rmdir "${D}/lib/modules/${KV_FULL}/kernel" &> /dev/null - fi -} - -pkg_postinst() { - elog - elog "Remember that all mixer channels will be MUTED by default." - elog "Use the 'alsamixer' program to unmute them, then save your" - elog "mixer settings with /etc/init.d/alsasound save" - elog - elog "If you experience problems, please try building the in-kernel" - elog "ALSA drivers instead. This ebuild is unsupported." - elog - - linux-mod_pkg_postinst - - if kernel_is 2 6 && [ -e "${ROOT}/lib/modules/${KV_FULL}/kernel/sound" ]; then - # Cleanup if they had older alsa installed - for file in $(find "${ROOT}/lib/modules/${KV_FULL}/${PN}" -type f); do - rm -f ${file//${KV_FULL}\/${PN}/${KV_FULL}\/kernel\/sound} - done - - find "${ROOT}/lib/modules/${KV_FULL}/kernel/sound" -type d -print0 | xargs --null rmdir - fi -} diff --git a/media-sound/alsa-driver/files/git-update.patch b/media-sound/alsa-driver/files/git-update.patch index 9876d0f..395db18 100644 --- a/media-sound/alsa-driver/files/git-update.patch +++ b/media-sound/alsa-driver/files/git-update.patch @@ -1,11 +1,148 @@ -diff -urN alsa-driver-1.0.17/acore/init.patch alsa-driver-patched/acore/init.patch ---- alsa-driver-1.0.17/acore/init.patch 2008-07-14 03:53:57.000000000 -0400 -+++ alsa-driver-patched/acore/init.patch 2008-08-02 13:04:14.882495553 -0400 +diff --git a/acore/control.patch b/acore/control.patch +index 728e4f8..4073cb9 100644 +--- a/acore/control.patch ++++ b/acore/control.patch +@@ -1,5 +1,5 @@ +---- ../alsa-kernel/core/control.c 2007-12-20 10:19:16.000000000 +0100 +-+++ control.c 2007-12-20 10:37:29.000000000 +0100 ++--- ../alsa-kernel/core/control.c 2008-08-08 15:07:55.000000000 +0200 +++++ control.c 2008-08-08 15:07:58.000000000 +0200 + @@ -1,3 +1,5 @@ + +#define __NO_VERSION__ + +#include "adriver.h" +@@ -14,7 +14,7 @@ + #include + #include + #include +-@@ -716,6 +719,10 @@ ++@@ -714,6 +717,10 @@ + return result; + } + +@@ -25,7 +25,7 @@ + static int snd_ctl_elem_read_user(struct snd_card *card, + struct snd_ctl_elem_value __user *_control) + { +-@@ -779,6 +786,10 @@ ++@@ -773,6 +780,10 @@ + return result; + } + +@@ -36,7 +36,7 @@ + static int snd_ctl_elem_write_user(struct snd_ctl_file *file, + struct snd_ctl_elem_value __user *_control) + { +-@@ -1383,25 +1394,44 @@ ++@@ -1380,25 +1391,44 @@ + /* + * ioctl32 compat + */ +diff --git a/acore/hwdep.patch b/acore/hwdep.patch +index 5d47609..26ab2c6 100644 +--- a/acore/hwdep.patch ++++ b/acore/hwdep.patch +@@ -1,5 +1,5 @@ +---- ../alsa-kernel/core/hwdep.c 2007-12-20 10:18:45.000000000 +0100 +-+++ hwdep.c 2007-12-20 10:39:00.000000000 +0100 ++--- ../alsa-kernel/core/hwdep.c 2008-08-08 15:08:59.000000000 +0200 +++++ hwdep.c 2008-08-08 15:10:26.000000000 +0200 + @@ -1,3 +1,4 @@ + +#include "adriver.h" + /* +diff --git a/acore/info.patch b/acore/info.patch +index 9bbb2b9..fa96a5e 100644 +--- a/acore/info.patch ++++ b/acore/info.patch +@@ -1,11 +1,11 @@ +---- ../alsa-kernel/core/info.c 2006-12-14 15:43:51.000000000 +0100 +-+++ info.c 2006-12-15 14:10:09.000000000 +0100 ++--- ../alsa-kernel/core/info.c 2008-08-08 15:10:19.000000000 +0200 +++++ info.c 2008-08-08 15:10:26.000000000 +0200 + @@ -1,3 +1,4 @@ + +#include "info.inc" + /* + * Information interface for ALSA driver + * Copyright (c) by Jaroslav Kysela +-@@ -154,6 +157,7 @@ ++@@ -154,6 +155,7 @@ + struct snd_info_entry *snd_oss_root; + #endif + +@@ -13,7 +13,7 @@ + static inline void snd_info_entry_prepare(struct proc_dir_entry *de) + { + de->owner = THIS_MODULE; +-@@ -165,6 +169,7 @@ ++@@ -165,6 +167,7 @@ + if (de) + remove_proc_entry(de->name, parent); + } +@@ -21,7 +21,7 @@ + + static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig) + { +-@@ -174,7 +179,9 @@ ++@@ -174,7 +177,9 @@ + + data = file->private_data; + entry = data->entry; +@@ -31,7 +31,7 @@ + switch (entry->content) { + case SNDRV_INFO_CONTENT_TEXT: + switch (orig) { +-@@ -203,7 +210,9 @@ ++@@ -203,7 +208,9 @@ + } + ret = -ENXIO; + out: +@@ -41,7 +41,7 @@ + return ret; + } + +-@@ -486,9 +495,26 @@ ++@@ -488,9 +495,26 @@ + return -ENOTTY; + } + +@@ -68,9 +68,9 @@ + struct snd_info_private_data *data; + struct snd_info_entry *entry; + +-@@ -509,17 +535,30 @@ ++@@ -511,17 +535,30 @@ + +- static struct file_operations snd_info_entry_operations = ++ static const struct file_operations snd_info_entry_operations = + { + +#ifndef LINUX_2_2 + .owner = THIS_MODULE, +@@ -99,7 +99,7 @@ + /** + * snd_create_proc_entry - create a procfs entry + * @name: the name of the proc file +-@@ -955,9 +994,16 @@ ++@@ -962,9 +999,16 @@ + mutex_unlock(&info_mutex); + return -ENOMEM; + } +@@ -117,7 +117,7 @@ + p->size = entry->size; + p->data = entry; + entry->p = p; +-@@ -977,9 +1023,19 @@ ++@@ -984,9 +1028,19 @@ + + static void snd_info_version_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) + { +diff --git a/acore/init.patch b/acore/init.patch +index e3fe39f..156653f 100644 +--- a/acore/init.patch ++++ b/acore/init.patch @@ -1,12 +1,12 @@ ---- ../alsa-kernel/core/init.c 2007-12-20 10:18:36.000000000 +0100 -+++ init.c 2007-12-20 10:40:06.000000000 +0100 -+--- ../alsa-kernel/core/init.c 2008-07-28 14:49:05.000000000 +0200 -++++ init.c 2008-07-30 11:49:01.000000000 +0200 ++--- ../alsa-kernel/core/init.c 2008-08-08 15:23:46.000000000 +0200 +++++ init.c 2008-08-08 15:25:21.000000000 +0200 @@ -1,3 +1,5 @@ +#define __NO_VERSION__ +#include "adriver.h" @@ -30,8 +167,8 @@ diff -urN alsa-driver-1.0.17/acore/init.patch alsa-driver-patched/acore/init.pat .mmap = snd_disconnect_mmap, .fasync = snd_disconnect_fasync }; -+@@ -548,9 +564,19 @@ -+ snd_assert(card != NULL, return -EINVAL); ++@@ -549,9 +565,19 @@ ++ return -EINVAL; + #ifndef CONFIG_SYSFS_DEPRECATED + if (!card->card_dev) { ++#ifdef CONFIG_SND_HAS_DEVICE_CREATE_DRVDATA @@ -50,9 +187,419 @@ diff -urN alsa-driver-1.0.17/acore/init.patch alsa-driver-patched/acore/init.pat + if (IS_ERR(card->card_dev)) + card->card_dev = NULL; + } -diff -urN alsa-driver-1.0.17/acore/rtctimer.c alsa-driver-patched/acore/rtctimer.c ---- alsa-driver-1.0.17/acore/rtctimer.c 2008-07-14 03:53:57.000000000 -0400 -+++ alsa-driver-patched/acore/rtctimer.c 2008-08-02 13:04:14.882495553 -0400 +diff --git a/acore/ioctl32/pcm32_old.c b/acore/ioctl32/pcm32_old.c +index 484fb25..2b589b9 100644 +--- a/acore/ioctl32/pcm32_old.c ++++ b/acore/ioctl32/pcm32_old.c +@@ -295,7 +295,8 @@ static inline int _snd_ioctl32_xfern(unsigned int fd, unsigned int cmd, unsigned + + pcm_file = file->private_data; + substream = pcm_file->substream; +- snd_assert(substream != NULL && substream->runtime, return -ENXIO); ++ if (PCM_RUNTIME_CHECK(substream)) ++ return -ENXIO; + + /* check validty of the command */ + switch (native_ctl) { +diff --git a/acore/memalloc.inc b/acore/memalloc.inc +index 120abf2..a8dbcd2 100644 +--- a/acore/memalloc.inc ++++ b/acore/memalloc.inc +@@ -35,4 +35,17 @@ static inline struct proc_dir_entry *create_proc_read_entry(const char *name, + } + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) ++#undef WARN_ON ++#define WARN_ON(condition) ({ \ ++ int __ret_warn_on = !!(condition); \ ++ if (unlikely(__ret_warn_on)) { \ ++ printk("BUG: warning at %s:%d/%s()\n", __FILE__, \ ++ __LINE__, __FUNCTION__); \ ++ dump_stack(); \ ++ } \ ++ unlikely(__ret_warn_on); \ ++}) ++#endif ++ + // vim: ft=c +diff --git a/acore/memalloc.patch b/acore/memalloc.patch +index 84c3b6c..b23e354 100644 +--- a/acore/memalloc.patch ++++ b/acore/memalloc.patch +@@ -1,12 +1,12 @@ +---- ../alsa-kernel/core/memalloc.c 2008-05-09 15:41:42.000000000 +0200 +-+++ memalloc.c 2008-05-09 15:40:05.000000000 +0200 ++--- ../alsa-kernel/core/memalloc.c 2008-08-06 18:32:43.000000000 +0200 +++++ memalloc.c 2008-08-07 17:27:28.000000000 +0200 + @@ -1,3 +1,4 @@ + +#include "memalloc.inc" + /* + * Copyright (c) by Jaroslav Kysela + * Takashi Iwai +-@@ -80,6 +81,138 @@ +- #endif ++@@ -68,6 +69,138 @@ ++ #define SNDRV_DMA_DEVICE_UNUSED (unsigned int)-1 + + /* + + * Hacks +@@ -144,7 +144,7 @@ + * + * Generic memory allocators + * +-@@ -97,6 +230,24 @@ ++@@ -85,6 +218,24 @@ + snd_allocated_pages -= 1 << order; + } + +@@ -169,8 +169,8 @@ + /** + * snd_malloc_pages - allocate pages with the given size + * @size: the size to allocate in bytes +-@@ -115,8 +266,10 @@ +- snd_assert(gfp_flags != 0, return NULL); ++@@ -105,8 +256,10 @@ ++ return NULL; + gfp_flags |= __GFP_COMP; /* compound page lets parts be mapped */ + pg = get_order(size); + - if ((res = (void *) __get_free_pages(gfp_flags, pg)) != NULL) +@@ -181,7 +181,7 @@ + return res; + } + +-@@ -135,6 +288,7 @@ ++@@ -125,6 +278,7 @@ + return; + pg = get_order(size); + dec_snd_pages(pg); +@@ -189,7 +189,7 @@ + free_pages((unsigned long) ptr, pg); + } + +-@@ -160,8 +314,10 @@ ++@@ -150,8 +304,10 @@ + | __GFP_NORETRY /* don't trigger OOM-killer */ + | __GFP_NOWARN; /* no stack trace print - this call is non-critical */ + res = dma_alloc_coherent(dev, PAGE_SIZE << pg, dma, gfp_flags); +@@ -201,7 +201,7 @@ + + return res; + } +-@@ -176,6 +332,7 @@ ++@@ -166,6 +322,7 @@ + return; + pg = get_order(size); + dec_snd_pages(pg); +@@ -209,7 +209,7 @@ + dma_free_coherent(dev, PAGE_SIZE << pg, ptr, dma); + } + #endif /* CONFIG_HAS_DMA */ +-@@ -420,6 +577,7 @@ ++@@ -411,6 +568,7 @@ + + + #ifdef CONFIG_PROC_FS +@@ -217,7 +217,7 @@ + /* + * proc file interface + */ +-@@ -558,6 +716,7 @@ ++@@ -549,6 +707,7 @@ + .release = single_release, + }; + +@@ -225,7 +225,7 @@ + #endif /* CONFIG_PROC_FS */ + + /* +-@@ -567,15 +726,23 @@ ++@@ -558,15 +717,23 @@ + static int __init snd_mem_init(void) + { + #ifdef CONFIG_PROC_FS +@@ -249,7 +249,7 @@ + free_all_reserved_pages(); + if (snd_allocated_pages > 0) + printk(KERN_ERR "snd-malloc: Memory leak? pages not freed = %li\n", snd_allocated_pages); +-@@ -598,3 +765,5 @@ ++@@ -589,3 +756,5 @@ + + EXPORT_SYMBOL(snd_malloc_pages); + EXPORT_SYMBOL(snd_free_pages); +diff --git a/acore/pcm_native.patch b/acore/pcm_native.patch +index 46df31b..3e0e361 100644 +--- a/acore/pcm_native.patch ++++ b/acore/pcm_native.patch +@@ -1,20 +1,23 @@ +---- ../alsa-kernel/core/pcm_native.c 2007-12-20 10:18:53.000000000 +0100 +-+++ pcm_native.c 2007-12-20 10:47:58.000000000 +0100 ++--- ../alsa-kernel/core/pcm_native.c 2008-08-08 15:23:46.000000000 +0200 +++++ pcm_native.c 2008-08-08 17:23:14.000000000 +0200 + @@ -1,3 +1,5 @@ + +#define __NO_VERSION__ + +#include "adriver.h" + /* + * Digital Audio (PCM) abstract layer + * Copyright (c) by Jaroslav Kysela +-@@ -20,6 +22,7 @@ ++@@ -20,9 +22,9 @@ + */ + + #include + +#include + #include + #include ++-#include + #include +-@@ -361,7 +364,10 @@ ++ #include ++ #include ++@@ -361,7 +363,10 @@ + return usecs; + } + +@@ -26,7 +29,7 @@ + struct snd_pcm_hw_params *params) + { + struct snd_pcm_runtime *runtime; +-@@ -1596,7 +1602,11 @@ ++@@ -1574,7 +1579,11 @@ + file = fget(fd); + if (!file) + return NULL; +@@ -38,7 +41,7 @@ + if (!S_ISCHR(inode->i_mode) || + imajor(inode) != snd_major) { + fput(file); +-@@ -2849,6 +2859,9 @@ ++@@ -2819,25 +2828,50 @@ + struct snd_pcm_runtime *runtime; + snd_pcm_sframes_t result; + +@@ -47,11 +50,30 @@ + +#endif + pcm_file = file->private_data; + substream = pcm_file->substream; +- snd_assert(substream != NULL, result = -ENXIO; goto end); +-@@ -2866,12 +2879,27 @@ ++- if (PCM_RUNTIME_CHECK(substream)) ++- return -ENXIO; +++ if (PCM_RUNTIME_CHECK(substream)) { +++ result = -ENXIO; +++ goto end; +++ } ++ runtime = substream->runtime; ++- if (runtime->status->state == SNDRV_PCM_STATE_OPEN) ++- return -EBADFD; ++- if (!frame_aligned(runtime, count)) ++- return -EINVAL; +++ if (runtime->status->state == SNDRV_PCM_STATE_OPEN) { +++ result = -EBADFD; +++ goto end; +++ } +++ if (!frame_aligned(runtime, count)) { +++ result = -EINVAL; +++ goto end; +++ } ++ count = bytes_to_frames(runtime, count); ++ result = snd_pcm_lib_write(substream, buf, count); + if (result > 0) + result = frames_to_bytes(runtime, result); +- end: +++ end: + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0) + + down(&file->f_dentry->d_inode->i_sem); + +#endif +@@ -77,7 +99,7 @@ + { + struct snd_pcm_file *pcm_file; + struct snd_pcm_substream *substream; +-@@ -2881,7 +2909,11 @@ ++@@ -2847,7 +2881,11 @@ + void __user **bufs; + snd_pcm_uframes_t frames; + +@@ -87,9 +109,9 @@ + + pcm_file = file->private_data; + +#endif + substream = pcm_file->substream; +- snd_assert(substream != NULL, return -ENXIO); +- runtime = substream->runtime; +-@@ -2904,8 +2936,13 @@ ++ if (PCM_RUNTIME_CHECK(substream)) ++ return -ENXIO; ++@@ -2871,8 +2909,13 @@ + return result; + } + +@@ -103,7 +125,7 @@ + { + struct snd_pcm_file *pcm_file; + struct snd_pcm_substream *substream; +-@@ -2915,7 +2952,11 @@ ++@@ -2882,7 +2925,11 @@ + void __user **bufs; + snd_pcm_uframes_t frames; + +@@ -113,17 +135,17 @@ + + pcm_file = file->private_data; + +#endif + substream = pcm_file->substream; +- snd_assert(substream != NULL, result = -ENXIO; goto end); +- runtime = substream->runtime; +-@@ -2941,6 +2982,7 @@ +- end: ++ if (PCM_RUNTIME_CHECK(substream)) ++ return -ENXIO; ++@@ -2904,6 +2951,7 @@ ++ kfree(bufs); + return result; + } + +#endif /* >= 2.3.44 */ + + static unsigned int snd_pcm_playback_poll(struct file *file, poll_table * wait) + { +-@@ -3026,6 +3068,17 @@ ++@@ -2991,6 +3039,17 @@ + * mmap support + */ + +@@ -141,7 +163,7 @@ + /* + * Only on coherent architectures, we can mmap the status and the control records + * for effcient data transfer. On others, we have to use HWSYNC ioctl... +-@@ -3034,6 +3087,7 @@ ++@@ -2999,6 +3058,7 @@ + /* + * mmap status record + */ +@@ -149,7 +171,7 @@ + static int snd_pcm_mmap_status_fault(struct vm_area_struct *area, + struct vm_fault *vmf) + { +-@@ -3047,10 +3101,49 @@ ++@@ -3012,10 +3072,49 @@ + get_page(vmf->page); + return 0; + } +@@ -199,7 +221,7 @@ + }; + + static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file, +-@@ -3066,14 +3159,21 @@ ++@@ -3030,14 +3129,21 @@ + if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status))) + return -EINVAL; + area->vm_ops = &snd_pcm_vm_ops_status; +@@ -221,7 +243,7 @@ + static int snd_pcm_mmap_control_fault(struct vm_area_struct *area, + struct vm_fault *vmf) + { +-@@ -3087,10 +3187,49 @@ ++@@ -3051,10 +3157,49 @@ + get_page(vmf->page); + return 0; + } +@@ -271,7 +293,7 @@ + }; + + static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file, +-@@ -3106,8 +3245,14 @@ ++@@ -3069,8 +3214,14 @@ + if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control))) + return -EINVAL; + area->vm_ops = &snd_pcm_vm_ops_control; +@@ -286,7 +308,7 @@ + return 0; + } + #else /* ! coherent mmap */ +-@@ -3129,6 +3274,7 @@ ++@@ -3092,6 +3243,7 @@ + /* + * fault callback for mmapping a RAM page + */ +@@ -294,7 +316,7 @@ + static int snd_pcm_mmap_data_fault(struct vm_area_struct *area, + struct vm_fault *vmf) + { +-@@ -3158,12 +3304,74 @@ ++@@ -3121,12 +3273,75 @@ + vmf->page = page; + return 0; + } +@@ -326,7 +348,8 @@ + + offset = area->vm_offset; + +#endif + + offset += address - area->vm_start; +-+ snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_SIGBUS); +++ if (snd_BUG_ON(offset % PAGE_SIZE)) +++ return NOPAGE_SIGBUS; + + dma_bytes = PAGE_ALIGN(runtime->dma_bytes); + + if (offset > dma_bytes - PAGE_SIZE) + + return NOPAGE_SIGBUS; +@@ -369,7 +392,7 @@ + }; + + /* +-@@ -3173,8 +3381,14 @@ ++@@ -3136,8 +3351,14 @@ + struct vm_area_struct *area) + { + area->vm_ops = &snd_pcm_vm_ops_data; +@@ -384,7 +407,7 @@ + atomic_inc(&substream->mmap_count); + return 0; + } +-@@ -3199,14 +3413,37 @@ ++@@ -3162,14 +3383,37 @@ + area->vm_page_prot = pgprot_noncached(area->vm_page_prot); + #endif + area->vm_ops = &snd_pcm_vm_ops_data_mmio; +@@ -423,7 +446,7 @@ + atomic_inc(&substream->mmap_count); + return 0; + } +-@@ -3242,7 +3479,11 @@ ++@@ -3204,7 +3448,11 @@ + runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED) + return -EINVAL; + size = area->vm_end - area->vm_start; +@@ -435,9 +458,9 @@ + dma_bytes = PAGE_ALIGN(runtime->dma_bytes); + if ((size_t)size > dma_bytes) + return -EINVAL; +-@@ -3267,7 +3508,11 @@ +- substream = pcm_file->substream; +- snd_assert(substream != NULL, return -ENXIO); ++@@ -3230,7 +3478,11 @@ ++ if (PCM_RUNTIME_CHECK(substream)) ++ return -ENXIO; + + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 25) + offset = area->vm_pgoff << PAGE_SHIFT; +@@ -447,7 +470,7 @@ + switch (offset) { + case SNDRV_PCM_MMAP_OFFSET_STATUS: + if (pcm_file->no_compat_mmap) +-@@ -3304,12 +3549,34 @@ ++@@ -3270,12 +3522,34 @@ + /* + * ioctl32 compat + */ +@@ -483,7 +506,7 @@ + /* + * To be removed helpers to keep binary compatibility + */ +-@@ -3432,26 +3699,46 @@ ++@@ -3398,26 +3672,46 @@ + + const struct file_operations snd_pcm_f_ops[2] = { + { +diff --git a/acore/rtctimer.c b/acore/rtctimer.c +index 85c222b..a96c3bd 100644 +--- a/acore/rtctimer.c ++++ b/acore/rtctimer.c @@ -1,9 +1,3 @@ #include "adriver.h" -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21) @@ -63,21 +610,22 @@ diff -urN alsa-driver-1.0.17/acore/rtctimer.c alsa-driver-patched/acore/rtctimer -#endif #include "../alsa-kernel/core/rtctimer.c" EXPORT_NO_SYMBOLS; -diff -urN alsa-driver-1.0.17/acore/sound.patch alsa-driver-patched/acore/sound.patch ---- alsa-driver-1.0.17/acore/sound.patch 2008-07-14 03:53:57.000000000 -0400 -+++ alsa-driver-patched/acore/sound.patch 2008-08-02 13:04:14.882495553 -0400 +diff --git a/acore/sound.patch b/acore/sound.patch +index 5011850..9c70327 100644 +--- a/acore/sound.patch ++++ b/acore/sound.patch @@ -1,11 +1,11 @@ ---- ../alsa-kernel/core/sound.c 2008-05-23 16:26:33.000000000 +0200 -+++ sound.c 2008-05-23 16:39:46.000000000 +0200 -+--- ../alsa-kernel/core/sound.c 2008-07-15 15:23:39.000000000 +0200 -++++ sound.c 2008-07-30 11:44:42.000000000 +0200 ++--- ../alsa-kernel/core/sound.c 2008-08-08 15:23:46.000000000 +0200 +++++ sound.c 2008-08-08 15:25:59.000000000 +0200 @@ -1,3 +1,4 @@ +#include "adriver.h" /* * Advanced Linux Sound Architecture * Copyright (c) by Jaroslav Kysela -@@ -40,6 +41,9 @@ -+@@ -41,6 +42,9 @@ ++@@ -39,6 +40,9 @@ EXPORT_SYMBOL(snd_major); static int cards_limit = 1; @@ -86,7 +634,7 @@ diff -urN alsa-driver-1.0.17/acore/sound.patch alsa-driver-patched/acore/sound.p MODULE_AUTHOR("Jaroslav Kysela "); MODULE_DESCRIPTION("Advanced Linux Sound Architecture driver for soundcards."); -@@ -48,6 +52,10 @@ -+@@ -49,6 +53,10 @@ ++@@ -47,6 +51,10 @@ MODULE_PARM_DESC(major, "Major # for sound driver."); module_param(cards_limit, int, 0444); MODULE_PARM_DESC(cards_limit, "Count of auto-loadable soundcards."); @@ -95,25 +643,30 @@ diff -urN alsa-driver-1.0.17/acore/sound.patch alsa-driver-patched/acore/sound.p /* this one holds the actual max. card number currently available. -@@ -165,7 +173,9 @@ -+@@ -178,7 +186,9 @@ ++@@ -176,7 +184,9 @@ static const struct file_operations snd_fops = { -@@ -36,7 +36,7 @@ +@@ -36,10 +36,10 @@ .open = snd_open }; -@@ -237,7 +247,11 @@ -+@@ -250,7 +260,11 @@ - struct snd_minor *preg; +- struct snd_minor *preg; ++@@ -252,7 +262,11 @@ - snd_assert(name, return -EINVAL); +- snd_assert(name, return -EINVAL); ++ if (snd_BUG_ON(!name)) ++ return -EINVAL; + +#ifdef CONFIG_DEVFS_FS + + preg = kmalloc(sizeof(*preg) + strlen(name) + 1, GFP_KERNEL); + +#else @@ -48,7 +48,7 @@ if (preg == NULL) return -ENOMEM; preg->type = type; -@@ -245,6 +259,9 @@ -+@@ -258,6 +272,9 @@ ++@@ -260,6 +274,9 @@ preg->device = dev; preg->f_ops = f_ops; preg->private_data = private_data; @@ -122,7 +675,7 @@ diff -urN alsa-driver-1.0.17/acore/sound.patch alsa-driver-patched/acore/sound.p #ifdef CONFIG_SND_DYNAMIC_MINORS minor = snd_find_free_minor(); -@@ -259,9 +276,21 @@ -+@@ -272,9 +289,23 @@ ++@@ -274,9 +291,23 @@ return minor; } snd_minors[minor] = preg; @@ -148,7 +701,7 @@ diff -urN alsa-driver-1.0.17/acore/sound.patch alsa-driver-patched/acore/sound.p snd_minors[minor] = NULL; mutex_unlock(&sound_mutex); -@@ -269,6 +298,22 @@ -+@@ -282,6 +313,22 @@ ++@@ -284,6 +315,22 @@ kfree(preg); return minor; } @@ -162,7 +715,7 @@ diff -urN alsa-driver-1.0.17/acore/sound.patch alsa-driver-patched/acore/sound.p mutex_unlock(&sound_mutex); return 0; -@@ -308,6 +353,9 @@ -+@@ -321,6 +368,9 @@ ++@@ -323,6 +370,9 @@ int snd_unregister_device(int type, struct snd_card *card, int dev) { int minor; @@ -171,7 +724,7 @@ diff -urN alsa-driver-1.0.17/acore/sound.patch alsa-driver-patched/acore/sound.p mutex_lock(&sound_mutex); minor = find_snd_minor(type, card, dev); -@@ -316,7 +364,20 @@ -+@@ -329,7 +379,20 @@ ++@@ -331,7 +381,20 @@ return -EINVAL; } @@ -180,7 +733,7 @@ diff -urN alsa-driver-1.0.17/acore/sound.patch alsa-driver-patched/acore/sound.p kfree(snd_minors[minor]); snd_minors[minor] = NULL; -@@ -329,16 +390,28 @@ -+@@ -342,16 +405,28 @@ ++@@ -344,16 +407,28 @@ int snd_add_device_sysfs_file(int type, struct snd_card *card, int dev, struct device_attribute *attr) { @@ -189,14 +742,110 @@ diff -urN alsa-driver-1.0.17/acore/sound.patch alsa-driver-patched/acore/sound.p EXPORT_SYMBOL(snd_add_device_sysfs_file); -@@ -424,31 +497,80 @@ -+@@ -437,31 +512,80 @@ ++@@ -439,31 +514,80 @@ * INIT PART */ -diff -urN alsa-driver-1.0.17/include/adriver.h alsa-driver-patched/include/adriver.h ---- alsa-driver-1.0.17/include/adriver.h 2008-07-14 03:53:57.000000000 -0400 -+++ alsa-driver-patched/include/adriver.h 2008-08-02 13:04:14.882495553 -0400 -@@ -1552,4 +1552,41 @@ +diff --git a/arm/s3c24xx-iis.c b/arm/s3c24xx-iis.c +index ac59a56..7dbe7c0 100644 +--- a/arm/s3c24xx-iis.c ++++ b/arm/s3c24xx-iis.c +@@ -472,7 +472,7 @@ static int s3c24xx_snd_close(struct snd_pcm_substream *substream) + + down(&chip->sem); + +- snd_assert(or->state != 0, chip = chip); ++ snd_BUG_ON(!or->state); + + /* mark stream as closed */ + or->state &= ~ST_OPENED; +diff --git a/drivers/aloop-kernel.c b/drivers/aloop-kernel.c +index 508c2c8..47ce7e2 100644 +--- a/drivers/aloop-kernel.c ++++ b/drivers/aloop-kernel.c +@@ -405,7 +405,8 @@ static int __init snd_card_loopback_new_mixer(snd_card_loopback_t *loopback) + { + struct snd_card *card = loopback->card; + +- snd_assert(loopback != NULL, return -EINVAL); ++ if (snd_BUG_ON(!loopback)) ++ return -EINVAL; + strcpy(card->mixername, "Loopback Mixer"); + return 0; + } +diff --git a/i2c/other/tea575x-tuner.patch b/i2c/other/tea575x-tuner.patch +index a24ee2d..54596fe 100644 +--- a/i2c/other/tea575x-tuner.patch ++++ b/i2c/other/tea575x-tuner.patch +@@ -1,5 +1,5 @@ +---- ../../alsa-kernel/i2c/other/tea575x-tuner.c 2007-12-20 10:21:09.000000000 +0100 +-+++ tea575x-tuner.c 2007-12-20 11:15:05.000000000 +0100 ++--- ../../alsa-kernel/i2c/other/tea575x-tuner.c 2008-08-04 18:17:47.000000000 +0200 +++++ tea575x-tuner.c 2008-08-04 18:22:43.000000000 +0200 + @@ -1,3 +1,4 @@ + +#include "adriver.h" + /* +@@ -58,7 +58,7 @@ + + switch(cmd) { + case VIDIOCGCAP: +-@@ -167,9 +201,11 @@ ++@@ -171,9 +205,11 @@ + } + } + +@@ -70,16 +70,23 @@ + + /* + * initialize all the tea575x chips +-@@ -188,13 +224,24 @@ +- tea->vd.owner = tea->card->module; ++@@ -189,14 +225,31 @@ ++ } ++ ++ memset(&tea->vd, 0, sizeof(tea->vd)); +++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +++ tea->vd.owner = tea->card->module; +++#endif + strcpy(tea->vd.name, tea->tea5759 ? "TEA5759 radio" : "TEA5757 radio"); +- tea->vd.type = VID_TYPE_TUNER; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) + + tea->vd.hardware = VID_HARDWARE_RTRACK; /* FIXME: assign new number */ + +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8) + tea->vd.release = snd_tea575x_release; + +#endif +++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +++ tea->vd.type = VID_TYPE_TUNER; +++#endif + video_set_drvdata(&tea->vd, tea); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) + + tea->vd.open = snd_tea575x_open; +diff --git a/i2c/uda1380.c b/i2c/uda1380.c +index 4ba95f9..9adb924 100644 +--- a/i2c/uda1380.c ++++ b/i2c/uda1380.c +@@ -107,9 +107,12 @@ static int snd_uda1380_hwsync(struct snd_uda1380 *uda, int read, + u8 buf[11]; + int ret; + +- snd_assert(count * 2 <= sizeof(buf) - 1, return -EINVAL); +- snd_assert(start_reg < ARRAY_SIZE(uda->regs), return -EINVAL); +- snd_assert(start_reg + count <= ARRAY_SIZE(uda->regs), return -EINVAL); ++ if (snd_BUG_ON(count * 2 >= sizeof(buf))) ++ return -EINVAL; ++ if (snd_BUG_ON(start_reg >= ARRAY_SIZE(uda->regs))) ++ return -EINVAL; ++ if (snd_BUG_ON(start_reg + count > ARRAY_SIZE(uda->regs))) ++ return -EINVAL; + + /* setup i2c msgs */ + msgs[0].addr = uda->i2c_client.addr; +diff --git a/include/adriver.h b/include/adriver.h +index 2984cb0..c1c64b8 100644 +--- a/include/adriver.h ++++ b/include/adriver.h +@@ -1552,4 +1552,97 @@ static inline void put_unaligned_be64(u64 val, void *p) #define page_to_pfn(page) (page_to_phys(page) >> PAGE_SHIFT) #endif @@ -237,10 +886,110 @@ diff -urN alsa-driver-1.0.17/include/adriver.h alsa-driver-patched/include/adriv + printk(KERN_NOTICE fmt, ##arg) +#endif + ++#ifndef WARN ++#define WARN(condition, arg...) ({ \ ++ int __ret_warn_on = !!(condition); \ ++ if (unlikely(__ret_warn_on)) { \ ++ printk("WARNING: at %s:%d %s()\n", \ ++ __FILE__, __LINE__, __func__); \ ++ printk(arg); \ ++ dump_stack(); \ ++ } \ ++ unlikely(__ret_warn_on); \ ++}) ++#endif ++ ++/* force to redefine WARN_ON() */ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) ++#undef WARN_ON ++#endif ++ ++#ifndef WARN_ON ++#define WARN_ON(condition) ({ \ ++ int __ret_warn_on = !!(condition); \ ++ if (unlikely(__ret_warn_on)) { \ ++ printk("WARNING: at %s:%d %s()\n", \ ++ __FILE__, __LINE__, __func__); \ ++ dump_stack(); \ ++ } \ ++ unlikely(__ret_warn_on); \ ++}) ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) ++#define dev_printk(level, dev, format, arg...) \ ++ printk(level format, ##arg) ++#define dev_emerg(dev, format, arg...) \ ++ dev_printk(KERN_EMERG , dev , format , ## arg) ++#define dev_alert(dev, format, arg...) \ ++ dev_printk(KERN_ALERT , dev , format , ## arg) ++#define dev_crit(dev, format, arg...) \ ++ dev_printk(KERN_CRIT , dev , format , ## arg) ++#define dev_err(dev, format, arg...) \ ++ dev_printk(KERN_ERR , dev , format , ## arg) ++#define dev_warn(dev, format, arg...) \ ++ dev_printk(KERN_WARNING , dev , format , ## arg) ++#define dev_notice(dev, format, arg...) \ ++ dev_printk(KERN_NOTICE , dev , format , ## arg) ++#define dev_info(dev, format, arg...) \ ++ dev_printk(KERN_INFO , dev , format , ## arg) ++#ifdef DEBUG ++#define dev_dbg(dev, format, arg...) \ ++ dev_printk(KERN_DEBUG , dev , format , ## arg) ++#else ++#define dev_dbg(dev, format, arg...) \ ++ ({ if (0) dev_printk(KERN_DEBUG, dev, format, ##arg); 0; }) ++#endif ++#endif /* < 2.6.0 */ ++ #endif /* __SOUND_LOCAL_DRIVER_H */ -diff -urN alsa-driver-1.0.17/isa/sb/sb16_csp.patch alsa-driver-patched/isa/sb/sb16_csp.patch ---- alsa-driver-1.0.17/isa/sb/sb16_csp.patch 2008-07-14 03:53:57.000000000 -0400 -+++ alsa-driver-patched/isa/sb/sb16_csp.patch 2008-08-02 13:04:14.882495553 -0400 +diff --git a/isa/cs423x/Makefile b/isa/cs423x/Makefile +index 36dc57a..ad9f3b3 100644 +--- a/isa/cs423x/Makefile ++++ b/isa/cs423x/Makefile +@@ -5,13 +5,13 @@ endif + include $(SND_TOPDIR)/toplevel.config + include $(SND_TOPDIR)/Makefile.conf + +-export-objs := cs4231_lib.o cs4236_lib.o ++export-objs := cs4236_lib.o + + isapnp-files := cs4232.isapnp cs4236.isapnp + + include $(SND_TOPDIR)/alsa-kernel/isa/cs423x/Makefile + +-snd-pc98-cs4232-objs := pc98.o +-obj-$(CONFIG_SND_PC98_CS4232) += snd-pc98-cs4232.o snd-cs4231-lib.o ++# snd-pc98-cs4232-objs := pc98.o ++# obj-$(CONFIG_SND_PC98_CS4232) += snd-pc98-cs4232.o snd-cs4231-lib.o + + include $(SND_TOPDIR)/Rules.make +diff --git a/isa/cs423x/cs4231_lib.c b/isa/cs423x/cs4231_lib.c +deleted file mode 100644 +index e4e4416..0000000 +--- a/isa/cs423x/cs4231_lib.c ++++ /dev/null +@@ -1,2 +0,0 @@ +-#include "adriver.h" +-#include "../../alsa-kernel/isa/cs423x/cs4231_lib.c" +diff --git a/isa/msnd/msnd_pinnacle_mixer.c b/isa/msnd/msnd_pinnacle_mixer.c +index 5924963..1d43d45 100644 +--- a/isa/msnd/msnd_pinnacle_mixer.c ++++ b/isa/msnd/msnd_pinnacle_mixer.c +@@ -300,7 +300,8 @@ int __init snd_msndmix_new( multisound_dev_t * msnd) + unsigned int idx; + int err; + +- snd_assert(msnd != NULL, return -EINVAL); ++ if (snd_BUG_ON(!msnd)) ++ return -EINVAL; + // spin_lock_init(&msnd->mixer_lock); + strcpy(card->mixername, "MSND Pinnacle Mixer"); + +diff --git a/isa/sb/sb16_csp.patch b/isa/sb/sb16_csp.patch +index a000b8c..8a14a20 100644 +--- a/isa/sb/sb16_csp.patch ++++ b/isa/sb/sb16_csp.patch @@ -1,21 +1,20 @@ ---- ../../alsa-kernel/isa/sb/sb16_csp.c 2007-12-20 10:23:34.000000000 +0100 -+++ sb16_csp.c 2007-12-20 11:20:57.000000000 +0100 @@ -271,20 +1020,62 @@ diff -urN alsa-driver-1.0.17/isa/sb/sb16_csp.patch alsa-driver-patched/isa/sb/sb return err; - #endif + p->csp_programs[index] = program; -diff -urN alsa-driver-1.0.17/kconfig-vers alsa-driver-patched/kconfig-vers ---- alsa-driver-1.0.17/kconfig-vers 2008-07-14 03:53:57.000000000 -0400 -+++ alsa-driver-patched/kconfig-vers 2008-08-02 13:04:14.882495553 -0400 -@@ -12,4 +12,6 @@ +diff --git a/isa/wss/Makefile b/isa/wss/Makefile +new file mode 100644 +index 0000000..85a4209 +--- /dev/null ++++ b/isa/wss/Makefile +@@ -0,0 +1,12 @@ ++ifndef SND_TOPDIR ++SND_TOPDIR=../.. ++endif ++ ++include $(SND_TOPDIR)/toplevel.config ++include $(SND_TOPDIR)/Makefile.conf ++ ++export-objs := wss_lib.o ++ ++include $(SND_TOPDIR)/alsa-kernel/isa/wss/Makefile ++ ++include $(SND_TOPDIR)/Rules.make +diff --git a/isa/wss/wss_lib.c b/isa/wss/wss_lib.c +new file mode 100644 +index 0000000..d05b5a2 +--- /dev/null ++++ b/isa/wss/wss_lib.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/isa/wss/wss_lib.c" +diff --git a/kconfig-vers b/kconfig-vers +index bf75dfd..c0b1aa5 100644 +--- a/kconfig-vers ++++ b/kconfig-vers +@@ -12,4 +12,6 @@ SND_CS5535AUDIO 2.6.10 SND_HDA_INTEL 2.6 SND_PCSP 2.6.24 SND_SIS7019 2.6 +SND_USB_US122L 2.6.26 SND_DYNAMIC_MINORS 2.6 +SND_HDA_INPUT_BEEP 2.6 -diff -urN alsa-driver-1.0.17/pci/hda/Makefile alsa-driver-patched/pci/hda/Makefile ---- alsa-driver-1.0.17/pci/hda/Makefile 2008-07-14 03:53:57.000000000 -0400 -+++ alsa-driver-patched/pci/hda/Makefile 2008-08-02 13:04:14.882495553 -0400 -@@ -5,7 +5,7 @@ +diff --git a/pci/asihpi/asihpi.c b/pci/asihpi/asihpi.c +index f9fe449..1795a52 100644 +--- a/pci/asihpi/asihpi.c ++++ b/pci/asihpi/asihpi.c +@@ -2538,7 +2538,8 @@ static int __devinit snd_card_asihpi_mixer_new(struct snd_card_asihpi *asihpi) + int err; + struct hpi_control asihpi_control; + +- snd_assert(asihpi != NULL, return -EINVAL); ++ if (snd_BUG_ON(!asihpi)) ++ return -EINVAL; + strcpy(card->mixername, "Asihpi Mixer"); + + err = +diff --git a/pci/hda/Makefile b/pci/hda/Makefile +index 15c601c..a9b2b29 100644 +--- a/pci/hda/Makefile ++++ b/pci/hda/Makefile +@@ -5,7 +5,7 @@ endif include $(SND_TOPDIR)/toplevel.config include $(SND_TOPDIR)/Makefile.conf @@ -293,21 +1084,16 @@ diff -urN alsa-driver-1.0.17/pci/hda/Makefile alsa-driver-patched/pci/hda/Makefi export-objs := hda_codec.o -@@ -16,3 +16,4 @@ +@@ -16,3 +16,4 @@ include $(SND_TOPDIR)/alsa-kernel/pci/hda/Makefile include $(SND_TOPDIR)/Rules.make hda_codec.c: hda_codec.patch $(SND_TOPDIR)/alsa-kernel/pci/hda/hda_codec.c +hda_beep.c: hda_beep.patch $(SND_TOPDIR)/alsa-kernel/pci/hda/hda_beep.c -diff -urN alsa-driver-1.0.17/pci/hda/hda_beep.c alsa-driver-patched/pci/hda/hda_beep.c ---- alsa-driver-1.0.17/pci/hda/hda_beep.c 1969-12-31 19:00:00.000000000 -0500 -+++ alsa-driver-patched/pci/hda/hda_beep.c 2008-08-02 13:04:14.882495553 -0400 -@@ -0,0 +1,3 @@ -+#define __NO_VERSION__ -+#include "adriver.h" -+#include "../../alsa-kernel/pci/hda/hda_beep.c" -diff -urN alsa-driver-1.0.17/pci/hda/hda_beep.patch alsa-driver-patched/pci/hda/hda_beep.patch ---- alsa-driver-1.0.17/pci/hda/hda_beep.patch 1969-12-31 19:00:00.000000000 -0500 -+++ alsa-driver-patched/pci/hda/hda_beep.patch 2008-08-02 13:04:14.884791088 -0400 +diff --git a/pci/hda/hda_beep.patch b/pci/hda/hda_beep.patch +new file mode 100644 +index 0000000..adb6fdb +--- /dev/null ++++ b/pci/hda/hda_beep.patch @@ -0,0 +1,76 @@ +--- ../../alsa-kernel/pci/hda/hda_beep.c 2008-07-29 12:07:35.000000000 +0200 ++++ hda_beep.c 2008-07-29 15:22:57.000000000 +0200 @@ -385,9 +1171,10 @@ diff -urN alsa-driver-1.0.17/pci/hda/hda_beep.patch alsa-driver-patched/pci/hda/ ++#endif + } + } -diff -urN alsa-driver-1.0.17/pci/korg1212/korg1212.patch alsa-driver-patched/pci/korg1212/korg1212.patch ---- alsa-driver-1.0.17/pci/korg1212/korg1212.patch 2008-07-14 03:53:57.000000000 -0400 -+++ alsa-driver-patched/pci/korg1212/korg1212.patch 2008-08-02 13:04:14.884791088 -0400 +diff --git a/pci/korg1212/korg1212.patch b/pci/korg1212/korg1212.patch +index 4a17319..350a30f 100644 +--- a/pci/korg1212/korg1212.patch ++++ b/pci/korg1212/korg1212.patch @@ -1,14 +1,14 @@ ---- ../../alsa-kernel/pci/korg1212/korg1212.c 2007-12-20 11:47:37.000000000 +0100 -+++ korg1212.c 2007-12-20 12:13:42.000000000 +0100 @@ -418,9 +1205,10 @@ diff -urN alsa-driver-1.0.17/pci/korg1212/korg1212.patch alsa-driver-patched/pci module_init(alsa_card_korg1212_init) module_exit(alsa_card_korg1212_exit) -diff -urN alsa-driver-1.0.17/pci/maestro3.patch alsa-driver-patched/pci/maestro3.patch ---- alsa-driver-1.0.17/pci/maestro3.patch 2008-07-14 03:53:57.000000000 -0400 -+++ alsa-driver-patched/pci/maestro3.patch 2008-08-02 13:04:14.884791088 -0400 +diff --git a/pci/maestro3.patch b/pci/maestro3.patch +index d63ab44..6c65eb9 100644 +--- a/pci/maestro3.patch ++++ b/pci/maestro3.patch @@ -1,14 +1,14 @@ ---- ../alsa-kernel/pci/maestro3.c 2007-12-20 11:47:37.000000000 +0100 -+++ maestro3.c 2007-12-20 12:14:04.000000000 +0100 @@ -451,15 +1239,1159 @@ diff -urN alsa-driver-1.0.17/pci/maestro3.patch alsa-driver-patched/pci/maestro3 module_init(alsa_card_m3_init) module_exit(alsa_card_m3_exit) -diff -urN alsa-driver-1.0.17/usb/usx2y/us122l.c alsa-driver-patched/usb/usx2y/us122l.c ---- alsa-driver-1.0.17/usb/usx2y/us122l.c 1969-12-31 19:00:00.000000000 -0500 -+++ alsa-driver-patched/usb/usx2y/us122l.c 2008-08-02 13:04:14.884791088 -0400 +diff --git a/pci/pdplus/pdplus.c b/pci/pdplus/pdplus.c +index d996de3..fac4a18 100644 +--- a/pci/pdplus/pdplus.c ++++ b/pci/pdplus/pdplus.c +@@ -1561,8 +1561,10 @@ static void pdplus_adda_write_ll (pdplus_t *scard, u_int reg, u_int value) + u_int regval; + PDPLUS_LOCAL_VADDR (scard); + +- snd_assert (reg >= 1 && reg <= 6, return); +- snd_assert (value <= 255, return); ++ if (snd_BUG_ON(reg < 1 || reg > 6)) ++ return; ++ if (snd_BUG_ON(value > 255)) ++ return; + + regval = 0x200000 | (reg << 8) | value; + PDPLUS_WRITE_HW (scard, FPGA, CS4222, regval); +@@ -1590,7 +1592,8 @@ static void pdplus_dco_programme_rate_ll (pdplus_t *scard, int rate) + { + int dco_rate; + PDPLUS_LOCAL_VADDR (scard); +- snd_assert (scard != NULL, return); ++ if (snd_BUG_ON(!scard)) ++ return; + + if (rate < PDPLUS_DCO_MIN_RATE) + rate = PDPLUS_DCO_MIN_RATE; +@@ -1695,7 +1698,8 @@ static void pdplus_clear_iomem_ll (snd_iomem_t *iomem) + { + u_long lauf; + u_long end; +- snd_assert (iomem != NULL, return); ++ if (snd_BUG_ON(!iomem)) ++ return; + + lauf = iomem->vaddr; + end = iomem->vaddr + iomem->size); +@@ -1949,7 +1953,8 @@ void pdplus_copy_from_user_ll ( + * without special cases. */ + switch (int_count % PDPLUS_WRITE_CYCLES) { + default: +- snd_assert (0, return); ++ snd_BUG(); ++ return; + do { + cycle_count--; + +@@ -1993,7 +1998,8 @@ static void pdplus_write_silence_ll ( + * without special cases. */ + switch (int_count % PDPLUS_WRITE_CYCLES) { + default: +- snd_assert (0, return); ++ snd_BUG(); ++ return; + do { + cycle_count--; + +@@ -2028,8 +2034,10 @@ static int pdplus_a_play_copy_ll ( + u_int bpos = PDPLUS_BYTES_FROM_FRAMES (upos, is_adat); + size_t bcount = PDPLUS_BYTES_FROM_FRAMES (ucount, is_adat); + +- snd_assert (bpos < PDPLUS_BUFFER_SIZE, return -EINVAL); +- snd_assert (bpos + bcount - 1 < PDPLUS_BUFFER_SIZE, return -EINVAL); ++ if (snd_BUG_ON(bpos >= PDPLUS_BUFFER_SIZE)) ++ return -EINVAL; ++ if (snd_BUG_ON(bpos + bcount - 1 >= PDPLUS_BUFFER_SIZE)) ++ return -EINVAL; + + /* pdplus doc: After after four writes at lastest, a read must be done. + * So we cannot memcpy_toio. */ +@@ -2054,8 +2062,10 @@ static int pdplus_a_play_silence_ll ( + u_int bpos = PDPLUS_BYTES_FROM_FRAMES (upos, is_adat); + size_t bcount = PDPLUS_BYTES_FROM_FRAMES (ucount, is_adat); + +- snd_assert (bpos < PDPLUS_BUFFER_SIZE, return -EINVAL); +- snd_assert (bpos + bcount - 1 < PDPLUS_BUFFER_SIZE, return -EINVAL); ++ if (snd_BUG_ON(bpos >= PDPLUS_BUFFER_SIZE)) ++ return -EINVAL; ++ if (snd_BUG_ON(bpos + bcount - 1 >= PDPLUS_BUFFER_SIZE)) ++ return -EINVAL; + + /* pdplus doc: After after four writes at lastest, a read must be done. + * So we cannot memcpy_toio. */ +@@ -2080,8 +2090,10 @@ static int pdplus_a_capt_copy_ll ( + u_int bpos = PDPLUS_BYTES_FROM_FRAMES (upos, is_adat); + size_t bcount = PDPLUS_BYTES_FROM_FRAMES (ucount, is_adat); + +- snd_assert (bpos < PDPLUS_BUFFER_SIZE, return -EINVAL); +- snd_assert (bpos + bcount - 1 < PDPLUS_BUFFER_SIZE, return -EINVAL); ++ if (snd_BUG_ON(bpos >= PDPLUS_BUFFER_SIZE)) ++ return -EINVAL; ++ if (snd_BUG_ON(bpos + bcount - 1 >= PDPLUS_BUFFER_SIZE)) ++ return -EINVAL; + + /* No constraints about access here. So we can use memcpy */ + copy_to_user_fromio ( +@@ -2106,8 +2118,10 @@ static int pdplus_d_play_copy_ll ( + u_int bpos = PDPLUS_BYTES_FROM_FRAMES (upos, is_adat); + size_t bcount = PDPLUS_BYTES_FROM_FRAMES (ucount, is_adat); + +- snd_assert (bpos < PDPLUS_BUFFER_SIZE, return -EINVAL); +- snd_assert (bpos + bcount - 1 < PDPLUS_BUFFER_SIZE, return -EINVAL); ++ if (snd_BUG_ON(bpos >= PDPLUS_BUFFER_SIZE)) ++ return -EINVAL; ++ if (snd_BUG_ON(bpos + bcount - 1 >= PDPLUS_BUFFER_SIZE)) ++ return -EINVAL; + + pdplus_copy_from_user_ll ( + scard->MEM_iomem.vaddr + PDPLUS_D_PLAY_OFFSET + bpos, +@@ -2130,8 +2144,10 @@ static int pdplus_d_play_silence_ll ( + u_int bpos = PDPLUS_BYTES_FROM_FRAMES (upos, is_adat); + size_t bcount = PDPLUS_BYTES_FROM_FRAMES (ucount, is_adat); + +- snd_assert (bpos < PDPLUS_BUFFER_SIZE, return -EINVAL); +- snd_assert (bpos + bcount - 1 < PDPLUS_BUFFER_SIZE, return -EINVAL); ++ if (snd_BUG_ON(bpos >= PDPLUS_BUFFER_SIZE)) ++ return -EINVAL; ++ if (snd_BUG_ON(bpos + bcount - 1 >= PDPLUS_BUFFER_SIZE)) ++ return -EINVAL; + + pdplus_write_silence_ll ( + scard->MEM_iomem.vaddr + PDPLUS_D_PLAY_OFFSET + bpos, +@@ -2158,8 +2174,10 @@ static unsigned int pdplus_d_capt_rate_llr (pdplus_t *scard) + if (PDPLUS_CUT_BITS (PDPLUS_HW_REG_RD_F1, reg_value) != 0) rate_code|= 2; + if (PDPLUS_CUT_BITS (PDPLUS_HW_REG_RD_F2, reg_value) != 0) rate_code|= 4; + +- snd_assert (rate_code >= 0, return 0); +- snd_assert (rate_code < 8, return 0); ++ if (snd_BUG_ON(rate_code < 0)) ++ return 0; ++ if (snd_BUG_ON(rate_code >= 8)) ++ return 0; + + return code2rate[rate_code]; + } +@@ -2178,8 +2196,10 @@ static int pdplus_d_capt_copy_ll ( + u_int bpos = PDPLUS_BYTES_FROM_FRAMES (upos, is_adat); + size_t bcount = PDPLUS_BYTES_FROM_FRAMES (ucount, is_adat); + +- snd_assert (bpos < PDPLUS_BUFFER_SIZE, return -EINVAL); +- snd_assert (bpos + bcount - 1 < PDPLUS_BUFFER_SIZE, return -EINVAL); ++ if (snd_BUG_ON(bpos >= PDPLUS_BUFFER_SIZE)) ++ return -EINVAL; ++ if (snd_BUG_ON(bpos + bcount - 1 >= PDPLUS_BUFFER_SIZE)) ++ return -EINVAL; + + /* Check input frequency and possibly generate an error. */ + if (substream->runtime->rate != pdplus_d_capt_rate_llr (scard)) +@@ -2823,7 +2843,8 @@ static int pdplus_a_route_set_ll (pdplus_t *scard, int route) + if (PDPLUS_CACHE_EQL (scard, FPGA, CTRL, D_ROUTE, A_CAPT)) + break; + +- snd_assert (scard->a_capt_prepared == 0, break); ++ if (scard->a_capt_prepared) ++ break; + + rate = pdplus_d_clock_rate_llr (scard); + if (rate > 0 && rate == pdplus_a_adjust_rate (rate)) { +@@ -3333,17 +3354,18 @@ static int pdplus_analog_find_and_programme_clock_ll ( + BOOL d_prepared = FALSE; + int d_rate = -1; + PDPLUS_LOCAL_VADDR (scard); +- snd_assert (substream != NULL, return -ENXIO); +- snd_assert (substream->runtime != NULL, return -ENXIO); + + /* Get the fixed frequency code of that rate. */ + fixclock = pdplus_get_fix_freq_code (rate); + + /* Is digital playback prepared? Get the rate they are using. */ + if (scard->d_play_prepared) { +- snd_assert (scard != NULL, return -ENXIO); +- snd_assert (scard->d_play != NULL, return -ENXIO); +- snd_assert (scard->d_play->runtime != NULL, return -ENXIO); ++ if (snd_BUG_ON(!scard)) ++ return -ENXIO; ++ if (snd_BUG_ON(!scard->d_play)) ++ return -ENXIO; ++ if (snd_BUG_ON(!scard->d_play->runtime)) ++ return -ENXIO; + + d_prepared = TRUE; + d_rate = scard->d_play->runtime->rate; +@@ -3416,28 +3438,33 @@ static int pdplus_digital_find_and_programme_clock_ll ( + BOOL a_prepared = FALSE; + int a_rate = -1; + PDPLUS_LOCAL_VADDR (scard); +- snd_assert (substream != NULL, return -ENXIO); +- snd_assert (substream->runtime != NULL, return -ENXIO); + + /* Get the fixed frequency code of that rate. */ + fixclock = pdplus_get_fix_freq_code (rate); + + /* Is analog playback or capture prepared? Get the rate they are using. */ + if (scard->a_play_prepared) { +- snd_assert (scard != NULL, return -ENXIO); +- snd_assert (scard->a_play != NULL, return -ENXIO); +- snd_assert (scard->a_play->runtime != NULL, return -ENXIO); ++ if (snd_BUG_ON(!scard)) ++ return -ENXIO; ++ if (snd_BUG_ON(!scard->a_play)) ++ return -ENXIO; ++ if (snd_BUG_ON(!scard->a_play->runtime)) ++ return -ENXIO; + + a_prepared = TRUE; + a_rate = scard->a_play->runtime->rate; + } + + if (scard->a_capt_prepared) { +- snd_assert (scard != NULL, return -ENXIO); +- snd_assert (scard->a_capt != NULL, return -ENXIO); +- snd_assert (scard->a_capt->runtime != NULL, return -ENXIO); +- snd_assert (a_rate == -1 || a_rate == (int)scard->a_capt->runtime->rate, +- return -ENXIO); ++ if (snd_BUG_ON(!scard)) ++ return -ENXIO; ++ if (snd_BUG_ON(!scard->a_capt)) ++ return -ENXIO; ++ if (snd_BUG_ON(!scard->a_capt->runtime)) ++ return -ENXIO; ++ if (snd_BUG_ON(a_rate != -1 && ++ a_rate != scard->a_capt->runtime->rate)) ++ return -ENXIO; + + a_prepared = TRUE; + a_rate = scard->a_capt->runtime->rate; +@@ -3538,13 +3565,12 @@ static int pdplus_a_play_prepare (struct snd_pcm_substream *substream) + int rate; + pdplus_t *scard = snd_pcm_substream_chip(substream); + PDPLUS_LOCAL_VADDR (scard); +- snd_assert (substream != NULL, return -ENXIO); +- snd_assert (substream->runtime != NULL, return -ENXIO); + ENTER; + + /* Get & check the sample rate */ + rate = substream->runtime->rate; +- snd_assert (rate == pdplus_a_adjust_rate (rate), return -ENXIO); ++ if (rate != pdplus_a_adjust_rate(rate)) ++ return -ENXIO; + + /* Lock */ + write_lock_irqsave (&scard->lock, flags); +@@ -3564,9 +3590,12 @@ static int pdplus_a_play_prepare (struct snd_pcm_substream *substream) + * which might be needed for something else later. */ + if (scard->a_capt_prepared) { + /* We have to use the same clock as analog rec */ +- snd_assert (scard != NULL, return -ENXIO); +- snd_assert (scard->a_capt != NULL, return -ENXIO); +- snd_assert (scard->a_capt->runtime != NULL, return -ENXIO); ++ if (snd_BUG_ON(!scard)) ++ return -ENXIO; ++ if (snd_BUG_ON(!scard->a_capt)) ++ return -ENXIO; ++ if (snd_BUG_ON(!scard->a_capt->runtime)) ++ return -ENXIO; + + if ((int)scard->a_capt->runtime->rate != rate) { + err = -EBUSY; +@@ -3602,13 +3631,12 @@ static int pdplus_a_capt_prepare (struct snd_pcm_substream *substream) + int rate; + pdplus_t *scard = snd_pcm_substream_chip(substream); + PDPLUS_LOCAL_VADDR (scard); +- snd_assert (substream != NULL, return -ENXIO); +- snd_assert (substream->runtime != NULL, return -ENXIO); + ENTER; + + /* Get & check the sample rate if necessary */ + rate = substream->runtime->rate; +- snd_assert (rate == pdplus_a_adjust_rate (rate), return -ENXIO); ++ if (rate != pdplus_a_adjust_rate(rate)) ++ return -ENXIO; + + /* Lock */ + write_lock_irqsave (&scard->lock, flags); +@@ -3628,9 +3656,12 @@ static int pdplus_a_capt_prepare (struct snd_pcm_substream *substream) + * which might be needed for something else later. */ + if (scard->a_play_prepared) { + /* We have to use the same clock as analog play */ +- snd_assert (scard != NULL, return -ENXIO); +- snd_assert (scard->a_play != NULL, return -ENXIO); +- snd_assert (scard->a_play->runtime != NULL, return -ENXIO); ++ if (snd_BUG_ON(!scard)) ++ return -ENXIO; ++ if (snd_BUG_ON(!scard->a_play)) ++ return -ENXIO; ++ if (snd_BUG_ON(!scard->a_play->runtime)) ++ return -ENXIO; + + if ((int)scard->a_play->runtime->rate != rate) { + err = -EBUSY; +@@ -3666,15 +3697,14 @@ static int pdplus_d_play_prepare (struct snd_pcm_substream *substream) + int rate; + pdplus_t *scard = snd_pcm_substream_chip(substream); + PDPLUS_LOCAL_VADDR (scard); +- snd_assert (substream != NULL, return -ENXIO); +- snd_assert (substream->runtime != NULL, return -ENXIO); + + /* Lock */ + write_lock_irqsave (&scard->lock, flags); + + /* Check the sample rate if necessary */ + rate = substream->runtime->rate; +- snd_assert (rate == pdplus_d_adjust_rate_llr (scard, rate, FALSE), return -ENXIO); ++ if (rate != pdplus_d_adjust_rate_llr(scard, rate, FALSE)) ++ return -ENXIO; + + /* Stop the card if it is playing (for whatever reason). */ + pdplus_d_play_stop_ll (scard); +@@ -3712,8 +3742,6 @@ static int pdplus_d_capt_prepare (struct snd_pcm_substream *substream) + int rate; + pdplus_t *scard = snd_pcm_substream_chip(substream); + PDPLUS_LOCAL_VADDR (scard); +- snd_assert (substream != NULL, return -ENXIO); +- snd_assert (substream->runtime != NULL, return -ENXIO); + + /* Lock */ + write_lock_irqsave (&scard->lock, flags); +@@ -3896,8 +3924,6 @@ static int pdplus_a_play_open (struct snd_pcm_substream *substream) + int err; + pdplus_t *scard = snd_pcm_substream_chip(substream); + ENTER; +- snd_assert (substream != NULL, return -ENXIO); +- snd_assert (substream->runtime != NULL, return -ENXIO); + + substream->runtime->hw = pdplus_a_play_info; + err = snd_pcm_hw_rule_add(substream->runtime, 0, +@@ -3952,8 +3978,6 @@ static int pdplus_a_capt_open (struct snd_pcm_substream *substream) + int err; + pdplus_t *scard = snd_pcm_substream_chip(substream); + ENTER; +- snd_assert (substream != NULL, return -ENXIO); +- snd_assert (substream->runtime != NULL, return -ENXIO); + + substream->runtime->hw = pdplus_a_capt_info; + err = snd_pcm_hw_rule_add(substream->runtime, 0, +@@ -4029,8 +4053,6 @@ static int pdplus_d_play_open (struct snd_pcm_substream *substream) + int err; + pdplus_t *scard = snd_pcm_substream_chip(substream); + ENTER; +- snd_assert (substream != NULL, return -ENXIO); +- snd_assert (substream->runtime != NULL, return -ENXIO); + + if ((err = pdplus_set_mode (scard, PDPLUS_MODE_DIGITAL))) + LEAVE (err); +@@ -4090,8 +4112,6 @@ static int pdplus_d_capt_open (struct snd_pcm_substream *substream) + int err; + pdplus_t *scard = snd_pcm_substream_chip(substream); + ENTER; +- snd_assert (substream != NULL, return -ENXIO); +- snd_assert (substream->runtime != NULL, return -ENXIO); + + if ((err = pdplus_set_mode (scard, PDPLUS_MODE_DIGITAL))) + LEAVE (err); +@@ -4215,17 +4235,13 @@ static __devinit int pdplus_a_pcm_new ( + if ((err = snd_pcm_new (card, "CS4222", device, 1, 1, &pcm)) < 0) + LEAVE (err); + +- snd_assert (pcm != NULL, return -ENOMEM); +- + pcm->private_data = scard; + pcm->private_free = pdplus_a_pcm_free; + + pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX; + +- snd_assert (pcm->name != NULL, return -ENXIO); + strcpy (pcm->name, "CS4222 DAC/ADC"); + +- snd_assert (pcm->streams != NULL, return -ENXIO); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pdplus_a_play_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pdplus_a_capt_ops); + +@@ -4247,17 +4263,14 @@ static __devinit int pdplus_d_pcm_new ( + + if ((err = snd_pcm_new (card, "CS84x4", device, 1, 1, &pcm)) < 0) + LEAVE (err); +- snd_assert (pcm != NULL, return -ENOMEM); + + pcm->private_data = scard; + pcm->private_free = pdplus_d_pcm_free; + + pcm->info_flags = 0; + +- snd_assert (pcm->name != NULL, return -ENXIO); + strcpy (pcm->name, "CS8404/CS8414 Digital Transceiver"); + +- snd_assert (pcm->streams != NULL, return -ENXIO); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pdplus_d_play_ops); + snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pdplus_d_capt_ops); + +@@ -5232,7 +5245,8 @@ static int __devinit pdplus_mixer_new (pdplus_t *scard) + unsigned int i; + int err= 0; + +- snd_assert (scard != NULL, return -ENXIO); ++ if (snd_BUG_ON(!scard)) ++ return -ENXIO; + + card= scard->card; + strcpy (card->mixername, DEVICE_NAME); +@@ -5270,7 +5284,8 @@ static BOOL pdplus_upload_circuit ( + PDPLUS_LOCAL_VADDR (scard); + ENTER; + +- snd_assert (scard != NULL, return FALSE); ++ if (snd_BUG_ON(!scard)) ++ return FALSE; + + #if DEBUG + Vprintk ("jiffies=%ld\n", jiffies); +@@ -5421,7 +5436,8 @@ static void pdplus_print_iomem_ll ( + void __iomem *end; + int i = 0; + +- snd_assert (iomem != NULL, return); ++ if (snd_BUG_ON(!iomem)) ++ return; + lauf = iomem->vaddr; + end = iomem->vaddr + iomem->size; + +@@ -5498,9 +5514,12 @@ static void pdplus_proc_read ( + pdplus_t *lcard; /* only _llr function may be called with &lcard!! */ + PDPLUS_LOCAL_VADDR (scard); + +- snd_assert (scard != NULL, return); +- snd_assert (scard->card != NULL, return); +- snd_assert (scard->card->longname != NULL, return); ++ if (snd_BUG_ON(!scard)) ++ return; ++ if (snd_BUG_ON(!scard->card)) ++ return; ++ if (snd_BUG_ON(!scard->card->longname)) ++ return; + + lcard = kmalloc(sizeof(*lcard), GFP_KERNEL); + if (! lcard) +@@ -5763,8 +5782,10 @@ static void __devinit pdplus_register_proc (pdplus_t *scard) + { + struct snd_info_entry *entry; + +- snd_assert (scard != NULL, return); +- snd_assert (scard->card != NULL, return); ++ if (snd_BUG_ON(!scard)) ++ return; ++ if (snd_BUG_ON(!scard->card)) ++ return; + + if (! snd_card_proc_new (scard->card, "prodif_plus", &entry)) + snd_info_set_text_ops(entry, scard, pdplus_proc_read); +@@ -5846,7 +5867,8 @@ static int __devinit pdplus_register_iomem ( + + DL (1, "Trying to grab MMIO region at 0x%lx, size=0x%lx", start, size); + +- snd_assert (piomem != NULL, return -ENXIO); ++ if (snd_BUG_ON(!piomem)) ++ return -ENXIO; + + if ((piomem->resource = request_mem_region(start, size, name)) == NULL) { + snd_printk(KERN_ERR "unable to grab memory region 0x%lx-0x%lx\n", +@@ -5877,8 +5899,10 @@ static int __devinit pdplus_check_consistency_ll (pdplus_t *scard) + u32 x, y; + PDPLUS_LOCAL_VADDR (scard); + +- snd_assert (scard != NULL, return -ENXIO); +- snd_assert (scard->PLX_ioport != 0, return -ENXIO); ++ if (snd_BUG_ON(!scard)) ++ return -ENXIO; ++ if (snd_BUG_ON(!scard->PLX_ioport)) ++ return -ENXIO; + + /* + * Some consistency checks to detect really weird errors +@@ -5923,7 +5947,8 @@ static int __devinit pdplus_init( + u_long start; + pdplus_t *scard; + +- snd_assert (card != NULL, return -ENXIO); ++ if (snd_BUG_ON(!card)) ++ return -ENXIO; + + scard = (pdplus_t *)card->private_data; + if (scard == NULL) +@@ -5941,12 +5966,6 @@ static int __devinit pdplus_init( + scard->auto_cd_mode = 1; + scard->auto_profi_mode = 1; + +- /* ALSA should have kcallocked our private_data. Check this. */ +- snd_assert (scard->PLX_iomem.vaddr == NULL, scard->PLX_iomem.vaddr = NULL); +- snd_assert (scard->MEM_iomem.vaddr == NULL, scard->MEM_iomem.vaddr = NULL); +- snd_assert (scard->FPGA_iomem.vaddr == NULL, scard->FPGA_iomem.vaddr = NULL); +- snd_assert (scard->HW_iomem.vaddr == NULL, scard->HW_iomem.vaddr = NULL); +- + #if MANY_CHECKS + DL (1, "Checking PCI resources"); + if ((err = pdplus_check_resources (pci)) != 0) +@@ -6113,10 +6132,12 @@ static void pdplus_sweep(struct snd_card *card) + u_long flags; + ENTER; + +- snd_assert (card != NULL, return); ++ if (snd_BUG_ON(!card)) ++ return; + + scard = (pdplus_t *)card->private_data; +- snd_assert (scard != NULL, return); ++ if (snd_BUG_ON(!scard)) ++ return; + + write_lock_irqsave (&scard->lock, flags); + +@@ -6183,8 +6204,10 @@ static int __init alsa_card_pdplus_init(void) + { + /* + * Check that our macros work. */ +- snd_assert (PDPLUS_HW_REG_WR_INITIAL_1 == 0x22, return -ENXIO); +- snd_assert (PDPLUS_HW_REG_WR_INITIAL_2 == 0x32, return -ENXIO); ++ if (snd_BUG_ON(PDPLUS_HW_REG_WR_INITIAL_1 != 0x22)) ++ return -ENXIO; ++ if (snd_BUG_ON(PDPLUS_HW_REG_WR_INITIAL_2 != 0x32)) ++ return -ENXIO; + + printk (PDPLUS_KERN_INFO "version " PDPLUS_VERSION "\n"); + return pci_register_driver (&driver); +diff --git a/ppc/beep_old.c b/ppc/beep_old.c +index 9d03759..0818af1 100644 +--- a/ppc/beep_old.c ++++ b/ppc/beep_old.c +@@ -182,7 +182,8 @@ static int snd_pmac_info_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin + static int snd_pmac_get_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) + { + pmac_t *chip = snd_kcontrol_chip(kcontrol); +- snd_assert(chip->beep, return -ENXIO); ++ if (snd_BUG_ON(!chip->beep)) ++ return -ENXIO; + ucontrol->value.integer.value[0] = chip->beep->volume; + return 0; + } +diff --git a/ppc/tumbler.patch b/ppc/tumbler.patch +index a91eb65..2d95977 100644 +--- a/ppc/tumbler.patch ++++ b/ppc/tumbler.patch +@@ -1,5 +1,5 @@ +---- ../alsa-kernel/ppc/tumbler.c 2008-02-05 11:23:24.000000000 +0200 +-+++ tumbler.c 2008-04-17 15:33:50.504338918 +0300 ++--- ../alsa-kernel/ppc/tumbler.c 2008-08-08 15:23:46.000000000 +0200 +++++ tumbler.c 2008-08-08 15:29:52.000000000 +0200 + @@ -1,3 +1,5 @@ + +#define __NO_VERSION__ + +#include "adriver.h" +@@ -21,7 +21,7 @@ + #undef DEBUG + + #ifdef DEBUG +-@@ -965,7 +975,11 @@ ++@@ -961,7 +971,11 @@ + } + } + +@@ -33,9 +33,9 @@ + static struct snd_pmac *device_change_chip; + + static void device_change_handler(struct work_struct *work) +-@@ -1035,7 +1049,11 @@ +- mix = chip->mixer_data; +- snd_assert(mix, return); ++@@ -1033,7 +1047,11 @@ ++ if (snd_BUG_ON(!mix)) ++ return; + mix->auto_mute_notify = do_notify; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) + + schedule_task(&device_change); +@@ -45,7 +45,7 @@ + } + } + #endif /* PMAC_SUPPORT_AUTOMUTE */ +-@@ -1455,7 +1473,11 @@ ++@@ -1447,7 +1465,11 @@ + chip->resume = tumbler_resume; + #endif + +diff --git a/soc/at32/at32-pcm.c b/soc/at32/at32-pcm.c +new file mode 100644 +index 0000000..46d5aec +--- /dev/null ++++ b/soc/at32/at32-pcm.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/at32/at32-pcm.c" +diff --git a/soc/at32/at32-ssc.c b/soc/at32/at32-ssc.c +new file mode 100644 +index 0000000..1913733 +--- /dev/null ++++ b/soc/at32/at32-ssc.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/at32/at32-ssc.c" +diff --git a/soc/at32/playpaq_wm8510.c b/soc/at32/playpaq_wm8510.c +new file mode 100644 +index 0000000..ee6442a +--- /dev/null ++++ b/soc/at32/playpaq_wm8510.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/at32/playpaq_wm8510.c" +diff --git a/soc/codecs/ad1980.c b/soc/codecs/ad1980.c +new file mode 100644 +index 0000000..d6ab452 +--- /dev/null ++++ b/soc/codecs/ad1980.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/codecs/ad1980.c" +diff --git a/soc/codecs/ak4535.c b/soc/codecs/ak4535.c +new file mode 100644 +index 0000000..8f30b6d +--- /dev/null ++++ b/soc/codecs/ak4535.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/codecs/ak4535.c" +diff --git a/soc/codecs/tlv320aic26.c b/soc/codecs/tlv320aic26.c +new file mode 100644 +index 0000000..e4c1718 +--- /dev/null ++++ b/soc/codecs/tlv320aic26.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/codecs/tlv320aic26.c" +diff --git a/soc/codecs/uda1380.c b/soc/codecs/uda1380.c +new file mode 100644 +index 0000000..92638a9 +--- /dev/null ++++ b/soc/codecs/uda1380.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/codecs/uda1380.c" +diff --git a/soc/codecs/wm8900.c b/soc/codecs/wm8900.c +new file mode 100644 +index 0000000..bb3ba10 +--- /dev/null ++++ b/soc/codecs/wm8900.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/codecs/wm8900.c" +diff --git a/soc/codecs/wm8990.c b/soc/codecs/wm8990.c +new file mode 100644 +index 0000000..8bb9836 +--- /dev/null ++++ b/soc/codecs/wm8990.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/codecs/wm8990.c" +diff --git a/soc/codecs/wm9713.c b/soc/codecs/wm9713.c +new file mode 100644 +index 0000000..ebc6f26 +--- /dev/null ++++ b/soc/codecs/wm9713.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/codecs/wm9713.c" +diff --git a/soc/fsl/fsl_dma.c b/soc/fsl/fsl_dma.c +new file mode 100644 +index 0000000..e9f5685 +--- /dev/null ++++ b/soc/fsl/fsl_dma.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/fsl/fsl_dma.c" +diff --git a/soc/fsl/fsl_ssi.c b/soc/fsl/fsl_ssi.c +new file mode 100644 +index 0000000..88651a2 +--- /dev/null ++++ b/soc/fsl/fsl_ssi.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/fsl/fsl_ssi.c" +diff --git a/soc/fsl/mpc5200_psc_i2s.c b/soc/fsl/mpc5200_psc_i2s.c +new file mode 100644 +index 0000000..b00aa71 +--- /dev/null ++++ b/soc/fsl/mpc5200_psc_i2s.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/fsl/mpc5200_psc_i2s.c" +diff --git a/soc/fsl/mpc8610_hpcd.c b/soc/fsl/mpc8610_hpcd.c +new file mode 100644 +index 0000000..8a96f03 +--- /dev/null ++++ b/soc/fsl/mpc8610_hpcd.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/fsl/mpc8610_hpcd.c" +diff --git a/soc/fsl/soc-of-simple.c b/soc/fsl/soc-of-simple.c +new file mode 100644 +index 0000000..b5f9b39 +--- /dev/null ++++ b/soc/fsl/soc-of-simple.c +@@ -0,0 +1,2 @@ ++#include "adriver.h" ++#include "../../alsa-kernel/soc/fsl/soc-of-simple.c" +diff --git a/usb/usx2y/us122l.c b/usb/usx2y/us122l.c +new file mode 100644 +index 0000000..8aeea9d +--- /dev/null ++++ b/usb/usx2y/us122l.c @@ -0,0 +1,2 @@ +#include "adriver.h" +#include "../../alsa-kernel/usb/usx2y/us122l.c" -diff -urN alsa-driver-1.0.17/usb/usx2y/usb_stream.c alsa-driver-patched/usb/usx2y/usb_stream.c ---- alsa-driver-1.0.17/usb/usx2y/usb_stream.c 1969-12-31 19:00:00.000000000 -0500 -+++ alsa-driver-patched/usb/usx2y/usb_stream.c 2008-08-02 13:04:14.884791088 -0400 +diff --git a/usb/usx2y/usX2Yhwdep.patch b/usb/usx2y/usX2Yhwdep.patch +index 91a0ec9..46ad0c5 100644 +--- a/usb/usx2y/usX2Yhwdep.patch ++++ b/usb/usx2y/usX2Yhwdep.patch +@@ -1,5 +1,5 @@ +---- ../../alsa-kernel/usb/usx2y/usX2Yhwdep.c 2008-06-05 16:16:42.000000000 +0200 +-+++ usX2Yhwdep.c 2008-06-06 10:24:46.000000000 +0200 ++--- ../../alsa-kernel/usb/usx2y/usX2Yhwdep.c 2008-08-06 18:04:33.000000000 +0200 +++++ usX2Yhwdep.c 2008-08-08 15:31:06.000000000 +0200 + @@ -1,3 +1,20 @@ + +#include "config.h" + +#ifdef CONFIG_HAVE_DEPRECATED_CONFIG_H +@@ -29,7 +29,7 @@ + static int snd_us428ctls_vm_fault(struct vm_area_struct *area, + struct vm_fault *vmf) + { +-@@ -55,9 +73,60 @@ ++@@ -55,9 +73,61 @@ + + return 0; + } +@@ -58,7 +58,8 @@ + + offset = area->vm_offset; + +#endif + + offset += address - area->vm_start; +-+ snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_SIGBUS); +++ if (snd_BUG_ON(offset % PAGE_SIZE)) +++ return NOPAGE_SIGBUS; + + vaddr = (char*)((struct usX2Ydev *)area->vm_private_data)->us428ctls_sharedmem + offset; + + page = virt_to_page(vaddr); + + get_page(page); +@@ -90,7 +91,7 @@ + }; + + static int snd_us428ctls_mmap(struct snd_hwdep * hw, struct file *filp, struct vm_area_struct *area) +-@@ -84,8 +153,14 @@ ++@@ -84,8 +154,14 @@ + us428->us428ctls_sharedmem->CtlSnapShotLast = -2; + } + area->vm_ops = &us428ctls_vm_ops; +@@ -105,7 +106,7 @@ + return 0; + } + +-@@ -127,7 +202,11 @@ ++@@ -127,7 +203,11 @@ + struct usX2Ydev *us428 = hw->private_data; + int id = -1; + +@@ -117,7 +118,7 @@ + case USB_ID_US122: + id = USX2Y_TYPE_122; + break; +-@@ -179,9 +258,15 @@ ++@@ -179,9 +259,15 @@ + }; + struct usb_device *dev = usX2Y(card)->chip.dev; + struct usb_interface *iface = usb_ifnum_to_if(dev, 0); +@@ -133,7 +134,7 @@ + + snd_printdd("usX2Y_create_usbmidi \n"); + return snd_usb_create_midi_interface(&usX2Y(card)->chip, iface, quirk); +-@@ -227,7 +312,11 @@ ++@@ -227,7 +313,11 @@ + if (err) + snd_printk(KERN_ERR "usb_set_interface error \n"); + else +diff --git a/usb/usx2y/usb_stream.c b/usb/usx2y/usb_stream.c +new file mode 100644 +index 0000000..97d19c8 +--- /dev/null ++++ b/usb/usx2y/usb_stream.c @@ -0,0 +1,2 @@ +#include "adriver.h" +#include "../../alsa-kernel/usb/usx2y/usb_stream.c" +diff --git a/usb/usx2y/usx2yhwdeppcm.patch b/usb/usx2y/usx2yhwdeppcm.patch +index 17f846a..4412463 100644 +--- a/usb/usx2y/usx2yhwdeppcm.patch ++++ b/usb/usx2y/usx2yhwdeppcm.patch +@@ -1,5 +1,5 @@ +---- ../../alsa-kernel/usb/usx2y/usx2yhwdeppcm.c 2008-06-05 16:16:42.000000000 +0200 +-+++ usx2yhwdeppcm.c 2008-06-06 10:25:41.000000000 +0200 ++--- ../../alsa-kernel/usb/usx2y/usx2yhwdeppcm.c 2008-08-06 18:04:34.000000000 +0200 +++++ usx2yhwdeppcm.c 2008-08-08 15:30:58.000000000 +0200 + @@ -1,3 +1,28 @@ + +#include "config.h" + +#ifdef CONFIG_HAVE_DEPRECATED_CONFIG_H +@@ -126,7 +126,7 @@ + static int snd_usX2Y_hwdep_pcm_vm_fault(struct vm_area_struct *area, + struct vm_fault *vmf) + { +-@@ -695,12 +750,55 @@ ++@@ -695,12 +750,56 @@ + get_page(vmf->page); + return 0; + } +@@ -149,7 +149,8 @@ + + offset = area->vm_offset; + +#endif + + offset += address - area->vm_start; +-+ snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); +++ if (snd_BUG_ON(offset % PAGE_SIZE)) +++ return NOPAGE_OOM; + + vaddr = (char*)((struct usX2Ydev *)area->vm_private_data)->hwdep_pcm_shm + offset; + + page = virt_to_page(vaddr); + +#ifndef CONFIG_SND_REMOVE_PAGE_RESERVE +@@ -182,7 +183,7 @@ + }; + + +-@@ -722,8 +820,14 @@ ++@@ -722,8 +821,14 @@ + return -ENODEV; + } + area->vm_ops = &snd_usX2Y_hwdep_pcm_vm_ops; +diff --git a/utils/alsa-info.sh b/utils/alsa-info.sh +index 6639ac3..3a48e81 100755 +--- a/utils/alsa-info.sh ++++ b/utils/alsa-info.sh +@@ -1,6 +1,6 @@ + #!/bin/bash + +-SCRIPT_VERSION=0.4.48 ++SCRIPT_VERSION=0.4.49 + CHANGELOG="http://www.alsa-project.org/alsa-info.sh.changelog" + + ################################################################################# +@@ -33,7 +33,11 @@ PASTEBINKEY="C9cRIO8m/9y8Cs0nVs0FraRx7U0pHsuc" + #Define some simple functions + + pbcheck(){ +- [[ $(ping -c1 www.pastebin.ca) ]] || KEEP_FILES="yes" NOUPLOAD="yes" PBERROR="yes" ++ if [[ -z $PASTEBIN ]]; then ++ [[ $(ping -c1 www.alsa-project.org) ]] || KEEP_FILES="yes" NOUPLOAD="yes" PBERROR="yes" ++ else ++ [[ $(ping -c1 www.pastebin.ca) ]] || KEEP_FILES="yes" NOUPLOAD="yes" PBERROR="yes" ++ fi + } + + update() { +@@ -69,12 +73,6 @@ cleanup() { + } + + +-#### FIX ME +-withsecure() { +- POST_URL="http://alsa-info.pastebin.ca" +-} +-########### +- + withaplay() { + echo "!!Aplay/Arecord output" >> $FILE + echo "!!------------" >> $FILE +@@ -192,6 +190,8 @@ SYSFS=$(mount |grep sysfs|awk {'print $3'}); + #Check modprobe config files for sound related options + SNDOPTIONS=$(modprobe -c|sed -n 's/^options \(snd[-_][^ ]*\)/\1:/p') + ++PASTEBIN="" ++WWWSERVICE="www.alsa-project.org" + QUESTION="yes" + PROCEED="yes" + REPEAT="" +@@ -205,6 +205,10 @@ case "$1" in + --no-upload) + NOUPLOAD="yes" + ;; ++ --pastebin) ++ PASTEBIN="yes" ++ WWWSERVICE="pastebin" ++ ;; + --no-dialog) + DIALOG="" + REPEAT="" +@@ -219,7 +223,7 @@ if [ "$QUESTION" = "yes" ]; then + if [[ -n "$DIALOG" ]] + then + if [ -z "$NOUPLOAD" ]; then +- dialog --backtitle "$BGTITLE" --title "ALSA-Info script v $SCRIPT_VERSION" --yesno "\nThis script will collect information about your ALSA installation and sound related hardware, to help diagnose your problem\n\nBy default, this script will AUTOMATICALLY UPLOAD your information to a pastebin site.\n\nSee $0 --help for options\n\nDo you want to run this script?" 0 0 ++ dialog --backtitle "$BGTITLE" --title "ALSA-Info script v $SCRIPT_VERSION" --yesno "\nThis script will collect information about your ALSA installation and sound related hardware, to help diagnose your problem\n\nBy default, this script will AUTOMATICALLY UPLOAD your information to a $WWWSERVICE site.\n\nSee $0 --help for options\n\nDo you want to run this script?" 0 0 + else + dialog --backtitle "$BGTITLE" --title "ALSA-Info script v $SCRIPT_VERSION" --yesno "\nThis script will collect information about your ALSA installation and sound related hardware, to help diagnose your problem\n\nSee $0 --help for options\n\nDo you want to run this script?" 0 0 + fi +@@ -238,11 +242,11 @@ echo "" + if [ -z "$NOUPLOAD" ]; then + if [[ -n "$TPUT" ]]; then + tput bold +-echo "By default, the collected information will be AUTOMATICALLY uploaded to a pastebin site." ++echo "By default, the collected information will be AUTOMATICALLY uploaded to a $WWWSERVICE site." + echo "If you do not wish for this to occur, run the script with the --no-upload argument" + tput sgr0 + else +-echo "By default, the collected information will be AUTOMATICALLY uploaded to a pastebin site." ++echo "By default, the collected information will be AUTOMATICALLY uploaded to a $WWWSERVICE site." + echo "If you do not wish for this to occur, run the script with the --no-upload argument" + fi + echo "" +@@ -297,7 +301,11 @@ cat /proc/asound/card*/codec97\#0/ac97\#0-0 > /tmp/alsainfo/alsa-ac97.tmp 2> /de + cat /proc/asound/card*/codec97\#0/ac97\#0-0+regs > /tmp/alsainfo/alsa-ac97-regs.tmp 2> /dev/null + + #Fetch the info, and put it in $FILE in a nice readable format. ++if [[ -z $PASTEBIN ]]; then ++echo "upload=true&script=true&cardinfo=" > $FILE ++else + echo "name=$USER&type=33&description=/tmp/alsa-info.txt&expiry=&s=Submit+Post&content=" > $FILE ++fi + echo "!!################################" >> $FILE + echo "!!ALSA Information Script v $SCRIPT_VERSION" >> $FILE + echo "!!################################" >> $FILE +@@ -425,6 +433,8 @@ then + until [ -z "$1" ] + do + case "$1" in ++ --pastebin) ++ ;; + --update) + update + exit +@@ -510,18 +520,23 @@ then + exit 0 + ;; + *) ++ echo "alsa-info.sh version $SCRIPT_VERSION" + echo "" + echo "Available options:" + echo " --with-aplay (includes the output of aplay -l)" + echo " --with-amixer (includes the output of amixer)" + echo " --with-alsactl (includes the output of alsactl)" +- echo " --with-configs (includes the output of ~/.asoundrc and /etc/asound.conf if they exist)" ++ echo " --with-configs (includes the output of ~/.asoundrc and" ++ echo " /etc/asound.conf if they exist)" + echo " --with-devices (shows the device nodes in /dev/snd/)" + echo "" + echo " --update (check server for script updates)" + echo " --no-upload (do not upload contents to remote server)" ++ echo " --pastebin (use http://pastebin.ca) as remote server" ++ echo " instead www.alsa-project.org" + echo " --about (show some information about the script)" +- echo " --debug (will run the script as normal, but will not delete $FILE)" ++ echo " --debug (will run the script as normal, but will not" ++ echo " delete $FILE)" + cleanup + exit 0 + ;; +@@ -539,6 +554,14 @@ then + if [[ -n "$DIALOG" ]] + then + if [[ -z $NOUPLOAD ]]; then ++ if [[ -z $PASTEBIN ]]; then ++ wget -O - --tries=5 --timeout=60 --post-file=/tmp/alsa-info.txt "http://www.alsa-project.org/cardinfo-db/" &>/tmp/alsainfo/wget.tmp || echo "Upload failed; exit" ++ { for i in 10 20 30 40 50 60 70 80 90; do ++ echo $i ++ sleep 0.2 ++ done ++ echo; } |dialog --backtitle "$BGTITLE" --guage "Uploading information to www.alsa-project.org ..." 6 70 0 ++ else + wget -O - --tries=5 --timeout=60 --post-file=/tmp/alsa-info.txt "http://pastebin.ca/quiet-paste.php?api=$PASTEBINKEY&encrypt=t&encryptpw=blahblah" &>/tmp/alsainfo/wget.tmp || echo "Upload failed; exit" + { for i in 10 20 30 40 50 60 70 80 90; do + echo $i +@@ -546,12 +569,18 @@ then + done + echo; } |dialog --backtitle "$BGTITLE" --guage "Uploading information to www.pastebin.ca ..." 6 70 0 + fi ++ fi + else + + if [[ -z $NOUPLOAD ]]; then ++ if [[ -z $PASTEBIN ]]; then ++ echo -n "Uploading information to www.alsa-project.org ... " ++ wget -O - --tries=5 --timeout=60 --post-file=/tmp/alsa-info.txt http://www.alsa-project.org/cardinfo-db/ &>/tmp/alsainfo/wget.tmp & ++ else + echo -n "Uploading information to www.pastebin.ca ... " + wget -O - --tries=5 --timeout=60 --post-file=/tmp/alsa-info.txt http://pastebin.ca/quiet-paste.php?api=$PASTEBINKEY &>/tmp/alsainfo/wget.tmp & + fi ++ fi + fi + #Progess spinner for wget transfer. + if [[ -z "$DIALOG" ]] +@@ -569,9 +598,17 @@ fi + if [[ -z $NOUPLOAD ]]; then + if [[ -n "$TPUT" ]] + then +- FINAL_URL=`tput setaf 1; grep "SUCCESS:" /tmp/alsainfo/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p';tput sgr0` ++ if [[ -z $PASTEBIN ]]; then ++ FINAL_URL=`tput setaf 1; grep "SUCCESS:" /tmp/alsainfo/wget.tmp | cut -d ' ' -f 2 ; tput sgr0` ++ else ++ FINAL_URL=`tput setaf 1; grep "SUCCESS:" /tmp/alsainfo/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p';tput sgr0` ++ fi + else +- FINAL_URL=`grep "SUCCESS:" /tmp/alsainfo/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p'` ++ if [[ -z $PASTEBIN ]]; then ++ FINAL_URL=`grep "SUCCESS:" /tmp/alsainfo/wget.tmp | cut -d ' ' -f 2` ++ else ++ FINAL_URL=`grep "SUCCESS:" /tmp/alsainfo/wget.tmp |sed -n 's/.*\:\([0-9]\+\).*/http:\/\/pastebin.ca\/\1/p'` ++ fi + fi + fi + #Output the URL of the uploaded file. +@@ -589,9 +626,9 @@ if [[ -n $DIALOG ]] + then + if [[ -n $NOUPLOAD ]]; then + if [[ -n $PBERROR ]]; then +- dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occured while contacting the pastebin. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $FILE" 10 100 ++ dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "An error occured while contacting the $WWWSERVICE. Your information was NOT automatically uploaded.\n\nYour ALSA information can be seen by looking in $FILE" 10 100 + else +- dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the pastebin\n\nYour ALSA information can be seen by looking in $FILE" 10 100 ++ dialog --backtitle "$BGTITLE" --title "Information collected" --msgbox "You requested that your information was NOT automatically uploaded to the $WWWSERVICE\n\nYour ALSA information can be seen by looking in $FILE" 10 100 + fi + else + dialog --backtitle "$BGTITLE" --title "Information uploaded" --yesno "Would you like to see the uploaded information?" 5 100 +@@ -605,12 +642,12 @@ fi + clear + if [[ -n $NOUPLOAD ]]; then + if [[ -n $PBERROR ]]; then +- echo "An error occured while contacting the pastebin. Your information was NOT automatically uploaded." ++ echo "An error occured while contacting the $WWWSERVICE. Your information was NOT automatically uploaded." + echo "" + echo "Your ALSA information can be seen by looking in $FILE" + echo "" + else +- echo "You requested that your information was NOT automatically uploaded to the pastebin" ++ echo "You requested that your information was NOT automatically uploaded to the $WWWSERVICE" + echo "" + echo "Your ALSA information can be seen by looking in $FILE" + echo "" +@@ -621,7 +658,7 @@ echo "Your ALSA information is located at $FINAL_URL" + echo "Please inform the person helping you." + echo "" + fi +- #We posted the file to pastebin.ca , so we dont need it anymore. delete it. ++ #We posted the file , so we dont need it anymore. delete it. + if [ -z $KEEP_FILES ] + then + rm $FILE +@@ -631,6 +668,16 @@ fi + else + if [[ -z $DIALOG ]] + then ++ if [[ -z $PASTEBIN ]]; then ++ echo "" ++ echo "Could not automatically upload output to http://www.alsa-project.org" ++ echo "Possible reasons are:" ++ echo " 1. Couldnt find 'wget' in your PATH" ++ echo " 2. Your version of wget is less than 1.8.2" ++ echo "" ++ echo "Please manually upload $FILE to http://www.alsa-project.org/cardinfo-db/ and submit your post." ++ echo "" ++ else + echo "" + echo "Could not automatically upload output to http://www.pastebin.ca" + echo "Possible reasons are:" +@@ -639,10 +686,15 @@ else + echo "" + echo "Please manually upload $FILE to http://www.pastebin.ca/upload.php and submit your post." + echo "" ++ fi + fi + if [[ -n $DIALOG ]] + then +- dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.pastebin.ca.\nPossible reasons are:\n\n 1. Couldn't find 'wget' in your PATH\n 2. Your version of wget is less than 1.8.2\n\nPlease manually upload $FILE to http://www.pastebin.ca/upload.php and submit your post." 25 100 ++ if [[ -z $PASTEBIN ]]; then ++ dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.alsa-project.org.\nPossible reasons are:\n\n 1. Couldn't find 'wget' in your PATH\n 2. Your version of wget is less than 1.8.2\n\nPlease manually upload $FILE to http://www.alsa-project,org/cardinfo-db/ and submit your post." 25 100 ++ else ++ dialog --backtitle "$BGTITLE" --msgbox "Could not automatically upload output to http://www.pastebin.ca.\nPossible reasons are:\n\n 1. Couldn't find 'wget' in your PATH\n 2. Your version of wget is less than 1.8.2\n\nPlease manually upload $FILE to http://www.pastebin.ca/upload.php and submit your post." 25 100 ++ fi + fi + fi + #Clean up the temp files +diff --git a/utils/alsasound.in b/utils/alsasound.in +index 7bdbbe3..94faa79 100644 +--- a/utils/alsasound.in ++++ b/utils/alsasound.in +@@ -73,6 +73,7 @@ if [ -x /sbin/lsmod ]; then + else + lsmod=lsmod + fi ++failedfile=/var/run/alsactl.init.failed + + # modprobe returns 255 when failed.. + function probe_module () { +@@ -86,6 +87,7 @@ function start() { + # insert all sound modules + # + ++ rm -f $failedfile + module_loaded=0 + drivers=`/sbin/modprobe -c | \ + grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | \ +@@ -112,7 +114,11 @@ function start() { + # + if [ -d /proc/asound ]; then + if [ ! -r $asoundcfg ]; then +- echo "No mixer config in $asoundcfg, you have to unmute your card!" ++ $alsactl init ++ if [ $? -ne 0 ]; then ++ echo "No mixer config in $asoundcfg, you have to unmute your card!" ++ touch $failedfile ++ fi + else + if [ -x $alsactl ]; then + $alsactl -F -f $asoundcfg restore +@@ -189,6 +195,7 @@ function stop() { + if [ -d /var/lock/subsys ] ; then + rm -f /var/lock/subsys/alsasound + fi ++ rm -f $failedfile + } + + # See how we were called. +diff --git a/utils/alsasound.posix.in b/utils/alsasound.posix.in +index 07cfcea..343afa6 100644 +--- a/utils/alsasound.posix.in ++++ b/utils/alsasound.posix.in +@@ -37,6 +37,7 @@ if [ -x /sbin/lsmod ]; then + else + lsmod=lsmod + fi ++failedfile=/var/run/alsactl.init.failed + + if [ ! -r $config ]; then + if [ -r /etc/conf.modules ]; then +@@ -47,6 +48,7 @@ fi + # See how we were called. + case "$1" in + start) ++ rm -f $failedfile + # Start driver. + if [ ! -d /proc/asound ]; then + # +@@ -69,7 +71,11 @@ case "$1" in + if [ -r $asoundcfg ]; then + $alsactl -F -f $asoundcfg restore + else +- echo "ERROR: alsactl can't start, $asoundcfg is not readable" ++ $alsactl init ++ if [ $? -ne 0 ]; then ++ echo "ERROR: alsactl can't start, $asoundcfg is not readable" ++ touch $failedfile ++ fi + fi + else + echo "ERROR: alsactl not found" +@@ -107,6 +113,7 @@ case "$1" in + if [ -d /var/lock/subsys ]; then + rm -f /var/lock/subsys/alsasound + fi ++ rm -f $failedfile + echo "done" + else + echo "ALSA driver isn't running." diff --git a/media-sound/alsa-utils/Manifest b/media-sound/alsa-utils/Manifest index 6b6b298..3d60269 100644 --- a/media-sound/alsa-utils/Manifest +++ b/media-sound/alsa-utils/Manifest @@ -7,10 +7,8 @@ AUX alsasound-1.0.10_rc2 7183 RMD160 7c1368905cc0fbe266e840f358a3502bbedb6d9c SH AUX alsasound-init-20070218 7657 RMD160 283ed673ec6f61c3aac77957393bd84ba05ff8d2 SHA1 16105ee86f8f208526eda4ce8ec6ff6b8206bedf SHA256 0330f7c58719e5669e39224be60bb6c2a1ba09b138801785655ffd245dc9d1e8 AUX alsasound.confd 1052 RMD160 b3a788626e239a844ac71119e887066074be3b30 SHA1 6386e6097629dcd405b61fd950370e610362a712 SHA256 073015ea00ffcbe536fd15258d30d17cdd8cacd6c334f330882d5ed9bdcf83ad AUX alsasound.initd 6557 RMD160 6e58e7b93619a505f87f8de7fecc6489daf5638f SHA1 fb1c5436e2ddfa191119fb19d439fe43e9f797f1 SHA256 09e54f5e4f75331a1de3af641623edcf4d687b49f23180f8bc14b42fc471acfe -AUX git-update-1.patch 112356 RMD160 f9ed998305d227cf79ee62d44a34998d89eff82d SHA1 7244fd921051353edaaf8b6519a6d6a3a74911c9 SHA256 8213c91b3c75abf39d98afea6a280b9c8b25bf1a3762e66e6383bb90f1717a7c -AUX git-update-2.patch 4571 RMD160 e1248d723c123c39247748af6d1cce3b98260e33 SHA1 8efde06673e88954596b613b7e2b54648f165d62 SHA256 5928371deb0bc87f4eee0335f2003590c12089a20da949fc78d8d0729ba5e401 +AUX git-update.patch 123346 RMD160 064c3f798b2f1f85014b4fc034ff52009eea7f57 SHA1 c237236ec25edcd675316826cb8a27f3dfffcd7c SHA256 9023c63a2e960c90b228748c1cc25e0bb0b20ddd55b15455ea601e7cc18f9a86 AUX makefile-fix.patch 285 RMD160 9f54824d420899f46fceb3102c2fbd20e464307f SHA1 2d0f26fc70ab4cb0b842b8beffc8bbad9a07f979 SHA256 7d7413eab6b5fc14a3db3148041f90afc9c5ec4094e37b475fdb25cc8e6a63bb DIST alsa-utils-1.0.17.tar.bz2 1016532 RMD160 6dbc55ffab43a6552bc5032099a071101be467ab SHA1 e71f752b79357fd8ad1c86e4e926cbce19de19d3 SHA256 6a06f457d66eca75ac1ab065e64539e4ccf22ed4e53703a70194cb85203b3125 -EBUILD alsa-utils-1.0.17-r3.ebuild 2836 RMD160 ca2874784cc2bc511df98aef5aa679827eb86560 SHA1 6499d38bdb2bebd94ce389647da0853c21bc12f3 SHA256 d1ad55048ca10c174de979133728a80833acb3803c73891c0f13d4c55827e9f2 -EBUILD alsa-utils-1.0.17-r4.ebuild 2877 RMD160 ab254dcb5df950a40e29fc86f03fa3a7970b4bba SHA1 562faa40432216a1a1907cd54d2fd5962eced988 SHA256 7e0111c6cd8810fd507002a874e36a50861ffc28f313b5f5c9530cbed978f875 +EBUILD alsa-utils-1.0.17-r5.ebuild 2834 RMD160 279303867975d6152e4a1ac7024e409bf6f051f7 SHA1 4ddbee2d425d7a162f698bfcc67b22a5f6d2a143 SHA256 a5b6f47dbcdd3294c89b98409c575add9dccf168c4951c82a3cdbdc01578346d MISC metadata.xml 220 RMD160 e49f8bb330d1798cd2c8ee5335cef1784f0d7ccb SHA1 1b895fe6cae4b8eab08ba1a6a1212baf4b4b4105 SHA256 8570ef11cd59b0d8edb71e78eecaec423616836b10eacb86bee0de941f0ae054 diff --git a/media-sound/alsa-utils/alsa-utils-1.0.17-r4.ebuild b/media-sound/alsa-utils/alsa-utils-1.0.17-r4.ebuild deleted file mode 100644 index 6800e19..0000000 --- a/media-sound/alsa-utils/alsa-utils-1.0.17-r4.ebuild +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/media-sound/alsa-utils/alsa-utils-1.0.17.ebuild,v 1.1 2008/08/02 21:00:32 betelgeuse Exp $ - -inherit eutils autotools - -MY_P="${P/_rc/rc}" - -DESCRIPTION="Advanced Linux Sound Architecture Utils (alsactl, alsamixer, etc.)" -HOMEPAGE="http://www.alsa-project.org/" -SRC_URI="mirror://alsaproject/utils/${MY_P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0.9" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86" -IUSE="nls midi minimal" - -DEPEND=">=sys-libs/ncurses-5.1 - dev-util/dialog - app-text/xmlto - >=media-libs/alsa-lib-${PV}" -RDEPEND="${DEPEND} - virtual/modutils - !minimal? ( sys-apps/pciutils )" - -S="${WORKDIR}/${MY_P}" - -pkg_setup() { - if use midi && ! built_with_use --missing true media-libs/alsa-lib midi; then - eerror "" - eerror "To be able to build alsa-utils with midi support you need" - eerror "to have built media-libs/alsa-lib with midi USE flag." - die "Missing midi USE flag on media-libs/alsa-lib" - fi -} - -src_unpack() { - unpack ${A} - cd "${S}" - - epatch "${FILESDIR}/${PN}-1.0.11_rc2-nls.patch" - epatch "${FILESDIR}/${PN}-1.0.11_rc5-alsaconf-redirect.patch" - epatch "${FILESDIR}/${PN}-1.0.14-alsaconf-modules-update.patch" - epatch "${FILESDIR}/${PN}-1.0.17-seq.patch" - epatch "${FILESDIR}/git-update-1.patch" - epatch "${FILESDIR}/git-update-2.patch" -# epatch "${FILESDIR}/makefile-fix.patch" - - AT_M4DIR="m4" eautoreconf -} - -src_compile() { - econf $(use_enable nls) \ - $(use_enable midi sequencer) \ - || die "configure failed" - - emake || die "make failed" -} - -pkg_preinst() { - if [[ -a /etc/modules.d/alsa ]] && [[ ! -a /etc/modprobe.d/alsa ]]; then - elog "Moving old alsa configuration in modules.d to new" - elog "location in modprobe.d in /etc/" - mv "${ROOT}/etc/modules.d/alsa" "${ROOT}/etc/modprobe.d/alsa" - fi -} - -src_install() { - local ALSA_UTILS_DOCS="ChangeLog README TODO - seq/aconnect/README.aconnect - seq/aseqnet/README.aseqnet" - - emake DESTDIR="${D}" install || die "Installation Failed" - - dodoc ${ALSA_UTILS_DOCS} || die - newdoc alsamixer/README README.alsamixer || die - - newinitd "${FILESDIR}/alsasound.initd" alsasound - newconfd "${FILESDIR}/alsasound.confd" alsasound - insinto /etc/modprobe.d - newins "${FILESDIR}/alsa-modules.conf-rc" alsa - - keepdir /var/lib/alsa -} - -pkg_postinst() { - echo - elog "To take advantage of the init script, and automate the process of" - elog "loading and unloading the ALSA sound drivers as well as" - elog "storing and restoring sound-card mixer levels you should" - elog "add alsasound to the boot runlevel. You can do this as" - elog "root like so:" - elog " # rc-update add alsasound boot" - echo - if use minimal; then - ewarn "The minimal use flag disables the dependency on pciutils that" - ewarn "is needed by alsaconf at runtime." - fi -} diff --git a/media-sound/alsa-utils/alsa-utils-1.0.17-r3.ebuild b/media-sound/alsa-utils/alsa-utils-1.0.17-r5.ebuild similarity index 98% rename from media-sound/alsa-utils/alsa-utils-1.0.17-r3.ebuild rename to media-sound/alsa-utils/alsa-utils-1.0.17-r5.ebuild index f39f6bc..14ca9fc 100644 --- a/media-sound/alsa-utils/alsa-utils-1.0.17-r3.ebuild +++ b/media-sound/alsa-utils/alsa-utils-1.0.17-r5.ebuild @@ -42,7 +42,7 @@ src_unpack() { epatch "${FILESDIR}/${PN}-1.0.11_rc5-alsaconf-redirect.patch" epatch "${FILESDIR}/${PN}-1.0.14-alsaconf-modules-update.patch" epatch "${FILESDIR}/${PN}-1.0.17-seq.patch" - epatch "${FILESDIR}/git-update-1.patch" + epatch "${FILESDIR}/git-update.patch" # epatch "${FILESDIR}/makefile-fix.patch" AT_M4DIR="m4" eautoreconf diff --git a/media-sound/alsa-utils/files/git-update-2.patch b/media-sound/alsa-utils/files/git-update-2.patch deleted file mode 100644 index 3a9eeba..0000000 --- a/media-sound/alsa-utils/files/git-update-2.patch +++ /dev/null @@ -1,147 +0,0 @@ -diff --git a/iecset/iecbits.c b/iecset/iecbits.c -index 8c62749..84d439b 100644 ---- a/iecset/iecbits.c -+++ b/iecset/iecbits.c -@@ -26,17 +26,39 @@ struct category_str { - }; - - static struct category_str con_category[] = { -+ { IEC958_AES1_CON_GENERAL, "general" }, -+ -+ { IEC958_AES1_CON_IEC908_CD, "CD" }, -+ { IEC958_AES1_CON_NON_IEC908_CD, "non-IEC908 CD" }, -+ { IEC958_AES1_CON_MINI_DISC, "Mini-Disc" }, -+ { IEC958_AES1_CON_DVD, "DVD" }, -+ -+ { IEC958_AES1_CON_PCM_CODER, "PCM coder" }, -+ { IEC958_AES1_CON_MIXER, "digital signal mixer" }, -+ { IEC958_AES1_CON_RATE_CONVERTER, "rate converter" }, -+ { IEC958_AES1_CON_SAMPLER, "sampler" }, -+ { IEC958_AES1_CON_DSP, "digital sound processor" }, -+ - { IEC958_AES1_CON_DAT, "DAT" }, - { IEC958_AES1_CON_VCR, "VCR" }, -- { IEC958_AES1_CON_MICROPHONE, "microphone" }, -+ { IEC958_AES1_CON_DCC, "DCC" }, -+ { IEC958_AES1_CON_MAGNETIC_DISC, "magnetic disc" }, -+ -+ { IEC958_AES1_CON_DAB_JAPAN, "digital audio broadcast (Japan)" }, -+ { IEC958_AES1_CON_DAB_EUROPE, "digital audio broadcast (Europe)" }, -+ { IEC958_AES1_CON_DAB_USA, "digital audio broadcast (USA)" }, -+ { IEC958_AES1_CON_SOFTWARE, "software delivery" }, -+ - { IEC958_AES1_CON_SYNTHESIZER, "synthesizer" }, -- { IEC958_AES1_CON_RATE_CONVERTER, "rate converter" }, -- { IEC958_AES1_CON_MIXER, "mixer" }, -- { IEC958_AES1_CON_SAMPLER, "sampler" }, -- { IEC958_AES1_CON_PCM_CODER, "PCM coder" }, -- { IEC958_AES1_CON_IEC908_CD, "CD" }, -- { IEC958_AES1_CON_NON_IEC908_CD, "non-IEC908 CD" }, -- { IEC958_AES1_CON_GENERAL, "general" }, -+ { IEC958_AES1_CON_MICROPHONE, "microphone" }, -+ -+ { IEC958_AES1_CON_ADC, "ADC without copyright information" }, -+ -+ { IEC958_AES1_CON_ADC_COPYRIGHT, "ADC with copyright information" }, -+ -+ { IEC958_AES1_CON_SOLIDMEM_DIGITAL_RECORDER_PLAYER, "flash memory recorder/player" }, -+ -+ { IEC958_AES1_CON_EXPERIMENTAL, "experimental" }, - }; - - -@@ -57,14 +79,38 @@ void dump_iec958(snd_aes_iec958_t *iec) - } - printf("Rate: "); - switch (iec->status[3] & IEC958_AES3_CON_FS) { -+ case IEC958_AES3_CON_FS_22050: -+ printf("22050 Hz\n"); -+ break; -+ case IEC958_AES3_CON_FS_24000: -+ printf("24000 Hz\n"); -+ break; -+ case IEC958_AES3_CON_FS_32000: -+ printf("32000 Hz\n"); -+ break; - case IEC958_AES3_CON_FS_44100: - printf("44100 Hz\n"); - break; - case IEC958_AES3_CON_FS_48000: - printf("48000 Hz\n"); - break; -- case IEC958_AES3_CON_FS_32000: -- printf("32000 Hz\n"); -+ case IEC958_AES3_CON_FS_88200: -+ printf("88200 Hz\n"); -+ break; -+ case IEC958_AES3_CON_FS_96000: -+ printf("96000 Hz\n"); -+ break; -+ case IEC958_AES3_CON_FS_176400: -+ printf("176400 Hz\n"); -+ break; -+ case IEC958_AES3_CON_FS_192000: -+ printf("192000 Hz\n"); -+ break; -+ case IEC958_AES3_CON_FS_768000: -+ printf("768000 Hz\n"); -+ break; -+ case IEC958_AES3_CON_FS_NOTID: -+ printf("not indicated\n"); - break; - default: - printf("unknown\n"); -diff --git a/iecset/iecset.c b/iecset/iecset.c -index a2fe4d1..44c43ab 100644 ---- a/iecset/iecset.c -+++ b/iecset/iecset.c -@@ -58,7 +58,7 @@ static struct cmdtbl cmds[] = { - { "aud", IDX_NOAUDIO, CMD_BOOL_INV, - "audio (common)\n\ton = audio mode, off = non-audio mode" }, - { "rat", IDX_RATE, CMD_INT, -- "rate (common)\n\tsample rate in Hz" }, -+ "rate (common)\n\tsample rate in Hz (0 = not indicated)" }, - { "emp", IDX_EMP, CMD_INT, - "emphasis (common)\n\t0 = none, 1 = 50/15us, 2 = CCITT" }, - { "loc", IDX_UNLOCK, CMD_BOOL_INV, -@@ -194,14 +194,38 @@ static int update_iec958_status(snd_aes_iec958_t *iec958, int *parms) - } else { - iec958->status[3] &= ~IEC958_AES3_CON_FS; - switch (parms[IDX_RATE]) { -+ case 22050: -+ iec958->status[3] |= IEC958_AES3_CON_FS_22050; -+ break; -+ case 24000: -+ iec958->status[3] |= IEC958_AES3_CON_FS_24000; -+ break; -+ case 32000: -+ iec958->status[3] |= IEC958_AES3_CON_FS_32000; -+ break; - case 44100: - iec958->status[3] |= IEC958_AES3_CON_FS_44100; - break; - case 48000: - iec958->status[3] |= IEC958_AES3_CON_FS_48000; - break; -- case 32000: -- iec958->status[3] |= IEC958_AES3_CON_FS_32000; -+ case 88200: -+ iec958->status[3] |= IEC958_AES3_CON_FS_88200;; -+ break; -+ case 96000: -+ iec958->status[3] |= IEC958_AES3_CON_FS_96000; -+ break; -+ case 176400: -+ iec958->status[3] |= IEC958_AES3_CON_FS_176400; -+ break; -+ case 192000: -+ iec958->status[3] |= IEC958_AES3_CON_FS_192000; -+ break; -+ case 768000: -+ iec958->status[3] |= IEC958_AES3_CON_FS_768000; -+ break; -+ default: -+ iec958->status[3] |= IEC958_AES3_CON_FS_NOTID; - break; - } - } diff --git a/media-sound/alsa-utils/files/git-update-1.patch b/media-sound/alsa-utils/files/git-update.patch similarity index 89% rename from media-sound/alsa-utils/files/git-update-1.patch rename to media-sound/alsa-utils/files/git-update.patch index 5d5749b..177319c 100644 --- a/media-sound/alsa-utils/files/git-update-1.patch +++ b/media-sound/alsa-utils/files/git-update.patch @@ -1,8 +1,10 @@ diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am -index d21a496..93b3d79 100644 +index d21a496..0e29c14 100644 --- a/alsactl/Makefile.am +++ b/alsactl/Makefile.am -@@ -1,6 +1,9 @@ +@@ -1,6 +1,11 @@ ++SUBDIRS = init ++ sbin_PROGRAMS=alsactl -man_MANS=alsactl.1 -EXTRA_DIST=alsactl.1 @@ -14,7 +16,7 @@ index d21a496..93b3d79 100644 noinst_HEADERS=alsactl.h + +%.7: %.xml -+ xmlto man $? ++ xmltoman $? diff --git a/alsactl/alsactl.c b/alsactl/alsactl.c index 78c6cb1..8d3987a 100644 --- a/alsactl/alsactl.c @@ -174,10 +176,10 @@ index f1e2b41..51396da 100644 +} diff --git a/alsactl/alsactl_init.xml b/alsactl/alsactl_init.xml new file mode 100644 -index 0000000..d4b65fd +index 0000000..f0ed9a4 --- /dev/null +++ b/alsactl/alsactl_init.xml -@@ -0,0 +1,534 @@ +@@ -0,0 +1,562 @@ + + @@ -437,7 +439,7 @@ index 0000000..d4b65fd + + + -+ ++ + + The relative path to sysfs subsystem specifying + the root directory of a soundcard device. Usually, @@ -451,7 +453,7 @@ index 0000000..d4b65fd + + Match sysfs attribute values of the soundcard device. + The relative path to sysfs tree must be defined by -+ SYSFS_DEVICE key. Trailing whitespace in the attribute ++ CONFIG{sysfs_device} key. Trailing whitespace in the attribute + values is ignored, if the specified match value does + not contain trailing whitespace itself. Depending on + the type of operator, this key is also used to set @@ -572,6 +574,16 @@ index 0000000..d4b65fd + + + ++ ++ ++ Set RESULT variable. Note that PROGRAM also sets ++ this variable, but setting this variable manually ++ might be useful to change code execution order (included ++ files). ++ ++ ++ ++ + + + Named label where a GOTO can jump to. @@ -586,7 +598,21 @@ index 0000000..d4b65fd + + + -+ ++ ++ ++ Include specified filename or all files in specified directory ++ ++ ++ ++ ++ ++ ++ Check if specified file or directory exists ++ ++ ++ ++ ++ + + The relative path to sysfs subsystem specifying + the root directory of a soundcard device. Usually, @@ -612,15 +638,19 @@ index 0000000..d4b65fd + + + -+ Exit immediately and set program exit code to value (should be integer). ++ Exit immediately and set program exit code to value ++ (should be integer). If value is "return" string, ++ parser leaves current included file and returns to parent ++ configuration file. + + + + + -+ The , , ++ The , , ++ , + , , -+ , ++ , + fields support simple printf-like string substitutions. + It allows the use of the complete environment set by earlier matching + rules. For all other fields, substitutions are applied while the individual rule is @@ -714,15 +744,15 @@ index 0000000..d4b65fd + diff --git a/alsactl/init/00main b/alsactl/init/00main new file mode 100644 -index 0000000..daac952 +index 0000000..3d289cb --- /dev/null +++ b/alsactl/init/00main -@@ -0,0 +1,16 @@ +@@ -0,0 +1,43 @@ +# This is toplevel configuration for for 'alsactl init'. +# See 'man alsactl_init' for syntax. + +# set root device directory in sysfs for soundcard for ATTR{} command -+SYSFS_DEVICE="/class/sound/controlC$cardinfo{card}/device" ++CONFIG{sysfs_device}="/class/sound/controlC$cardinfo{card}/device" + +# test for extra commands +ENV{CMD}=="help", INCLUDE="help", GOTO="00main_end" @@ -731,15 +761,55 @@ index 0000000..daac952 +ENV{CMD}=="*", ERROR="Unknown command '$env{CMD}'\n", GOTO="00main_end" + +# include files with real configuration -+CARDINFO{driver}=="HDA-Intel", INCLUDE="hda", GOTO="00main_end" -+CARDINFO{driver}=="Test", INCLUDE="test", GOTO="00main_end" ++# ++# steps are: ++# 1) look for preinit subdirectory and parse all files in it ++# 2) if RESULT=="skip", skip ALSA standard configuration files ++# 3) do ALSA standard configuration ++# 4) look for postinit subdirectory and parse all files in it ++# 5) if RESULT!="true", print an error message and return with exit code 99 ++# 6) return with exit code 0 (success) ++# ++ ++RESULT="unknown" ++ACCESS=="preinit", INCLUDE="preinit" ++RESULT=="skip", GOTO="init_end" ++ ++# real ALSA configuration database ++CARDINFO{driver}=="HDA-Intel", INCLUDE="hda", GOTO="init_end" ++CARDINFO{driver}=="Test", INCLUDE="test", GOTO="init_end" ++ ++LABEL="init_end" ++ACCESS=="postinit", INCLUDE="postinit" ++RESULT=="true", GOTO="00_mainend" ++ERROR="Unknown hardware: \"$cardinfo{driver}\" \"$cardinfo{mixername}\" \"$cardinfo{components}\" \"$attr{subsystem_vendor}\" \"$attr{subsystem_device}\"\n" ++ERROR="Hardware is left uninitialized\n" ++EXIT="99" ++ ++# ++# label identifying end of main file ++# ++ +LABEL="00main_end" +diff --git a/alsactl/init/Makefile.am b/alsactl/init/Makefile.am +new file mode 100644 +index 0000000..2a7e13f +--- /dev/null ++++ b/alsactl/init/Makefile.am +@@ -0,0 +1,7 @@ ++ ++init_files = \ ++ 00main help info test \ ++ hda ++EXTRA_DIRST = $(init_files) ++alsainitdir = $(datadir)/alsa/init ++alsainit_DATA = $(init_files) diff --git a/alsactl/init/hda b/alsactl/init/hda new file mode 100644 -index 0000000..c34daaa +index 0000000..9c33123 --- /dev/null +++ b/alsactl/init/hda -@@ -0,0 +1,37 @@ +@@ -0,0 +1,34 @@ +# Configuration for HDA Intel driver (High Definition Audio - Azalia) + +CARDINFO{mixername}=="Realtek ALC880", \ @@ -748,11 +818,8 @@ index 0000000..c34daaa +CARDINFO{mixername}=="Analog Devices AD1984", \ + ATTR{subsystem_vendor}=="0x17aa", ATTR{subsystem_device}=="0x20ac", \ + GOTO="Lenovo T61" -+ -+ERROR="Unknown hardware: \"$cardinfo{mixername}\" \"$cardinfo{components}\" \"$attr{subsystem_vendor}" \"$attr{subsystem_device}\"\n" -+ERROR="Hardware is left uninitialized\n" -+EXIT="99" -+ ++RESULT="false", EXIT="return" ++ +LABEL="Acer Travelmate 8100" +# playback +CTL{reset}="mixer" @@ -764,19 +831,19 @@ index 0000000..c34daaa +CTL{name}="Input Source", CTL{value}="0" +CTL{name}="Capture Volume", CTL{value}="65,65" +CTL{name}="Capture Switch", CTL{value}="on,on" -+EXIT="0" ++RESULT="true", EXIT="return" + +LABEL="Lenovo T61" +# playback +CTL{reset}="mixer" +CTL{name}="Headphone Playback Switch", CTL{value}="on,on" -+CTL{name}="PCM Playback Volume", CTL{value}="150,550" ++CTL{name}="PCM Playback Volume", CTL{value}="30,30" +# capture (Internal Mic) +CTL{name}="Input Source", CTL{value}="1" +CTL{name}="Internal Mic Boost", CTL{value}="1" +CTL{name}="Capture Volume", CTL{value}="45,45" +CTL{name}="Capture Switch", CTL{value}="on,on" -+EXIT="0" ++RESULT="true", EXIT="return" diff --git a/alsactl/init/help b/alsactl/init/help new file mode 100644 index 0000000..60d9b1c @@ -1082,10 +1149,10 @@ index 0000000..d1f4f11 +PRINT="\nAll tests done..\n" diff --git a/alsactl/init_parse.c b/alsactl/init_parse.c new file mode 100644 -index 0000000..a99362d +index 0000000..96caf46 --- /dev/null +++ b/alsactl/init_parse.c -@@ -0,0 +1,1517 @@ +@@ -0,0 +1,1612 @@ +/* + * Advanced Linux Sound Architecture Control Program - Parse initialization files + * Copyright (c) by Jaroslav Kysela , @@ -1122,6 +1189,8 @@ index 0000000..a99362d +#include +#include +#include ++#include ++#include +#include +#include "aconfig.h" +#include "alsactl.h" @@ -1129,6 +1198,7 @@ index 0000000..a99362d + +#define PATH_SIZE 512 +#define NAME_SIZE 128 ++#define EJUSTRETURN 0x7fffffff + +enum key_op { + KEY_OP_UNSET, @@ -2034,7 +2104,7 @@ index 0000000..a99362d + const char *value = NULL; + size_t size; + -+ pair = value_find(space, "SYSFS_DEVICE"); ++ pair = value_find(space, "sysfs_device"); + if (pair == NULL) + break; + value = sysfs_attr_get_value(pair->value, attr); @@ -2303,7 +2373,17 @@ index 0000000..a99362d + if (op == KEY_OP_MATCH || op == KEY_OP_NOMATCH) { + if (!do_match(key, op, value, space->program_result)) + break; -+ } else { ++ } else if (op == KEY_OP_ASSIGN) { ++ if (space->program_result) { ++ free(space->program_result); ++ space->program_result = NULL; ++ } ++ strlcpy(string, value, sizeof(string)); ++ apply_format(space, string, sizeof(string)); ++ space->program_result = strdup(string); ++ if (space->program_result == NULL) ++ break; ++ } else { + Perror(space, "invalid RESULT operation"); + goto invalid; + } @@ -2362,7 +2442,7 @@ index 0000000..a99362d + goto invalid; + } + if (op == KEY_OP_MATCH || op == KEY_OP_NOMATCH) { -+ pair = value_find(space, "SYSFS_DEVICE"); ++ pair = value_find(space, "sysfs_device"); + if (pair == NULL) + break; + dbg("sysfs_attr: '%s' '%s'", pair->value, attr); @@ -2407,6 +2487,8 @@ index 0000000..a99362d + if (strcasecmp(key, "INCLUDE") == 0) { + char *rootdir, *go_to; + const char *filename; ++ struct dirent *dirent; ++ DIR *dir; + int linenum; + if (op != KEY_OP_ASSIGN) { + Perror(space, "invalid INCLUDE operation"); @@ -2423,16 +2505,41 @@ index 0000000..a99362d + go_to = space->go_to; + filename = space->filename; + linenum = space->linenum; -+ space->go_to = NULL; -+ space->rootdir = new_root_dir(string); -+ if (space->rootdir) { -+ err = parse(space, string); -+ free(space->rootdir); -+ } else -+ err = -ENOMEM; -+ if (space->go_to) { -+ Perror(space, "unterminated GOTO '%s'", space->go_to); -+ free(space->go_to); ++ dir = opendir(string); ++ if (dir) { ++ count = strlen(string); ++ while ((dirent = readdir(dir)) != NULL) { ++ if (strcmp(dirent->d_name, ".") == 0 || ++ strcmp(dirent->d_name, "..") == 0) ++ continue; ++ string[count] = '\0'; ++ strlcat(string, "/", sizeof(string)); ++ strlcat(string, dirent->d_name, sizeof(string)); ++ space->go_to = NULL; ++ space->rootdir = new_root_dir(string); ++ if (space->rootdir) { ++ err = parse(space, string); ++ free(space->rootdir); ++ } else ++ err = -ENOMEM; ++ if (space->go_to) { ++ Perror(space, "unterminated GOTO '%s'", space->go_to); ++ free(space->go_to); ++ } ++ } ++ closedir(dir); ++ } else { ++ space->go_to = NULL; ++ space->rootdir = new_root_dir(string); ++ if (space->rootdir) { ++ err = parse(space, string); ++ free(space->rootdir); ++ } else ++ err = -ENOMEM; ++ if (space->go_to) { ++ Perror(space, "unterminated GOTO '%s'", space->go_to); ++ free(space->go_to); ++ } + } + space->go_to = go_to; + space->rootdir = rootdir; @@ -2442,31 +2549,82 @@ index 0000000..a99362d + break; + continue; + } ++ if (strncasecmp(key, "ACCESS", 6) == 0) { ++ if (op == KEY_OP_MATCH || op == KEY_OP_NOMATCH) { ++ if (value[0] != '/') { ++ strlcpy(string, space->rootdir, sizeof(string)); ++ strlcat(string, "/", sizeof(string)); ++ strlcat(string, value, sizeof(string)); ++ } else { ++ strlcat(string, value, sizeof(string)); ++ } ++ count = access(string, F_OK); ++ dbg("access(%s) = %i", value, count); ++ if (op == KEY_OP_MATCH && count != 0) ++ break; ++ if (op == KEY_OP_NOMATCH && count == 0) ++ break; ++ } else { ++ Perror(space, "invalid ACCESS operation"); ++ goto invalid; ++ } ++ continue; ++ } + if (strncasecmp(key, "PRINT", 5) == 0) { ++ if (op != KEY_OP_ASSIGN) { ++ Perror(space, "invalid PRINT operation"); ++ goto invalid; ++ } + strlcpy(string, value, sizeof(string)); + apply_format(space, string, sizeof(string)); + fwrite(string, strlen(string), 1, stdout); + continue; + } + if (strncasecmp(key, "ERROR", 5) == 0) { ++ if (op != KEY_OP_ASSIGN) { ++ Perror(space, "invalid ERROR operation"); ++ goto invalid; ++ } + strlcpy(string, value, sizeof(string)); + apply_format(space, string, sizeof(string)); + fwrite(string, strlen(string), 1, stderr); + continue; + } + if (strncasecmp(key, "EXIT", 4) == 0) { ++ if (op != KEY_OP_ASSIGN) { ++ Perror(space, "invalid EXIT operation"); ++ goto invalid; ++ } + strlcpy(string, value, sizeof(string)); + apply_format(space, string, sizeof(string)); ++ if (strcmp(string, "return") == 0) ++ return -EJUSTRETURN; + space->exit_code = strtol(string, NULL, 0); + space->quit = 1; + break; + } -+ if (strncasecmp(key, "SYSFS_DEVICE", 12) == 0) { -+ strlcpy(string, value, sizeof(string)); -+ apply_format(space, string, sizeof(string)); -+ err = value_set(space, key, string); -+ dbg("SYSFS_DEVICE='%s'", string); -+ break; ++ if (strncasecmp(key, "CONFIG{", 7) == 0) { ++ attr = get_key_attribute(space, key + 6, string, sizeof(string)); ++ if (attr == NULL) { ++ Perror(space, "error parsing CONFIG attribute"); ++ goto invalid; ++ } ++ strlcpy(result, value, sizeof(result)); ++ apply_format(space, result, sizeof(result)); ++ if (op == KEY_OP_ASSIGN) { ++ err = value_set(space, attr, result); ++ dbg("CONFIG{%s}='%s'", attr, result); ++ break; ++ } else if (op == KEY_OP_MATCH || op == KEY_OP_NOMATCH) { ++ pair = value_find(space, attr); ++ if (pair == NULL) ++ break; ++ if (!do_match(key, op, result, pair->value)) ++ break; ++ } else { ++ Perror(space, "invalid CONFIG{} operation"); ++ goto invalid; ++ } + } + + Perror(space, "unknown key '%s'", key); @@ -2548,6 +2706,10 @@ index 0000000..a99362d + dbg("read (%i) '%s'", linenum, line); + space->linenum = linenum; + err = parse_line(space, line, linesize); ++ if (err == -EJUSTRETURN) { ++ err = 0; ++ break; ++ } + linenum += linenum_adj; + } + @@ -3693,3 +3855,191 @@ index 0000000..eb22ecc + + return count - pos; +} +diff --git a/configure.in b/configure.in +index 2484971..d478224 100644 +--- a/configure.in ++++ b/configure.in +@@ -93,8 +93,11 @@ case "$dir" in + *) dir="$prefix/share" + esac + +-dir="$dir/sounds/alsa" +-AC_DEFINE_UNQUOTED(DATADIR, "$dir", [directory containing sample data]) ++soundsdir="$dir/sounds/alsa" ++AC_DEFINE_UNQUOTED(SOUNDSDIR, "$soundsdir", [directory containing sample data]) ++ ++mydatadir="$dir/alsa" ++AC_DEFINE_UNQUOTED(DATADIR, "$mydatadir", [directory containing alsa configuration]) + + AC_ARG_WITH(testsound, + [ --with-testsound=file give the path of test sound file for alsaconf], +@@ -117,7 +120,8 @@ AC_SYS_LARGEFILE + + SAVE_UTIL_VERSION + +-AC_OUTPUT(Makefile alsactl/Makefile alsamixer/Makefile amidi/Makefile amixer/Makefile \ ++AC_OUTPUT(Makefile alsactl/Makefile alsactl/init/Makefile \ ++ alsamixer/Makefile amidi/Makefile amixer/Makefile \ + m4/Makefile po/Makefile.in \ + alsaconf/alsaconf alsaconf/Makefile \ + alsaconf/po/Makefile \ +diff --git a/iecset/iecbits.c b/iecset/iecbits.c +index 8c62749..84d439b 100644 +--- a/iecset/iecbits.c ++++ b/iecset/iecbits.c +@@ -26,17 +26,39 @@ struct category_str { + }; + + static struct category_str con_category[] = { ++ { IEC958_AES1_CON_GENERAL, "general" }, ++ ++ { IEC958_AES1_CON_IEC908_CD, "CD" }, ++ { IEC958_AES1_CON_NON_IEC908_CD, "non-IEC908 CD" }, ++ { IEC958_AES1_CON_MINI_DISC, "Mini-Disc" }, ++ { IEC958_AES1_CON_DVD, "DVD" }, ++ ++ { IEC958_AES1_CON_PCM_CODER, "PCM coder" }, ++ { IEC958_AES1_CON_MIXER, "digital signal mixer" }, ++ { IEC958_AES1_CON_RATE_CONVERTER, "rate converter" }, ++ { IEC958_AES1_CON_SAMPLER, "sampler" }, ++ { IEC958_AES1_CON_DSP, "digital sound processor" }, ++ + { IEC958_AES1_CON_DAT, "DAT" }, + { IEC958_AES1_CON_VCR, "VCR" }, +- { IEC958_AES1_CON_MICROPHONE, "microphone" }, ++ { IEC958_AES1_CON_DCC, "DCC" }, ++ { IEC958_AES1_CON_MAGNETIC_DISC, "magnetic disc" }, ++ ++ { IEC958_AES1_CON_DAB_JAPAN, "digital audio broadcast (Japan)" }, ++ { IEC958_AES1_CON_DAB_EUROPE, "digital audio broadcast (Europe)" }, ++ { IEC958_AES1_CON_DAB_USA, "digital audio broadcast (USA)" }, ++ { IEC958_AES1_CON_SOFTWARE, "software delivery" }, ++ + { IEC958_AES1_CON_SYNTHESIZER, "synthesizer" }, +- { IEC958_AES1_CON_RATE_CONVERTER, "rate converter" }, +- { IEC958_AES1_CON_MIXER, "mixer" }, +- { IEC958_AES1_CON_SAMPLER, "sampler" }, +- { IEC958_AES1_CON_PCM_CODER, "PCM coder" }, +- { IEC958_AES1_CON_IEC908_CD, "CD" }, +- { IEC958_AES1_CON_NON_IEC908_CD, "non-IEC908 CD" }, +- { IEC958_AES1_CON_GENERAL, "general" }, ++ { IEC958_AES1_CON_MICROPHONE, "microphone" }, ++ ++ { IEC958_AES1_CON_ADC, "ADC without copyright information" }, ++ ++ { IEC958_AES1_CON_ADC_COPYRIGHT, "ADC with copyright information" }, ++ ++ { IEC958_AES1_CON_SOLIDMEM_DIGITAL_RECORDER_PLAYER, "flash memory recorder/player" }, ++ ++ { IEC958_AES1_CON_EXPERIMENTAL, "experimental" }, + }; + + +@@ -57,14 +79,38 @@ void dump_iec958(snd_aes_iec958_t *iec) + } + printf("Rate: "); + switch (iec->status[3] & IEC958_AES3_CON_FS) { ++ case IEC958_AES3_CON_FS_22050: ++ printf("22050 Hz\n"); ++ break; ++ case IEC958_AES3_CON_FS_24000: ++ printf("24000 Hz\n"); ++ break; ++ case IEC958_AES3_CON_FS_32000: ++ printf("32000 Hz\n"); ++ break; + case IEC958_AES3_CON_FS_44100: + printf("44100 Hz\n"); + break; + case IEC958_AES3_CON_FS_48000: + printf("48000 Hz\n"); + break; +- case IEC958_AES3_CON_FS_32000: +- printf("32000 Hz\n"); ++ case IEC958_AES3_CON_FS_88200: ++ printf("88200 Hz\n"); ++ break; ++ case IEC958_AES3_CON_FS_96000: ++ printf("96000 Hz\n"); ++ break; ++ case IEC958_AES3_CON_FS_176400: ++ printf("176400 Hz\n"); ++ break; ++ case IEC958_AES3_CON_FS_192000: ++ printf("192000 Hz\n"); ++ break; ++ case IEC958_AES3_CON_FS_768000: ++ printf("768000 Hz\n"); ++ break; ++ case IEC958_AES3_CON_FS_NOTID: ++ printf("not indicated\n"); + break; + default: + printf("unknown\n"); +diff --git a/iecset/iecset.c b/iecset/iecset.c +index a2fe4d1..44c43ab 100644 +--- a/iecset/iecset.c ++++ b/iecset/iecset.c +@@ -58,7 +58,7 @@ static struct cmdtbl cmds[] = { + { "aud", IDX_NOAUDIO, CMD_BOOL_INV, + "audio (common)\n\ton = audio mode, off = non-audio mode" }, + { "rat", IDX_RATE, CMD_INT, +- "rate (common)\n\tsample rate in Hz" }, ++ "rate (common)\n\tsample rate in Hz (0 = not indicated)" }, + { "emp", IDX_EMP, CMD_INT, + "emphasis (common)\n\t0 = none, 1 = 50/15us, 2 = CCITT" }, + { "loc", IDX_UNLOCK, CMD_BOOL_INV, +@@ -194,14 +194,38 @@ static int update_iec958_status(snd_aes_iec958_t *iec958, int *parms) + } else { + iec958->status[3] &= ~IEC958_AES3_CON_FS; + switch (parms[IDX_RATE]) { ++ case 22050: ++ iec958->status[3] |= IEC958_AES3_CON_FS_22050; ++ break; ++ case 24000: ++ iec958->status[3] |= IEC958_AES3_CON_FS_24000; ++ break; ++ case 32000: ++ iec958->status[3] |= IEC958_AES3_CON_FS_32000; ++ break; + case 44100: + iec958->status[3] |= IEC958_AES3_CON_FS_44100; + break; + case 48000: + iec958->status[3] |= IEC958_AES3_CON_FS_48000; + break; +- case 32000: +- iec958->status[3] |= IEC958_AES3_CON_FS_32000; ++ case 88200: ++ iec958->status[3] |= IEC958_AES3_CON_FS_88200;; ++ break; ++ case 96000: ++ iec958->status[3] |= IEC958_AES3_CON_FS_96000; ++ break; ++ case 176400: ++ iec958->status[3] |= IEC958_AES3_CON_FS_176400; ++ break; ++ case 192000: ++ iec958->status[3] |= IEC958_AES3_CON_FS_192000; ++ break; ++ case 768000: ++ iec958->status[3] |= IEC958_AES3_CON_FS_768000; ++ break; ++ default: ++ iec958->status[3] |= IEC958_AES3_CON_FS_NOTID; + break; + } + } +diff --git a/speaker-test/speaker-test.c b/speaker-test/speaker-test.c +index 22d13bf..57a7cbc 100644 +--- a/speaker-test/speaker-test.c ++++ b/speaker-test/speaker-test.c +@@ -81,7 +81,7 @@ static pink_noise_t pink; + static snd_pcm_uframes_t buffer_size; + static snd_pcm_uframes_t period_size; + static const char *given_test_wav_file = NULL; +-static char *wav_file_dir = DATADIR; ++static char *wav_file_dir = SOUNDSDIR; + + static const char *channel_name[MAX_CHANNELS] = { + N_("Front Left"), diff --git a/sys-kernel/zendisk-sources/Manifest b/sys-kernel/zendisk-sources/Manifest index b6889b1..83e10bf 100644 --- a/sys-kernel/zendisk-sources/Manifest +++ b/sys-kernel/zendisk-sources/Manifest @@ -1,9 +1,12 @@ DIST 2.6.27-rc2-zendisk1.patch.lzma 15507 RMD160 b8fa785a5d17b30d4216251a4ad20acbeff268a0 SHA1 f9216cba187ffb4d8c0fc0a5532ac3df764da1f8 SHA256 bb595cb6b8b13fe63e9597464b4c508799101f1a8351468ed9748596b8bc3a31 DIST 2.6.27-rc2-zendisk2.patch.lzma 215144 RMD160 789e7023054529c445f30af256d304e8f47bf2af SHA1 fece876157eb8337b9f544d2eb0af78db2b0985e SHA256 30195cbc3787ade1edc00e8cb6ff59cae4548630bc388fe13b18f8c03148fc2c DIST 2.6.27-rc2-zendisk3.patch.lzma 1009237 RMD160 4470aa118637c6447ee7fd10244fcbafc6e2f64f SHA1 3030e6d4d2992365c55d5088a79bab3f5d48d9bf SHA256 013366e1d60483c519fe440b494742e9156977d0b097db3d2b623ec91652c684 +DIST 2.6.27-rc3-zendisk1.patch.lzma 390641 RMD160 7cd3d7e7d63266ccb8913c8436842592f1105ec7 SHA1 8c8831433d633c9081fa1a5ce21abeccf5c43839 SHA256 2c7bdf9662c752cdb02ef0173b3be645644a79f22376bc64a9062845d1f52f40 DIST linux-2.6.26.tar.bz2 49441874 RMD160 57c37e81afa48e7c05e1a933d390a12ac2921255 SHA1 3f44384bf84f27add3b6c43ec68f974d7f7e9c67 SHA256 666488e2511393fdb901eaf1e67275bcc38ab37c930e8a9adb290a95c1721a2a DIST patch-2.6.27-rc2.bz2 11773942 RMD160 00334ab07bd986768430f0a3bbd063d28abd0363 SHA1 20ae203875f652ebd7b3a22bfc910d20726e69b0 SHA256 0d8f76dc2d6648a4a36c8ec6124347360315af7b1376f2ad2d1baf092902c79b +DIST patch-2.6.27-rc3.bz2 13125549 RMD160 7c85eae9c559b50cddff197f4860667c77e47472 SHA1 9726c7ee82ecdd54e0082ee757d5971d59e7b0f9 SHA256 ec95b8afaeaf3c07a2f36db2d9535e552aa0d173a1ccf6e86bc7b18977a80474 EBUILD zendisk-sources-2.6.27_rc2-r10.ebuild 156 RMD160 68849a145e005f133fe37395474d0d761d2ea6ad SHA1 13e7783459cb635ee29fbc4e6226b6b404416876 SHA256 01c2ae86b140ad41f70636a4096fd81cda04955192fc902d2c0fe768e1ecde52 EBUILD zendisk-sources-2.6.27_rc2-r20.ebuild 156 RMD160 68849a145e005f133fe37395474d0d761d2ea6ad SHA1 13e7783459cb635ee29fbc4e6226b6b404416876 SHA256 01c2ae86b140ad41f70636a4096fd81cda04955192fc902d2c0fe768e1ecde52 EBUILD zendisk-sources-2.6.27_rc2-r30.ebuild 156 RMD160 68849a145e005f133fe37395474d0d761d2ea6ad SHA1 13e7783459cb635ee29fbc4e6226b6b404416876 SHA256 01c2ae86b140ad41f70636a4096fd81cda04955192fc902d2c0fe768e1ecde52 +EBUILD zendisk-sources-2.6.27_rc3-r10.ebuild 156 RMD160 68849a145e005f133fe37395474d0d761d2ea6ad SHA1 13e7783459cb635ee29fbc4e6226b6b404416876 SHA256 01c2ae86b140ad41f70636a4096fd81cda04955192fc902d2c0fe768e1ecde52 MISC metadata.xml 481 RMD160 f0436c1ce408a06debbb46bd09ffd0b238e4c77b SHA1 357d49500131e91c66fc9b4dd3dfb2db3507712b SHA256 5e2e57871dcc72676b54759509f6ca6aeb95e8205a747e759a19107503c3af40 diff --git a/sys-kernel/zendisk-sources/zendisk-sources-2.6.27_rc3-r10.ebuild b/sys-kernel/zendisk-sources/zendisk-sources-2.6.27_rc3-r10.ebuild new file mode 100644 index 0000000..e037ec5 --- /dev/null +++ b/sys-kernel/zendisk-sources/zendisk-sources-2.6.27_rc3-r10.ebuild @@ -0,0 +1,6 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit zen-sources +detect_version -- 2.11.4.GIT