From: Takashi Iwai Subject: Re: hw_params function and OSS emulation Date: Wed, 22 Aug 2007 23:05:04 +0200 Message-ID: References: <46CB2BB4.9060808@freescale.com> <46CC480F.7090604@freescale.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id E2B2C1037FB for ; Wed, 22 Aug 2007 23:05:05 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Trent Piepho Cc: alsa-devel@alsa-project.org, Timur Tabi List-Id: alsa-devel@alsa-project.org At Wed, 22 Aug 2007 13:25:04 -0700 (PDT), Trent Piepho wrote: > > On Wed, 22 Aug 2007, Takashi Iwai wrote: > > At Wed, 22 Aug 2007 09:28:31 -0500, > > Timur Tabi wrote: > > > > > > Takashi Iwai wrote: > > > > > > >> 3) Can I assume that .hw_params() is never called after .prepare() is called? > > > > > > > > The call is allowed. > > > > > > Ugh, so in other words, .hw_params() and .prepare() can be called any number > > > of times in any order? > > > > Well, prepare is always after hw_params. But the number of times is > > unlimited. > > Does that mean that once prepare is called, the hw_params can no longer > change? Or do you mean that hw_params must always be called before > prepare, but it's possible to call hw_params again after prepare, provided > one then calls prepare again before trigger? The latter case. > If that is the case, wouldn't it work to allocate the DMA buffer the first > time prepare is called? The buffer allocation in prepare callback would actually do work. I've never mentioned that it doesn't work. It's just not recommended, simply because the prepare is called more often than hw_params even without changing the parameters. Takashi