[alsa-devel] hw_params ignores ioplug's buffer size requirements

Andrew Eikum aeikum at codeweavers.com
Wed Aug 8 16:51:42 CEST 2012


On Tue, Aug 07, 2012 at 06:06:13PM +0200, Takashi Iwai wrote:
> At Tue, 7 Aug 2012 09:32:11 -0500,
> Andrew Eikum wrote:
> > There is also test client, alsa-test.c, which attempts to violate
> > those hw_params restrictions, and succeeds! The eventual call to the
> > ioplug's example_hw_params() callback gets an invalid buffer_size
> > parameter (it happens to be 512).
> 
> Why is it wrong?  512 frames = 512 * 2 channel * 2 bytes-per-sample
>  = 2048 bytes.
> 
> I guess you are confused about the units passed to
> snd_pcm_hw_params_set_buffer_size_near().  It's in frames, not in
> bytes.
> 

Yeah, you're right. I should've noticed the type for that parameter.
Thanks for pointing it out, sorry for the noise.

Andrew


More information about the Alsa-devel mailing list