You are not logged in.

#1 2019-08-09 02:59:09

ThinkPad
Member
Registered: 2019-01-29
Posts: 125

[SOLVED] alsa-restore and alsa-state systemd units fail

#  systemctl status alsa-restore
----
● alsa-restore.service - Save/Restore Sound Card State
   Loaded: loaded (/usr/lib/systemd/system/alsa-restore.service; static; vendor preset: /var/lib/alsa/asound.state disabled)
   Active: inactive (dead)
Condition: start condition failed at Thu 2019-08-08 16:23:22 MST; 3h 11min ago
           └─ ConditionPathExists=/var/lib/alsa/asound.state was not met
Aug 08 16:23:22 X390 systemd[1]: Condition check resulted in Save/Restore Sound Card State being skipped.
#  systemctl status alsa-state
----
● alsa-state.service - Manage Sound Card State (restore and store)
   Loaded: loaded (/usr/lib/systemd/system/alsa-state.service; static; vendor preset: disabled)
   Active: inactive (dead)
Condition: start condition failed at Thu 2019-08-08 16:23:22 MST; 3h 11min ago
           └─ ConditionPathExists=/etc/alsa/state-daemon.conf was not met

Laptop: ThinkPad X390

Similar unsolved post

/var/lib/alsa/asound.state does not exist.

Tried reinstalling. Tried starting manually.


SOLUTION:
See #2 and updated ALSA wiki page.

Last edited by ThinkPad (2019-08-12 01:36:55)

Offline

#2 2019-08-09 08:32:16

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,659

Re: [SOLVED] alsa-restore and alsa-state systemd units fail

Unlike the issue in the unsolved thread, that one is normal.

Run

sudo alsactl store

at some point, in the future that service shouldn't fail anymore, (see https://bbs.archlinux.org/viewtopic.php … 8#p1845078 as well)

This reminds me, I did mean to clean up the wording in the wiki after what transpired in my referenced thread.

Edit: Wiki should be fixed now, let me know if something is  still unclear.

Last edited by V1del (2019-08-09 09:10:37)

Offline

#3 2019-08-09 17:35:05

ThinkPad
Member
Registered: 2019-01-29
Posts: 125

Re: [SOLVED] alsa-restore and alsa-state systemd units fail

That is a big improvement to the wiki, thank you. I successfully started 'alsa-restore' after running 'alsactl store'. But, I cannot enable the unit with systemd. It gives an error:

#  systemctl enable alsa-restore
----
The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled using systemctl.

Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit's
  .wants/ or .requires/ directory.
• A unit's purpose may be to act as a helper for some other unit which has
  a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
  D-Bus, udev, scripted systemctl call, ...).
• In case of template units, the unit is meant to be enabled with some
  instance name specified.

This may be due to me not understanding what is meant by 'activated' in the wiki. I couldn't find an explanation in the systemd wiki. You wrote that they are activated upon install. I took this to mean enabled, but their default status is disabled.

Offline

#4 2019-08-10 14:38:30

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,659

Re: [SOLVED] alsa-restore and alsa-state systemd units fail

The "default" status  will be disabled for virtually every service, as that's systemd/Arch default config. They are enabled by default because the alsa-utils package contains symlinks to the service files via /usr/lib/systemd/system/sound.target.wants/alsa-restore.service . sound.target [1] is a special target that gets activated when any kind of sound hardware is detected.

[1] https://www.freedesktop.org/software/sy … und.target

Last edited by V1del (2019-08-10 14:43:17)

Offline

#5 2019-08-12 01:31:19

ThinkPad
Member
Registered: 2019-01-29
Posts: 125

Re: [SOLVED] alsa-restore and alsa-state systemd units fail

Thank you. Is "activate" equivalent to 'systemctl start'?

Offline

#6 2019-08-12 13:35:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,659

Re: [SOLVED] alsa-restore and alsa-state systemd units fail

By logic of how it works it is more similar to being enabled (all an "enablement" does is set up a symlink for the specific systemd target to the service file to be executed), this is just a special case, because the actual service files do not contain an install directive and instead place the appropriate symlinks as part of the package. This is how alsa-utils upstream has defined the service files, you could have an "equivalent" service file, adding an [Install] section WantedBy=sound.target in which case you could enable the service like you're used to.

Offline

#7 2019-08-13 00:19:03

ThinkPad
Member
Registered: 2019-01-29
Posts: 125

Re: [SOLVED] alsa-restore and alsa-state systemd units fail

Understood. Thank you very much for the clarification and help!

Offline

Board footer

Powered by FluxBB