Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jul 2005 11:10:26 +0200
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        Yuka Muromachi <yuka.muromachi@gmail.com>
Cc:        freebsd-multimedia@freebsd.org
Subject:   Re: The device name
Message-ID:  <20050727111026.hatkyjuweko8co48@netchild.homeip.net>
In-Reply-To: <c5c2798005072606427b22cd1c@mail.gmail.com>
References:  <c5c2798005072606427b22cd1c@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Yuka Muromachi <yuka.muromachi@gmail.com> wrote:

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

Great!

> 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.

Bye,
Alexander.

-- 
http://www.Leidinger.net  Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org     netchild @ FreeBSD.org  : PGP ID = 72077137
The qotc (quote of the con) was Liz's:
	"My brain is paged out to my liver"





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