From owner-freebsd-multimedia@FreeBSD.ORG Wed Jul 27 09:16:27 2005 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E23616A420 for ; Wed, 27 Jul 2005 09:16:27 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from mailout11.sul.t-online.com (mailout11.sul.t-online.com [194.25.134.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8737643D68 for ; Wed, 27 Jul 2005 09:16:26 +0000 (GMT) (envelope-from Alexander@Leidinger.net) Received: from fwd23.aul.t-online.de by mailout11.sul.t-online.com with smtp id 1Dxhw8-0003nb-00; Wed, 27 Jul 2005 11:10:48 +0200 Received: from Andro-Beta.Leidinger.net (XZrTowZGgelGqLCNyajVlPHpl4xd212MrvnzicQrwX90HTaHujaqgy@[84.165.204.126]) by fwd23.sul.t-online.de with esmtp id 1Dxhvq-0qxZ0C0; Wed, 27 Jul 2005 11:10:30 +0200 Received: from localhost (localhost [127.0.0.1]) by Andro-Beta.Leidinger.net (8.13.3/8.13.3) with ESMTP id j6R9AQCv025543; Wed, 27 Jul 2005 11:10:26 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from 141.113.101.31 ([141.113.101.31]) by netchild.homeip.net (Horde MIME library) with HTTP for ; Wed, 27 Jul 2005 11:10:26 +0200 Message-ID: <20050727111026.hatkyjuweko8co48@netchild.homeip.net> X-Priority: 3 (Normal) Date: Wed, 27 Jul 2005 11:10:26 +0200 From: Alexander Leidinger To: Yuka Muromachi References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0.3) / FreeBSD-4.11 X-ID: XZrTowZGgelGqLCNyajVlPHpl4xd212MrvnzicQrwX90HTaHujaqgy@t-dialin.net X-TOI-MSGID: 7fd51f10-b9ce-4e13-8405-b967a33867c3 Cc: freebsd-multimedia@freebsd.org Subject: Re: The device name X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2005 09:16:27 -0000 Yuka Muromachi 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"