The device name

Alexander Leidinger Alexander at
Wed Jul 27 09:16:27 GMT 2005

Yuka Muromachi <yuka.muromachi at> wrote:

> I'm trying to written Azalia (HD Audio) support for freebsd now.


> The controller part is working, I'm trying to add codec support now.
> There is a question:
> most sound device attach function will call those two line to create
> /dev/audio* , /dev/dsp*, /dev/dspW* and /dev/dspr*:
> pcm_addchan(dev, PCMDIR_REC, &ad1816chan_class, ad1816);
> pcm_addchan(dev, PCMDIR_PLAY, &ad1816chan_class, ad1816);
> pcm_addchan() will call pcm_chn_add()
> But, I do not understand, why direction = PCMDIR_REC
> will still create one more /dev/audio , /dev/dspW, /dev/dspr
> device?

I don't know this code, but from my general understanding each driver needs
to register some capabilities. Here it seems it specifies the capability to
play and record (one channel each). So if the device has more than one
channel you may need to add more than one play or record channel (remember,
I don't know what pcm_addchan() does). After registering the capabilities
the system adds device nodes as needed, e.g. for a full-duplex device it
needs to create 2 devices in this example, since it is able to use 2
channels at the same time (and we're not able to open one device multiple
times by default).

This explanation may be completely wrong, since I don't know the code. And it
doesn't explains how this works when the number of vchans is greater than
zero. But I don't think I'm that far off from reality.


--  Alexander @ PGP ID = B0063FE7     netchild @  : PGP ID = 72077137
The qotc (quote of the con) was Liz's:
	"My brain is paged out to my liver"

More information about the freebsd-multimedia mailing list