Trouble with SooperLooper compilation/execution on Raspberry Pi

Programming applications for making music on Linux.

Moderators: khz, MattKingUSA

User avatar
Digital Larry
Established Member
Posts: 127
Joined: Thu Jan 09, 2014 5:25 am

Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Digital Larry » Sun Nov 10, 2019 3:03 pm

First let me sing praises loud and clear for Jesse Chappell, the guy who initially wrote SooperLooper. The first release was 15 years ago and while the UI isn't beautiful, I've managed to get better results with this than many other packages or hardware pedals. The way my musical mind works, I cannot tolerate high levels of complexity, which way too many music making apps have on tap. tap? :D sorry.

I managed to compile SooperLooper under Ubuntu Studio, and I found a couple things that needed changing which I documented on the SooperLooper forum here:

http://essej.net/slforum/viewtopic.php? ... 7287#p7287

I still had to make the change to build rubberband, while fftw3 didn't have any problems compiling this time.

Now, here's what happens when I run sooperlooper (just the engine part) on my Pi:

Code: Select all

pi@raspberrypi:~ $ sooperlooper
SooperLooper 1.7.3
Copyright 2007 Jesse Chappell
OSC server URI (network) is: osc.udp://raspberrypi:9952/



(no errors)

Here's what I get when trying to run slgui:

Code: Select all

pi@raspberrypi:~/Downloads/sooperlooper/src/gui $ which slgui
/usr/local/bin/slgui
pi@raspberrypi:~/Downloads/sooperlooper/src/gui $ ls -l $(which slgui)
-rwxr-xr-x 1 root root 15424652 Nov 10 06:19 /usr/local/bin/slgui
pi@raspberrypi:~/Downloads/sooperlooper/src/gui $ slgui
slgui: our URL is osc.udp://raspberrypi:17056/
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  12 (X_ConfigureWindow)
  Value in failed request:  0x0
  Serial number of failed request:  1046
  Current serial number in output stream:  1048
pi@raspberrypi:~/Downloads/sooperlooper/src/gui $


I did a web search on this error and seems like it has something to do with the X subsystem. It's not specific to Pi. Note that at the moment I am running this command using VNC to a terminal window.

https://askubuntu.com/questions/833795/ ... r-operatio

If I run the installed version of SooperLooper that came from the Raspbian repository, I get this (and it works):
sooper-looper-02.JPG


I tried running gdb, and the same error pops up when I set a breakpoint at "main", run to main, and then use the "next" command:

Code: Select all

Breakpoint 1, main (argc=1, argv=0x7efff384) at gui_app.cpp:65
65   IMPLEMENT_APP(SooperLooperGui::GuiApp)
(gdb) n
slgui: our URL is osc.udp://raspberrypi:17528/
[New Thread 0x732722f0 (LWP 27571)]
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  12 (X_ConfigureWindow)
  Value in failed request:  0x0
  Serial number of failed request:  1046
  Current serial number in output stream:  1048
[Thread 0x73758010 (LWP 27568) exited]
warning: Error removing breakpoint 0
warning: Error removing breakpoint 0
warning: Error removing breakpoint 0
warning: Error removing breakpoint 0
warning: Error removing breakpoint 0
warning: Error removing breakpoint 0
[Inferior 1 (process 27568) exited with code 01]
(gdb)


I'll trace into the code to see where it's going wrong, but this seems common enough that maybe one of you wizards knows what I've done wrong.
You do not have the required permissions to view the files attached to this post.
Last edited by Digital Larry on Mon Nov 11, 2019 3:09 pm, edited 3 times in total.

User avatar
Digital Larry
Established Member
Posts: 127
Joined: Thu Jan 09, 2014 5:25 am

Re: Trouble with SooperLooper compilation on Raspberry Pi

Postby Digital Larry » Sun Nov 10, 2019 3:07 pm

Same thing happens if I try to use "s" instead of "n" so I trace into functions instead of executing until they return. I am not very experienced with gdb so maybe I'm doing something stupid.

Code: Select all

Breakpoint 1, main (argc=1, argv=0x7efff384) at gui_app.cpp:65
65   IMPLEMENT_APP(SooperLooperGui::GuiApp)
(gdb) s
slgui: our URL is osc.udp://raspberrypi:17725/
[New Thread 0x732722f0 (LWP 27579)]
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  12 (X_ConfigureWindow)
  Value in failed request:  0x0
  Serial number of failed request:  1046
  Current serial number in output stream:  1048
