[systemd-devel] alsa-restore.service seems to be too early

Colin Guthrie gmane at colin.guthr.ie
Mon Sep 3 02:05:05 PDT 2012


'Twas brillig, and Вечный Студент at 02/09/12 15:48 did gyre and gimble:
> In accordance with 
> 
> ~ $ cat /etc/modprobe.d/alsa.conf 
> options snd slots=snd-hda-intel,snd-hdsp,snd-usb-audio
> 
> I have three sound cards. The second one's state (snd-hdsp) isn't restored after booting up (say, Sample Clock Source parameter is set to default 48 KHz rather to AutoSync). Starting 'alsactl restore' manually restores the state. Used service is listed below. Where to dig in?
> 
> 
> a
> 
> //-------------------
> ~ $ sudo systemctl | grep basic
> basic.target              loaded active active        Basic System
> ~ $ cat /usr/lib/systemd/system/basic.target.wants/alsa-restore.service 
> [Unit]
> Description=Restore Sound Card State
> DefaultDependencies=no
> After=sysinit.target
> Before=shutdown.target
> Conflicts=shutdown.target
> 
> [Service]
> Type=oneshot
> ExecStart=-/usr/sbin/alsactl restore
> StandardOutput=syslog

Yes this unit is just a part of a two part solution here. See the commit
where it was introduced for an explanation:

http://git.alsa-project.org/?p=alsa-utils.git;a=commitdiff;h=de7c3eff0e371ce155403bbcdcf81ee79266fa0f

So the udev rule is the other part of the puzzle that should deal with
restoration during hotplug events.

You should have the file [/usr]/lib/udev/rules.d/90-alsa-restore.rules

Col

-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list