[alsa-devel] What does snd_pcm_delay() actually return?

Jaroslav Kysela perex at perex.cz
Fri Jun 13 10:14:33 CEST 2008

On Fri, 13 Jun 2008, Takashi Iwai wrote:

> - Add some new API functions,

I would prefer to extend the current API than to change meaning of hw_ptr 
to handle extra latencies.

>   * To give the accuracy of the position inquiry (optional)
>     This requires some new kernel <-> user-space stuff.

>   * To query the known latency
>     Ditto, or we may reuse snd_pcm_hw_params_fifo_size()?

Yes, fifo_size was designed to announce possible extra latency to 

>   * To query the position being played (optionally)
>     This can be simply hwptr + latency.
> - Don't change snd_pcm_delay().  Keep as is now.
> About the period model -- it's a bit more tough problem.
> I once already made a patch to allow user-apps to use a system timer
> for more flexible period settings.  But, it was for very old version
> of ALSA.  Better to write from the scratch again...

I think that the current PCM API concept is tightly period based. You 
cannot change it easily. It would be probably better to move to 
"byte-stream" in next revision of PCM API.


Jaroslav Kysela <perex at perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.

More information about the Alsa-devel mailing list