From abce3dee7a20abba8be0b50ad1de701c9e4a43cb Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 16 Oct 2023 16:59:14 +0200 Subject: [PATCH] Use Pipewire and switch to Pipewire audio backend --- config/hosts/audio/shairport-sync.nix | 13 ++++++++++++- flake.nix | 9 +++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/config/hosts/audio/shairport-sync.nix b/config/hosts/audio/shairport-sync.nix index 5c323e0..830dc89 100644 --- a/config/hosts/audio/shairport-sync.nix +++ b/config/hosts/audio/shairport-sync.nix @@ -8,9 +8,20 @@ { services.shairport-sync = { enable = true; - arguments = "-o alsa -- -d plughw:1,0 -r 48000"; + arguments = "-o pw"; }; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + systemWide = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + users.users.shairport.extraGroups = [ "pipewire" ]; + users.users.chaos.extraGroups = [ "pipewire" ]; + environment.etc.shairport-sync-config = { enable = true; source = ./shairport-sync.conf; diff --git a/flake.nix b/flake.nix index f604f3a..3a4737d 100644 --- a/flake.nix +++ b/flake.nix @@ -28,11 +28,16 @@ # following error doesn't happen: # fatal error: The nqptp service on this system, which is required for # Shairport Sync to operate, does not seem to be initialised. + # + # Also use a more recent dev version to fix Pipewire stuttering issue. + # See: + # https://github.com/mikebrady/shairport-sync/issues/1736 + # https://github.com/mikebrady/shairport-sync/blob/a65ec2d7f1f380bbae196d7f8f1cd6a88ef5777b/RELEASENOTES-DEVELOPMENT.md#version-432-dev-51-g98679bbb src = final.fetchFromGitHub { owner = "mikebrady"; repo = finalAttr.pname; - rev = "4.3.1"; - hash = "sha256-Yj0SKMKACj2B/ADPkUzO4EvaYZX39erKmjaTsr5UN0s="; + rev = "98679bbb54f5aaeda859e34aa28425647b8d179e"; + hash = "sha256-k0kcgtWk2xlG34lP0ryEaqdskYMNM68YnIRLwFR3jaY="; }; }); nqptp = prev.nqptp.overrideAttrs (finalAttr: previousAttr: {