about summary refs log tree commit diff
path: root/modules/services/audio
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2012-09-23 22:26:49 +0200
committerPeter Simons <simons@cryp.to>2012-09-23 22:40:19 +0200
commit97c74bf05017524115e4127aa8fb27e776ed5d4a (patch)
tree3d3702f2aa85802252c193e72c1525666b47da19 /modules/services/audio
parent00e19c91e59d2c3244f6f3bd6d048941e7ddafab (diff)
downloadnixlib-97c74bf05017524115e4127aa8fb27e776ed5d4a.tar
nixlib-97c74bf05017524115e4127aa8fb27e776ed5d4a.tar.gz
nixlib-97c74bf05017524115e4127aa8fb27e776ed5d4a.tar.bz2
nixlib-97c74bf05017524115e4127aa8fb27e776ed5d4a.tar.lz
nixlib-97c74bf05017524115e4127aa8fb27e776ed5d4a.tar.xz
nixlib-97c74bf05017524115e4127aa8fb27e776ed5d4a.tar.zst
nixlib-97c74bf05017524115e4127aa8fb27e776ed5d4a.zip
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.
Diffstat (limited to 'modules/services/audio')
-rw-r--r--modules/services/audio/alsa.nix5
1 files 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 =