From 450fcb57101e6f80da321f45836bf70a00d8c9bf Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Wed, 8 Jan 2025 15:12:47 +0100 Subject: [PATCH] bespokesynth: Fix compatibility with pipewire's JACK emulation --- .../2001-bespokesynth-fix-pipewire-jack.patch | 30 +++++++++++++++++++ pkgs/by-name/be/bespokesynth/package.nix | 6 ++++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/by-name/be/bespokesynth/2001-bespokesynth-fix-pipewire-jack.patch diff --git a/pkgs/by-name/be/bespokesynth/2001-bespokesynth-fix-pipewire-jack.patch b/pkgs/by-name/be/bespokesynth/2001-bespokesynth-fix-pipewire-jack.patch new file mode 100644 index 000000000000..c14848843bdc --- /dev/null +++ b/pkgs/by-name/be/bespokesynth/2001-bespokesynth-fix-pipewire-jack.patch @@ -0,0 +1,30 @@ +diff --git a/libs/JUCE/modules/juce_audio_devices/native/juce_JackAudio_linux.cpp b/libs/JUCE/modules/juce_audio_devices/native/juce_JackAudio_linux.cpp +index 4cce7016f..25554a7cd 100644 +--- a/libs/JUCE/modules/juce_audio_devices/native/juce_JackAudio_linux.cpp ++++ b/libs/JUCE/modules/juce_audio_devices/native/juce_JackAudio_linux.cpp +@@ -291,7 +291,6 @@ public: + juce::jack_on_info_shutdown (client, infoShutdownCallback, this); + juce::jack_set_xrun_callback (client, xrunCallback, this); + juce::jack_activate (client); +- deviceIsOpen = true; + + if (! inputChannels.isZero()) + { +@@ -336,6 +335,7 @@ public: + } + + updateActivePorts(); ++ deviceIsOpen = true; + + return lastError; + } +@@ -525,7 +525,8 @@ private: + static void portConnectCallback (jack_port_id_t, jack_port_id_t, int, void* arg) + { + if (JackAudioIODevice* device = static_cast (arg)) +- device->mainThreadDispatcher.updateActivePorts(); ++ if (device->isOpen()) ++ device->mainThreadDispatcher.updateActivePorts(); + } + + static void threadInitCallback (void* /* callbackArgument */) diff --git a/pkgs/by-name/be/bespokesynth/package.nix b/pkgs/by-name/be/bespokesynth/package.nix index f2bf3a98d339..29ff82de7e2f 100644 --- a/pkgs/by-name/be/bespokesynth/package.nix +++ b/pkgs/by-name/be/bespokesynth/package.nix @@ -66,6 +66,12 @@ stdenv.mkDerivation (finalAttrs: { fetchSubmodules = true; }; + patches = [ + # Fix compatibility with pipewire's JACK emulation + # https://github.com/BespokeSynth/BespokeSynth/issues/1405#issuecomment-1721437868 + ./2001-bespokesynth-fix-pipewire-jack.patch + ]; + # Linux builds are sandboxed properly, this always returns "localhost" there. # Darwin builds doesn't have the same amount of sandboxing by default, and the builder's hostname is returned. # In case this ever gets embedded into VersionInfoBld.cpp, hardcode it to the Linux value