PipeWire: Difference between revisions
m Fixed section hierarchy, add links to options and packages |
|||
| (5 intermediate revisions by 5 users not shown) | |||
| Line 10: | Line 10: | ||
==Configuring PipeWire== | ==Configuring PipeWire== | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
# rtkit | # rtkit (optional, recommended) allows Pipewire to use the realtime scheduler for increased performance. | ||
security.rtkit.enable = true; | security.rtkit.enable = true; | ||
services.pipewire = { | services.pipewire = { | ||
| Line 17: | Line 17: | ||
alsa.support32Bit = true; | alsa.support32Bit = true; | ||
pulse.enable = true; | pulse.enable = true; | ||
# If you want to use JACK applications, uncomment | # If you want to use JACK applications, uncomment the following | ||
#jack.enable = true; | #jack.enable = true; | ||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
It is possible to use the {{nixos:option|services.pipewire.extraConfig}} option hierarchy in NixOS to create drop-in configuration files, if needed. | It is possible to use the {{nixos:option|services.pipewire.extraConfig}} option hierarchy in NixOS to create drop-in configuration files, if needed. For example, to disable the [https://docs.pipewire.org/page_module_x11_bell.html PipeWire x11-bell module] (which plays a sound on every X11 urgency hint), use: | ||
<syntaxhighlight lang="nix"> | |||
services.pipewire = { | |||
enable = true; | |||
# Disable X11 bell module, which plays a sound on urgency hint | |||
# (my prompt includes an urgency hint, so I want no sounds). | |||
extraConfig = { | |||
pipewire."99-silent-bell.conf" = { | |||
"context.properties" = { | |||
"module.x11.bell" = false; | |||
}; | |||
}; | |||
}; | |||
}; | |||
</syntaxhighlight> | |||
==Bluetooth Configuration== | ==Bluetooth Configuration== | ||
| Line 117: | Line 132: | ||
* {{nixos:package|carla}}: with JACK emulation, provides a patchbay (make sure to go to "Patchbay" tab and check "Canvas > Show External"). | * {{nixos:package|carla}}: with JACK emulation, provides a patchbay (make sure to go to "Patchbay" tab and check "Canvas > Show External"). | ||
* catia/{{nixos:package|patchage}}: similar to qjackctl and carla. | * catia/{{nixos:package|patchage}}: similar to qjackctl and carla. | ||
* {{nixos:package| | * {{nixos:package|pwvucontrol}}: Similar to pavucontrol but for pipewire | ||
==Advanced Configuration== | ==Advanced Configuration== | ||
| Line 266: | Line 281: | ||
Despite early activation, you may still experience a race condition that prevents audio from working if you play media immediately after a new login such as running an SSH command. If this occurs, try introducing a short delay (e.g. <code>sleep 5</code>) before invoking the media player application. | Despite early activation, you may still experience a race condition that prevents audio from working if you play media immediately after a new login such as running an SSH command. If this occurs, try introducing a short delay (e.g. <code>sleep 5</code>) before invoking the media player application. | ||
==== System-wide PipeWire ==== | |||
As an alternative to having lingering systemd user services, PipeWire can also run as a system-wide Systemd service. See {{nixos:option|services.pipewire.systemWide}} for more. | |||
{{file|/etc/nixos/configuration.nix|nix|3= | |||
services.pipewire.systemWide = true; | |||
services.pipewire.pulse.enable = true; # pipewire-pulse also supports running system-wide | |||
# PipeWire users must be in the `pipewire` group | |||
users.users.myservice1.extraGroups = [ "pipewire" ]; | |||
systemd.services.myservice2.serviceConfig.SupplementaryGroups = [ "pipewire" ]; | |||
}} | |||
==Troubleshooting== | ==Troubleshooting== | ||