From 8bf3c2c1bf4d01119bad0af269833f3af2e288f8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 26 Jul 2011 13:00:43 +0000 Subject: [PATCH] * The implementation of the ALSA_PLUGIN_DIRS variable is buggy: because it uses strtok() to modify the environment variable in place, it only works correctly the first time it's called. Subsequent calls only see the first directory listed in the variable. This causes applications such as Audacious to fail because the Pulse plugin is not in the first directory. However, we don't actually need $ALSA_PLUGIN_DIRS, because /etc/asound.conf allows the full path to the Pulse plugin to be specified. svn path=/nixos/trunk/; revision=27960 --- modules/config/pulseaudio.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/config/pulseaudio.nix b/modules/config/pulseaudio.nix index 55270c29037d..0d0dd829782d 100644 --- a/modules/config/pulseaudio.nix +++ b/modules/config/pulseaudio.nix @@ -19,7 +19,7 @@ with pkgs.lib; config = mkIf config.hardware.pulseaudio.enable { environment.systemPackages = - [ pkgs.pulseaudio pkgs.alsaPlugins ]; + [ pkgs.pulseaudio ]; environment.etc = [ # Write an /etc/asound.conf that causes all ALSA applications to @@ -28,10 +28,19 @@ with pkgs.lib; { target = "asound.conf"; source = pkgs.writeText "asound.conf" '' + pcm_type.pulse { + lib ${pkgs.alsaPlugins}/lib/alsa-lib/libasound_module_pcm_pulse.so + } + pcm.!default { type pulse hint.description "Default Audio Device (via PulseAudio)" } + + ctl_type.pulse { + lib ${pkgs.alsaPlugins}/lib/alsa-lib/libasound_module_ctl_pulse.so + } + ctl.!default { type pulse } @@ -39,9 +48,6 @@ with pkgs.lib; } ]; - # Ensure that the ALSA Pulse plugin appears in ALSA's search path. - environment.pathsToLink = [ "lib/alsa-lib" ]; - }; }