Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonic Pi 3.0.1 won't run on Raspbian Buster #2095

Open
PhlegmingChee opened this issue Jun 26, 2019 · 20 comments

Comments

@PhlegmingChee
Copy link

commented Jun 26, 2019

So I did a dist-upgrade to Buster from Stretch on my Raspberry Pi 3 B+, but it seems to have borked Sonic Pi.

This is the error log:

Sonic Pi Boot Error Report

System Information

  • Sonic Pi version: 3.0.1
  • OS: Raspbian GNU/Linux 10 (buster)

GUI Log

/home/pi/.sonic-pi/log/gui.log

[GUI] - Detecting port numbers...
[GUI] - GUI OSC listen port 4558
[GUI] -    port: 4558 [OK]
[GUI] - Server OSC listen port 4557
[GUI] -    port: 4557 [OK]
[GUI] - Server incoming OSC cues port 4559
[GUI] -    port: 4559 [OK]
[GUI] - Scsynth port 4556
[GUI] -    port: 4556 [OK]
[GUI] - Server OSC out port 4558
[GUI] - GUI OSC out port 4557
[GUI] - Scsynth send port 4556
[GUI] - Erlang router port 4560
[GUI] -    port: 4560 [OK]
[GUI] - OSC MIDI out port 4561
[GUI] -    port: 4561 [OK]
[GUI] - OSC MIDI in port 4562
[GUI] -    port: 4562 [OK]
[GUI] - Init script completed
[GUI] - using default editor colours
[GUI] - launching Sonic Pi Server:
[GUI] - starting UDP OSC Server on port 4558...
[GUI] - UDP OSC Server ready and listening
[GUI] - Ruby server pid registered: 1269
[GUI] - waiting for Sonic Pi Server to boot...
............................................................
[GUI] - Critical error! Could not boot Sonic Pi Server.
[GUI] - stopping UDP OSC Server...
[GUI] - UDP OSC Server no longer listening

Server Errors

/home/pi/.sonic-pi/log/server-errors.log

Failed to load the fast_osc c-extension, falling back to pure Ruby version
Overriding fast_osc c-extension FastOsc::decode_single_message, falling back to pure Ruby version
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- ffi_c (LoadError)
	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /opt/sonic-pi/app/server/vendor/ffi-1.9.17/lib/ffi.rb:6:in `rescue in <top (required)>'
	from /opt/sonic-pi/app/server/vendor/ffi-1.9.17/lib/ffi.rb:3:in `<top (required)>'
	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /opt/sonic-pi/app/server/vendor/ruby-aubio-prerelease/lib/aubio/api.rb:1:in `<top (required)>'
	from /opt/sonic-pi/app/server/vendor/ruby-aubio-prerelease/lib/aubio.rb:2:in `require_relative'
	from /opt/sonic-pi/app/server/vendor/ruby-aubio-prerelease/lib/aubio.rb:2:in `<top (required)>'
	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /opt/sonic-pi/app/server/sonicpi/lib/sonicpi/samplebuffer.rb:17:in `<top (required)>'
	from /opt/sonic-pi/app/server/sonicpi/lib/sonicpi/studio.rb:16:in `require_relative'
	from /opt/sonic-pi/app/server/sonicpi/lib/sonicpi/studio.rb:16:in `<top (required)>'
	from /opt/sonic-pi/app/gui/qt/../../../app/server/bin/sonic-pi-server.rb:20:in `require_relative'
	from /opt/sonic-pi/app/gui/qt/../../../app/server/bin/sonic-pi-server.rb:20:in `<main>'

Server Output

/home/pi/.sonic-pi/log/server-output.log


Scsynth Output

/home/pi/.sonic-pi/log/scsynth.log


Process Log

/home/pi/.sonic-pi/log/processes.log

No pids store found here: /tmp/sonic-pi-pids
Exiting
Creating pids store: /tmp/sonic-pi-pids
Started [1269] [-] /usr/bin/ruby -E utf-8 /opt/sonic-pi/app/gui/qt/../../../app/server/bin/sonic-pi-server.rb -u 4557 4558 4556 4556 4559 4560 4561 4562 [-] /tmp/sonic-pi-pids/1269



@samaaron

This comment has been minimized.

Copy link
Owner

commented Jun 26, 2019

Sorry, I no longer have the resources to support Raspberry Pi since they stopped funding me.

Could you try with a fresh image of their latest release on a clean SD card. Does that work?

@PhlegmingChee

This comment has been minimized.

Copy link
Author

commented Jun 26, 2019

Hi Sam,
Sorry to learn that RPi Foundation is no longer funding this project.

So I did a clean Buster installation and Sonic Pi is no longer installed by default. I tried installing the 3.0.1 deb package but ran into some missing dependencies, namely ruby2, erlang-base, libqwt-qt5 and libqt5scintilla2. Deciding I will try to fix the dependencies later, I went ahead and tried installing from the default repository. That was successful but it installed version 2.10.

