Re: Available frames > buffer size

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

 



Rob Duncan wrote:
> Is it ever correct for snd_pcm_avail() to return a value that’s greater
> than that returned by snd_pcm_hw_params_get_buffer_size()?

Yes, but only if have disabled stop-on-underrun (by setting the
stop_threshold to the boundary value).

> the writei() call returns 2080.  I immediately ask how many frames are
> available now (I usually get a small number in response ~ 20-30) but
> this time I get an XRUN.

The XRUN state can indicate either an underrun or some other error that
makes the stream stop.  What exactly that some other error could be
depends on the driver.

> I call snd_pcm_recover() and then snd_pcm_avail() again and now I get
> 4126 frames.
>
> As you can see the time between these two logs is less than
> 1 millisecond, so I don’t understand how the PCM can go from
> 2080 frames available to >4096 frames available so quickly.

This sounds like a bug. Which version of alsa-lib are you using?


Regards,
Clemens
_______________________________________________
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