yambar/modules
Daniel Eklöf 360e1fbada
module/alsa: don’t re-create the /dev/snd inotify watcher after each connect failure
When e.g. a USB soundcard is inserted, we get several CREATE
events. In my experiments, we only succeed in connecting to ALSA after
the last event.

This means, we’ll have several CREATE events that we receive, remove
the watcher, attempt to connect, fail, and then re-add the watcher.

What if that “last” CREATE event occurs while our watcher has been
removed? That’s right, we miss it, and will get stuck waiting forever.

The solution is keep the watcher around.

Now, if we’ve been successfully connected to ALSA for a long time,
chances are we’ve built up events (for other cards, for example). We
don’t want to trigger a storm of re-connect attempts, so drain the
event queue after having been disconnected from ALSA.

There *is* a small race here - if a card is removed and
re-added *very* fast, we _may_ accidentally drain the CREATE event. I
don’t see this happening in reality though.
2021-08-21 11:08:45 +02:00
..
alsa.c module/alsa: don’t re-create the /dev/snd inotify watcher after each connect failure 2021-08-21 11:08:45 +02:00
backlight.c modules: implement description() 2021-06-20 21:15:24 +02:00
battery.c modules: implement description() 2021-06-20 21:15:24 +02:00
clock.c modules: implement description() 2021-06-20 21:15:24 +02:00
i3-common.c module/i3-common: fix compilation warning with asan 2020-07-07 14:06:29 +02:00
i3-common.h modules/sway-xkb: new module, uses sway 'input' events to expose kbd layout 2019-08-14 21:51:43 +02:00
i3-ipc.h module/i3: use our own copy of i3/ipc.h 2019-03-31 12:08:44 +02:00
i3.c module/i3: add ‘persistent’ attribute 2021-07-26 21:41:59 +02:00
label.c modules: implement description() 2021-06-20 21:15:24 +02:00
meson.build module/sway-xkb: fix name of .so file, fixes load failures when built as shared module 2020-11-25 20:41:09 +01:00
mpd.c modules: implement description() 2021-06-20 21:15:24 +02:00
network.c log: pull in log.{c,h} from foot 2021-08-15 11:41:12 +02:00
removables.c modules: implement description() 2021-06-20 21:15:24 +02:00
river.c module/river: add support for river-status v2 (‘urgent’ views) 2021-08-19 19:25:18 +02:00
script.c log: pull in log.{c,h} from foot 2021-08-15 11:41:12 +02:00
sway-xkb.c modules: implement description() 2021-06-20 21:15:24 +02:00
xkb.c modules: implement description() 2021-06-20 21:15:24 +02:00
xwindow.c modules: implement description() 2021-06-20 21:15:24 +02:00