From 97c74bf05017524115e4127aa8fb27e776ed5d4a Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Sun, 23 Sep 2012 22:26:49 +0200 Subject: [PATCH] alsa.nix: initialize the sound card before restoring previously stored settings The sound card in my ThinkPad won't work unless "init" is run explicitly. --- modules/services/audio/alsa.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/services/audio/alsa.nix b/modules/services/audio/alsa.nix index d16a67948327..4d622428976a 100644 --- a/modules/services/audio/alsa.nix +++ b/modules/services/audio/alsa.nix @@ -54,8 +54,9 @@ in '' mkdir -m 0755 -p $(dirname ${soundState}) - # Restore the sound state. - ${alsaUtils}/sbin/alsactl --ignore -f ${soundState} restore + # Try to restore the sound state. + ${alsaUtils}/sbin/alsactl --ignore init || true + ${alsaUtils}/sbin/alsactl --ignore -f ${soundState} restore || true ''; postStop =