Re: [LAD] ALSA latency and MMAP

From: Clemens Ladisch <clemens@email-addr-hidden>
Date: Tue Sep 08 2009 - 18:02:12 EEST

Paul Davis wrote:
> On Tue, Sep 8, 2009 at 2:39 AM, Clemens Ladisch<clemens@email-addr-hidden> wrote:
>> Paul Davis wrote:
>>> On Mon, Sep 7, 2009 at 10:54 AM, Clemens Ladisch<clemens@email-addr-hidden> wrote:
>>>> Paul Davis wrote:
>>>>> snd_pcm_write() and snd_pcm_read(), IIRC, allow reads&writes of chunks
>>>>> of data that are not period-sized.
>>>>
>>>> Yes. So does snd_pcm_mmap_commit().
>>>
>>> something must have changed. "back in the day", you could not possible
>>> use the mmap API to deliver > 1 period at a time. has that changed?
>>
>> I don't know about "those days", but if that was the case then, it has
>> indeed changed.
>
> the documentation for snd_pcm_writei() notes:
>
> "If the blocking behaviour is selected, then routine waits until all
> requested bytes are played or put to the playback ring buffer. ...
>
> do you want to clarify your comment about "no additional buffering"?

That "playback ring buffer" is the hardware buffer. If there is not
enough free space in the buffer, it has to wait. (It is even possible
to _writei() more data than would fit in the entire buffer.)

In the case of mmap, snd_pcm_mmap_begin() never returns more frames than
are available in the buffer, so it is never possible for _commit() to
be in a situation where it would have to wait.

Best regards,
Clemens
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Tue Sep 8 20:15:02 2009

This archive was generated by hypermail 2.1.8 : Tue Sep 08 2009 - 20:15:02 EEST