[LAD] Alsa: poll mixer events, always returns true in subsequent calls
news at koster.tk
Mon Jan 28 22:19:00 UTC 2013
I'm trying to poll mixer events in Alsa using C. I've used the following
functions within an infinite while loop:
snd_hctl_poll_descriptors(hctl, poll_fds, 1);
err = poll (poll_fds, 1, -1);
if (poll_fds.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
More information about the Linux-audio-dev