Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X error with Surge XT #18

Open
magnetophon opened this issue Dec 24, 2021 · 5 comments
Open

X error with Surge XT #18

magnetophon opened this issue Dec 24, 2021 · 5 comments

Comments

@magnetophon
Copy link

I ran into a bug with the LV2 version of Surge XT:
The following 3 commits all give an X error when I build Surge XT with them and run the plugin in Jalv.GTK:

"000e15a1e108101a68aa068b5c621a0d5b58f4d6"
"936a26d4beb49529d68f3c67765d783dc2de4e62"
"99312f2496c9e6524f742489acbf7594053d2e78"

The full error is:

The program 'jalv.gtk' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 54 error_code 3 request_code 20 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

The following commit doesn't show up in jalv:

"36b47a4538514b38d68127c2d0dd4979ba1fd171"

This one bulds and runs fine:
"c5174d84fdb12e2233ec3c502fb6a9c54ed87a9f"

These commits don't build on NixOS; looks like they are trying to use git during the build, which NixOS doesn't allow:
Could NOT find Git (missing: GIT_EXECUTABLE)
Probably not worth inverstigating further, since it's NixOS specific, and also doesn't ocur on other commits, both before and after these.
For completeness sake I've included the full build output of one of these builds at the bottom of this issue.

"250b85b6a465c912c1abbe9f2f44b7c308b9e9c4"
"ddaa09110392a4419fecbb6d3022bede89b7e841"
"f052e1becbd0e62002c2a98ae258432546e4990e"
"156722d299935d01759e5deae87b849499cf375f"
"1744008413974a2b2d9caf9ffa0a206d3dc863c3"
"b421159be31ecf18f4b1600d3a90e2a34d62aab8"

This one works again:
"5106d9d77b892c22afcb9379c13982f270429e2e"

I am on Nixos Linux, 64 bit.

  • Full build output of the failing builds, for completeness sake:
nix-env -f $NIXPKGS -iA surge-XT  --max-jobs 8 --builders ''
replacing old 'surge-XT-unstable-2021-12-24'
installing 'surge-XT-unstable-2021-12-24'
this derivation will be built:
  /nix/store/wv8xp05lqpy6avsi349n2cczxzvhxm0s-surge-XT-unstable-2021-12-24.drv
building '/nix/store/wv8xp05lqpy6avsi349n2cczxzvhxm0s-surge-XT-unstable-2021-12-24.drv'...
unpacking sources
unpacking source archive /nix/store/jap4ph4vr0bzvjsfx8nahidliicxsr6a-source
source root is source
patching sources
configuring
fixing cmake files...
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/dah3rihc7rizqcr4nrjprmplbkbd92sb-surge-XT-unstable-2021-12-24/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/dah3rihc7rizqcr4nrjprmplbkbd92sb-surge-XT-unstable-2021-12-24/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/dah3rihc7rizqcr4nrjprmplbkbd92sb-surge-XT-unstable-2021-12-24/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/dah3rihc7rizqcr4nrjprmplbkbd92sb-surge-XT-unstable-2021-12-24/share/doc/Surge -DCMAKE_INSTALL_INFODIR=/nix/store/dah3rihc7rizqcr4nrjprmplbkbd92sb-surge-XT-unstable-2021-12-24/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/dah3rihc7rizqcr4nrjprmplbkbd92sb-surge-XT-unstable-2021-12-24/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/dah3rihc7rizqcr4nrjprmplbkbd92sb-surge-XT-unstable-2021-12-24/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/dah3rihc7rizqcr4nrjprmplbkbd92sb-surge-XT-unstable-2021-12-24/include -DCMAKE_INSTALL_SBINDIR=/nix/store/dah3rihc7rizqcr4nrjprmplbkbd92sb-surge-XT-unstable-2021-12-24/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/dah3rihc7rizqcr4nrjprmplbkbd92sb-surge-XT-unstable-2021-12-24/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/dah3rihc7rizqcr4nrjprmplbkbd92sb-surge-XT-unstable-2021-12-24/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/xiq6j4jsyj351p8q3yw9cg1hdqp9m685-gcc-wrapper-10.3.0/bin/strip -DCMAKE_RANLIB=/nix/store/lbxfixyw1yk099pjyaiy3xj5dl7kxm1g-binutils-2.35.2/bin/ranlib -DCMAKE_AR=/nix/store/lbxfixyw1yk099pjyaiy3xj5dl7kxm1g-binutils-2.35.2/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/dah3rihc7rizqcr4nrjprmplbkbd92sb-surge-XT-unstable-2021-12-24 -DJUCE_SUPPORTS_LV2=ON -DSURGE_JUCE_PATH=/nix/store/ykg8i78p3w3kbfba5csma0q1b6v3733j-juce-lv2-unstable-2021-12-11 -DCMAKE_EXE_LINKER_FLAGS=-no-pie
-- The C compiler identification is GNU 10.3.0
-- The CXX compiler identification is GNU 10.3.0
-- The ASM compiler identification is GNU
-- Found assembler: /nix/store/xiq6j4jsyj351p8q3yw9cg1hdqp9m685-gcc-wrapper-10.3.0/bin/gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/xiq6j4jsyj351p8q3yw9cg1hdqp9m685-gcc-wrapper-10.3.0/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/xiq6j4jsyj351p8q3yw9cg1hdqp9m685-gcc-wrapper-10.3.0/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- It's Surge XT, folks! Version is 0.99.0
-- CMAKE_BUILD_TYPE is Release
-- CMake version is 3.21.2
-- Compiler version is 10.3.0
-- Targeting 64-bit configuration
-- Performing Test COMPILER_HAS_AVX_OR_IS_ARM
-- Performing Test COMPILER_HAS_AVX_OR_IS_ARM - Failed
-- Holding off on AVX support. See #4479 for the strategy
-- Using JUCE from /nix/store/ykg8i78p3w3kbfba5csma0q1b6v3733j-juce-lv2-unstable-2021-12-11
-- Found PkgConfig: pkg-config (found version "0.29.2")
-- Checking for module 'alsa'
--   Found alsa, version 1.2.5.1
-- Checking for module 'freetype2'
--   Found freetype2, version 24.0.18
-- Checking for module 'libcurl'
--   No package 'libcurl' found
-- Checking for modules 'webkit2gtk-4.0;gtk+-x11-3.0'
--   No package 'webkit2gtk-4.0' found
--   No package 'gtk+-x11-3.0' found
-- Configuring juceaide
-- Building juceaide
-- Exporting juceaide
-- Including JUCE LV2 support. You will need the LV2 fork of JUCE!
-- Turning off deprecation warning to error, since JUCE LV2 uses deprecated APIs
-- Building Surge XT using the following JUCE wrappers: VST3;Standalone;LV2
-- filesystem: Using ghc::filesystem from "filesystem/ghc-filesystem.h"
-- Module support is disabled.
-- Version: 8.0.1
-- Build type: Release
-- CXX_STANDARD: 17
-- Performing Test has_std_17_flag
-- Performing Test has_std_17_flag - Success
-- Performing Test has_std_1z_flag
-- Performing Test has_std_1z_flag - Success
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success
-- Performing Test FMT_HAS_VARIANT
-- Performing Test FMT_HAS_VARIANT - Success
-- Required features: cxx_variadic_templates
-- Looking for strtod_l
-- Looking for strtod_l - not found
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Checking processor clipping capabilities...
-- Performing Test CPU_CLIPS_POSITIVE
-- Performing Test CPU_CLIPS_POSITIVE - Failed
-- Performing Test CPU_CLIPS_NEGATIVE
-- Performing Test CPU_CLIPS_NEGATIVE - Failed
-- Checking processor clipping capabilities... none
-- Performing Test HAVE_VISIBILITY
-- Performing Test HAVE_VISIBILITY - Success
-- Including local sqlite
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for sin in m
-- Looking for sin in m - found
-- Checking LJ_TARGET_X64 /build/source/libs/LuaJitLib/LuaJIT;/build/source/libs/LuaJitLib/LuaJIT/src;/build/source/build/libs/LuaJitLib
-- Performing Test LJ_TARGET_X64
-- Performing Test LJ_TARGET_X64 - Success
-- LuaJIT target: x64
-- LuaJIT target: x64
-- Performing Test LJ_ARCH_BITS_64
-- Performing Test LJ_ARCH_BITS_64 - Success
-- Performing Test LJ_HASJIT_1
-- Performing Test LJ_HASJIT_1 - Success
-- Performing Test LJ_HASFFI_1
-- Performing Test LJ_HASFFI_1 - Success
-- Performing Test LJ_DUALNUM_1
-- Performing Test LJ_DUALNUM_1 - Failed
-- Performing Test LJ_ARCH_HASFPU_1
-- Performing Test LJ_ARCH_HASFPU_1 - Success
-- Performing Test LJ_ABI_SOFTFP_1
-- Performing Test LJ_ABI_SOFTFP_1 - Failed
-- Looking for sin in m
-- Looking for sin in m - found
-- Including JUCE accessibility support
-- Including JUCE VST3 host-side context menu support
-- Including JUCE VST3 client extensions
CMake Error at src/surge-xt/CMakeLists.txt:192 (target_sources):
  Cannot specify sources for target "surge-xt_LV2" which is not built by this
  project.


-- Validate me! Please!
-- Creating pluginval target for plugin: Surge XT.vst3
-- Creating pluginval target for plugin: .vst3
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- Absent git, making extra content commands no-ops
-- Configuring incomplete, errors occurred!
See also "/build/source/build/CMakeFiles/CMakeOutput.log".
See also "/build/source/build/CMakeFiles/CMakeError.log".
error: builder for '/nix/store/wv8xp05lqpy6avsi349n2cczxzvhxm0s-surge-XT-unstable-2021-12-24.drv' failed with exit code 1;
       last 10 log lines:
       >
       >
       > -- Validate me! Please!
       > -- Creating pluginval target for plugin: Surge XT.vst3
       > -- Creating pluginval target for plugin: .vst3
       > -- Could NOT find Git (missing: GIT_EXECUTABLE)
       > -- Absent git, making extra content commands no-ops
       > -- Configuring incomplete, errors occurred!
       > See also "/build/source/build/CMakeFiles/CMakeOutput.log".
       > See also "/build/source/build/CMakeFiles/CMakeError.log".
       For full logs, run 'nix log /nix/store/wv8xp05lqpy6avsi349n2cczxzvhxm0s-surge-XT-unstable-2021-12-24.drv'.

@JugadK
Copy link

JugadK commented Dec 25, 2021

