[alsa-devel] Can DMA address, periods, buffer size, etc change after hw_params is called?

Clemens Ladisch clemens at ladisch.de
Thu Jan 29 09:58:10 CET 2009


Hans-Christian Egtvedt wrote:
> Is there a chance that the following might happen:
>  - stop trigger,
>  - hw_free
>  - hw_params
>  - prepare
>  - start trigger
> 
> I.e. without calling close and open?

Yes.

It is also possible that the same happens without hw_free, i.e.,
hw_params has to initialize _or_ to change the parameters.

> Clemens Ladisch <clemens at ladisch.de> wrote:
> > The DMA address is selected by the driver in the hw_params callback,
> > but most drivers let the framework handle this by calling
> > snd_pcm_lib_malloc_pages().
> 
> Yes, this is what I do today. I am considering if I should release the
> DMA stuff in hw_free and then in the prepare callback check if it needs
> to be prepared again (since it was released in hw_free).

The framework guarantees that prepare is called only when the hardware
parameters are set.


Best regards,
Clemens


More information about the Alsa-devel mailing list