[alsa-devel] Measuring Device Throughput - MMAP vs. RW

Pavel Hofman pavhofman at gmail.com
Tue Sep 10 09:48:24 CEST 2019


On Tue, Sep 10, 2019 at 9:18 AM Takashi Iwai <tiwai at suse.de> wrote:

>
> The value read from snd_pcm_status() should give the accurate pair of
> the position and the timestamp.
>
Thanks. IIUC, if I call snd_pcm_status() in that mmap_commit method, get
data between e.g. 10 seconds, and divide the increase of status._ptr
https://github.com/michaelwu/alsa-lib/blob/afb2fbd0e554e42e51325c3197a176ea96a74203/include/sound/asound.h#L422
by increase of status.tstamp, I should get the the most precise available
soundcard rate estimate referenced to system time.



> You need to check the delay count as
> well, which compensates the in-flight samples.
>
>
I need just the rate at which the soundcard consumes/produces samples, I do
not care about time at which the sound is being produced. I do not know
exact meaning of the delay field. Is it involved in this calculation?
Please is there any exact detailed description of the status fields?

Thanks.

Pavel.


More information about the Alsa-devel mailing list