From owner-freebsd-hackers Mon Dec 30 11:13:03 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id LAA11899 for hackers-outgoing; Mon, 30 Dec 1996 11:13:03 -0800 (PST) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id LAA11884 for ; Mon, 30 Dec 1996 11:12:58 -0800 (PST) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id TAA04898; Mon, 30 Dec 1996 19:51:28 +0100 Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id TAA11805; Mon, 30 Dec 1996 19:51:27 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.8.4/8.6.9) id TAA09551; Mon, 30 Dec 1996 19:40:09 +0100 (MET) From: J Wunsch Message-Id: <199612301840.TAA09551@uriah.heep.sax.de> Subject: Re: DEVFS strangeness To: freebsd-hackers@freebsd.org (FreeBSD hackers) Date: Mon, 30 Dec 1996 19:40:09 +0100 (MET) Cc: randy@zyzzyva.com (Randy Terbush) Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199612291900.NAA18516@sierra.zyzzyva.com> from Randy Terbush at "Dec 29, 96 01:00:05 pm" X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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. ;-)