PulseAudio: Difference between revisions
Add pipewire to "See also" |
Remove obsolete config example |
||
| (5 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
PulseAudio is a popular sound server for Linux. | PulseAudio is a popular sound server for Linux. A number of applications now expect a PulseAudio-compatible audio server. | ||
As of NixOS 24.11, [[PipeWire]] is used over PulseAudio for most graphical sessions by default, but it can provide a PulseAudio-compatible server (see that page for more details). This page documents how to use "native" PulseAudio as an alternative. | |||
==Enabling PulseAudio== | ==Enabling PulseAudio== | ||
Add to your configuration: | Add to your configuration: | ||
< | <syntaxhighlight lang="nix"> | ||
services.pipewire.enable = false; | |||
services.pulseaudio.enable = true; | |||
</ | services.pulseaudio.support32Bit = true; # If compatibility with 32-bit applications is desired. | ||
</syntaxhighlight> | |||
You may need to add users to the <tt>audio</tt> group for them to be able to use audio devices: | You may need to add users to the <tt>audio</tt> group for them to be able to use audio devices: | ||
| Line 30: | Line 34: | ||
Or automatically: | Or automatically: | ||
<syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
services.pulseaudio.extraConfig = "load-module module-combine-sink"; | |||
</syntaxHighlight> | </syntaxHighlight> | ||
| Line 36: | Line 40: | ||
<syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
services.pulseaudio.extraConfig = "unload-module module-suspend-on-idle"; | |||
</syntaxHighlight> | </syntaxHighlight> | ||
| Line 83: | Line 87: | ||
<syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
services.pulseaudio.package = pkgs.pulseaudioFull; | |||
</syntaxHighlight> | </syntaxHighlight> | ||
| Line 101: | Line 105: | ||
To turn timer-based scheduling off add this to your configuration: | To turn timer-based scheduling off add this to your configuration: | ||
<syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
services.pulseaudio.configFile = pkgs.runCommand "default.pa" {} '' | |||
sed 's/module-udev-detect$/module-udev-detect tsched=0/' \ | sed 's/module-udev-detect$/module-udev-detect tsched=0/' \ | ||
${pkgs.pulseaudio}/etc/pulse/default.pa > $out | ${pkgs.pulseaudio}/etc/pulse/default.pa > $out | ||