[Pkg-alsa-devel] Bug#848395: udev rule fails with exit code 99

Paul Menzel pmenzel at molgen.mpg.de
Sat Dec 17 10:03:48 UTC 2016


Package: alsa-utils
Version: 1.1.2
Severity: normal


Dear Debian folks,


I see the message below on a Debian Sid/unstable system.

```
$ sudo journalctl -u systemd-udevd
[…]
[…] systemd-udevd[323]: Process '/usr/sbin/alsactl -E HOME=/run/alsa restore 0' failed with exit code 99.
```

If I am not mistaken, this is from the udev rule file [1].

```
ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", TEST=="@sbindir@", TEST=="@mydatadir@", GOTO="alsa_restore_go"
GOTO="alsa_restore_end"

LABEL="alsa_restore_go"
TEST!="@daemonswitch@", TEST=="/usr/sbin/alsactl", RUN+="@sbindir@/alsactl -E HOME=@alsactlhome@ restore $attr{device/number}"
TEST=="@daemonswitch@", TEST=="/usr/sbin/alsactl", RUN+="@sbindir@/alsactl -E HOME=@alsactlhome@ nrestore $attr{device/number}"

LABEL="alsa_restore_end"
```

Manually running this command shows that `/var/lib/alsa/asound.state` is
missing.

```
$ sudo /usr/sbin/alsactl -E HOME=/run/alsa restore 0
/usr/sbin/alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: No such file or directory
/usr/sbin/alsactl: sysfs_init:48: sysfs path '/sys' is invalid

X11 connection rejected because of wrong authentication.
xcb_connection_has_error() returned true
Found hardware: "HDA-Intel" "Realtek ALC269VB" "HDA:10ec0269,10280577,00100100 HDA:80862806,80860101,00100000" "0x1028" "0x0577"
Hardware is initialized using a generic method
```

But there is also a systemd service unit [2] for the same purpose, which
checks for the presence of `/var/lib/alsa/asound.state`.

```
$ more /lib/systemd/system/basic.target.wants/alsa-restore.service
#
# Note that two different ALSA card state management schemes exist and they
# can be switched using a file exist check - /etc/alsa/state-daemon.conf .
#

[Unit]
Description=Save/Restore Sound Card State
Documentation=man:alsactl(1)
ConditionPathExists=!/etc/alsa/state-daemon.conf
ConditionPathExistsGlob=/dev/snd/control*
ConditionPathExists=/var/lib/alsa/asound.state
After=alsa-state.service

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=-/usr/sbin/alsactl -E HOME=/run/alsa restore
ExecStop=-/usr/sbin/alsactl -E HOME=/run/alsa store
$ systemctl status alsa-restore
● alsa-restore.service - Save/Restore Sound Card State
   Loaded: loaded (/lib/systemd/system/alsa-restore.service; static; vendor preset: enabled)
   Active: inactive (dead)
Condition: start condition failed at Fri 2016-12-16 11:51:03 CET; 11min ago
           └─ ConditionPathExists=/var/lib/alsa/asound.state was not met
     Docs: man:alsactl(1)
```

Is the udev rule still needed? I don’t really know, how it’s supposed to
work, and what I don’t have that file `asound.state`.

It would be nice to not run `alsactl` during startup, if it’s failing,
to get rid of the error message.


Kind regards,

Paul


[1] https://sources.debian.net/src/alsa-utils/1.1.2-1/alsactl/90-alsa-restore.rules.in/
[2] https://sources.debian.net/src/alsa-utils/1.1.2-1/alsactl/alsa-restore.service.in/



More information about the Pkg-alsa-devel mailing list