@PhlegmingChee

This comment has been minimized.

Copy link
Author

commented Jun 27, 2019

Buster doesn't seems to like the libqt5scintilla2-v12.5 library (i.e., no longer seems to be available in the repository) so 3.0.1 will not install in Buster.

@glenpike

This comment has been minimized.

Copy link

commented Jun 27, 2019

Would it work if you changed the name of the package in the build file?

libqt5scintilla2-dev -> libqscintilla2-qt5-dev

I think it's renamed slightly?
https://packages.debian.org/search?keywords=libqscintilla2-qt5
https://packages.debian.org/buster/libs/libqscintilla2-qt5-13

@PhlegmingChee

This comment has been minimized.

Copy link
Author

commented Jun 27, 2019

Would it work if you changed the name of the package in the build file?

libqt5scintilla2-dev -> libqscintilla2-qt5-dev

I think it's renamed slightly?
https://packages.debian.org/search?keywords=libqscintilla2-qt5
https://packages.debian.org/buster/libs/libqscintilla2-qt5-13

Doesn't work. I tried that too. dpkg reports that dependency is unmet for libqt5scintilla2-v12.5

@samaaron

This comment has been minimized.

Copy link
Owner

commented Jun 27, 2019

Unfortunately I don't have the resources to work on the Pi version any more and the Raspberry Pi Foundation have been quite short about it all:

RPi-Distro/repo#139

@glenpike

This comment has been minimized.

Copy link

commented Jun 27, 2019

So I manually installed the scintilla lib with sudo apt-get install libqscintilla2-qt5-dev before I did anything else and am trying to build with the (modified) build-debian-app script.

First time round, I tried with option 2, but it failed when it tried to build a deb for Supercollider - I think it's due to this bug: opencv/opencv#8897 (comment)

Now trying to build with option 1. (Pi 3B+)

@PhlegmingChee

This comment has been minimized.

Copy link
Author

commented Jun 27, 2019

Thanks glenpike for looking into this.

I am wondering if this doesn't call out for making Sonic-Pi a Docker image? It is something to think about as a way to freeze the build in "Stretch" so that we keep the dependencies contained in the image, which would allow it to run on "Buster" in the future.

@glenpike

This comment has been minimized.

Copy link

commented Jun 27, 2019

Not sure that Docker wouldn't add more cruft, it may certainly hog resources on RPi <=3

My build from source failed with linker issues on Sonic-Pi, but I was at bleeding edge.
Looking at the building from source doc. It looks like Buster has the versions of Supercollider, SC3 Plugin & Aubio binary packages that are needed. I'm going to try installing these, then rebuilding 3.1.0 tag - slow progress, but let's see.

@glenpike

This comment has been minimized.

Copy link

commented Jun 27, 2019

Ran into issues with the rugged package similar to #1908 - can't figure out how to get around this, so calling it a night.

@glenpike

This comment has been minimized.

Copy link

commented Jul 10, 2019

Right, as an aside, I've managed to get v3.1.0 building on ubuntu 18.04 with a modified build script and using system ruby gems where possible (I guess following dvzrv's comment in #1908 (comment)).

It's in the branch here: https://github.com/glenpike/sonic-pi/tree/devendor-gems
Maybe I will be able to try this on the Raspberry Pi and see if it behaves...

@glenpike

This comment has been minimized.

Copy link

commented Jul 11, 2019

So I built it on Buster (not a clean install) with some messing around, but it seems to hang somewhere with server startup, then fails. I get to 'Boot - Server connection established', but then the 'Studio...' messages don't seem to appear. Will investigate further.

Relevant logs:

==> /home/pi/.sonic-pi/log/server-output.log <==
configuring for 44100Hz, period = 2048 frames (46.4 ms), buffer = 3 periods
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 3 periods for playback
Boot - Starting the SuperCollider server...
Boot - scsynth -u 4556 -m 131072 -a 1024 -D 0 -R 0 -l 1 -i 2 -o 2 -z 128 -c 128 -U /usr/lib/SuperCollider/plugins:/home/pi/sonic-pi/app/server/native/extra-ugens/ -b 4096 -B 127.0.0.1
Boot - SuperCollider booted successfully.
Boot - Connecting to the SuperCollider server...
Boot - Sending /status to server: 127.0.0.1:4556
Boot - Receiving ack from scsynth
Boot - Server connection established

==> /home/pi/.sonic-pi/log/gui.log <==
............................................................
[GUI] - Critical error! Could not boot Sonic Pi Server.
[GUI] - stopping UDP OSC Server...
[GUI] - UDP OSC Server no longer listening
[GUI] - Aborting. Sorry about this.
@samaaron

This comment has been minimized.

Copy link
Owner

commented Jul 11, 2019

