spa: alsa: Read ctl events instead of doing a global diff

This does a couple of things: first, we implement revents demangling,
which seems to be required (although hw: devices work fine without it).

The second is to actually read the ctl events so we can tell when
elements we care about have changed, instead of reading everything and
trying to do a diff.

The latter is also required from a correctness perspective, as otherwise
the ctl might keep triggering wakeups while the fd is ready to be read.
This commit is contained in:
Arun Raghavan 2024-03-14 10:13:41 -04:00
parent f2874ad1c2
commit e3fc41bf41
2 changed files with 66 additions and 25 deletions

View file

@ -258,6 +258,7 @@ struct state {
/* ALSA ctls exposed as params */
unsigned int num_bind_ctls;
struct bound_ctl bound_ctls[16];
struct pollfd ctl_pfds[MAX_POLL];
struct spa_source ctl_sources[MAX_POLL];
int ctl_n_fds;