[LAD] Alsa: poll mixer events, always returns true in subsequent calls

From: Muffinman <news@email-addr-hidden>
Date: Tue Jan 29 2013 - 00:19:00 EET

Hello,

I'm trying to poll mixer events in Alsa using C. I've used the following
functions within an infinite while loop:

if (snd_hctl_wait(hctl,-1))
{
...
}

###### and

snd_hctl_poll_descriptors(hctl, poll_fds, 1);
err = poll (poll_fds, 1, -1);
if (poll_fds[0].revents & POLLIN)
{
...
}

While I can get the first mixer event fine, in all subsequent rounds,
both snd_hctl_wait and poll always return immediately.

With the snd_mixer functions one has to call snd_mixer_handle_events to
clear events. However, calling snd_hctl_handle_events here never returns
and I can't quite figure out why. Nonetheless, I'm not even sure that's
the key to my solution.

Can anyone give me some advice on how to get this working?

Kind regards, Maarten
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Tue Jan 29 00:15:02 2013

This archive was generated by hypermail 2.1.8 : Tue Jan 29 2013 - 00:15:02 EET