#!/bin/sh # Frank Schlaefendorf # erstellt am 12.02.2005 # letzte Aenderung am 22.02.2005 # ################### ESD-Einstellungen ##################### # sollen die sounds mit 16bit tiefe abgespielt werden? (achtung performance!) SOUND16BIT=no # sollen die sounds mit 11k, 22k oder 44kbit abgespielt werden? (achtung performance!) SAMPLERATE=22 # soll der sound daemon als sound-server fungieren? (achtung performance!) SOUNDSERVER=no # auf welchem port soll er lauschen z.B. 16001 (xmms) SERVERPORT=5001 # soll er auch tcp-zugriffe von entfernten rechnern zulassen REMOTESERVER=yes ################### SOUND-SYSTEM-BIOS-EINSTELLUNGEN ######### CONTROLIOADRESS=370 WSSIOADRESS=530 IRQLEVEL=5 WSSDMA=1 SBProDMA=0 ################################################################# ### prozeduren # defaultwerte SOUNDSAM="" SOUNDBIT="" set_optionen(){ FEHLER=0 # einstellen der control adresse, die steht fest auf 0x370 CONTROLIOADRESS=0x370 # einstellen der wss-io-adresse, wahlweise 530,540,550,560 case $WSSIOADRESS in 530|540|550|560) WSSIOADRESS="0x${WSSIOADRESS}" ;; *) FEHLER=1 echo "Die WSS I/O Adresse $WSSIOADRESS ist unbekannt" ;; esac # einstellen des irq-level, wahlweise 5,7,9,11,15 case $IRQLEVEL in 5|7|9|11|15) IRQLEVEL=$IRQLEVEL ;; *) FEHLER=2 echo "Der IRQ ${IRQLEVEL} ist unbekannt" ;; esac case $WSSDMA in 0|1|3) WSSDMA=$WSSDMA ;; *) FEHLER=3 echo "Der DMA-Kanal ${WSSDMA} ist unbekannt" ;; esac case $SBProDMA in 0|1|3) SBProDMA=$SBProDMA ;; *) FEHLER=3 echo "Der DMA-Kanal ${SBProDMA} ist unbekannt" ;; esac if [ "$WSSDMA" == "$SBProDMA" ]; then echo "Die DMA-Kanaele fuer SBPRO und WSS sind gleich, dadurch kann es zu konflikten kommen" fi if [ "$SOUND16BIT" == "yes" ]; then SOUNDBIT="" else SOUNDBIT="-b" fi if [ "$SOUNDSERVER" == "yes" ]; then SOUNDSERVER=" -promiscuous -tcp" if [ "$REMOTESERVER" == "yes" ]; then SOUNDSERVER="$SOUNDSERVER -public" fi if [ "$SERVERPORT" != "" ]; then SOUNDSERVER="$SOUNDSERVER -port $SERVERPORT" else SOUNDSERVER="$SOUNDSERVER -port 16001" fi else SOUNDSERVER="" fi case $SAMPLERATE in 11) SOUNDSAM=11025 ;; 22) SOUNDSAM=22050 ;; 44) SOUNDSAM=44100 ;; *) SOUNDSAM=22050 ;; esac } case $1 in start) if [ -x /usr/bin/esd ]; then set_optionen /sbin/modprobe opl3sa2 io=${CONTROLIOADRESS} mss_io=${WSSIOADRESS} irq=${IRQLEVEL} dma=${WSSDMA} dma2=${SBProDMA} /usr/local/bin/esd ${SOUNDBIT} -r ${SOUNDSAM} ${SOUNDSERVER} 2>&1 > /dev/null & aumix -w 95,95 fi ;; local) if [ -x /usr/bin/esd ]; then set_optionen /sbin/modprobe opl3sa2 io=${CONTROLIOADRESS} mss_io=${WSSIOADRESS} irq=${IRQLEVEL} dma=${WSSDMA} dma2=${SBProDMA} /usr/local/bin/esd ${SOUNDBIT} -r ${SOUNDSAM} 2>&1 > /dev/null & aumix -w 95,95 fi ;; stop) killall esd sleep 1 /sbin/rmmod opl3sa2 /sbin/rmmod ad1848 /sbin/rmmod mpu401 /sbin/rmmod sound /sbin/rmmod soundcore ;; restart) $0 stop && sleep 3 && $0 start ;; *) echo "Benutze /etc/rc.d/rc.sound start|local|stop|restart" ;; esac