[alsa-devel] [PATCH 2/2] Improve hw_params documentation

Clemens Ladisch clemens at ladisch.de
Thu Nov 17 14:27:51 CET 2011


Raymond Yau wrote:
> The logic of your program is wrong since your program did not set
> channel, rate and format

It is allowed to not set some parameters; snd_pcm_hw_params() then
chooses some random values for them.

> The buffer and period calculation is only valid after you have choose
> the format and channels

This is wrong; parameters can be set in any order.
(As long as format/channels are not yet set, the exact relationship
between frames and bytes is not yet known, but this is handled by
the parameters being intervals.)


Regards,
Clemens


More information about the Alsa-devel mailing list