? .Makefile.swp Index: Makefile =================================================================== RCS file: /home/pcvs/ports/audio/aureal-kmod/Makefile,v retrieving revision 1.31 diff -u -r1.31 Makefile --- Makefile 29 Jun 2007 09:16:35 -0000 1.31 +++ Makefile 1 Jun 2008 05:01:41 -0000 @@ -7,7 +7,7 @@ PORTNAME= aureal-kmod PORTVERSION= 1.5 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= audio kld MASTER_SITES= http://www.matey.org/au88x0/ DISTNAME= au88x0-${PORTVERSION}_${DISTREVISION} @@ -22,9 +22,11 @@ STRAYFILES= au88x0.h au88x0.c asp10.o asp20.o asp30.o DISTREVISION= 4 -WRKSRC= ${WRKDIR} +USE_RC_SUBR= aureal +SUB_FILES= pkg-message +SUB_LIST= RC_SUBR_SUFFIX=${RC_SUBR_SUFFIX} -PKGMESSAGE= ${WRKSRC}/.MESSAGE +WRKSRC= ${WRKDIR} MAKE_ENV= WRKSRC="${WRKSRC}" @@ -51,14 +53,9 @@ .endfor pre-install: - @${SED} 's|%%PREFIX%%|${PREFIX}|g' ${PKGDIR}/pkg-message > \ - ${PKGMESSAGE} - @${SED} 's|%%PREFIX%%|${PREFIX}|g' ${FILESDIR}/aureal.sh > \ - ${WRKDIR}/aureal.sh.sample ${MKDIR} ${PREFIX}/lib/au88x0 post-install: - @${INSTALL_SCRIPT} ${WRKDIR}/aureal.sh.sample ${PREFIX}/etc/rc.d @${CAT} ${PKGMESSAGE} .include Index: pkg-message =================================================================== RCS file: pkg-message diff -N pkg-message --- pkg-message 20 May 2003 04:45:10 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,38 +0,0 @@ -------------------------------------------------------------------------------- -IMPORTANT! MAKE SURE TO READ THE FOLLOWING! - -To use the driver, make a copy of %%PREFIX%%/etc/rc.d/aureal.sh.sample under -%%PREFIX%%/etc/rc.d/aureal.sh and do: chmod +x %%PREFIX%%/etc/rc.d/aureal.sh. - -To load the driver run (as root): - -# %%PREFIX%%/etc/rc.d/aureal.sh start - -To unload it: - -# %%PREFIX%%/etc/rc.d/aureal.sh stop - -It'll also load the driver automatically when the system is started. - -In case it fails to detect the type of your Vortex soundcard correctly, -edit this script and set "CARD=" to 88X0 where X is 1, 2 or 3 depending -on which Aureal chipset you have - au8810 (Vortex Advantage), au8820 -(Vortex 1) or au8830 (Vortex 2) correspondingly. - -If your system is based on a Via Apollo KX133 chipset, your computer will -most likely lock up soon after playback is started. This is a known issue. -Make sure to uncomment "VIAKX133FIX=yes" in aureal.sh start-up script. - -Please note that you also need to have a `snd_pcm.ko' module either already -loaded or placed into appropriate location for modules on your system (default -is /modules/ on 4-STABLE and /boot/kernel/ on 5-CURRENT). You can compile and -install snd_pcm by doing: - -# cd /sys/modules/sound/pcm/ && make all install - -Report problems to Alexander Matey . - -Thanks and enjoy! - --Maxim -------------------------------------------------------------------------------- Index: files/aureal.in =================================================================== RCS file: files/aureal.in diff -N files/aureal.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/aureal.in 1 Jun 2008 05:01:41 -0000 @@ -0,0 +1,96 @@ +#!/bin/sh + +# PROVIDE: aureal +# BEFORE: hald +# KEYWORD: nojail +# +# Add the following line to /etc/rc.conf[.local] to enable aureal +# +# aureal_enable="YES" +# +# By default the script automatically detects the right kernel module +# to load, if this fails, you can set "aureal_card" to the right value. +# Possible values are 8810, 8820, and 8830. +# +# If your AMD Athlon system is based on a VIA Apollo KX133 motherboard +# chipset, your system will most certainly lock up shortly after +# you start a playback. To work around this issue please add this following +# line to /etc/rc.conf[.local]: +# +# aureal_viakx133fix="YES" +# + +. %%RC_SUBR%% + +name="aureal" +rcvar=${name}_enable + +start_cmd="aureal_start" +stop_cmd="aureal_stop" + +load_rc_config $name + +: ${aureal_enable="NO"} +: ${aureal_card=""} +: ${aureal_viakx133fix="NO"} + +aureal_detect() +{ + PCICONF="/usr/sbin/pciconf" + if [ -z "${aureal_card}" -a -x ${PCICONF} ]; then + if [ "`${PCICONF} -l 2>&- | grep 0x000312eb`" ]; then + aureal_card=8810 + elif [ "`${PCICONF} -l 2>&- | grep 0x000112eb`" ]; then + aureal_card=8820 + elif [ "`${PCICONF} -l 2>&- | grep 0x000212eb`" ]; then + aureal_card=8830 + fi + fi + + if [ -z "${aureal_card}" ]; then + err 1 "Unable to determine your Aureal car type - override it by aureal_card rc variable" + fi + + PREFIX=%%PREFIX%% + LIBDIR=${PREFIX}/lib/au88x0 + DRIVERFILE=snd_au${aureal_card} +} + +aureal_start() +{ + aureal_detect + if [ ! -f ${LIBDIR}/${DRIVERFILE}.ko ]; then + err 64 "${LIBDIR}/${DRIVERFILE} for ${aureal_card} not found!" + fi + if ! kldstat -qm ${DRIVERFILE}; then + if ! kldload ${LIBDIR}/${DRIVERFILE}.ko; then + warn 'aureal module failed to load' + return 1 + fi + fi + + if checkyesno aureal_viakx133fix; then + pcisel=`${PCICONF} -l 2>&- | grep ^pcm0 | awk -F: '{ gsub("^[^@]*@", ""); print $1":"$2":"$3 }'` + if [ -z "$pcisel" ]; then + warn "Soundcard PCI selector undetermined. Unable to install VIA KX133 workaround. Starting a playback will likely to lock-up your system!" + return 0 + fi + + oldvalue=`${PCICONF} -r -b $pcisel 0x40 2>&- | sed 's/ *$//'` + ${PCICONF} -w -b $pcisel 0x40 0xff + newvalue=`${PCICONF} -r -b $pcisel 0x40 2>&- | sed 's/ *$//'` + info "with VIA KX133 workaround: ${pcisel},0x40: ${oldvalue} -> ${newvalue}" + fi + + return 0 +} + +aureal_stop() +{ + aureal_detect + kldstat -qm ${DRIVERFILE} && kldunload ${DRIVERFILE} + + return 0 +} + +run_rc_command "$1" Index: files/aureal.sh =================================================================== RCS file: files/aureal.sh diff -N files/aureal.sh --- files/aureal.sh 15 May 2002 18:16:23 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,82 +0,0 @@ -#!/bin/sh -#--------------------------------------------------------------------- -# -# I. Auto-detection of your Aureal Vortex sound card -# -# If for some reason this script fails to guess the type of your -# Aureal card correctly, you can manually override it here. -# Set this to 8810 (Vortex Advantage), 8820 (Vortex 1) or 8830 -# (Vortex 2): -# -#CARD=8830 -# -# II. VIA Apollo KX133 lock-up issue workaround -# -# If your AMD Athlon system is based on a VIA Apollo KX133 motherboard -# chipset, your system will most certainly lock up shortly after -# you start a playback. To work around this issue please uncomment -# this line: -# -#VIAKX133FIX=yes -#--------------------------------------------------------------------- - -PCICONF="/usr/sbin/pciconf" - -if [ -z "${CARD}" -a -x ${PCICONF} ]; then - if [ "`${PCICONF} -l 2>&- | grep 0x000312eb`" ]; then - CARD=8810 - elif [ "`${PCICONF} -l 2>&- | grep 0x000112eb`" ]; then - CARD=8820 - elif [ "`${PCICONF} -l 2>&- | grep 0x000212eb`" ]; then - CARD=8830 - fi -fi - -if [ -z "${CARD}" ]; then - echo "Unable to determine your Aureal card type -" \ - "override it manually in $0" >&2 - exit 255 -fi - -PREFIX=%%PREFIX%% -LIBDIR=${PREFIX}/lib/au88x0 -DRIVERFILE=snd_au${CARD}.ko - -case "$1" in - start) - if [ ! -f ${LIBDIR}/${DRIVERFILE} ]; then - echo "" - echo "${LIBDIR}/${DRIVERFILE} for ${CARD} not found!" - echo "" - exit 64 - fi - /sbin/kldload ${LIBDIR}/${DRIVERFILE} - - echo -n " aureal-kmod" - - # Increase PCI timeout for broken VIA Apollo KX133 chipsets - # NOTE: This assumes your Aureal card is the pcm0 device - if [ "$VIAKX133FIX" ]; then - pcisel=`${PCICONF} -l 2>&- | grep ^pcm0 | awk -F: '{ gsub("^[^@]*@", ""); print $1":"$2":"$3 }'` - if [ -z "$pcisel" ]; then - echo " (WARNING: Soundcard PCI selector undetermined. Unable to install VIA KX133 workaround. Starting a playback will likely to lock-up your system!)" - exit 64 - fi - oldvalue=`${PCICONF} -r -b $pcisel 0x40 2>&- | sed 's/ *$//'` - echo -n " (with VIA KX133 workaround: ${pcisel},0x40: ${oldvalue} -> " - ${PCICONF} -w -b $pcisel 0x40 0xff - echo -n "`${PCICONF} -r -b $pcisel 0x40 2>&- | sed 's/ *$//'`)" - fi - ;; - stop) - /sbin/kldunload ${DRIVERFILE} - echo -n " aureal-kmod" - ;; - *) - echo "" - echo "Usage: `basename $0` { start | stop }" - echo "" - exit 64 - ;; -esac - Index: files/pkg-message.in =================================================================== RCS file: files/pkg-message.in diff -N files/pkg-message.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/pkg-message.in 1 Jun 2008 05:01:41 -0000 @@ -0,0 +1,37 @@ +------------------------------------------------------------------------------- +IMPORTANT! MAKE SURE TO READ THE FOLLOWING! + +To use this driver, put the following line in /etc/rc.conf + +aureal_enable="YES" + +To load the driver run (as root): + +%%PREFIX%%/etc/rc.d/aureal%%RC_SUBR_SUFFIX%% start + +To unload it: + +%%PREFIX%%/etc/rc.d/aureal%%RC_SUBR_SUFFIX%% stop + +It'll also load the driver automatically when the system is started. + +In case it fails to detect the type of your Vortex soundcard correctly, +set the 'aureal_card' variable in your /etc/rc.conf to either 8810, 8820, +or 8830 depending on which Aureal chipset you have. + +If your system is based on a Via Apollo KX133 chipset, your computer will +most likely lock up soon after playback is started. This is a known issue. +Make sure you put + +aureal_viakx133fix="YES" + +in your /etc/rc.conf. + +Please note that you also need to have the 'sound.ko' moduld loaded already. + +Report problems to Alexander Matey . + +Thanks and enjoy! + +-Maxim +-------------------------------------------------------------------------------