From: Takashi Iwai Subject: Re: alsa problems Date: Tue, 28 Mar 2006 15:36:24 +0200 Message-ID: References: <1143547835.13615.25.camel@localhost> <1143551506.13615.48.camel@localhost> <1143552082.13615.51.camel@localhost> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mx1.suse.de (ns.suse.de [195.135.220.2]) by alsa.jcu.cz (ALSA's E-mail Delivery System) with ESMTP id E479C19F for ; Tue, 28 Mar 2006 15:36:24 +0200 (MEST) In-Reply-To: <1143552082.13615.51.camel@localhost> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Johannes Berg Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Tue, 28 Mar 2006 15:21:22 +0200, Johannes Berg wrote: > > [1 ] > On Tue, 2006-03-28 at 15:16 +0200, Takashi Iwai wrote: > > > Why do you need to register the device before creating instances? > > It means that apps are allowed to access the driver even though it's > > not ready. This looks like a wrong design. > > Because the pcm is created by my i2s bus driver (which knows it can only > have one pcm per i2s bus). What do you mean one pcm? One PCM substream, one-directional stream, or both one pcm instance containing playback and capture streams? > Then once codecs are discovered, they attach, and the streams are > created. The question is rather the flow of creation. Usually, the registration occurs at the very last of initialization stage, i.e. all devices are probed and initialized to be ready for use. Then the driver calls register function. If the registration _must_ be done dynamically, one by one, the situation becomes a bit more complicated. It's not only to the driver but to the user-space things. > Right now it's even more broken requiring me to create both the playback > and capture stream without knowing if there's anything on the bus that > can handle it. You don't have to create an empty PCM, but create a PCM on demand, as usbaudio.c does. It doesn't create both streams. The point is only that the register is done later. Takashi ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642