[alsa-devel] snd_pcm_sw_params_set_xfer_align replacement?

Clemens Ladisch clemens at ladisch.de
Tue Jul 22 09:01:54 CEST 2008


Aaron J. Grier wrote:
> On Mon, Jul 21, 2008 at 10:37:09AM +0200, Clemens Ladisch wrote:
> > You get partial reads/writes only when you ask for it (by using non-
> > blocking mode) or when an error occurs.
>
> I want non-blocking behavior (return immediately if there is no data
> available), but I don't want to have to deal with partial reads.  I
> figured out a workaround using snd_pcm_avail_update(), but I'm wondering
> if there isn't a better way.

You could write your own read function that calls snd_pcm_read*()
repeatedly until you have as much data as you want, but this is probably
more complex than just checking for data before doing a blocking read.


Regards,
Clemens


More information about the Alsa-devel mailing list