From alsa-devel-owner@alsa.jcu.cz  Wed Feb 17 18:41:37 1999
Received: from zaphod.wh9.tu-dresden.de (heinrich@zaphod.wh9.tu-dresden.de [141.76.120.10])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id SAA20294
	for <alsa-devel@alsa.jcu.cz>; Wed, 17 Feb 1999 18:41:26 +0100
Received: (from heinrich@localhost)
	by zaphod.wh9.tu-dresden.de (8.8.8/8.8.8/Debian/GNU) id SAA12296
	for alsa-devel@alsa.jcu.cz; Wed, 17 Feb 1999 18:41:24 +0100
Message-ID: <19990217184124.A12226@zaphod.wh9.tu-dresden.de>
Date: Wed, 17 Feb 1999 18:41:24 +0100
From: Heinrich Langos <heinrich@zaphod.wh9.tu-dresden.de>
To: alsa-devel@alsa.jcu.cz
Subject: ok ok .. here's the attachment I forgot last time :-)
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary=vtzGhvizbBRQ85DL
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list


--vtzGhvizbBRQ85DL
Content-Type: text/plain; charset=us-ascii


Yeah I know....
I would forget my head if it wasn't fixed on my neck :-)

-heinrich


--vtzGhvizbBRQ85DL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="snddevices.in"

#!/bin/sh

MAJOR=@SNDCFG_MAJOR@
MAX_CARDS=4
PERM=660
USER=root
GROUP=audio

function create_device () {
  rm -f $1
  echo -n "Creating $1..."
  mknod -m $PERM $1 c $MAJOR $2
  chown $USER.$GROUP $1
  echo " done"
}

function create_odevices () {
  tmp=0
  tmp1=0
  rm -f $1 $1?
  echo -n "Creating $1?..."
  while [ $tmp1 -lt $MAX_CARDS ]; do
    minor=$[ $2 + $tmp ]
    mknod -m $PERM $1$tmp1 c $MAJOR $minor
    chown $USER.$GROUP $1$tmp1
    tmp=$[ $tmp + 16 ]
    tmp1=$[ $tmp1 + 1 ]
  done
  echo " done"
}

function create_device1 () {
  rm -f $1
  minor=$2
  echo -n "Creating $1..."
  mknod -m $PERM $1 c $MAJOR $minor
  chown $USER.$GROUP $1
  echo " done"
}

function create_devices () {
  tmp=0
  rm -f $1 $1?
  echo -n "Creating $1?..."
  while [ $tmp -lt $MAX_CARDS ]; do
    minor=$[ $2 + $tmp ]
    mknod -m $PERM $1$tmp c $MAJOR $minor
    chown $USER.$GROUP $1$tmp
    tmp=$[ $tmp + 1 ]
  done
  echo " done"
}

function create_devices2 () {
  tmp=0
  rm -f $1 $1?
  echo -n "Creating $1??..."
  while [ $tmp -lt $MAX_CARDS ]; do
    tmp1=0
    while [ $tmp1 -lt $3 ]; do
      minor=$[ $tmp * $3 ]
      minor=$[ $2 + $minor + $tmp1 ]
      mknod -m $PERM $1$tmp$tmp1 c $MAJOR $minor
      chown $USER.$GROUP $1$tmp$tmp1
      tmp1=$[ $tmp1 + 1 ]
    done
    tmp=$[ $tmp + 1 ]
  done
  echo " done"
}

if test "$1" = "-?" || test "$1" = "-h" || test "$1" = "--help"; then
  echo "Usage: snddevices [max]"
  exit
fi

if test "$1" = "max"; then
  DSP_MINOR=19
fi

# OSS (Lite) compatible devices...

if test $MAJOR -eq 14; then
  create_odevices /dev/mixer		0
  create_device /dev/sequencer		1
  create_odevices /dev/midi		2
  create_odevices /dev/dsp		3
  create_odevices /dev/audio		4
  create_device /dev/sndstat		6
  create_device /dev/music		8
  create_odevices /dev/dmmidi		9
  create_odevices /dev/dmfm		10
  create_odevices /dev/adsp		12	# alternate dsp
  create_odevices /dev/amidi		13	# alternate midi
  create_odevices /dev/admmidi		14	# alternate direct midi
  # create symlinks
  ln -svf /dev/mixer0 /dev/mixer
  ln -svf /dev/midi0 /dev/midi
  ln -svf /dev/dsp0 /dev/dsp
  ln -svf /dev/audio0 /dev/audio
  ln -svf /dev/music /dev/sequencer2
  ln -svf /dev/adsp0 /dev/adsp
  ln -svf /dev/amidi0 /dev/amidi
fi

# New devices (obsolete now)...

mv -f /dev/sndstat /dev/1sndstat
rm -f /dev/snd*
mv -f /dev/1sndstat /dev/sndstat
#create_device1	/dev/sndseq		136
#create_devices  /dev/sndcontrol	144
#create_devices2 /dev/sndmixer		152	2
#create_devices2 /dev/sndpcm		168	4
#create_devices2 /dev/sndmidi		200	4
#create_devices	/dev/sndfm		248

# New dynamic sound device filesystem

echo "ALSA dynamic sound device filesystem"
ln -sfv /proc/asound/dev /dev/snd

--vtzGhvizbBRQ85DL--

