[alsa-devel] hw_params function and OSS emulation

Takashi Iwai tiwai at suse.de
Wed Aug 22 23:05:04 CEST 2007


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


More information about the Alsa-devel mailing list