alsa-utils/alsactl
Lennart Poettering de7c3eff0e alsactl: systemd and udev hookup
Add minimal systemd and udev support to alsactl so that mixer settings
are restored at boot, when sound cards are plugged in and saved on
shutdown.

This is similar to existing udev/init script solutions in various
distributions.

Note that alsactl is called both synchronously from the udev rules as
well as asynchronously at boot. This is intended, and to ensure two
things:

- At boot the asound.state file might not be readable, since it resides
  on a different file system. That means exclusively restoring sound card
  settings from udev rules will no suffice, since if the rule is
  executed at early boot (for example within udev settle) then the file
  will no be readable and cannot be restored.

- We need to ensure that applications monitoring sound cards coming and
  going (such as PA) must not get these events before the mixer settings
  have been restored. That means the mixer settings must be restored
  synchronously withing the udev rules, before the events are passed on
  to the apps.

That basically means we need to restore the settings once in udev, to
deal with sound cards becoming available during runtime. And once in
early boot to deal with coldplugged soundcards whose data files might
not have been available at time of plugging. Hence we call alsactl
twice: one from the udev rule, and once from he systemd unit file.

Signed-off-by: Lennart Poettering <mznyfn@0pointer.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-11-23 10:42:35 +01:00
..
init alsactl init: Initialize also "Master Front Playback Volume" & "Switch" 2010-09-07 17:33:14 +02:00
.gitignore alsactl: systemd and udev hookup 2010-11-23 10:42:35 +01:00
90-alsa-restore.rules.in alsactl: systemd and udev hookup 2010-11-23 10:42:35 +01:00
alsa-restore.service.in alsactl: systemd and udev hookup 2010-11-23 10:42:35 +01:00
alsa-store.service.in alsactl: systemd and udev hookup 2010-11-23 10:42:35 +01:00
alsactl.1 Add -I option to alsactl 2008-11-13 09:28:43 +01:00
alsactl.c alsactl: Fix return code 2010-02-14 19:07:25 +01:00
alsactl.h Revert wrong parts of "alsactl: use snd_config_imake* functions" 2010-05-26 10:37:58 +02:00
alsactl_init.xml alsactl init: Add CTL{do_search} and CTL{do_count} parsers 2009-10-08 13:47:27 +02:00
init_parse.c alsactl: fix error path code in init_parse.c 2009-12-14 17:26:57 +01:00
init_sysdeps.c alsa-utils check if __USE_BSD is defined before compiling "BSD functions" 2008-12-08 11:55:27 +01:00
init_sysfs.c Initial 'alsactl init' implementation 2008-07-31 15:45:08 +02:00
init_utils_run.c Initial 'alsactl init' implementation 2008-07-31 15:45:08 +02:00
init_utils_string.c Fix misc compile warnings in alsactl 2009-02-18 15:34:57 +01:00
list.h Initial 'alsactl init' implementation 2008-07-31 15:45:08 +02:00
Makefile.am alsactl: systemd and udev hookup 2010-11-23 10:42:35 +01:00
state.c alsactl: Change handling of inactive controls 2010-09-02 15:48:43 +02:00
utils.c Revert wrong parts of "alsactl: use snd_config_imake* functions" 2010-05-26 10:37:58 +02:00