@glenpike thanks for investigating this.

For the record soon I will be announcing a kickstarter funding campaign which will have the explicit goal of funding the work to build the infrastructure to create automated releases for Raspbian (and hopefully other platforms).

@glenpike

This comment has been minimized.

Copy link

commented Jul 13, 2019

So I think I found out where the problem is and possibly why - the Ruby server was never receiving an OSC message that the synthdefs had loaded.

Looking at the system versions of supercollider & sc3-plugins in Buster, it appears that they are mismatched:

sudo apt-cache show supercollider
Package: supercollider
Source: supercollider (1:3.8.0~repack-2)
Version: 1:3.8.0~repack-2+b1
Architecture: armhf
sudo apt-cache show sc3-plugins
Package: sc3-plugins
Source: supercollider-sc3-plugins
Version: 3.9.1~repack-3
Installed-Size: 51

The release doc's for SC 3.9.0 specifically state:
plugin binaries compiled for SuperCollider 3.8 will not work with SuperCollider 3.9 and vice versa.

So I am trying to compile from source, but didn't have much luck the first time round when I tried to start the server... This time I will make sure SC and the plugins are behaving first before trying Sonic Pi stuff.

@PhlegmingChee

This comment has been minimized.

Copy link
Author

commented Jul 14, 2019

Great progress, Glen. I'm not sure who maintains this stuff. Does SuperCollider's web site not give a hint? https://supercollider.github.io/

@glenpike

This comment has been minimized.

Copy link

commented Jul 14, 2019

I submitted a but on Raspbian's system and had a reply from someone this morning - https://bugs.launchpad.net/raspbian/+bug/1836465 @samaaron I think Sonic Pi does depend on the plugins - is that right? If so, would you know if the fail at synthdefs loading would relate to this?

@glenpike

This comment has been minimized.

Copy link

commented Jul 14, 2019

Finally... (although it's v3.1)

pi

So, I managed to build Supercollider and SC3 Plugins from source - I used the Version-3.9.3 tag for both, following these instructions: https://supercollider.github.io/development/building-raspberrypi (I'd also installed additional libs from my tweaks to the ubuntu install, but some of these may be redundant (apart from aubio-tools and possibly the change to the scintilla lib - libqscintilla2-qt5-dev?)

One of the things I'd missed last night was not initialising or updating the submodules when I switched tags, so I had compile / link errors. I did install libyaml-cpp-dev and libyaml-cpp0.6, but these may be red-herrings.

Once I got supercollider working, the other issue was the path the Ruby server sets for the plugins (because this was compiled from source, it ends up in /usr/local/lib/SuperCollider/plugins/, which is different from the path passed to '-U' in scsynthexternal.rb). I guess this can be set as a CMAKE option, but I have not looked - I just changed in the ruby file to make it work.

I've ordered some SD cards, so I will try with a clean install of Buster (and possibly retry an update from Stretch, but only if I have time)

@do5rsw

This comment has been minimized.

Copy link

commented Jul 30, 2019

just to facts:

I just installed a brand new raspian buster image into a rpi4 and it came with sonic pi already installed. just it was v2.10.
I tried the .deb provided on the sonic-pi website and I was able to meet all dependencies except one from out the buster repos. This one is libqt5scintilla2-12v5. Same as reported above.
After querying google for a while I found out that this is not a fault of the rpi foundation but more due to the debian foundation. They removed this lib from the official debian buster repo in the beginning of 2018. Due to this it is also missing in raspian buster.
That would also mean you cannot run sonic pi v3 on debian buster for any platform because you cannot meet the dependencies.

The best would be for sonic pi to completely get rid of this dependency. I gues once it is gone in debian stable (which is now) the other distributions an derivates will sooner or later remove it too...

@do5rsw

This comment has been minimized.

Copy link

commented Jul 30, 2019

probably this is the reason for the downgrade to 2.10 in raspian too. I guess 2.10 was the last sonic pi release that did not have that dependency. So the rpi foundation chose that one to be able to still ship sonic pi with raspian buster.

@glenpike

This comment has been minimized.

Copy link

commented Aug 1, 2019

So I've managed to build again on a clean Buster install (RPi 4 really helps speed things up!). Raspbian has fixed an issue with the Supercollider vs SC3-Plugins packages, so it's possible to install these with 'apt'. I think I got a fairly good build (with most gems installed with bundler) on my devendor-gems branch, but waiting on Xavier Riley to merge a PR for his ruby-aubio package. If there is somewhere/someone who knows a bit more about making '.deb' src / other packages, I'd be happy to muck in, but I'm a n00b there. In a previous bug I saw the source package with patches, so I guess we can use the patches in there for the lib unless libaubio is fixed. FastOsc looks like it has been refactored a bit too, so I've had to freeze the version of that.
I need to test my script a few times, but people welcome to try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.