Adding patch from recent alsa cvs to fix 7.1 detection on some audigy2 cards. Closes...
authorJeremy Huddleston <eradicator@gentoo.org>
Fri, 26 Nov 2004 06:53:30 +0000 (06:53 +0000)
committerJeremy Huddleston <eradicator@gentoo.org>
Fri, 26 Nov 2004 06:53:30 +0000 (06:53 +0000)
media-sound/alsa-driver/ChangeLog
media-sound/alsa-driver/Manifest
media-sound/alsa-driver/alsa-driver-1.0.7-r1.ebuild
media-sound/alsa-driver/files/alsa-driver-1.0.7-audigy71.patch [new file with mode: 0644]
media-sound/alsa-driver/files/alsa-driver-1.0.7-ioctl32.patch-r1

index b3a14c69253088754d0bbeec4cec74c0469302c8..27beba5aa698af9ad60619ef3fbd3ec20c852170 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for media-sound/alsa-driver
 # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/ChangeLog,v 1.108 2004/11/24 20:16:06 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/ChangeLog,v 1.109 2004/11/26 06:53:30 eradicator Exp $
+
+  25 Nov 2004; Jeremy Huddleston <eradicator@gentoo.org>
+  +files/alsa-driver-1.0.7-audigy71.patch,
+  files/alsa-driver-1.0.7-ioctl32.patch-r1, alsa-driver-1.0.7-r1.ebuild:
+  Adding patch from recent alsa cvs to fix 7.1 detection on some audigy2
+  cards. Closes bug #72433. Also incorporate some kernel-mod fixes thanks to
+  johnm.
 
   24 Nov 2004; Daniel Drake <dsd@gentoo.org> alsa-driver-1.0.7-r1.ebuild,
   alsa-driver-1.0.7.ebuild:
index d8ef74f53dc98f2f677689e17bef62e490cfb97b..ca43df25038d57b335390b7ee9767db8062a3224 100644 (file)
@@ -1,9 +1,9 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-MD5 6b901b5f29ef1645cb26a8f862d44bc2 ChangeLog 18361
+MD5 39a65d28cb0e82e0d0f4b63a3dd7a33a ChangeLog 18694
 MD5 46f88ce4ab65513f63f868e186942482 alsa-driver-1.0.7.ebuild 4128
-MD5 abfe25e62adec6bbaad09fa08636aa1f alsa-driver-1.0.7-r1.ebuild 4239
+MD5 2dd719d4d57268e35516abfe3782dce2 alsa-driver-1.0.7-r1.ebuild 3684
 MD5 d388a1b0706024ddccccc99045b976f9 alsa-driver-0.9.8.ebuild 2341
 MD5 e5de43659b629d1e9f0ee8d3f1864840 alsa-driver-1.0.3.ebuild 3363
 MD5 a1eaeb2ae801daeb712c90c060e922dc metadata.xml 158
@@ -15,8 +15,9 @@ MD5 8c120f7730b91118d0a8148d2deb3a43 files/alsa-driver-0.9.8-au-fix.patch 1267
 MD5 1d70561326ef89e94179634d92782610 files/alsa-driver-1.0.4-devfix.patch 2756
 MD5 08af7cfec9cd33819c62880d6219f3a5 files/alsa-driver-1.0.5-devfix.patch 763
 MD5 034733ce45d34c261a5c9bb74679f77a files/alsa-driver-1.0.7-ioctl32.patch 8684
-MD5 f452ac25eee838c3aba484dfd6055596 files/alsa-driver-1.0.7-ioctl32.patch-r1 31053
+MD5 f44df0defb4d16e703eb8b3aafb097f8 files/alsa-driver-1.0.7-ioctl32.patch-r1 32006
 MD5 479ee887025f4ce7944adee1e4a6fdf3 files/digest-alsa-driver-1.0.7-r1 71
+MD5 831a1a1097613c2444cc3e512ff09a01 files/alsa-driver-1.0.7-audigy71.patch 643
 MD5 439dab13c036317c9b308b234ecf7290 files/digest-alsa-driver-0.9.8 71
 MD5 e1b13905eac70fe728dcb85fcaac27a9 files/digest-alsa-driver-1.0.6a 72
 MD5 938a2ee36c54416322d1acd47b249c99 files/digest-alsa-driver-1.0.3 71
