Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Dec 1996 19:40:09 +0100 (MET)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        freebsd-hackers@freebsd.org (FreeBSD hackers)
Cc:        randy@zyzzyva.com (Randy Terbush)
Subject:   Re: DEVFS strangeness
Message-ID:  <199612301840.TAA09551@uriah.heep.sax.de>
In-Reply-To: <199612291900.NAA18516@sierra.zyzzyva.com> from Randy Terbush at "Dec 29, 96 01:00:05 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
As Randy Terbush wrote:

> Seems that sound devices are being created as follows.
> 
> crw-rw----  1 root   games      30,  68 Dec 19 08:49 /dev/audio4

> # Sounds support
> controller snd0
> device      gus0    at isa? port 0x220 irq 12 drq 1 vector gusintr
> 
> #> cat /usr/local/lib/sound/sounds/clink.au > /dev/audio4
> su: /dev/audio4: Device not configured
> 
> Is this a known deficiency of the DEVFS?

No, it's a known (now that you mention it :) deficiency of the sound
driver.  A quick glance over the source yields:


static int
sndattach (struct isa_device *dev)
{
  int             unit;
...

  unit = driver_to_voxunit(dev->id_driver);
...

#ifdef DEVFS
/* XXX */ /* find out where to store the tokens.. */
/* XXX */ /* should only create devices if that card has them */
#define SND_UID 0
#define SND_GID 13

    snd_devfs_token[unit]=
                devfs_add_devswf(&snd_cdevsw, (unit << 4)+SND_DEV_CTL, DV_CHR, 
                                               ^^^^
                                 SND_UID,  SND_GID, 0660, "mixer%d", unit);
                                                                ^^   ^^^^

However:

static int
driver_to_voxunit(struct isa_driver *driver)
{
  /* converts a sound driver pointer into the equivalent
     VoxWare device unit number */
  if(driver == &opldriver)
    return(SNDCARD_ADLIB);
  else if(driver == &sbdriver)
    return(SNDCARD_SB);
  else if(driver == &pasdriver)
    return(SNDCARD_PAS);
etc. pp....

So this driver seems to have to very different ideas of what a `unit'
might be.  If it would really use the term `unit' consistently in the
above sense, it should recognize it always as being unit 4.  Probably,
the unit # in the DEVFS sense can only be 0 at all for this driver,
however.

I think this idea of a unit # is a gross abuse... If i read this
correctly, it would never be possible to put two identical soundcards
into the same machine (on different hardware addresses and interrupt
vectors, i mean)?

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199612301840.TAA09551>