alsa-utils/Makefile.am
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

42 lines
826 B
Makefile

INCLUDES=-I$(top_srcdir)/include
SUBDIRS = include alsactl utils m4 po
if ALSAMIXER
SUBDIRS += alsamixer
endif
if HAVE_MIXER
SUBDIRS += amixer
endif
if HAVE_RAWMIDI
SUBDIRS += amidi
endif
if ALSACONF
SUBDIRS += alsaconf
endif
if HAVE_PCM
SUBDIRS += aplay iecset speaker-test
if ALSALOOP
SUBDIRS += alsaloop
endif
endif
if HAVE_SEQ
SUBDIRS += seq
endif
EXTRA_DIST= TODO gitcompile
AUTOMAKE_OPTIONS=foreign
ACLOCAL_AMFLAGS = -I m4
rpm: dist
$(MAKE) -C $@
dist-hook:
-chmod -R a+r $(distdir)
@if ! test -z "$(AMTAR)"; then \
$(AMTAR) --create --verbose --file=- $(distdir) | bzip2 -c -9 > $(distdir).tar.bz2 ; \
else \
$(TAR) --create --verbose --file=- $(distdir) | bzip2 -c -9 > $(distdir).tar.bz2 ; \
fi
DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)