@@ -29,7 +30,7 @@ MD5 8bb31a005a1db2e306c51d017fd44e70 files/alsa-driver-1.0.5a-xbox-ac97.patch 72
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.6 (GNU/Linux)
 
-iD8DBQFBpOwRArHZZzCEUG0RAivWAJ96ZS5S+MP42SGV7QgULlXB3xV74wCcCz6A
-26QWuq89l04FpukOe5cNuaw=
-=I67U
+iD8DBQFBptMsArHZZzCEUG0RApFmAJ9EjMas5hivRAMAwohbuGZ34vmm3ACeIDof
+pmDQUEMafz0REsXpRXtw04Q=
+=X1TL
 -----END PGP SIGNATURE-----
index 108fca9a716adfd751ae9671097fb35d210835c1..1c4aaf1ca912596e8ebb04f7d86a94ba9eabf2dc 100644 (file)
@@ -1,10 +1,10 @@
 # Copyright 1999-2004 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.7-r1.ebuild,v 1.3 2004/11/24 20:16:06 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/alsa-driver-1.0.7-r1.ebuild,v 1.4 2004/11/26 06:53:30 eradicator Exp $
 
 IUSE="oss doc"
 
-inherit kernel-mod flag-o-matic eutils
+inherit linux-mod flag-o-matic eutils
 
 MY_P=${P/_rc/rc}
 S=${WORKDIR}/${MY_P}
@@ -14,33 +14,22 @@ HOMEPAGE="http://www.alsa-project.org/"
 SRC_URI="mirror://alsaproject/driver/${P}.tar.bz2"
 
 LICENSE="GPL-2 LGPL-2.1"
-SLOT="${KV}"
+SLOT="0"
 #KEYWORDS="~alpha ~amd64 ~ia64 ~mips ~ppc ~sparc ~x86"
-
-#alsa-driver-1.0.7-r1 only has ioctl32 updates over 1.0.7
-#KEYWORDS="~amd64 ~mips ~sparc"
+# ioctl32 update still being worked on
 KEYWORDS="-*"
 
 RDEPEND="virtual/modutils
-        ~media-sound/alsa-headers-${PV}"
+               ~media-sound/alsa-headers-${PV}"
 
 DEPEND="${RDEPEND}
-       sys-devel/patch
-       virtual/linux-sources
-       >=sys-devel/autoconf-2.50
-       sys-apps/debianutils"
+               sys-devel/patch
+               virtual/linux-sources
+               >=sys-devel/autoconf-2.50
+               sys-apps/debianutils"
 
 PROVIDE="virtual/alsa"
 
