From 1cd74cd8d8de70ec359bf90f7613a250f942b515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 22 Dec 2023 14:57:58 +0100 Subject: [PATCH] audio-server: fix zeroconf tcp stream --- modules/audio-server.nix | 81 +++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/modules/audio-server.nix b/modules/audio-server.nix index 594cdfb7..d5e88212 100644 --- a/modules/audio-server.nix +++ b/modules/audio-server.nix @@ -14,46 +14,51 @@ in boot.kernelPackages = lib.mkOverride 900 pkgs.linuxPackages-rt_latest; environment = { - etc."pipewire/pipewire.conf.d/audio-server.conf".text = - # _____ _______ ____ _____ - # / ____|__ __/ __ \| __ \ - # | (___ | | | | | | |__) | - # \___ \ | | | | | | ___/ - # ____) | | | | |__| | | - # |_____/ |_| \____/|_| - # - # errors such as: - # mod.zeroconf-publish: error id:47 seq:349 res:-2 (No such file or directory): enum params id:16 (Spa:Enum:ParamId:ProcessLatency) failed - # are harmless and can be ignored. You most likely want to restart your local avahi-daemon: sudo systemctl restart avahi-daemon - builtins.toJSON { - "context.exec" = let - path = "${pkgs.pulseaudio}/bin/pactl"; - in [ { - inherit path; - args = "load-module module-zeroconf-publish"; - } { - # https://wiki.archlinux.org/title/PulseAudio/Examples#PulseAudio_over_network - inherit path; - args = "load-module module-rtp-recv latency_msec=10 sap_address=0.0.0.0"; - } ]; - "pulse.properties" = { - "auth-ip-acl" = [ - "127.0.0.0/8" - "::1/128" - "fd23:42:c3d2:500::/56" - "172.22.99.0/24" - "172.20.72.0/21" - "2a00:8180:2c00:200::/56" - "2a0f:5382:acab:1400::/56" - ]; - "pulse.default.tlength" = "96000/48000"; - "server.address" = [ - "unix:native" - "tcp:4713" - "udp:9875" - ]; + # _____ _______ ____ _____ + # / ____|__ __/ __ \| __ \ + # | (___ | | | | | | |__) | + # \___ \ | | | | | | ___/ + # ____) | | | | |__| | | + # |_____/ |_| \____/|_| + # + # errors such as: + # mod.zeroconf-publish: error id:47 seq:349 res:-2 (No such file or directory): enum params id:16 (Spa:Enum:ParamId:ProcessLatency) failed + # are harmless and can be ignored. You most likely want to restart your local avahi-daemon: sudo systemctl restart avahi-daemon + etc = { + "pipewire/pipewire.conf.d/audio-server.conf".text = builtins.toJSON { + "context.modules" = [ { + # https://wiki.archlinux.org/title/PulseAudio/Examples#PulseAudio_over_network + name = "libpipewire-module-rtp-sap"; + args = { + "sap.ip" = "0.0.0.0"; + "sess.latency.msec" = 10; + }; + } ]; + }; + "pipewire/pipewire-pulse.conf.d/audio-server.conf".text = builtins.toJSON { + "context.exec" = [ { + path = "${pkgs.pulseaudio}/bin/pactl"; + args = "load-module module-zeroconf-publish"; + } ]; + "pulse.properties" = { + "auth-ip-acl" = [ + "127.0.0.0/8" + "::1/128" + "fd23:42:c3d2:500::/56" + "172.22.99.0/24" + "172.20.72.0/21" + "2a00:8180:2c00:200::/56" + "2a0f:5382:acab:1400::/56" + ]; + "pulse.default.tlength" = "96000/48000"; + "server.address" = [ + "unix:native" + "tcp:4713" + ]; + }; }; }; + systemPackages = with pkgs; [ mpd mpv