[PD] Raspberry pi 4 startup problem

Patco colet.patrice at gmail.com
Thu Apr 13 20:26:26 CEST 2023


Hello,
 I'm using crontab to load pd, the only way I've found to have sound when pd starts at boot is about adding delay into the script that starts PureData like this:

#!/bin/bash
env sleep 10
,pd -nogui mypatch
 
on some computer 5s is enough, on some other it's about 10s...

How could we know that soundcard is ready?

I've been reading somewhere that pd needs pulse loaded to get sound working so I've tried this before in the script:

 while [ ! -d /run/user/1000/pulse ]
do
      sleep 0.2
done

but it has no effect.

this is happening on raspberryOS lite, and on patchboxOS which have a realtime kernel, the main user added to audio group, same problem...

One thing I didn't try yet is about using this service file provided by Orac:

[Unit]
Description=Run Orac at boot
DefaultDependencies=no
Wants=network-online.target
After=network-online.target
Conflicts=shutdown.target
Before=shutdown.target 

[Service]
Type=simple
User=patch
Group=patch
Environment=HOME=/home/patch
EnvironmentFile=/etc/environment
LimitRTPRIO=infinity
LimitMEMLOCK=infinity
KillMode=process
Restart=always
WorkingDirectory=/usr/local/orac
ExecStart=/usr/bin/pd -rt -alsamidi -nogui -audiobuf 4 mother.pd main.pd 

[Install]
WantedBy=default.target

I'd be glad to get any hint about what would prevent pd to have audio working at boot.

Maybe there is something to do into PureData for accessing soundcard when it is ready?

> Le 13 avr. 2023 à 12:48, Lucas Cordiviola <lucarda27 at hotmail.com> a écrit :
> 
> sounds that you have to delay "pd starts up on boot" part. seems Pd is started before the soundcard is ready.
> 
> 
> 
> --
> 
> Mensaje telepatico asistido por maquinas.
> 
> On 13/04/2023 07:39, Simon Iten wrote:
>> Or as a workaround, is there a way to hit that apply button automagically from within a pd patch on loadbang?
>> 
>> 
>> 
>>> On 13 Apr 2023, at 12:36, Simon Iten <itensimon at gmail.com> wrote:
>>> 
>>> Ok, I have a strange one…
>>> 
>>> I have a raspberry PI 4 with a usb sound card as in/output and a patch that starts up on boot (via the simple autostart in /etc/xdg/lxsession/LXDE-pi/autostart)
>>> 
>>> Since I also need graphics from puredata.
>>> 
>>> Whenever pd is auto-started, it does not get any sound input.
>>> As soon as I go to the media -> audio settings menu, I can see that the card is correctly specified.
>>> Now a simple “Apply” (without changing anything else) makes the sound work.
>>> 
>>> Opening a pd patch manually I have correct sound input without going to the menu…
>>> 
>>> Any tips?
>>> 
>>> I tried delaying the dsp 1 message on loadbang by 200ms since I read somewhere this could be the problem.
>>> 
>>> 
>> 
>> 
>> 
>> _______________________________________________
>> Pd-list at lists.iem.at mailing list
>> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
> 
> 
> 
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list






More information about the Pd-list mailing list