I fetch alsa device fd by fd field of struct pollfd structure filled by snd_pcm_poll_descriptors... But when it comes to "demangle" event comming from epoll_wait, snd_pcm_poll_descriptors_revents which is no help since only struct pollfd fits to it's arguments.
When you get an epoll notification about a file descriptor, set the corresponding bit(s) in the revents
field of the original struct pollfd
. Then you can call snd_pcm_poll_descriptors()
.