[Thread 0x73758010 (LWP 27576) exited]
warning: Error removing breakpoint 0
warning: Error removing breakpoint 0
warning: Error removing breakpoint 0
warning: Error removing breakpoint 0
warning: Error removing breakpoint 0
warning: Error removing breakpoint 0
[Inferior 1 (process 27576) exited with code 01]
(gdb)


I am guessing that perhaps I didn't configure the wxWidgets build properly when I ran that. You're supposed to run:

Code: Select all

./configure --enable-gtk2


I can't think of anything else. gtk does appear to be running here (or at least it's in the path of something that is running, I do not know exactly what this is):

Code: Select all

pi@raspberrypi:~ $ ps ax | grep gtk
  868 ?        Sl     0:00 /usr/lib/gvfs/gvfsd-trash --spawner :1.4 /org/gtk/gvfs/exec_spaw/0
27583 pts/5    S+     0:00 grep --color=auto gtk
pi@raspberrypi:~ $


I did a "make clean" in wxWidgets and am running "./configure --enable-gtk2". Here is the relevant output:

Code: Select all

checking for GTK+ version...
checking for pkg-config... /usr/bin/pkg-config
checking for GTK+ - version >= 2.6.0... yes (version 2.24.32)
checking if GTK+ is version >= 2.18... yes
checking for X11/Xlib.h... yes
checking for X11/XKBlib.h... yes
checking for Xxf86vm... yes
checking for X11/extensions/xf86vmode.h... yes
checking for SM... yes
checking for OpenGL headers... found in /usr/include
checking for GL/gl.h... yes
checking for GL/glu.h... yes
checking for GL... yes
checking for GLU... yes

...


