From d25dc3904fbf001b9154125cd43adcb11fc38e1c Mon Sep 17 00:00:00 2001 From: Jon Sahlberg Date: Tue, 5 Nov 2024 09:42:25 +0200 Subject: [PATCH] Change to use pulseaudio old tunnelin module There seems to be issues with pulseaudio module-tunnel -new modules The moules cause desynch in audio that is not recoverable. The bugs of that are some 10 years old and seem not to get fixed. --- .../microvm/common/ghaf-audio.nix | 5 ++-- overlays/custom-packages/default.nix | 1 - .../custom-packages/pulseaudio/default.nix | 7 ----- .../pulseaudio-remove-dont-move.patch | 28 ------------------- 4 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 overlays/custom-packages/pulseaudio/default.nix delete mode 100644 overlays/custom-packages/pulseaudio/pulseaudio-remove-dont-move.patch diff --git a/modules/microvm/virtualization/microvm/common/ghaf-audio.nix b/modules/microvm/virtualization/microvm/common/ghaf-audio.nix index 9be8fbe77..58dc1b538 100644 --- a/modules/microvm/virtualization/microvm/common/ghaf-audio.nix +++ b/modules/microvm/virtualization/microvm/common/ghaf-audio.nix @@ -37,10 +37,9 @@ in hardware.pulseaudio = lib.mkIf cfg.useTunneling { enable = true; extraConfig = '' - load-module module-tunnel-sink-new sink_name=${cfg.name}.speaker server=${address} reconnect_interval_ms=${toString reconnectMs} - load-module module-tunnel-source-new source_name=${cfg.name}.mic server=${address} reconnect_interval_ms=${toString reconnectMs} + load-module module-tunnel-sink sink_name=${cfg.name}.speaker server=${address} reconnect_interval_ms=${toString reconnectMs} + load-module module-tunnel-source source_name=${cfg.name}.mic server=${address} reconnect_interval_ms=${toString reconnectMs} ''; - package = pkgs.pulseaudio-ghaf; }; environment = lib.mkIf (!cfg.useTunneling) { diff --git a/overlays/custom-packages/default.nix b/overlays/custom-packages/default.nix index eccedb090..395d9676c 100644 --- a/overlays/custom-packages/default.nix +++ b/overlays/custom-packages/default.nix @@ -21,7 +21,6 @@ open-normal-extension = final.callPackage ../../packages/open-normal-extension { }; gtklock = import ./gtklock { inherit prev; }; hardware-scan = final.callPackage ../../packages/hardware-scan { }; - pulseaudio-ghaf = import ./pulseaudio { inherit prev; }; globalprotect-openconnect = final.libsForQt5.callPackage ../../packages/globalprotect-openconnect { }; diff --git a/overlays/custom-packages/pulseaudio/default.nix b/overlays/custom-packages/pulseaudio/default.nix deleted file mode 100644 index 65338250b..000000000 --- a/overlays/custom-packages/pulseaudio/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors -# SPDX-License-Identifier: Apache-2.0 -{ prev, ... }: -prev.pulseaudio.overrideAttrs (_prevAttrs: { - # This patch enables the live switching of pulse tunnels to different sinks - patches = _prevAttrs.patches ++ [ ./pulseaudio-remove-dont-move.patch ]; -}) diff --git a/overlays/custom-packages/pulseaudio/pulseaudio-remove-dont-move.patch b/overlays/custom-packages/pulseaudio/pulseaudio-remove-dont-move.patch deleted file mode 100644 index 363c9b1a6..000000000 --- a/overlays/custom-packages/pulseaudio/pulseaudio-remove-dont-move.patch +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors -# SPDX-License-Identifier: Apache-2.0 -diff --git a/src/modules/module-tunnel-sink-new.c b/src/modules/module-tunnel-sink-new.c -index 0b91ce266..ea41c50e2 100644 ---- a/src/modules/module-tunnel-sink-new.c -+++ b/src/modules/module-tunnel-sink-new.c -@@ -417,7 +417,7 @@ static void on_sink_created(struct userdata *u) { - if (pa_stream_connect_playback(u->stream, - u->remote_sink_name, - &bufferattr, -- PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_DONT_MOVE | PA_STREAM_START_CORKED | PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_ADJUST_LATENCY, -+ PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_START_CORKED | PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_ADJUST_LATENCY, - NULL, - NULL) < 0) { - pa_log_error("Could not connect stream."); -diff --git a/src/modules/module-tunnel-source-new.c b/src/modules/module-tunnel-source-new.c -index d75fe9e6b..510d0c1aa 100644 ---- a/src/modules/module-tunnel-source-new.c -+++ b/src/modules/module-tunnel-source-new.c -@@ -397,7 +397,7 @@ static void on_source_created(struct userdata *u) { - if (pa_stream_connect_record(u->stream, - u->remote_source_name, - &bufferattr, -- PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_DONT_MOVE|PA_STREAM_AUTO_TIMING_UPDATE|PA_STREAM_START_CORKED|PA_STREAM_ADJUST_LATENCY) < 0) { -+ PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE|PA_STREAM_START_CORKED|PA_STREAM_ADJUST_LATENCY) < 0) { - pa_log_debug("Could not create stream: %s", pa_strerror(pa_context_errno(u->context))); - u->thread_mainloop_api->quit(u->thread_mainloop_api, TUNNEL_THREAD_FAILED_MAINLOOP); - }