Alex7
Posts: 10
Joined: Fri Oct 09, 2020 9:57 pm

Cannot autostart supercollider on RPi4

Wed Apr 21, 2021 10:36 am

Hello everybody,

I would like to start my supercollider code right after Pi boots.

If I put in this into the terminal:

Code: Select all

sudo /usr/local/bin/sclang /home/pi/Desktop/mycode.scd
or

Code: Select all

sudo lxterminal -e /usr/local/bin/sclang /home/pi/Desktop/mycode.scd
it works without a problem. However I cannot get it to start on boot. I have went through multiple threads like:

https://community.blokas.io/t/supercoll ... -sh/246/34

or the whole approach suggested here:

https://github.com/supercollider/superc ... ERRY_PI.md

none of the solutions seems to do it. I tried:

adding this into crontab -e:

Code: Select all

@reboot sleep 20 && sudo lxterminal -e /usr/local/bin/sclang /home/pi/Desktop/mycode.scd
or adding the same into

Code: Select all

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
both with and without sleep

Would anyone know what am I doing wrong ? I am not having these issues when I try to run other stuff.

Thank you for any possible suggestions !!

Alex

klricks
Posts: 7733
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Cannot autostart supercollider on RPi4

Wed Apr 21, 2021 1:42 pm

A sleep command can't be used directly in autostart as each command is executed independently..... so sleep will do nothing.
Instead make a bash script and call the bash script from autostart.

Code: Select all

#!/bin/bash
sleep 20
lxterminal -e /usr/local/bin/sclang /home/pi/Desktop/mycode.scd
For autostart details see: viewtopic.php?f=66&t=294014
Why use sudo?
If your script requires network then try setting the wait for network on boot option in sudo raspi-config
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

Return to “General programming discussion”