-# 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
-#
-[ -z "${ALSA_CARDS}" ] && ALSA_CARDS=all
-
 src_unpack() {
        unpack ${A}
 
@@ -48,32 +37,17 @@ src_unpack() {
        epatch ${FILESDIR}/${PN}-1.0.5-devfix.patch
        epatch ${FILESDIR}/${PN}-1.0.5a-cs46xx-passthrough.patch
 
-       if [ "${PROFILE_ARCH}" == "xbox" ]; then
+       [ "${PROFILE_ARCH}" == "xbox" ] && \
                epatch ${FILESDIR}/${PN}-1.0.5a-xbox-ac97.patch
-       fi
-
-       if kernel-mod_is_2_5_kernel || (kernel-mod_is_2_6_kernel && [ ${KV_PATCH} -lt 6 ]); then
-               FULL_KERNEL_PATH="${ROOT}/usr/src/${KV_DIR}"
-
-               if ! [ -d "${FULL_KERNEL_PATH}" ]; then
-                       eerror "An error seems to have occurred.  We looked in ${FULL_KERNEL_PATH} for your kernel sources, but we didn't see them."
-                       die "ALSA driver configuration failure."
-               fi
-
-               einfo "A 2.5 or 2.6 kernel was detected.  We are copying the kernel source tree from"
-               einfo "${FULL_KERNEL_PATH} to ${T}/linux"
-               einfo "because the alsa-driver build process overwrites files in the 2.6.x kernel tree."
-
-               # Copy everything over to our tmp dir...
-               cp -a ${FULL_KERNEL_PATH} ${T}/linux
-       else
-               # SUBDIRS -> M
-               epatch ${FILESDIR}/${PN}-1.0.6a-kbuild.patch
-       fi
+               
+       convert_to_m ${S}/Makefile
 
        # Fix ioctl32 support
        epatch ${FILESDIR}/${P}-ioctl32.patch-r1
 
+       # Fix audigy 7.1 detection on some cards... bug #72433
+       epatch ${FILESDIR}/${P}-audigy71.patch
+
        # Fix order of configure operations so the kernel compiler isn't used
        # for tests.
        epatch ${FILESDIR}/${PN}-1.0.7-configure.patch
@@ -82,34 +56,30 @@ src_unpack() {
 }
 
 src_compile() {
-       # Default ARCH & kernel path to set in compilation and make
-       KER_DIR=${KERNEL_DIR}
-
-       # If we're using a 2.5 or 2.6 kernel, use our copied kernel tree.
-       if [ -d "${T}/linux" ]; then
-               KER_DIR="${T}/linux"
-       fi
+       # Should fix bug #46901
+       is-flag "-malign-double" && filter-flags "-fomit-frame-pointer"
 
        econf `use_with oss` \
-               --with-kernel="${KER_DIR}" \
+               --with-kernel="${KV_DIR}" \
                --with-build="${KER_DIR}" \
                --with-isapnp=yes \
                --with-sequencer=yes \
                --with-cards="${ALSA_CARDS}" || die "econf failed"
 
-       # Should fix bug #46901
-       is-flag "-malign-double" && filter-flags "-fomit-frame-pointer"
-
+       # linux-mod_src_compile doesn't work well with alsa
        unset ARCH
        # -j1 : see bug #71028
        emake -j1 || die "Parallel Make Failed"
-
-       if use doc; then
+       
+       if use doc;
+       then
+               ebegin "Building Documentation"
                cd ${S}/scripts
-               emake || die
+               emake || die Failed making docs in ${S}/scripts
 
                cd ${S}/doc/DocBook
-               emake || die
+               emake || die Failed making docs in ${S}/doc/DocBook
+               eend $?
        fi
 }
 
@@ -141,12 +111,26 @@ src_install() {
        fi
 }
 
-pkg_postinst() {
-       if [ "${ROOT}" = / ]
+pkg_setup() {
+       linux-mod_pkg_setup
+       if [ ! getfilevar_isset ] ;
        then
-               [ -x /usr/sbin/update-modules ] && /usr/sbin/update-modules
+               eerror "Sound support is currently built into the kernel."
+               eerror "unable to continue."
+               die Sound support built into kernel already
        fi
+       
+       # 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
+       #
+       [ -z "${ALSA_CARDS}" ] && ALSA_CARDS=all
+}
 
+pkg_postinst() {
        einfo
        einfo "The alsasound initscript and modules.d/alsa have now moved to alsa-utils"
        einfo
@@ -156,4 +140,6 @@ pkg_postinst() {
        einfo "Version 1.0.3 and above should work with version 2.6 kernels."
        einfo "If you experience problems, please report bugs to http://bugs.gentoo.org."
        einfo
+       
+       linux-mod_pkg_postinst
 }
diff --git a/media-sound/alsa-driver/files/alsa-driver-1.0.7-audigy71.patch b/media-sound/alsa-driver/files/alsa-driver-1.0.7-audigy71.patch
new file mode 100644 (file)
index 0000000..bb69d98
--- /dev/null
@@ -0,0 +1,16 @@
+===================================================================
+RCS file: /cvsroot/alsa/alsa-kernel/pci/emu10k1/emu10k1_main.c,v
+retrieving revision 1.40
+retrieving revision 1.41
+diff -u -r1.40 -r1.41
+--- alsa/alsa-kernel/pci/emu10k1/emu10k1_main.c        2004/11/22 18:45:49     1.40
++++ alsa/alsa-kernel/pci/emu10k1/emu10k1_main.c        2004/11/23 16:39:46     1.41
+@@ -716,7 +716,7 @@
+               emu->no_ac97 = 1;       
+       }
+       
+-      if (emu->revision == 4 && emu->model == 0x2002) {
++      if (emu->revision == 4 && (emu->model == 0x2001 || emu->model == 0x2002)) {
+               /* Audigy 2 ZS */
+               snd_printdd(KERN_INFO "Audigy2 ZS is detected. setting 7.1 mode.\n");
+               emu->spk71 = 1;
index 95e9123a08248dadc463f044f35f27599c4b9582..97a066faab04ee56ddf5c1478e098c930d001b88 100644 (file)
@@ -52,8 +52,32 @@ RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/core/ioctl32/ioctl32.c,v
 retrieving revision 1.27
 diff -u -r1.27 ioctl32.c
 --- alsa-kernel/core/ioctl32/ioctl32.c 18 Oct 2004 14:31:33 -0000      1.27
-+++ alsa-kernel/core/ioctl32/ioctl32.c 23 Nov 2004 14:13:47 -0000
-@@ -93,43 +93,28 @@
++++ alsa-kernel/core/ioctl32/ioctl32.c 24 Nov 2004 13:48:10 -0000
+@@ -30,6 +30,23 @@
+ #include <asm/uaccess.h>
+ #include "ioctl32.h"
+ 
++
++#if defined(CONFIG_SPARC64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 8)
++size_t hack_copy_in_user(void __user *to, const void __user *from, size_t size)
++{
++      char tmp[64];
++      while (size) {
++              size_t s = sizeof(tmp) < size ? sizeof(tmp) : size;
++              if (copy_from_user(tmp, from, s) || copy_to_user(to, tmp, s))
++                      break;
++              size -= s;
++              from += s;
++              to += s;
++      }
++      return size;
++}
++#endif
++
+ /*
+  * register/unregister mappers
+  * exported for other modules
+@@ -93,43 +110,28 @@
        unsigned char reserved[50];
  } /* don't set packed attribute here */;
  
@@ -111,7 +135,7 @@ diff -u -r1.27 ioctl32.c
                return -EFAULT;
        return 0;
  }
-@@ -170,54 +155,57 @@
+@@ -170,54 +172,57 @@
  
  static inline int _snd_ioctl32_ctl_elem_info(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file, unsigned int native_ctl)
  {
@@ -140,8 +164,8 @@ diff -u -r1.27 ioctl32.c
 -      set_fs(KERNEL_DS);
 -      err = file->f_op->ioctl(file->f_dentry->d_inode, file, native_ctl, (unsigned long)&data);
 -      set_fs(oldseg);
-+      if (__copy_in_user(&data->value.enumerated.item,
-+                         &data32->value.enumerated.item, 4))
++      if (copy_in_user(&data->value.enumerated.item,
++                       &data32->value.enumerated.item, 4))
 +              return -EFAULT;
 +      err = file->f_op->ioctl(file->f_dentry->d_inode, file, native_ctl, (unsigned long)data);
        if (err < 0)
@@ -175,9 +199,9 @@ diff -u -r1.27 ioctl32.c
 -              data32.value.integer64.min = data.value.integer64.min;
 -              data32.value.integer64.max = data.value.integer64.max;
 -              data32.value.integer64.step = data.value.integer64.step;
-+              if (__copy_in_user(&data32->value.integer64,
-+                                 &data->value.integer64,
-+                                 sizeof(data->value.integer64)))
++              if (copy_in_user(&data32->value.integer64,
++                               &data->value.integer64,
++                               sizeof(data->value.integer64)))
 +                      return -EFAULT;
                break;
        case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
@@ -185,9 +209,9 @@ diff -u -r1.27 ioctl32.c
 -              data32.value.enumerated.item = data.value.enumerated.item;
 -              memcpy(data32.value.enumerated.name, data.value.enumerated.name,
 -                     sizeof(data.value.enumerated.name));
-+              if (__copy_in_user(&data32->value.enumerated,
-+                                 &data->value.enumerated,
-+                                 sizeof(data->value.enumerated)))
++              if (copy_in_user(&data32->value.enumerated,
++                               &data->value.enumerated,
++                               sizeof(data->value.enumerated)))
 +                      return -EFAULT;
                break;
        default:
@@ -198,7 +222,7 @@ diff -u -r1.27 ioctl32.c
        return 0;
  }
  
-@@ -277,60 +265,85 @@
+@@ -277,60 +282,85 @@
  static inline int _snd_ioctl32_ctl_elem_value(unsigned int fd, unsigned int cmd, unsigned long arg, struct file *file, unsigned int native_ctl)
  {
        struct sndrv_ctl_elem_value *data;
@@ -280,7 +304,7 @@ diff -u -r1.27 ioctl32.c
 +                              goto __end;
 +                      }
 +                      data->value.integer.value[i] = val;
-               }
++              }
 +              break;
 +      case SNDRV_CTL_ELEM_TYPE_INTEGER64:
 +              if (__copy_from_user(data->value.integer64.value,
@@ -296,7 +320,7 @@ diff -u -r1.27 ioctl32.c
 +                                   sizeof(data32->value.enumerated.item))) {
 +                      err = -EFAULT;
 +                      goto __end;
-+              }
+               }
 +              break;
 +      case SNDRV_CTL_ELEM_TYPE_BYTES:
 +              if (__copy_from_user(data->value.bytes.data,
@@ -321,7 +345,7 @@ diff -u -r1.27 ioctl32.c
        }
  
        oldseg = get_fs();
-@@ -340,38 +353,53 @@
+@@ -340,38 +370,53 @@
        if (err < 0)
                goto __end;
        /* restore info to 32bit */
@@ -367,7 +391,7 @@ diff -u -r1.27 ioctl32.c
 +                                 sizeof(data32->value.integer64.value))) {
 +                      err = -EFAULT;
 +                      goto __end;
-+              }
+               }
 +              break;
 +      case SNDRV_CTL_ELEM_TYPE_ENUMERATED:
 +              if (__copy_to_user(data32->value.enumerated.item,
@@ -375,7 +399,7 @@ diff -u -r1.27 ioctl32.c
 +                                 sizeof(data32->value.enumerated.item))) {
 +                      err = -EFAULT;
 +                      goto __end;
-               }
++              }
 +              break;
 +      case SNDRV_CTL_ELEM_TYPE_BYTES:
 +              if (__copy_to_user(data32->value.bytes.data,
@@ -409,7 +433,7 @@ RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/core/ioctl32/ioctl32.h,v
 retrieving revision 1.14
 diff -u -r1.14 ioctl32.h
 --- alsa-kernel/core/ioctl32/ioctl32.h 18 Oct 2004 14:31:33 -0000      1.14
-+++ alsa-kernel/core/ioctl32/ioctl32.h 23 Nov 2004 14:12:15 -0000
++++ alsa-kernel/core/ioctl32/ioctl32.h 24 Nov 2004 13:49:00 -0000
 @@ -28,20 +28,37 @@
  
  #include <linux/compat.h>
@@ -526,6 +550,19 @@ diff -u -r1.14 ioctl32.h
  }
  
  #define DEFINE_ALSA_IOCTL_ENTRY(name,type,native_ctl) \
+@@ -128,4 +99,12 @@
+ int snd_ioctl32_register(struct ioctl32_mapper *mappers);
+ void snd_ioctl32_unregister(struct ioctl32_mapper *mappers);
+ 
++#if defined(CONFIG_SPARC64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 8)
++#ifdef copy_in_user
++#undef copy_in_user
++#endif
++size_t hack_copy_in_user(void __user *to, const void __user *from, size_t size);
++#define copy_in_user hack_copy_in_user
++#endif
++
+ #endif /* __ALSA_IOCTL32_H */
 Index: alsa-kernel/core/ioctl32/pcm32.c
 ===================================================================
 RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/core/ioctl32/pcm32.c,v