[alsa-devel] Confusion about whether snd_pcm_poll_descriptors_revents()'s revents field is a single integer or an array

Lennart Poettering mznyfn at 0pointer.de
Mon Feb 2 03:50:22 CET 2009


If we look into the pcm example how snd_pcm_poll_descriptors_revents()
is used then we can see that the revents parameter apparently is
supposed to be a single integer. (which makes a lot of sense to me)


However, snd_pcm_wait_nocheck() calls the same function and assumes it
is a complete array!


So what's it now? It makes more sense to me if it would be a single

The problem becomnes visible if someone writes a plugin that wants
wakeups from more than one fd because either snd_pcm_wait() using
applications start to act weirdly because the revents are not fully
initialized or snd_pcm_poll_descriptors_revents() using applications
get invalid memory accesses.

This has become visible in the Bluetooth plugin.

I guess nobody has written a plugin that has more than one fd to sleep
on yet, right?


Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net         ICQ# 11060553
http://0pointer.net/lennart/           GnuPG 0x1A015CC4

More information about the Alsa-devel mailing list