Vember surge synth opensourced, builds and runs on Linux

Ahhh, great!

I will start a first try…

The race is on…

2 Likes

:face_with_monocle: Obviously as proof from the winner !!

3 Likes

Hmmm… that’s what I have until now:

#!/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
cp build-linux.sh build-linux-arm.sh
sed -i 's/x64/armv7ve/g' build-linux-arm.sh
sed -i "s#lv2_dest_path=\"/usr/lib/lv2\"#lv2_dest_path=\"$ZYNTHIAN_PLUGINS_DIR/lv2\"#g" build-linux-arm.sh
./build-linux-arm.sh build --project=lv2 >/dev/null 2>&1 # VERY BAD HACK!
sed -i 's/-msse2//g' surge-lv2.make
sed -i 's/^DEFINES += /DEFINES += -DNEON_SSE=1 /g' surge-lv2.make
#sed -i 's/ -lgcc_s -lgcc//g' surge-lv2.make
#sed -i 's/ -fdata-sections -ffunction-sections//g' surge-lv2.make
./build-linux-arm.sh -v build --project=lv2
./build-linux-arm.sh -v install --project=lv2
./build-linux-arm.sh clean-all
cd ..

But I am getting strange problems when linking:
make[1]: *** [surge-lv2.make:351: target/lv2/Release/Surge.lv2/Surge.so] Bus error

When I link “by hand” (with cut’n’paste the complete command) it works:

root@zynthian:/zynthian/zynthian-sw/plugins/surge# find . -iname "Surge.so"
./target/lv2/Release/Surge.lv2/Surge.so
root@zynthian:/zynthian/zynthian-sw/plugins/surge# ls -al ./target/lv2/Release/Surge.lv2/Surge.so
-rwxr-xr-x 1 root root 3597848 Apr 30 14:04 ./target/lv2/Release/Surge.lv2/Surge.so
root@zynthian:/zynthian/zynthian-sw/plugins/surge# file ./target/lv2/Release/Surge.lv2/Surge.so
./target/lv2/Release/Surge.lv2/Surge.so: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=379c776478770db725b013a5c57579567c3f258c, stripped

But the script which should generate the LV2 TTL files from this shared object does stop also:

root@zynthian:/zynthian/zynthian-sw/plugins/surge# python scripts/linux/generate-lv2-ttl.py target/lv2/Release/Surge.lv2/Surge.so
Bus error

For now I will give up, perhaps @Baggypants has some ideas…

Regards, Holger

1 Like

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…