Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Nov 1997 10:08:17 +0100 (MET)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        pst@Shockwave.COM (Paul Traina)
Cc:        multimedia@FreeBSD.ORG
Subject:   Re: -current change to Luigi's driver?
Message-ID:  <199711040908.KAA19760@labinfo.iet.unipi.it>
In-Reply-To: <199711040923.BAA00258@precipice.shockwave.com> from "Paul Traina" at Nov 4, 97 01:23:28 am

next in thread | previous in thread | raw e-mail | index | archive | help
> 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: <CS4237> 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/
_____________________________|______________________________________



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