Configured wxWidgets 3.0.4 for `armv7l-unknown-linux-gnueabihf'

  Which GUI toolkit should wxWidgets use?                 GTK+ 2 with support for GTK+ printing libnotify
  Should wxWidgets be compiled into single library?       no
  Should wxWidgets be linked as a shared library?         yes
  Should wxWidgets support Unicode?                       yes (using wchar_t)
  What level of wxWidgets compatibility should be enabled?
                                       wxWidgets 2.6      no
                                       wxWidgets 2.8      yes
  Which libraries should wxWidgets use?
                                       STL                no
                                       jpeg               sys
                                       png                sys
                                       regex              builtin
                                       tiff               sys
                                       zlib               sys
                                       expat              sys
                                       libmspack          no
                                       sdl                no

pi@raspberrypi:~/Downloads/wxWidgets-3.0.4 $


User avatar
Digital Larry
Established Member
Posts: 127
Joined: Thu Jan 09, 2014 5:25 am

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Digital Larry » Sun Nov 10, 2019 5:45 pm

Now I'm getting this:

Code: Select all

pi@raspberrypi:~/Downloads/sooperlooper/src $ cd gui
pi@raspberrypi:~/Downloads/sooperlooper/src/gui $ ./slgui &
[2] 22792
pi@raspberrypi:~/Downloads/sooperlooper/src/gui $ 17:42:35: Error: Unable to initialize GTK+, is DISPLAY set properly?
pi@raspberrypi:~/Downloads/sooperlooper/src/gui $
[2]+  Exit 255                ./slgui
pi@raspberrypi:~/Downloads/sooperlooper/src/gui $

I may need to go work on the washing machine for a bit. :D

User avatar
Digital Larry
Established Member
Posts: 127
Joined: Thu Jan 09, 2014 5:25 am

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Digital Larry » Sat Nov 16, 2019 10:45 am

My wife wanted me to let you all know, that thanks to my efforts to repair our old washer, we now have a new one. :D She now knows the way to get something new around the house is to encourage me to fix the old one. Dangit! It was supposed to be my little secret.

Back to my SooperLooper saga, I think that rebooting it got rid of the problem I was having with the gtk/DISPLAY errors, much as I don't understand why that is the case. So last night I set about trimming controls out of SooperLooper. That is actually much harder than I expected. I had to write a little script that would look for the presence of variables outside of my #if/#endif conditional compilation blocks as it was very hard to track them all down just using vi. I figured out how to use gdb (well for a start anyway). Now I'm at the point where I don't get compilation errors, just run time errors. Those are way harder to solve because the places at which I get a seg fault (e.g. trying to use a variable which was never initialized to dereference something) tends to fail far away from the SooperLooper code. But I'm pretty stubborn about these kinda of things. Might get a new dishwasher by the time I'm done. :D

I had been used to using the layout managers in Java Swing for a project I did using that a few years ago. wxWidgets uses a similar thing and it requires a fair bit of planning to get that to work right after rearranging. There is a W-word visual tool for wxWidgets called wxStudio I think, but it's not clear that I can use that here as I don't think it was originally developed with it. So I have to map out the current use of the layout manager and then strategize how to move things around within that.

User avatar
Digital Larry
Established Member
Posts: 127
Joined: Thu Jan 09, 2014 5:25 am

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Digital Larry » Thu Nov 28, 2019 4:13 pm

I had to sign up to the wxWidgets forum and get some debugging tips from an expert, but I think I have solved my problem as regards simplifying the UI for SooperLooper to let it run on a 7" LCD on my Raspberry Pi.

Before is above, after below.

slgui-before-and-after.JPG


Next up, trying to get real time kernel onto my Pi. There's an alternative I read about for multi core devices that sets one aside for a dedicated process such that Linux doesn't try to use it.
You do not have the required permissions to view the files attached to this post.

User avatar
Linuxmusician01
Established Member
Posts: 674
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Linuxmusician01 » Fri Nov 29, 2019 1:30 pm

Digital Larry wrote:I had to sign up to the wxWidgets forum and get some debugging tips from an expert, but I think I have solved my problem as regards simplifying the UI for SooperLooper to let it run on a 7" LCD on my Raspberry Pi.

Before is above, after below.

[picture snip!]

Next up, trying to get real time kernel onto my Pi. There's an alternative I read about for multi core devices that sets one aside for a dedicated process such that Linux doesn't try to use it.

If I want to compile Sooperlooper on my Pi just like you did, what do I have to do? Do you have a procedure? I like the simplified look. :)

User avatar
Digital Larry
Established Member
Posts: 127
Joined: Thu Jan 09, 2014 5:25 am

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Digital Larry » Fri Nov 29, 2019 2:50 pm

Linuxmusician01 wrote:If I want to compile Sooperlooper on my Pi just like you did, what do I have to do? Do you have a procedure? I like the simplified look. :)


You can probably read between the lines of the build requirements at the bottom of this page: https://github.com/essej/sooperlooper

Note that if you are just going to try to modify the UI, you don't need all of that as the UI and server are two different apps. I think that I built SooperLooper under Ubuntu Studio 19, Mac, and most recently Raspbian, and the world would be a better place if I'd taken notes! I'll have to stumble through it again. Right now I am operating in the src/gui folder which has its own makefile that just deals with the GUI code.

I'm fairly sure you'll need:

wxWidgets
liblio

maybe:
ncurses and libxml

almost certainly not:
rubberband, fftw3, libsndfile, libsamplerate and jack

On the Pi, I actually built everything from source, which is probably not necessary. Part of the "reading between the lines" is that (speaking very roughly) when they say "you need jack", what you want is something called libjack-dev or similar. You don't really need to build all that from source. wxWidgets takes about 70 minutes to build on a Pi 3B.

Be warned, I haven't concluded that SL works well on a Pi. So my next step is to see how far I get with tweaking of jack parameters and if that is not adequate to getting rid of the glitching, I will probably try a real-time kernel or some other tricks I've read about.

I also need to fork the sooperlooper repo over to my own Github account so I can check in my code changes there.

User avatar
Linuxmusician01
Established Member
Posts: 674
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Linuxmusician01 » Sat Nov 30, 2019 1:50 pm

Digital Larry wrote:
Linuxmusician01 wrote:If I want to compile Sooperlooper on my Pi just like you did, what do I have to do? Do you have a procedure? I like the simplified look. :)


You can probably read between the lines of the build requirements at the bottom of this page: https://github.com/essej/sooperlooper

Note that if you are just going to try to modify the UI, you don't need all of that as the UI and server are two different apps. I think that I built SooperLooper under Ubuntu Studio 19, Mac, and most recently Raspbian, and the world would be a better place if I'd taken notes! I'll have to stumble through it again. Right now I am operating in the src/gui folder which has its own makefile that just deals with the GUI code.

I'm fairly sure you'll need:

wxWidgets
liblio

maybe:
ncurses and libxml

almost certainly not:
rubberband, fftw3, libsndfile, libsamplerate and jack

On the Pi, I actually built everything from source, which is probably not necessary. Part of the "reading between the lines" is that (speaking very roughly) when they say "you need jack", what you want is something called libjack-dev or similar. You don't really need to build all that from source. wxWidgets takes about 70 minutes to build on a Pi 3B.

Be warned, I haven't concluded that SL works well on a Pi. So my next step is to see how far I get with tweaking of jack parameters and if that is not adequate to getting rid of the glitching, I will probably try a real-time kernel or some other tricks I've read about.

I also need to fork the sooperlooper repo over to my own Github account so I can check in my code changes there.

Thanks for the tips. How did you modify the UI? What file from the source code did you modify? Can you post said file on https://pastebin.com ?

User avatar
Digital Larry
Established Member
Posts: 127
Joined: Thu Jan 09, 2014 5:25 am

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Digital Larry » Sat Nov 30, 2019 3:57 pm

Linuxmusician01 wrote:Thanks for the tips. How did you modify the UI? What file from the source code did you modify? Can you post said file on https://pastebin.com ?

Here's a link to my forked repo at Github. https://github.com/HolyCityAudio/sooperlooper

Down in src/gui, I am editing main_panel.cpp (the global parameters at the top edge) and looper_panel.cpp (the per track parameters).

The layout consists of objects called wxBoxSizers, into which you can stack some other controls. Then you can put vertically oriented wxBoxSizers inside horizontally oriented wxBoxSizers. etc. etc. There's apparently a way to get wxWidgets to show you outlines of the wxBoxSizers but you have to compile the package with debug level set to 2. I tried it and it didn't work. Then last night I toasted my JACK somehow (having the repo-installed package in /usr/bin and my own built version in /usr/local/bin, painted into a corner. The instructions on the JACK page actually pointed out that if you are building and installing JACK from source on top of an existing package, you need to use "--prefix /usr" when configuring the build. So, too late for that, I reimaged the SD card (after checking my code changes into Github) and am compiling wxWidgets yet again. :D I'm not going to rebuild JACK as it's not needed for the GUI as far as I can tell.

Let me know if you have some questions, as I understand this code a little bit now. You could ask at the SooperLooper forum, but it's fairly quiet over there.

User avatar
Digital Larry
Established Member
Posts: 127
Joined: Thu Jan 09, 2014 5:25 am

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Digital Larry » Sat Nov 30, 2019 11:26 pm

OK, sadly there's no easy way to shortcut building just the slgui. I took a log of everything I did, but it was from 3 different computers over a couple days and will require a little sifting to get the important stuff out. One thing happened that I wasn't expecting, which was a compile error against the function "SetVirtualSizeHints" or something like that in a couple of the files. I replaced it with "SetVirtualSize" but now I'm getting assert failure popups whenever adding a new loop. It's just annoying for now. Some cross checking on this function against the WxWidgets documentation shows that it was deprecated, and they suggest using something else, like "FitInside" but it's not quite as straightforward as all that.

I am not sure why this happened this time and not previously. The SooperLooper instructions say you should use "--enable-gtk2" when configuring wxWidgets, but that's not an available option. I looked at all the options and the closest thing is "--with-gtk=2" or something similar. Also, this time when I built wxWidgets it took almost 4 hours, not sure why. I have a CPU load meter running and it looks like running a big "make" takes it to 25% or maxing out 1 of 4 cores.

All that said, I did get 3 stereo loops running, and it's OK but the audio is a bit glitchy. I also installed Guitarix which is kinda cool, didn't help or hurt with the glitchiness. One thing that's interesting is that when I was trying out Fedora from CCRMA a few months back, without a low latency or RT kernel, I could make the sound completely go to heck by dragging an app window around the screen. That was on an Athlon 740-something PC. But that doesn't do anything to increase glitchiness on the Pi.

I am using the settings screen of qjackctl to set my JACK parameters, using 512 bytes and 3 periods for a buffer. There is some slightly noticeable latency at this setting. With the Behringer UMC404 there's a knob that lets you pan between direct monitoring and the digital return, so it can be faked in the analog world.

I wish there were a way to prove what the cause of the glitches is. I've had a few xruns but not nearly as many as just little glitches or warbles.

AndersBiork
Established Member
Posts: 16
Joined: Tue Nov 15, 2016 12:11 pm

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby AndersBiork » Sun Dec 01, 2019 1:32 pm

I dont know if you are aware of it but there is a simplified version of the sooperlooper for the modduo which
also is found in the modep project. https://blokas.io/modep/
https://github.com/BlokasLabs/modep

I dont know what you can make of it just thought I should mention it.

Anders
My mother tongue is swedish. Running KXstudio on Xubuntu 18.04. No wine. But beer.

User avatar
Digital Larry
Established Member
Posts: 127
Joined: Thu Jan 09, 2014 5:25 am

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Digital Larry » Sun Dec 01, 2019 2:02 pm

AndersBiork wrote:I dont know if you are aware of it but there is a simplified version of the sooperlooper for the modduo which
also is found in the modep project. https://blokas.io/modep/
https://github.com/BlokasLabs/modep

I dont know what you can make of it just thought I should mention it.

Anders

Thanks, I'll take a look. Mod Duo is almost $400 though. With the Pi and a little 7" display, a Softstep MIDI footpedal and Behringer audio IF, I am really getting close to an ideal UI for my personal looping style. It's small, I can put it on top of my guitar amp rack box so I can interact with it directly, using a mouse when needed, keyboard when needed, but mostly via MIDI. So I just have to get over the audio quality hump. If I can't then I will go in search of some better hardware and still use the same concept of an LCD display. To me it is the best of all worlds.

MOD Dep looks cool though (MOD Emulator for Pi)! I will check that out. Yet another distraction!
Last edited by Digital Larry on Sun Dec 01, 2019 2:18 pm, edited 2 times in total.

User avatar
Digital Larry
Established Member
Posts: 127
Joined: Thu Jan 09, 2014 5:25 am

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Digital Larry » Sun Dec 01, 2019 2:07 pm

Regarding build preparation on the Pi, I am going to try to come up with a comprehensive set of instructions (i.e. a script) that will take a Pi running Raspbian and prepare it for developing SooperLooper. Here's what I have so far:

Code: Select all

sudo apt install -y autoconf
sudo apt install -y autopoint
sudo apt install -y libtool-bin
sudo apt install -y sigc++
sudo apt install -y libxml2
sudo apt install -y libxml2-dev
sudo apt install -y libjack-jackd2-dev
sudo apt install -y liblo-dev
sudo apt install -y libsamplerate0-dev
sudo apt install -y libsndfile1-dev
sudo apt install -y librubberband-dev
sudo apt install -y libwxbase2.8-dev
sudo apt install -y libwxgtk2.8-dev
sudo apt install -y libncurses5-dev


This is of course, in addition to cloning my repo from Github, or the original one, wherever you want to start.

You also have to get wxWidgets source from their web site and compile it. [edit: no you don't]

I believe that configure should take --enable-compat28 and --with-gtk=2, but I am still checking that.

At first wxWidgets took about 70 minutes to compile. Last 2 times I tried, it was around 4 hours! So checking different flags with wxWidgets is not exactly easy. :evil:
Last edited by Digital Larry on Wed Dec 04, 2019 5:36 am, edited 4 times in total.

User avatar
Linuxmusician01
Established Member
Posts: 674
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Linuxmusician01 » Sun Dec 01, 2019 2:24 pm

Digital Larry wrote:[...] Some cross checking on this function against the WxWidgets documentation shows that it was deprecated, and they suggest using something else, like "FitInside" but it's not quite as straightforward as all that.

Thank you for the detailed info. I have very bad experiences w/ building stuff from source. Not only considering dependency hell, but w/ seemingly deprecated commands in the source code itself. Why they make compilers that are not backwards compatible so everybody must re-write one's source code every year is a mystery to me. Stuff written in Python, for instance, I avoid like the plague.

Why do you compile wxWidgts on the Pi from source? Won't the libwxbase2.8-dev package work for you?

Digital Larry wrote:I am not sure why this happened this time and not previously. The SooperLooper instructions say you should use "--enable-gtk2"

I don't know for sure, but isn't gtk2 deprecated in itself since gtk3 came out? Maybe it's still in many repo's for backwards compatibility, but in the future...

User avatar
Digital Larry
Established Member
Posts: 127
Joined: Thu Jan 09, 2014 5:25 am

Re: Trouble with SooperLooper compilation/execution on Raspberry Pi

Postby Digital Larry » Sun Dec 01, 2019 5:45 pm

Linuxmusician01 wrote:
Digital Larry wrote:[...] Some cross checking on this function against the WxWidgets documentation shows that it was deprecated, and they suggest using something else, like "FitInside" but it's not quite as straightforward as all that.

Thank you for the detailed info. I have very bad experiences w/ building stuff from source. Not only considering dependency hell, but w/ seemingly deprecated commands in the source code itself. Why they make compilers that are not backwards compatible so everybody must re-write one's source code every year is a mystery to me. Stuff written in Python, for instance, I avoid like the plague.

Why do you compile wxWidgts on the Pi from source? Won't the libwxbase2.8-dev package work for you?

Digital Larry wrote:I am not sure why this happened this time and not previously. The SooperLooper instructions say you should use "--enable-gtk2"

I don't know for sure, but isn't gtk2 deprecated in itself since gtk3 came out? Maybe it's still in many repo's for backwards compatibility, but in the future...

Hmmm. If you can get away with not compiling wxWidgets, so much the better! The only reason I can think of at the moment would be if you wanted to change the debug level or something like that. When I fine tune the procedure I will try that. Thanks! I don't know much if anything about gtk2 or 3 and I just blow through this stuff trying to get rid of error messages and not giving it enough thought other than that!


Return to “Developer's Section”

Who is online

Users browsing this forum: No registered users and 18 guests