Re: Can DMA address, periods, buffer size, etc change after hw_params is called?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 29, 2009 at 1:18 AM, Hans-Christian Egtvedt
<hans-christian.egtvedt@xxxxxxxxx> wrote:

> Should I after the open and hw_params calls be ready to handle any
> change at all regarding DMA buffer address, periods and/or number of
> periods?

You would need to do this, if you allocate your DMA buffer in the
hw_params function.  However, I recommend that you allocate it in the
_new/_open function instead (I can't remember what it's called) for
the maximum size possible, and in _hw_params, just remember what the
size is supposed to be.  That way, you won't need to free/realloc your
DMA buffer.  Trust me, it's a lot easier this way.

Take a look at commit bf9c8c9ddef7ef761ae9747349175adad0ef16ce, where
I modify my driver to move the DMA allocation from _hw_params to
_open.

-- 
Timur Tabi
Linux kernel developer at Freescale
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux