Skip to contentSkip to conversation

alsactl: Make sure the kernel driver loaded before alsa-restore.service

PATCH In review Takashi Iwai 1 participant 2 messages Nov 28, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alsactl: Make sure the kernel driver loaded before alsa-restore.service

alsa-restore.service requires the sound devices having been set up beforehand. However, systemd tends to start this service too early before the driver setup, which leads to the unsuccessful state restore.

For assuring the kernel driver setup before this service, add the dependency on sound.target.

---
 alsactl/alsa-restore.service.in | 2 ++
 1 file changed, 2 insertions(+)
alsactl/alsa-restore.service.in +2 -0
index a84c2e842444..104b97a6ef68 100644
@@ -8,6 +8,8 @@ Description=Save/Restore Sound Card State
 ConditionPathExists=!@daemonswitch@
 ConditionPathExistsGlob=/dev/snd/control*
 ConditionPathExists=@asoundrcfile@
+Requires=sound.target
+After=sound.target
 
 [Service]
 Type=oneshot
Signature · 1 line
2.26.2
#1 lore raw
Quoted 11 lines · Takashi Iwai

alsa-restore.service requires the sound devices having been set up beforehand. However, systemd tends to start this service too early before the driver setup, which leads to the unsuccessful state restore.

For assuring the kernel driver setup before this service, add the dependency on sound.target.

Scratch this. There is already certain dependencies between this service and sound.target. It needs more investigation why it doesn't work as expected.

Takashi

Quoted 21 lines
---
 alsactl/alsa-restore.service.in | 2 ++
 1 file changed, 2 insertions(+)
alsactl/alsa-restore.service.in +2 -0
index a84c2e842444..104b97a6ef68 100644
@@ -8,6 +8,8 @@ Description=Save/Restore Sound Card State
 ConditionPathExists=!@daemonswitch@
 ConditionPathExistsGlob=/dev/snd/control*
 ConditionPathExists=@asoundrcfile@
+Requires=sound.target
+After=sound.target
 
 [Service]
 Type=oneshot
Signature · 1 line
2.26.2