I have the following patch that is working on my Mac.
I upload it to my Pi 2 and when I try to open it pd crashing and close itself.
Can someone see what the issue might be?
-
pd keep crashing when open a patch on Pi 2
-
Some updates:
I disconnected the loading at the top of the patch (which is connected to ';pd dsp 1' and to 'delay 100'When doing so the patch is open without crashing but this is not my wish. I would like it to work with the loadbang message so the patch will start as soon the pi is started.
-
Are you trying to debug it with some debugger? You could also try to put a delay between [loadband] and [; pd dsp 1( and see if that makes a difference. Otherwise you can see if you can turn the DSP on with
pdsend
and then write a script that does this for you. -
@alexandros
So I've did the following: a delay of 2000 ms to the bang object that read the file to the buffer and a delay of 4000 ms to the dsp 1 object. It solved the problem.Thanks!
another question I have (might need to open a new topic?) :
In case that pure data patch is crashing(which have happen to me before) - Is it possible to reboot the Pi? so if pure data crashing automatically Pi will reboot.
-
@KMETE You shouldn't need to reboot, although you can of course.
Discussion here.... https://stackoverflow.com/questions/696839/how-do-i-write-a-bash-script-to-restart-a-process-if-it-dies
David. -
@whale-av said:
this is a little above my head.. How can I make it work for my pd patch?
there is more than 1 answer in that thread. Could you please direct me to one of them?Thanks
-
Hi,
Ideally you should write a systemd config file and let the system restart your patch when neededCreate a new service with
sudo systemctl edit --force --full my_puredata.service
paste this code and customize it
[Unit] Description=My PureData service [Service] Type=simple LimitNOFILE=1000000 ExecStart=/usr/bin/puredata -open /home/pi/mypatch.pd WorkingDirectory=/home/pi User=pi Group=pi Restart=always # Restart service after 10 seconds if service crashes RestartSec=10 [Install] WantedBy=multi-user.target
then run
sudo systemctl enable my_puredata.service
to enable autorun at rpi start
and
sudo systemctl start my_puredata.service
to launch it just nowWork in progress : FCPD a FreeCAD PureData connexion
-
@FFW
Thanks for your help!
my pd patch is already autostart. I don't remember how I did it, I think via the 'lxsession' as I found in that thread .
How can I disabled my way of autostart my pd patch?just to make sure I understand your script -
It will autostart my patch when first powering the pi as well restart it when it crashed?
Another question I regarding opening the pd patch without gui. Do you think is needed? it can help with something? if so - I can I load the pd patch without gui?
Thanks!
-
With systemd you don't need to open a user session. It saves resource and help to keep puredata reactive.
NB : I think you can't launch a GUI with systemd as the X server may not be launched when the service starts.
so you have to append the -nogui option to the ExecStart line.$ pd -help […] -nogui -- suppress starting the GUI […]
Work in progress : FCPD a FreeCAD PureData connexion
-
*edit: I have found it inside the lxesession folder .
*How can I find how and where my pd patch is starting and cancel it? :/ I don't want to write your script before I'm cancelling my autostart of the patch I have already made in the past. -
@FFW said:
then run
sudo systemctl enable my_puredata.service
to enable autorun at rpi start
and
sudo systemctl start my_puredata.service
to launch it just nowwhen I run the last line of code it should autostart my pure data patch if I did everything the right way? because it did not start my patch..
-
I have change the path in yellow to be the correct path where my pd patch is located.
What about the lines in purple and blue? Do I need to change them as well? because I did not.
If so - how can I know to what I should change them?Thanks
-
@KMETE
/usr/bin/puredata is the path to the executable, you can check it withwhereis puredata
WorkingDirectory is not used by PD but it's good to point to a user writable place.
-nogui is mandatory (I just test) as the systemctl process has no right on X server to start a GUI
You can see information about failure with
sudo systemctl stop my_puredata.service sudo systemctl status my_puredata.service
Work in progress : FCPD a FreeCAD PureData connexion
-
@FFW said:
-nogui is mandatory (I just test) as the systemctl process has no right on X server to start a GUI
Where do I add the -nogui command? inside the "MY PureData service" script?
-
@KMETE yes, in the ExecStart line
[Unit] Description=My PureData service [Service] Type=simple LimitNOFILE=1000000 ExecStart=/usr/bin/puredata -nogui -open /home/pi/mypatch.pd WorkingDirectory=/home/pi User=pi Group=pi Restart=always # Restart service after 10 seconds if service crashes RestartSec=10 [Install] WantedBy=multi-user.target
Work in progress : FCPD a FreeCAD PureData connexion
-
So here is the script I try to run with "sudo systemctl enable my_puredata.service"
I got the following error:
Do you see where my mistake is?
Thanks
-
@FFW
Thanks. No error now but the patch is not playing when I reboot my Pi.
Here is the command line after running:sudo systemctl status my_puredata.service
When I opened the same patch "mypatch.pd" with gut (I double clicked the pd patch) the sound is indeed coming out and everything is working.
Can you see where is my mistake?Thanks
-
I run again to check the status and I'm getting lots of errors now: