Skip to content

Instantly share code, notes, and snippets.

Recommendations for Linux Plugin Vendors

Plugins should not rely on external (system-wide) resources, and must be statically linked (except for libc, libX11, and lib/server interfaces).

First of all, one cannot reply that a given compatible shared library is present on the target system. But the real issue however are ABI conflicts:

Say you have one plugin linking against system-wide libaubio.so.2 and another plugin using libaubio.so.3.

#!/usr/bin/python3
# https://pyusb.github.io/pyusb/ -- python3-usb
import usb.core
## Focusrite(R) Scarlett 18i6
device = usb.core.find(idVendor= 0x1235, idProduct=0x8004)
if device is None:
raise ValueError('Device not found')
@x42
x42 / .gitignore
Last active August 25, 2022 09:33
*.swp
*.lv2/
*-svg/
knob
knob.png
// g++ -o /tmp/sf_out sf_out.cc -Wall -lsndfile -lm
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <sndfile.h>
// g++ -o /tmp/sf_out sf_out.cc -Wall -lsndfile
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <sndfile.h>
int main (int argc, char** argv)
@x42
x42 / zenity
Created October 18, 2021 14:42
#!/bin/sh
unset LD_LIBRARY_PATH;
exec /usr/bin/zenity "$@"
ardour {
["type"] = "EditorAction",
name = "Close Gaps",
license = "MIT",
author = "Ardour Team",
description = [[Same as Region > Edit > Close Gaps, but for all regions on selected tracks]]
}
function factory () return function ()
@x42
x42 / peak_calc.cc
Last active September 24, 2021 16:20
// -- Linux / Intel --
// g++ -o peak_calc peak_calc.cc -Wall -mavx -lm -O3 -fopt-info && ./peak_calc
// g++ -o peak_calc peak_calc.cc -Wall -msse2 -lm -O3 -fopt-info && ./peak_calc
//
// -- Linux / ARM --
// g++ -o peak_calc peak_calc.cc -Wall -lm -O3 && ./peak_calc
// g++ -o peak_calc peak_calc.cc -Wall -mfpu=neon-vfpv4 -lm -O3 && ./peak_calc
//
// -- macOS --
// g++ -o peak_calc peak_calc.cc -Wall -lm -O3 -framework Accelerate
// gcc -o /tmp/fft-debug fft-debug.c `pkg-config --libs fftw3f` -lm
// /tmp/fft-debug > /tmp/fft.dat
// gnuplot
// plot '/tmp/fft.dat' u 3 w l, '' u 4 w l, '' u 5 w lp
#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* needed for M_PI */
#endif
#include <fftw3.h>