Unverified Commit bfb9fffc authored by Seth Flynn's avatar Seth Flynn Committed by GitHub
Browse files

easyeffects: 7.1.9 -> 7.2.3, lsp-plugins: 1.2.16 -> 1.2.20 (#373878)

parents 83d6af3a 273dcbd9
Loading
Loading
Loading
Loading
+0 −229
Original line number Diff line number Diff line
From a2f524ffe163e1a15dc8a4b6f21964092ec8e0a7 Mon Sep 17 00:00:00 2001
From: Sofi <sofi+git@mailbox.org>
Date: Sat, 28 Sep 2024 00:31:11 +0200
Subject: [PATCH] Revert "Merge pull request #3340 from
 violetmage/violetmage-spectrum-avsync"

This reverts commit d40ff638e2f0db00579e1f30a9880b7d35f137fd, reversing
changes made to ee0fe4a8da57ef84a39600ad02280ddc98d9de31.
---
 ...thub.wwmm.easyeffects.spectrum.gschema.xml |  5 --
 data/ui/preferences_spectrum.ui               | 21 -----
 include/spectrum.hpp                          |  5 --
 src/preferences_spectrum.cpp                  |  7 +-
 src/spectrum.cpp                              | 86 +++----------------
 5 files changed, 14 insertions(+), 110 deletions(-)

diff --git a/data/schemas/com.github.wwmm.easyeffects.spectrum.gschema.xml b/data/schemas/com.github.wwmm.easyeffects.spectrum.gschema.xml
index 340da382e..1260810f3 100644
--- a/data/schemas/com.github.wwmm.easyeffects.spectrum.gschema.xml
+++ b/data/schemas/com.github.wwmm.easyeffects.spectrum.gschema.xml
@@ -49,10 +49,5 @@
             <range min="120" max="22000" />
             <default>20000</default>
         </key>
-
-        <key name="avsync-delay" type="i">
-            <range min="0" max="1000" />
-            <default>0</default>
-        </key>
     </schema>
 </schemalist>
\ No newline at end of file
diff --git a/data/ui/preferences_spectrum.ui b/data/ui/preferences_spectrum.ui
index 2eae7b8ab..97535d518 100644
--- a/data/ui/preferences_spectrum.ui
+++ b/data/ui/preferences_spectrum.ui
@@ -18,27 +18,6 @@
                         </child>
                     </object>
                 </child>
-
-                <child>
-                    <object class="AdwActionRow">
-                        <property name="title" translatable="yes">Compensating Delay (ms)</property>
-
-                        <child>
-                            <object class="GtkSpinButton" id="avsync_delay">
-                                <property name="valign">center</property>
-                                <property name="digits">0</property>
-                                <property name="adjustment">
-                                    <object class="GtkAdjustment">
-                                        <property name="lower">0</property>
-                                        <property name="upper">1000</property>
-                                        <property name="step-increment">1</property>
-                                        <property name="page-increment">10</property>
-                                    </object>
-                                </property>
-                            </object>
-                        </child>
-                    </object>
-                </child>
             </object>
         </child>
 
diff --git a/include/spectrum.hpp b/include/spectrum.hpp
index 546ceec59..af49dd9e5 100644
--- a/include/spectrum.hpp
+++ b/include/spectrum.hpp
@@ -65,11 +65,6 @@ class Spectrum : public PluginBase {
 
   std::array<float, n_bands> real_input;
   std::array<double, n_bands / 2U + 1U> output;
-  
-  std::vector<float> left_delayed_vector;
-  std::vector<float> right_delayed_vector;
-  std::span<float> left_delayed;
-  std::span<float> right_delayed;
 
   std::array<float, n_bands> latest_samples_mono;
 
diff --git a/src/preferences_spectrum.cpp b/src/preferences_spectrum.cpp
index 2902a8ee4..151960bef 100644
--- a/src/preferences_spectrum.cpp
+++ b/src/preferences_spectrum.cpp
@@ -49,7 +49,7 @@ struct _PreferencesSpectrum {
 
   GtkDropDown* type;
 
-  GtkSpinButton *n_points, *height, *line_width, *minimum_frequency, *maximum_frequency, *avsync_delay;
+  GtkSpinButton *n_points, *height, *line_width, *minimum_frequency, *maximum_frequency;
 
   GSettings* settings;
 
@@ -119,7 +119,6 @@ void preferences_spectrum_class_init(PreferencesSpectrumClass* klass) {
   gtk_widget_class_bind_template_child(widget_class, PreferencesSpectrum, axis_color_button);
   gtk_widget_class_bind_template_child(widget_class, PreferencesSpectrum, minimum_frequency);
   gtk_widget_class_bind_template_child(widget_class, PreferencesSpectrum, maximum_frequency);
-  gtk_widget_class_bind_template_child(widget_class, PreferencesSpectrum, avsync_delay);
 
   gtk_widget_class_bind_template_callback(widget_class, on_spectrum_color_set);
   gtk_widget_class_bind_template_callback(widget_class, on_spectrum_axis_color_set);
@@ -193,9 +192,9 @@ void preferences_spectrum_init(PreferencesSpectrum* self) {
   // spectrum section gsettings bindings
 
   gsettings_bind_widgets<"show", "fill", "rounded-corners", "show-bar-border", "dynamic-y-scale", "n-points", "height",
-                         "line-width", "minimum-frequency", "maximum-frequency", "avsync-delay">(
+                         "line-width", "minimum-frequency", "maximum-frequency">(
       self->settings, self->show, self->fill, self->rounded_corners, self->show_bar_border, self->dynamic_y_scale,
-      self->n_points, self->height, self->line_width, self->minimum_frequency, self->maximum_frequency, self->avsync_delay);
+      self->n_points, self->height, self->line_width, self->minimum_frequency, self->maximum_frequency);
 
   ui::gsettings_bind_enum_to_combo_widget(self->settings, "type", self->type);
 
diff --git a/src/spectrum.cpp b/src/spectrum.cpp
index 28f7ff4da..1075a358f 100644
--- a/src/spectrum.cpp
+++ b/src/spectrum.cpp
@@ -55,30 +55,6 @@ Spectrum::Spectrum(const std::string& tag,
 
   plan = fftwf_plan_dft_r2c_1d(static_cast<int>(n_bands), real_input.data(), complex_output, FFTW_ESTIMATE);
 
-
-
-  lv2_wrapper = std::make_unique<lv2::Lv2Wrapper>("http://lsp-plug.in/plugins/lv2/comp_delay_x2_stereo");
-
-  package_installed = lv2_wrapper->found_plugin;
-
-  if (!package_installed) {
-    util::debug(log_tag + "http://lsp-plug.in/plugins/lv2/comp_delay_x2_stereo is not installed, spectrum will not have A/V sync compensation");
-  }
-
-  lv2_wrapper->set_control_port_value("mode_l", 2);
-  lv2_wrapper->set_control_port_value("mode_r", 2);
-
-  lv2_wrapper->set_control_port_value("dry_l", 0.0F);
-  lv2_wrapper->set_control_port_value("dry_r", 0.0F);
-
-  lv2_wrapper->set_control_port_value("wet_l", static_cast<float>(util::db_to_linear(0.0F)));
-  lv2_wrapper->set_control_port_value("wet_r", static_cast<float>(util::db_to_linear(0.0F)));
-
-  lv2_wrapper->bind_key_int<"time_l", "avsync-delay">(settings);
-  lv2_wrapper->bind_key_int<"time_r", "avsync-delay">(settings);
-
-
-
   g_signal_connect(settings, "changed::show", G_CALLBACK(+[](GSettings* settings, char* key, gpointer user_data) {
                      auto* self = static_cast<Spectrum*>(user_data);
 
@@ -106,19 +82,6 @@ Spectrum::~Spectrum() {
 void Spectrum::setup() {
   std::ranges::fill(real_input, 0.0F);
   std::ranges::fill(latest_samples_mono, 0.0F);
-
-  left_delayed_vector.resize(n_samples, 0.0F);
-  right_delayed_vector.resize(n_samples, 0.0F);
-
-  left_delayed = std::span<float>(left_delayed_vector);
-  right_delayed = std::span<float>(right_delayed_vector);
-
-  lv2_wrapper->set_n_samples(n_samples);
-
-  if (lv2_wrapper->get_rate() != rate) {
-    util::debug(log_tag + " creating instance of comp delay x2 stereo for spectrum A/V sync");
-    lv2_wrapper->create_instance(rate);
-  }
 }
 
 void Spectrum::process(std::span<float>& left_in,
@@ -132,46 +95,19 @@ void Spectrum::process(std::span<float>& left_in,
     return;
   }
 
-  // delay the visualization of the spectrum by the reported latency
-  // of the output device, so that the spectrum is visually in sync
-  // with the audio as experienced by the user. (A/V sync)
-  if ( lv2_wrapper->found_plugin && lv2_wrapper->has_instance() ) {
-    lv2_wrapper->connect_data_ports(left_in, right_in, left_delayed, right_delayed);
-    lv2_wrapper->run();
+  if (n_samples < n_bands) {
+    // Drop the oldest quantum.
+    std::memmove(&latest_samples_mono[0], &latest_samples_mono[n_samples],
+        (n_bands - n_samples) * sizeof(float));
 
-    // Downmix the latest n_bands samples from the delayed signal.
-    if (n_samples < n_bands) {
-      // Drop the oldest quantum.
-      std::memmove(&latest_samples_mono[0], &latest_samples_mono[n_samples],
-          (n_bands - n_samples) * sizeof(float));
-
-      // Copy the new quantum.
-      for (size_t n = 0; n < n_samples; n++) {
-        latest_samples_mono[n_bands - n_samples + n] = 0.5F * (left_delayed[n] + right_delayed[n]);
-      }
-    } else {
-      // Copy the latest n_bands samples.
-      for (size_t n = 0; n < n_bands; n++)
-        latest_samples_mono[n] = 0.5F * (left_delayed[n_samples - n_bands + n] +
-                                        right_delayed[n_samples - n_bands + n]);
-    }
+    // Copy the new quantum.
+    for (size_t n = 0; n < n_samples; n++)
+      latest_samples_mono[n_bands - n_samples + n] = 0.5F * (left_in[n] + right_in[n]);
   } else {
-    // Downmix the latest n_bands samples from the non-delayed signal.
-    if (n_samples < n_bands) {
-      // Drop the oldest quantum.
-      std::memmove(&latest_samples_mono[0], &latest_samples_mono[n_samples],
-          (n_bands - n_samples) * sizeof(float));
-
-      // Copy the new quantum.
-      for (size_t n = 0; n < n_samples; n++) {
-        latest_samples_mono[n_bands - n_samples + n] = 0.5F * (left_in[n] + right_in[n]);
-      }
-    } else {
-      // Copy the latest n_bands samples.
-      for (size_t n = 0; n < n_bands; n++)
-        latest_samples_mono[n] = 0.5F * (left_in[n_samples - n_bands + n] +
-                                        right_in[n_samples - n_bands + n]);
-    }
+    // Copy the latest n_bands samples.
+    for (size_t n = 0; n < n_bands; n++)
+      latest_samples_mono[n] = 0.5F * (left_in[n_samples - n_bands + n] +
+                                       right_in[n_samples - n_bands + n]);
   }
 
   /*
-- 
2.46.0
+5 −8
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  appstream-glib,
  calf,
  deepfilternet,
  desktop-file-utils,
  fetchFromGitHub,
  fftw,
  fftwFloat,
  fmt_9,
@@ -45,15 +45,16 @@ let
  # Fix crashes with speexdsp effects
  speexdsp' = speexdsp.override { withFftw3 = false; };
in

stdenv.mkDerivation rec {
  pname = "easyeffects";
  version = "7.1.9";
  version = "7.2.3";

  src = fetchFromGitHub {
    owner = "wwmm";
    repo = "easyeffects";
    tag = "v${version}";
    hash = "sha256-It+kldlhThWF9y/rTgKt9QlIouH1cQcCtSHQTsaGjfo=";
    hash = "sha256-bTyPStOQusIho8x6RI+2Z+4wHSG9ERjo4NuvLUILIm8=";
  };

  nativeBuildInputs = [
@@ -102,6 +103,7 @@ stdenv.mkDerivation rec {
        mda_lv2 # loudness
        zam-plugins # maximizer
      ];

      ladspaPlugins = [
        deepfilternet # deep noise remover
        rubberband # pitch shifting
@@ -114,11 +116,6 @@ stdenv.mkDerivation rec {
      )
    '';

  patches = [
    # Remove when lsp-plugins is >= 1.2.17. (https://github.com/wwmm/easyeffects/issues/3394)
    ./0001-Revert-Merge-pull-request-3340-from-violetmage-viole.patch
  ];

  separateDebugInfo = true;

  passthru = {
+47 −29
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  cairo,
  fetchurl,
  pkg-config,
  makeWrapper,
  libsndfile,
  gst_all_1,
  jack2,
  libGLU,
  libGL,
  lv2,
  cairo,
  ladspaH,
  php,
  libGL,
  libGLU,
  libXrandr,
  libsndfile,
  lv2,
  php82,
  pkg-config,
}:

stdenv.mkDerivation rec {
  pname = "lsp-plugins";
  version = "1.2.16";
let
  php = php82;
in

  src = fetchurl {
    url = "https://github.com/lsp-plugins/lsp-plugins/releases/download/${version}/lsp-plugins-src-${version}.tar.gz";
    sha256 = "sha256-w2BUIF44z78syLroQk2asVXA5bt9P9POiuwxpnlkc8o=";
  };
stdenv.mkDerivation (finalAttrs: {
  pname = "lsp-plugins";
  version = "1.2.20";

  outputs = [
    "out"
@@ -30,39 +29,57 @@ stdenv.mkDerivation rec {
    "doc"
  ];

  src = fetchurl {
    url = "https://github.com/lsp-plugins/lsp-plugins/releases/download/${finalAttrs.version}/lsp-plugins-src-${finalAttrs.version}.tar.gz";
    hash = "sha256-yohg3Ka/see8q6NCwVPl/F06AlyR22akQz43gp+1kck=";
  };

  # By default, GStreamer plugins are installed right alongside GStreamer itself
  # We can't do that in Nixpkgs, so lets install it to $out/lib like other plugins
  postPatch = ''
    substituteInPlace modules/lsp-plugin-fw/src/Makefile \
      --replace-fail '$(shell pkg-config --variable=pluginsdir gstreamer-1.0)' '$(LIBDIR)/gstreamer-1.0'
  '';

  nativeBuildInputs = [
    php
    pkg-config
    (php.withExtensions (_: [ ]))
    makeWrapper
  ];

  buildInputs = [
    jack2
    libsndfile
    libGLU
    libGL
    lv2
    cairo
    gst_all_1.gst-plugins-base
    gst_all_1.gstreamer
    jack2
    ladspaH
    libGL
    libGLU
    libXrandr
    libsndfile
    lv2
  ];

  makeFlags = [
    "PREFIX=${placeholder "out"}"
    "ETCDIR=${placeholder "out"}/etc"
    "PREFIX=${placeholder "out"}"
    "SHAREDDIR=${placeholder "out"}/share"
  ];

  env.NIX_CFLAGS_COMPILE = "-DLSP_NO_EXPERIMENTAL";

  configurePhase = ''
    make config PREFIX=${placeholder "out"}
    runHook preConfigure

    make $makeFlags config

    runHook postConfigure
  '';

  doCheck = true;

  enableParallelBuilding = true;

  meta = with lib; {
  meta = {
    description = "Collection of open-source audio plugins";
    longDescription = ''
      Compatible with the following formats:
@@ -123,11 +140,12 @@ stdenv.mkDerivation rec {
      - Trigger
    '';
    homepage = "https://lsp-plug.in";
    maintainers = with maintainers; [
    changelog = "https://github.com/lsp-plugins/lsp-plugins/releases/tag/${finalAttrs.version}";
    maintainers = with lib.maintainers; [
      magnetophon
      PowerUser64
    ];
    license = licenses.gpl2;
    platforms = platforms.linux;
    license = lib.licenses.gpl2;
    platforms = lib.platforms.linux;
  };
}
})
+0 −2
Original line number Diff line number Diff line
@@ -14209,8 +14209,6 @@ with pkgs;
    portaudio = null;
  };
  lsp-plugins = callPackage ../applications/audio/lsp-plugins { php = php82; };
  luminanceHDR = libsForQt5.callPackage ../applications/graphics/luminance-hdr { };
  luddite = with python3Packages; toPythonApplication luddite;