[alsa-devel] maintaining fixed latency between output and input?

Aaron J. Grier agrier at poofygoof.com
Tue Sep 30 01:34:45 CEST 2008

On Fri, Sep 26, 2008 at 08:33:19AM +0200, Clemens Ladisch wrote:
> To communicate with other threads, you can use a pipe so that you have
> a file descriptor that can be used with the poll().

now how to get posix message queues available to poll()?  (=

> Aaron J. Grier wrote:
> > combining the output and input snd_pcm_t into a single descriptor
> > list for poll() seems straight-forward, but can I pass this superset
> > list to snd_pcm_poll_descriptors_revents() without it getting
> > confused?
> No, snd_pcm_poll_descriptors_revents() looks at the file descriptors of
> a single device and returns the ready status of that device.

to follow up to myself, I was able to allocate a contiguous array of
struct pollfd, and point ALSA at different sections of it.  the entire
array was handed to poll().  it seems to work as described, and my
timing is now a bit tighter than it previously was.

  Aaron J. Grier | "Not your ordinary poofy goof." | agrier at poofygoof.com

More information about the Alsa-devel mailing list