I want to launch Pd when my raspberry pi boots, so in /etc/rc.local I wrote the following, just before 'exit 0'
usr/local/bin/pd -nogui -open ~/pd_patches/load_test.pd
The patch that's supposed to open turns the DSP on on load and outputs a sine tone at 440 Hz. But when I power up the pi, I hear nothing out of the headphones (I tested the patch and it works if I launch Pd from the terminal).
If I type 'top' in the terminal, I see that there's pd taking some small CPU, but after I exit top, if I type 'killall pd', I get this: pd(2097): Operation not permitted pd: no process found
Is this 2097 Pd's pid?
What am I doing wrong?
On 06/02/15 22:20, Alexandros Drymonitis wrote:
I want to launch Pd when my raspberry pi boots, so in /etc/rc.local I wrote the following, just before 'exit 0'
usr/local/bin/pd -nogui -open ~/pd_patches/load_test.pd
The patch that's supposed to open turns the DSP on on load and outputs a sine tone at 440 Hz. But when I power up the pi, I hear nothing out of the headphones (I tested the patch and it works if I launch Pd from the terminal).
If I type 'top' in the terminal, I see that there's pd taking some small CPU, but after I exit top, if I type 'killall pd', I get this: pd(2097): Operation not permitted pd: no process found
Is this 2097 Pd's pid?
What am I doing wrong?
rc.local runs as root ... to launch pd use:
sudo -u pi -i pd -nogui -noaudio -nomidi /share/master.pd &
or similar, here pi is the user, the & means pd runs in the background.
I usually keep a script at /share/initialise then call it as user pi, it makes it a lot easier to keep different projects ans swap between them.
Simon
On Fri, Feb 6, 2015 at 1:46 PM, Simon Wise simonzwise@gmail.com wrote:
rc.local runs as root ... to launch pd use:
sudo -u pi -i pd -nogui -noaudio -nomidi /share/master.pd &
I don't get the /share/master.pd what is it supposed to do in this command?
or similar, here pi is the user, the & means pd runs in the background.
I usually keep a script at /share/initialise then call it as user pi, it makes it a lot easier to keep different projects ans swap between them.
there's no /share/initialise file or directory... should I create it? And then should I put my script there and call it from rc.local? For example 'sudo -u pi -i sh /share/initialise/launch_pd.sh' is any good (supposing I write a script called launch_pd.sh which launches Pd and open the desired patch...)?
I put 'sudo -u pi -i /usr/local/bin/pd -nogui -open ~/pd_patches/load_test.pd' in rc.local but again it didn't work...
Simon
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
Did you check if rc.local is executable?
Ingo
Von: Pd-list [mailto:pd-list-bounces@lists.iem.at] Im Auftrag von Alexandros Drymonitis Gesendet: Freitag, 6. Februar 2015 13:59 Cc: pd-list@lists.iem.at Betreff: Re: [PD] is /etc/rc.local the script that runs on boot?
On Fri, Feb 6, 2015 at 1:46 PM, Simon Wise simonzwise@gmail.com wrote:
rc.local runs as root ... to launch pd use:
sudo -u pi -i pd -nogui -noaudio -nomidi /share/master.pd &
I don't get the /share/master.pd what is it supposed to do in this command?
or similar, here pi is the user, the & means pd runs in the background.
I usually keep a script at /share/initialise then call it as user pi, it makes it a lot easier to keep different projects ans swap between them.
there's no /share/initialise file or directory... should I create it? And then should I put my script there and call it from rc.local? For example 'sudo -u pi -i sh /share/initialise/launch_pd.sh' is any good (supposing I write a script called launch_pd.sh which launches Pd and open the desired patch...)?
I put 'sudo -u pi -i /usr/local/bin/pd -nogui -open ~/pd_patches/load_test.pd' in rc.local but again it didn't work...
Simon
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On 02/06/2015 01:58 PM, Alexandros Drymonitis wrote:
On Fri, Feb 6, 2015 at 1:46 PM, Simon Wise simonzwise@gmail.com wrote:
rc.local runs as root ... to launch pd use:
sudo -u pi -i pd -nogui -noaudio -nomidi /share/master.pd &
I don't get the /share/master.pd what is it supposed to do in this command?
it's the patch that gets loaded.
or similar, here pi is the user, the & means pd runs in the background.
I usually keep a script at /share/initialise then call it as user pi, it makes it a lot easier to keep different projects ans swap between them.
there's no /share/initialise file or directory... should I create it? And
afaict, simon gave you a description of his setup. the FHS does not mandate (or mention) a /share/initialize file (nor directory), i assume that this is simon's "invention".
what he bsaically tells you is:
patches. (probably you can even make that script be owned by your ordinary user, so you can minimize the need to become root).
the script as your ordinary user (rather than root).
separating the tasks of "running as ordinary user" and "starting Pd" makes it easier to get both things right (and not break one thing while fixing the other)
running pd as an ordinary user minimizes the chances that it will bork your system (remember that Pd was not written with security in mind)
gfmsar IOhannes
On 06/02/15 23:58, Alexandros Drymonitis wrote:
I put 'sudo -u pi -i /usr/local/bin/pd -nogui -open ~/pd_patches/load_test.pd' in rc.local but again it didn't work...
~ means home folder ... but that file is in the home folder of pi, not of root (which is running this command) ... use:
sudo -u pi -i /usr/local/bin/pd -nogui -open /home/pi/pd_patches/load_test.pd
in any case using explict full paths is a good idea in root scripts like rc.local.
Iohannes answered the rest, I was a too terse! yes, to make it easy to work with several projects and Pis I keep all the project specific stuff in a folder I call /share/ ... then it is easy to swap between projects.
simon
hi,
in my case, I put my scripts in /etc/init.d and then make them run on boot with update-rc.d or insserv if I need to run them when plugin a USB device, I wrote a udev rules and if I need networking, I put my script in /etc/networking/if-up.d running a pd patch at startup that relies on network implies to check the network state inside Pd running the patch through if-up.d and stoping it with if-down is more robust to my eyes
a
-- do it yourself http://antoine.villeret.free.fr
2015-02-06 16:00 GMT+01:00 Simon Wise simonzwise@gmail.com:
On 06/02/15 23:58, Alexandros Drymonitis wrote:
I put 'sudo -u pi -i /usr/local/bin/pd -nogui -open
~/pd_patches/load_test.pd' in rc.local but again it didn't work...
~ means home folder ... but that file is in the home folder of pi, not of root (which is running this command) ... use:
sudo -u pi -i /usr/local/bin/pd -nogui -open /home/pi/pd_patches/load_test. pd
in any case using explict full paths is a good idea in root scripts like rc.local.
Iohannes answered the rest, I was a too terse! yes, to make it easy to work with several projects and Pis I keep all the project specific stuff in a folder I call /share/ ... then it is easy to swap between projects.
simon
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
On 07/02/15 02:12, Antoine Villeret wrote:
hi,
in my case, I put my scripts in /etc/init.d and then make them run on boot with update-rc.d or insserv if I need to run them when plugin a USB device, I wrote a udev rules and if I need networking, I put my script in /etc/networking/if-up.d running a pd patch at startup that relies on network implies to check the network state inside Pd running the patch through if-up.d and stoping it with if-down is more robust to my eyes
that is a good way to do it .. and with a few scripts running as root then one can automate loading all the required files for a project
but for me I find splitting the project files from the base is very important, especially with varying machines that need different base systems (e.g. I need a different OS for my B+ which is incompatible with my B models with audio cards) and with several similar projects sharing a set of machines, or being swapped into machines owned by other people on different continents. I would rather that no project adds files outside the media folder /srv/ (which contains all machine-specific data such as vids for a particular projector and the cues for that projector) and the /share/ folder (which contains all the project specific scripts, patches etc that are common to all machines in the project).
I try to make the project scripts robust, and to make it possible for the artists I work with to do as much of the adjusting and maintenance as possible.
Antoine, re your audio-video sync question from November ... this code got me close enough for what I needed, by loading the video paused then triggering start via dbus is reasonably consistent, and a fixed short delay kept the audio and video pretty close .. but I am now looking at a couple of modified omxplayers, one that renders to texture and I will look at the omxplayer-sync one also, I would prefer to use the clocking of the audio as the master, and get the videos to stay in sync with that, and need the texture control as well in future.
The omxplayer code is quite big, but I am starting to get a handle on it.
Simon
On 06/02/15 12:58, Alexandros Drymonitis wrote:
I put 'sudo -u pi -i /usr/local/bin/pd -nogui -open ~/pd_patches/load_test.pd' in rc.local but again it didn't work...
~/ gets expanded by the shell to the contents of ${HOME} before the sudo command is even executed, so it's going to be root's home, usually /root
full path to the script in your /etc/rc.local sudo command (avoid using ~/ or ${HOME}).
On Fri, Feb 6, 2015 at 5:12 PM, Claude Heiland-Allen claude@mathr.co.uk wrote:
On 06/02/15 12:58, Alexandros Drymonitis wrote:
I put 'sudo -u pi -i /usr/local/bin/pd -nogui -open ~/pd_patches/load_test.pd' in rc.local but again it didn't work...
~/ gets expanded by the shell to the contents of ${HOME} before the sudo command is even executed, so it's going to be root's home, usually /root - (as recommended by others) launch pd from a script, and specify the full path to the script in your /etc/rc.local sudo command (avoid using ~/ or ${HOME}).
That worked. Claude and Simon, you guys were right about this. Thanks a lot to all.