Vember surge synth opensourced, builds and runs on Linux

Yes, i remember …

C0d3man, I try your recipe but the compilation is a debug version.
I change in surge-lv2.make config=debug_x64 by config=release_x64

The compilation has no error, but when testing on zynthian no sound.

I install raspbian on another pi, and install surge from kxstudio, it does not work, same bus error.

Are you sure? Even it is named debug, all debug flags are removed (especially ‘-g’).

Regards, Holger

No, I’m not sure, but it puts the compilation in debug directory with the name debug so the end of your recipe can’t work.

On Raspbian, I take the compilation done by your recipe, and I get the interface, with some error about preset missing.
Surge want the preset in /usr/local/share/Surge
after copying preset, sound works on raspbian but not yet on Zynthian

Edit :
I install carla, I manually plug ch0 of zynmidirouter to Surge, and audio out to system playback, I get sound :sunglasses:

The UI of surge don’t want to open, but for now I get sound

FYI, this is my conversation with falkTX:

jofemodo 10:46:47
Hi @falktx! I’m trying to run the surge’s LV2 plugin from KXStudio repositories, on RBPi4 with latest raspbian, but i get a “Bus error”. The kernel’s log dumps this nice messages:

falktx 11:35:42
I never tested that build, it might need some work.
mostly I got it to compile, but did not have time to check much further
see SSE2 to NEON compatibility by falkTX · Pull Request #1606 · surge-synthesizer/surge · GitHub for the current discussion
if you have some time that you could dedicate on this, would be very welcome and appreciated

jofemodo 11:48:58
OK! I will do my best :wink:
BTW, Did you manage to successfully run surge on “any” ARM platform?

falktx 11:50:09
I dont recall, I think so but likely only works on aarch64 systems

jofemodo 11:50:36
OK. What i suspected …

falktx 11:50:39
the ttl generator crashes under arm, so I am guessing that has core issues to solve
you are running arm and not aarch64 I guess?

jofemodo 11:51:24
Yes. 32 bit Raspberry Pi OS

falktx 11:51:33
also, do note surge lv2 is broken/WIP, not to be considered stable right now
there is an ongoing PR for that

jofemodo 11:52:11
OK! Thanks for the advice …

falktx 11:52:48
ok, so arm build might need a bit of work. from your crash log it seems just to be about memory alignment, which is sorta trivial to solve if we find the right spot to change would be interesting to try the aarch64 build in any case

jofemodo 11:53:51
I have this marked with bright RED in my loooong TODO list

Regards,

1 Like

I resume the progress:

  • Recipe from C0d3man works, just maybe check why the compilation make the release in debug directory
  • We need to have surge preset in usr/local/share/Surge
  • When ading the layer, the midi is not connected to events_in

Have you managed to run the plugin and get some sound from it?

Yes, but I need to manually connect midi with Carla, with the default sound seems no latency with rapsberry 4
The lv2 plugins I compile :
Surge.lv2.tar.gz (1.3 MB)
and this directory https://github.com/surge-synthesizer/surge/tree/main/resources/data to be put in /usr/local/share/Surge/

I compiled some lv2 presets for if we ever get the lv2 version working! Surge-lv2-presets-leon.tgz (37.5 KB)

You are right! I have fixed this inside my recipe (some messages up) and also fixed another small bug.

Nice! I put them into /zynthian/zynthian-my-data/presets/lv2/ but it seems that Surge does not find them…

Check it’s in your $LV2_PATH?

Checked:

/zynthian/zynthian-plugins/lv2:/zynthian/zynthian-my-plugins/lv2:/zynthian/zynthian-data/presets/lv2:/zynthian/zynthian-my-data/presets/lv2

Manual installation won’t help also. Uploading gives an error.

Sorry, uploading works. But until now: no sound output :cry:

This may be relevant https://github.com/surge-synthesizer/surge/issues/1577

I will try later, for your sound problems do you check with Carla for midi connection.
I think the lv2 is seen as audio plugins not instrument, so not automatic midi connection

@C0d3man I try your new recipe on a fresh zynthian, compilation is ok, just need to install premake5 before
For Surge, we need to copy all the data from/zynthian/zynthian-sw/plugins/surge-arm-build/surge/resources/data to /usr/local/share/Surge

I try to understand why Surge is seen as an audio effect, I look into zynthian_lv2.py to try to change the creation of plugins.json without success.
I change manually in plugins.json to put Surge in MIDI Synth, with this hack, the midi connection works and make sound, @jofemodo do you have an idea why Surge is not in midi synth?
The 4 presets of @Baggypants works, I record this, at the end, my speaker make jerky sound but is not in the record

6 Likes

Surge has audio inputs. Plugins don’t typically don’t advertise themselves as being in a category so there is a script that looks at them and sorts them. I think one of the things the script checks is if a plugin has audio inputs.

Yes, I see this in zynthian_lv2.py:

if n_audio_out>0 and n_audio_in==0:
	if n_midi_in>0:
		return PluginType.MIDI_SYNTH
	else:
		return PluginType.AUDIO_GENERATOR

There is also the plugin.get_class() and for surge it say Instrument.
return of lv2info:

    Name:              Surge
    Class:             Instrument Plugin
    Author:            Vember Audio

Edit1 : maybe since surge is a synth and an audio effect plugins (I see we can make vocoder with midi and audio input) have this kind of plugins in both instrument and FX layer

Edit2: in /zynthian/zynthian-ui/zynthian_lv2.py at line 223 I replace :

plugin_class = str(plugin.get_class().get_label())

by

plugin_class =re.sub(’ Plugin’, ‘’, str(plugin.get_class().get_label()))

like the line 144 which define the class of the lv2 plugin without the terms “Plugins”

With this modification, Surge is shown as in Midi Synth, there is other plugins put in this list instead of audio effect.
List of all plugins affect by this modification :

  • LSP Multi-Sampler x12 DirectOut
  • LSP Multi-Sampler x12 Stereo
  • LSP Multi-Sampler x24 DirectOut
  • LSP Multi-Sampler x24 Stereo
  • LSP Multi-Sampler x48 DirectOut
  • LSP Multi-Sampler x48 Stereo
  • LSP Sampler Mono
  • Surge
  • drumkv1
  • padthv1
  • samplv1
  • synthv1
2 Likes

Sure…

9 Likes

Yes … but i need to install it on my machine and find a fix. I will do ASAP! :wink:

2 Likes

@Jofemodo, I find the problem.
The class of Surge is “Instrument Plugin”, when creating plugins.json, the script remove “Plugin”.
The script zynthian_lv2.py when decide where to put the plugins search if the class is in “Instrument” and that is the problem, “Instrument plugin” is not in “Instrument”.

At line 223, if I replace
plugin_class = str(plugin.get_class().get_label())
by
plugin_class =re.sub(’ Plugin’, ‘’, str(plugin.get_class().get_label()))

It works :wink:

6 Likes