From owner-freebsd-multimedia Tue Nov 4 02:20:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id CAA01472 for multimedia-outgoing; Tue, 4 Nov 1997 02:20:52 -0800 (PST) (envelope-from owner-freebsd-multimedia) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id CAA01462 for ; Tue, 4 Nov 1997 02:20:40 -0800 (PST) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id KAA19760; Tue, 4 Nov 1997 10:08:18 +0100 From: Luigi Rizzo Message-Id: <199711040908.KAA19760@labinfo.iet.unipi.it> Subject: Re: -current change to Luigi's driver? To: pst@Shockwave.COM (Paul Traina) Date: Tue, 4 Nov 1997 10:08:17 +0100 (MET) Cc: multimedia@FreeBSD.ORG In-Reply-To: <199711040923.BAA00258@precipice.shockwave.com> from "Paul Traina" at Nov 4, 97 01:23:28 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-multimedia@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > I'm confused about proper configuration of a CS4237 based PnP device. > I'm running -current as of today. > The relevant bits of my config are: > > controller pnp0 > devicepcm0 at isa? port ? tty irq 11 drq 1 flags 0x3 vector pcmintr Not correct. If you have a secondary dma channel for a non PnP device, you need "flags 0x13". But since you have a PnP device all the parameters are ignored except "vector pcmintr" ... > This seemed to work a week or so ago. the previous code was over one month old and it used the same principle -- the only difference might be that there was no check and your device was attached twice, as both pcm1 and pcm0. > I personally think the sound code should be configured with: > > controller pnp0 > device pcm0 at isa? vector pcmintr > > but that option was not suggested in the text. it is probably ok, however I am a bit uncertain if the "vector" field is used properly when there is no "irq" field. Plus, you need full parameters for non PnP devices, so i went for the safe way and suggested filling all fields. > /dev/sndstat reads: > > FreeBSD Audio Driver (971023) Nov 3 1997 22:48:58 > Installed devices: > pcm1: at 0x530 irq 5 dma 1:3 > > What should I be doing to get the device to show up as pcm0? There is no support for this right now. Once again: PnP devices are probed and attached before non-PnP devices. When you put "device pcm0 ..." in your config file it means that you want unit 0 reserved for a non-PnP device, so PnP device must start from the next available unit. This is exactly the same thing that is done for drivers which support both non-PnP and other (e.g. PCI) devices, such as the "ed" driver. The possible alternatives are: 1. use low numbers for PnP devices, and the next ones for non-PnP ones. This would cause no problems since it is rare that somebody has more than one sound card installed (I at times use three but only for testing purposes...). Maybe this is something to be pursued but realize that it is different from what has been done for PCI and I find it confusing to adopt two radically different strategies in the kernel. 2. change the order of probe-attach so that all probes are done first, then all attach. This however might require some massive checks in drivers to make sure that they still work and do not expect an attach right after the probe (and I suspect many do). 3. change unit numbers after attaching all devices to pack them starting from 0. This can be confusing since you might see in your dmesg.boot things like: pcm1 attached... ... pcm0 not found ... pcm1 now becomes pcm0 4. make the same device appear as both unit 0 and unit 1. I don't even want to think about this... If there is some agreement about one of the above -- or some other alternative, let me know and I will be glad to implement the relevant parts in the audio driver, provided the rest of the kernel is aligned to use the same conventions. Until then I will stick with what is done for ISA/PCI device drivers. Cheers Luigi -----------------------------+-------------------------------------- Luigi Rizzo | Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it | Universita' di Pisa tel: +39-50-568533 | via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 | http://www.iet.unipi.it/~luigi/ _____________________________|______________________________________