---
name: emu10kx
version: 20051021
origin: audio/emu10kx
comment: SBLive!, Audigy, and Audigy2 driver for FreeBSD
arch: freebsd:9:x86:64
www: http://chibis.persons.gfk.ru/audigy/
maintainer: michaels@sdf.lonestar.org
prefix: /usr/local
licenselogic: single
flatsize: 36196
desc: |
  This is a port of the snd_emu10kx sound driver. This driver works for
  SBLive!, Audigy, and Audigy2 based cards.

  This is an alternate driver that you may use instead of the snd_emu10k1
  driver in the FreeBSD kernel.

  This driver was written by Yuriy Tsibizov.

  WWW: http://chibis.persons.gfk.ru/audigy/
categories: [kld, audio]
files:
  /usr/local/etc/rc.d/emuctrl.sh: 024d1ed3fc9db5ad2431b577b9bd3f93752e959c1492f4ba57261a41631f6c83
  /usr/local/man/man8/emuctrl.8.gz: 93f9f2295bc99e1c393a7b984dd55f17b480c71d4a97ee75463f3c8dd91a258e
  /usr/local/sbin/emuctrl: 895c1b10c23f822016af87d680fbab77e98d2d6a61cd7d7bbb26908299878dfa
scripts:
  install: "#!/bin/sh\n\n[ \"$2\" != \"POST-INSTALL\" ] && exit 0\n\n#============================================================\n#
    POST-INSTALL\n#============================================================\nDRIVERNAME=snd_emu10kx\n\n#
    Ask user about installing driver\necho -n \"Do you want to install $DRIVERNAME
    driver and load it on boot time? [y/n]: \"\nread RES\necho\n\nif [ x\"$RES\" =
    x\"y\" ] ; then\n\n# Unload the driver\nkldstat -n $DRIVERNAME > /dev/null 2>&1;
    RESULT=$?\nif [ ${RESULT} -eq 0 ]; then\n\tkldunload -n $DRIVERNAME > /dev/null
    2>&1; RESULT=$?\n\tif [ ${RESULT} -ne 0 ]; then\n\t\techo \"ERROR: Failed to unload
    the $DRIVERNAME module!\"\n\t\techo \"ERROR: Is $DRIVERNAME.ko in use?\"\n\t\texit
    1;\n\tfi\nfi\n\n# Load the driver\nkldload $DRIVERNAME > /dev/null 2>&1 ; RESULT=$?\nif
    [ ${RESULT} -ne 0 ]; then\n\techo \"ERROR: Failed to load the $DRIVERNAME module!\"\n\texit
    1;\nfi\n\n# Have the driver load at boot\ngrep ${DRIVERNAME}_load /boot/loader.conf
    > /dev/null 2>&1; RESULT=$?\nif [ ${RESULT} -eq 0 ]; then\n\t# Present.\n\tsed
    -e \"s/${DRIVERNAME}_load.*/${DRIVERNAME}_load=\\\"YES\\\"/g\" -i.orig /boot/loader.conf\nelse\n\t#
    Not present.\n\techo \"${DRIVERNAME}_load=\\\"YES\\\"\" >> /boot/loader.conf\nfi\n\nfi\n#============================================================\n"
  deinstall: "#!/bin/sh\n\n[ \"$2\" != \"DEINSTALL\" ] && exit 0\n\n#============================================================\n#
    DEINSTALL\n#============================================================\nDRIVERNAME=snd_emu10kx\n\n#
    Unload the driver\nkldstat -n $DRIVERNAME > /dev/null 2>&1; RESULT=$?\nif [ ${RESULT}
    -eq 0 ]; then\n\tkldunload -n $DRIVERNAME > /dev/null 2>&1; RESULT=$?\n\tif [
    ${RESULT} -ne 0 ]; then\n\t\techo \"ERROR: Failed to unload the $DRIVERNAME module!\"\n\t\techo
    \"ERROR: Is $DRIVERNAME.ko in use?\"\n\t\texit 1;\n\tfi\nfi\n\n# Remove the driver\nrm
    /boot/modules/$DRIVERNAME.ko\n\n# Remove the driver from loader.conf\ngrep ${DRIVERNAME}_load
    /boot/loader.conf > /dev/null 2>&1; RESULT=$?\nif [ ${RESULT} -eq 0 ]; then\n\tsed
    -e /${DRIVERNAME}_load.*/d -i.orig /boot/loader.conf\nfi\n\n# Tell the user about
    the state files\nif [ -f /var/db/emu10kx0-state ]; then\necho \"If you will not
    be using this port anymore, please remove \" /var/db/emu10kx[0-9]-state \" manually.\"\nfi\n#============================================================\n"
message: "\nTo use these drivers, make sure that you have loaded the emu10kx kernel\nmodule,
  by doing\n\n\t# kldload snd_emu10kx\n\nor adding\n\n\tsnd_emu10kx_load=\"YES\"\n\nto
  your /boot/loader.conf (normally done automatically when installing\nthe port).\n\nNote
  you should disable loading of the emu10k1 driver (this driver is for\nthe same hardware).\n"
