So, I'm in the last stage of developing my Bela live looping pedal and for the first time, I tried the "Run project on boot" option for my SuperCollider code which consists of one _main.scd file and two custom class files I have saved in /usr/local/share/SuperCollider/Extensions.

When I reboot Bela, the project does not load and the IDE shows me these systemd messages:

make: Leaving directory '/root/Bela'
Nov 03 17:17:22 bela systemd[1]: bela_startup.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Nov 03 17:17:22 bela systemd[1]: bela_startup.service: Unit entered failed state.
Nov 03 17:17:22 bela systemd[1]: bela_startup.service: Failed with result 'exit-code'.
Nov 03 17:17:23 bela systemd[1]: bela_startup.service: Service hold-off time over, scheduling restart.
Nov 03 17:17:23 bela systemd[1]: Stopped Run Bela at boot.
Nov 03 17:17:23 bela systemd[1]: bela_startup.service: Start request repeated too quickly.
Nov 03 17:17:23 bela systemd[1]: Failed to start Run Bela at boot.
Nov 03 17:17:23 bela systemd[1]: bela_startup.service: Unit entered failed state.
Nov 03 17:17:23 bela systemd[1]: bela_startup.service: Failed with result 'exit-code'.

Does anyone have an idea?

Hmmm,
What version is your image?

run this in the console at the bottom of the IDE:

grep v0 /etc/motd

?
Also, did you update your core code?
I fixed a bug on Supercollider startup programs earlier this year, but it was shortly lived, and the log was different from this AFAICT.

grep v0 /etc/motd

gives me:

Bela image, v0.3.6a, 15 October 2018

I just tried with a few other projects. The basic sine wave project loads fine but even the most basic SuperCollider project fails.

Can you point me to the SC startup code? I'd like to take a look at it but I'm still rather confused about how SC is integrated with Bela so I have no idea where to look.

Usually something like

sclang <options> <path-to-_main.scd>

should be enough.

Ha ! That's exactly the image for which it failed: it was fixed four days later:

https://github.com/BelaPlatform/Bela/commit/9934cf64a0c260b3712f2e347f985ffa792f3d43#diff-b67911656ef5d18c4ae36cb6741b7965

you see there that all it happens to start sclang is:

bash -c 'touch /tmp/sclang.yaml; rm -rf $(SCLANG_FIFO) && mkfifo $(SCLANG_FIFO) &&
   sclang -l /tmp/sclang.yaml $(SUPERCOLLIDER_FILE) <> $(SCLANG_FIFO)'

which is a verbose way of running

 sclang -l /tmp/sclang.yaml /root/Bela/projects/projectName/_main.scd

with the additional FIFO stuff (just needed to keep prevent sclang from detecting an "end of file" when run as a service.
The code on the board you have will be missing -l /tmp/sclang.yaml in the sclang command (and the touch /tmp/sclang.yaml in that line), as this workaround was needed for this.

Long story short, if you update your board's code to the latest version, that should take care of this. There is - however - currently a (browser-dependent) issue when updating the board from the IDE, so I'd suggest - especially if you are on Mac or Linux - that you try the alternative update method first:
- download https://github.com/BelaPlatform/Bela/archive/master.zip
- unzip
- navigate to Bela/scripts and double click on update_board, follow the instructions on the screen and you should be all set

PS: alternatively just download the newest Makefile from here and copy it to the board on /root/Bela/ if that is easier for you (e.g.: scp /path/to/Makefile root@192.168.7.2:Bela/).

Thanks a lot, Giulio, for the help and the background info. I just updated the board and my project loads on boot.

3 years later

Hi giulio,

I am having this same issue. I was loading a puredata, then I received the same messages listed above in the OP. I'm following the directions you posted above, having downloaded the Bela/archive/master.zip from the github. I'm hoping this will fix my bela saltπŸ™‚

If you have any helpful advice, I'd very much appreciate it. I'm trying to get it back up for a performance tomorrow haha

Can you postthe actual console message you are getting? What board version do you have (see above instructions) and did updating with the zip archive fix it?

Hi giulio!

I didn't see this response until just now. Yes, it was actually fixed by following these instructions above. My current problem is not being able to run the cyclone or else externals, though the manta external works. I posted this in a different thread, so my apologies for convoluting this one. feel free to delete my posts in this thread if that helps clear things upπŸ™‚