when Pi is boot the command line will be open then two lines will be executed one after the other:
Code: Select all
sudo systemctl stop my_puredata.service
Code: Select all
sudo systemctl start my_puredata.service
How can I do so?
Code: Select all
sudo systemctl stop my_puredata.service
Code: Select all
sudo systemctl start my_puredata.service
Code: Select all
sudo systemctl restart my_puredata
Is it complicated to make pi run this command on boot?NotRequired wrote: ↑Thu Dec 01, 2022 6:57 pmThe two commands you posted does the same as:
Code: Select all
sudo systemctl restart my_puredata
For some reason only after restarting the service the pd patch is loading. if I don't do so it keep crashing
Code: Select all
[Unit]
...
After=sound.target
...
Code: Select all
[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
Code: Select all
After=sound.target
That may not help especially if audio I/O is required. RPiOS uses pulse audio which in the default configuration is not started until a user logs into the desktop.NotRequired wrote: ↑Thu Dec 01, 2022 7:51 pmI cannot se the source of the systemd service, but you could try to add:
Code: Select all
[Unit] ... After=sound.target ...
It means don't start (or try to start) this service before the listed targets have been reached orthe listed services have been started. It's often used in conjunction with "Required="
Code: Select all
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Yes. That will start it at every desktop login by any user. However that may not matter to you. Use your target user's autostart file as outlined in section 5.1.1 of the document I linked to above.hello_maxish wrote: ↑Fri Dec 02, 2022 7:19 amIs there anything wrong with open the PD file using the autostart folderI might need to disabled completely the builtin Pi audio card?Code: Select all
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart