Vember surge synth opensourced, builds and runs on Linux

Ahhh, I forgot to tell:

You need premake5 and Raspian has only premake3… so you have to install by your own:

#!/bin/bash
cd $ZYNTHIAN_PLUGINS_SRC_DIR
git clone https://github.com/premake/premake-core.git
cd premake-core
make -j3 -f Bootstrap.mak linux 
#premake5 gmake
bin/release/premake5 embed
#bin/release/premake5 test
cp bin/release/premake5 /usr/local/bin/premake5
cd ..

Regards, Holger

Hmmm, I tried several hours and made the build script easier, but I am still getting a Bus error for Surge.so.

This is the actual build-script:
#!/bin/bash

cd $ZYNTHIAN_PLUGINS_SRC_DIR
sudo apt-get install --no-install-recommends --yes build-essential libcairo2-dev libxkbcommon-x11-dev libxkbcommon-dev libxcb-cursor-dev libxcb-keysyms1-dev libxcb-util0-dev
git clone https://github.com/falkTX/surge.git
cd surge
git submodule update --init --recursive
premake5 --cc=gcc --os=linux gmake2
sed -i 's/config=debug_x64/config=release_armv7ve/g' surge-lv2.make
sed -i 's/-msse2/-DNEON_SSE=1/g' surge-lv2.make
CXXFLAGS=`echo $CXXFLAGS | sed 's/-munaligned-access //'` make -f surge-lv2.make
rsync -r --delete target/lv2/Release/Surge.lv2 ${ZYNTHIAN_PLUGINS_DIR}/lv2
cd ..

I have no idea… anyone?

Regards, Holger

Same here. Bus error … :worried:

Ok, that was hard work, a lot of testing and reading. hexdump0815 has already done everything for VCVRack - I just had to find it, test it and put it into a suitable script:

#!/bin/bash
# https://github.com/hexdump0815/surge-arm-build
# https://github.com/nemequ/simde

cd $ZYNTHIAN_PLUGINS_SRC_DIR
sudo apt-get install --no-install-recommends --yes build-essential libcairo2-dev libxkbcommon-x11-dev libxkbcommon-dev libxcb-cursor-dev libxcb-keysyms1-dev libxcb-util0-dev
git clone https://github.com/hexdump0815/surge-arm-build.git
cd surge-arm-build
git checkout 5add960506adc2af3a647698edb8fca3f6ef07f0 # just to be sure to use the right version!
git clone https://github.com/surge-synthesizer/surge.git
cd surge
git checkout release_1.6.6
git submodule update --init --recursive
patch --forward -p0 <../surge-armv7l.patch
find * -type f -exec ../simde-ify.sh {} \;
git clone https://github.com/nemequ/simde.git
sed -i 's/flags { "StaticRuntime" }/flags { staticruntime "On" }/g' premake5.lua
premake5 --cc=gcc --os=linux gmake2
sed -i '/^ifndef verbose/,+4d' surge-lv2.make
sed -i 's, -m64,,g;s,-msse2,-march=armv7-a -mfpu=vfpv3-d16 -mno-unaligned-access,g;s,FORCE_INCLUDE +=,FORCE_INCLUDE += -Isimde/simde,g' surge-*.make
sed -i 's,config=debug_x64,config=release_x64,' surge-*.make
CXXFLAGS="" CFLAGS="" make -f surge-lv2.make
rsync -r --delete target/lv2/Release/Surge.lv2 "${ZYNTHIAN_PLUGINS_DIR}/lv2"
cd ..

Now for the restrictions:

  • Whatever the reason is: the synth appears as an LV2 effect and not as a generator.
  • It crashes MOD-UI :unamused: (but not jalv)
  • There is (currently) only one (default-)sound available.
  • The LV2 parameters do not have reasonable names.

Regards, Holger

[EDIT]: PR created.
[EDIT2]: Fixed a problem in the recipe.

4 Likes

I’ve opened an Issue

1 Like

Surge LV2-plugin is already installed on the latest nightly builds, but there is no presets on the bundle. Somebody has LV2-presets for surge? What is the native preset format for Surge? Perhaps we have to write the converter …

Hi Jofemodo, you can grab additionnal preset on https://github.com/surge-synthesizer/surge-synthesizer.github.io/wiki/Additional-Content
I make an update, but did not find surge plugin, do I need to download the nightly builds?

Yes, you need to download one of the latest nightly builds.

Regards,

Okay, found surge in the audio effects tab.
This is how it looks:

whereissurge

and the TAL plugins no longer appear :thinking:

Hi @spurkopf, what SD-image are you using?

Thanks!

I have the same problem, surge happens in audio-fx layer.
I take the last night build https://os.zynthian.org/2020-07-06-zynthianos-buster-lite-armhf-1.0.0.zip

In the log on webconf :

Jul 08 09:13:17 zynthian startx[4827]: ERROR:zynthian_engine: Can't start engine Jalv/Surge => End Of File (EOF). Exception style platform.
Jul 08 09:13:17 zynthian startx[4827]: <pexpect.pty_spawn.spawn object at 0xac57bef0>
Jul 08 09:13:17 zynthian startx[4827]: command: /usr/local/bin/jalv
Jul 08 09:13:17 zynthian startx[4827]: args: ['/usr/local/bin/jalv', '-n', 'Surge-00', 'https://surge-synthesizer.github.io/lv2/surge']
Jul 08 09:13:17 zynthian startx[4827]: buffer (last 100 chars): b''
Jul 08 09:13:17 zynthian startx[4827]: before (last 100 chars): b'k length: 256 frames\r\nMIDI buffers: 32768 bytes\r\nComm buffers: 131072 bytes\r\nUpdate rate: 30.0 Hz\r\n'
Jul 08 09:13:17 zynthian startx[4827]: after: <class 'pexpect.exceptions.EOF'>
Jul 08 09:13:17 zynthian startx[4827]: match: None
Jul 08 09:13:17 zynthian startx[4827]: match_index: None
Jul 08 09:13:17 zynthian startx[4827]: exitstatus: None
Jul 08 09:13:17 zynthian startx[4827]: flag_eof: True
Jul 08 09:13:17 zynthian startx[4827]: pid: 6343
Jul 08 09:13:17 zynthian startx[4827]: child_fd: 34
Jul 08 09:13:17 zynthian startx[4827]: closed: False
Jul 08 09:13:17 zynthian startx[4827]: timeout: 20
Jul 08 09:13:17 zynthian startx[4827]: delimiter: <class 'pexpect.exceptions.EOF'>

Yes, there is some problem with surge engine. When running from command line:

root@zynthian:/usr/lib/lv2/Surge.lv2# jalv https://surge-synthesizer.github.io/lv2/surge
Plugin:       https://surge-synthesizer.github.io/lv2/surge
UI:           None
JACK Name:    Surge
Sample rate:  44100 Hz
Block length: 256 frames
MIDI buffers: 32768 bytes
Comm buffers: 131072 bytes
Update rate:  30.0 Hz
Bus error

I’m afraid we have to do some extra work before having the surge engine working on zynthian :unamused:

I also used:
https://os.zynthian.org/2020-07-06-zynthianos-buster-lite-armhf-1.0.0.zip

but we’re getting closer :slightly_smiling_face:

No so close … a “Bus error” is a bad thing, normally meaning that the program binary is trying to execute code that is not well-formatted and the CPU can’t execute. In fact, when looking at the kernel’s log on zynthian, we can see this beautiful messages:

[ 1307.889030] Alignment trap: not handling instruction f9400aef at [<b16fdb62>]
[ 1307.889038] Unhandled fault: alignment exception (0xa21) at 0xb100aba8
[ 1307.889049] pgd = e4da2cc1
[ 1307.889055] [b100aba8] *pgd=29b76003, *pmd=7fd35003
[ 1485.098175] Alignment trap: not handling instruction f9400aef at [<afffdb62>]
[ 1485.098183] Unhandled fault: alignment exception (0xa21) at 0xafed8ba8
[ 1485.098194] pgd = 69ed81e6
[ 1485.098200] [afed8ba8] *pgd=29ea6003, *pmd=7fde0003
[ 1574.723563] Alignment trap: not handling instruction f9400aef at [<affbbb62>]
[ 1574.723571] Unhandled fault: alignment exception (0xa21) at 0xafe08ba8
[ 1574.723583] pgd = 516f01f0
[ 1574.723589] [afe08ba8] *pgd=296c2003, *pmd=7bce1003
[ 2172.624459] Alignment trap: not handling instruction f9400aef at [<afffdb62>]
[ 2172.624466] Unhandled fault: alignment exception (0xa21) at 0xafe4aba8
[ 2172.624478] pgd = fd218542
[ 2172.624484] [afe4aba8] *pgd=28476003, *pmd=7bddc003
[ 2183.980975] Alignment trap: not handling instruction f9400aef at [<b16fdb62>]
[ 2183.980985] Unhandled fault: alignment exception (0xa21) at 0xb1065ba8
[ 2183.980999] pgd = a9cef924
[ 2183.981005] [b1065ba8] *pgd=29bd1003, *pmd=7c7af003

It seems that Surge doesn’t compile for 32 bits platforms.
I’m trying to contact falkTX via freenode webchat:

https://webchat.freenode.net/?channels=#kxstudio,#opensourcemusicians

Regards!

2 Likes

:+1:

1 Like

That’s exactly what first happend when trying to compile. Look at my recipe to fix this…

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