For the first issue,I ran into the same problem on arch linux and ardour, and reverting to that commit fixed it (Thank you for that)

  (Details: serial 54 error_code 3 request_code 20 minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

running ardour through gdb I get this segfault after the above message when it attempts to load the lv2

0x00007ffff54e8a95 in clock_nanosleep@GLIBC_2.2.5 () from /usr/lib/libc.so.6

for me it only happen on kde, on gnome is seems to work just fine

@KottV
Copy link
Member

KottV commented Dec 25, 2021

surge_xt is tested with 6.1.2 branch https://github.com/lv2-porting-project/JUCE/tree/6.1.2-lv2 does it work for you?

These commits don't build on NixOS; looks like they are trying to use git during the build, which NixOS doesn't allow:
Could NOT find Git (missing: GIT_EXECUTABLE)

is it JUCE-lv2 issue? looks like Surge's option

@magnetophon
Copy link
Author

surge_xt is tested with 6.1.2 branch https://github.com/lv2-porting-project/JUCE/tree/6.1.2-lv2 does it work for you?

Yes it does.

is it JUCE-lv2 issue? looks like Surge's option

It's probably an NixOS issue. Feel free to ignore.

@KottV
Copy link
Member

KottV commented Dec 26, 2021

well, i build Surge XT with 6.1.4 branch and see no crashes in jalv.gtk

изображение

@magnetophon
Copy link
Author

@orivej Does the LV2 of the following pkg work for you?

{ stdenv
, lib
, fetchFromGitHub
, cmake
, pkg-config
, alsa-lib
, freetype
, libjack2
, lv2
, libX11
, libXcursor
, libXext
, libXinerama
, libXrandr
}:

let
  juce-lv2 = stdenv.mkDerivation {
    pname = "juce-lv2";
    version = "unstable-2021-12-11";

    # lv2 branch
    src = fetchFromGitHub {
      owner = "lv2-porting-project";
      repo = "JUCE";
      # see https://github.com/lv2-porting-project/JUCE/issues/18
      # rev = "c5174d84fdb12e2233ec3c502fb6a9c54ed87a9f";
      # sha256 = "sha256-jwWDB0XXaKkHJDNOSnhV4tDd+2lt61Qp8gFwXDuY63c=";
      # see https://github.com/lv2-porting-project/JUCE/issues/18#issuecomment-1001005528
      # rev = "13e817f41f381a72a788618852f9c6799c9a9711";
      # sha256 = "sha256-RNS/CahCWT56n8dReAnMUFAtjZ5jJRvJtecrIgiW8fI=";
      # see https://github.com/lv2-porting-project/JUCE/issues/18?notification_referrer_id=NT_kwDOAHSqD7IyODY2NjgyNDQ2Ojc2NDU3MTE&notifications_query=is%3Aunread#issuecomment-1001152634
      rev = "936a26d4beb49529d68f3c67765d783dc2de4e62";
      sha256 = "sha256-XtLN77GZadKNE5ZfifrvcWIfql15z5KfXzyGYH9/M+c=";
    };

    dontConfigure = true;
    dontBuild = true;

    installPhase = ''
      cp -r . $out
    '';
  };
in
stdenv.mkDerivation rec {
  pname = "surge-XT";
  version = "unstable-2021-12-24";

  src = fetchFromGitHub {
    owner = "surge-synthesizer";
    repo = "surge";
    rev = "74164850e53d4891083a1055da5de538bad6f0a1";
    fetchSubmodules = true;
    sha256 = "sha256-SN1m7BWvLQ7EtaNpfZZ8JB9fHDkd9fa6txAoJvjZpBI=";
  };

  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  buildInputs = [
    alsa-lib
    freetype
    libjack2
    lv2
    libX11
    libXcursor
    libXext
    libXinerama
    libXrandr
  ];

  cmakeFlags = [
    "-DJUCE_SUPPORTS_LV2=ON"
    "-DSURGE_JUCE_PATH=${juce-lv2}"
  ];

  # JUCE dlopen's these at runtime, crashes without them
  NIX_LDFLAGS = (toString [
    "-lX11"
    "-lXext"
    "-lXcursor"
    "-lXinerama"
    "-lXrandr"
    "-ljack -L${libjack2}"
  ]);

  # see https://github.com/NixOS/nixpkgs/pull/149487#issuecomment-991747333
  postPatch = ''
    export XDG_DOCUMENTS_DIR=$(mktemp -d)
  '';

  meta = with lib; {
    description = "LV2 & VST3 synthesizer plug-in (previously released as Vember Audio Surge)";
    homepage = "https://surge-synthesizer.github.io";
    license = licenses.gpl3;
    platforms = [ "x86_64-linux" ];
    maintainers = with maintainers; [ magnetophon orivej ];
  };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants