Hello I'm trying to launch security procedures in case of trouble, that will respond in less than 250 msec. The fundamental question is :
Is there an object to schedule an event in the future with firm absolute delay ?
{realtime} measures time AFTER the problem (no scheduling) {del} schedules things but the delay is kind of elastic, depending on the CPU load.
thanks JM
[delay] is as firm as your going to get, from what I've seen. [delay] should be at least as accurate to about one audio block, so like 1.5ms, so if you only need 250ms accuracy, you have plenty of room.
.hc
On Oct 30, 2012, at 1:13 PM, Jean-Marie Adrien wrote:
Hello I'm trying to launch security procedures in case of trouble, that will respond in less than 250 msec. The fundamental question is :
Is there an object to schedule an event in the future with firm absolute delay ?
{realtime} measures time AFTER the problem (no scheduling) {del} schedules things but the delay is kind of elastic, depending on the CPU load.
thanks JM
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Tue, 2012-10-30 at 13:42 -0400, Hans-Christoph Steiner wrote:
[delay] is as firm as your going to get, from what I've seen. [delay] should be at least as accurate to about one audio block, so like 1.5ms, so if you only need 250ms accuracy, you have plenty of room.
[delay] is not "somewhat precise", it is absolutely precise. However, there are classes that ignore the precision of [delay] and treat incoming messages as if they would have been sent at block boundaries. For instance the phase inlets of [osc~] and [phasor~].
What Jean-Adrien probably means by 'elastic' is not the lack of precision of [delay] in the deterministic scope of Pd, but the fact that it tied to that deterministic scope and thus is precise only in logical time, but not in real time. If the CPU load of Pd goes above 100%, logical time gets more and more behind real time.
Roman
.hc
On Oct 30, 2012, at 1:13 PM, Jean-Marie Adrien wrote:
Hello I'm trying to launch security procedures in case of trouble, that will respond in less than 250 msec. The fundamental question is :
Is there an object to schedule an event in the future with firm absolute delay ?
{realtime} measures time AFTER the problem (no scheduling) {del} schedules things but the delay is kind of elastic, depending on the CPU load.
thanks JM
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Thanks everyone ! Best practical way is probably communicate with another PD on multiprocessor architecture though. This is what I had in thought, but I wanted to post before implementing. JM
Le 31 oct. 2012 à 09:12, Roman Haefeli a écrit :
On Tue, 2012-10-30 at 13:42 -0400, Hans-Christoph Steiner wrote:
[delay] is as firm as your going to get, from what I've seen. [delay] should be at least as accurate to about one audio block, so like 1.5ms, so if you only need 250ms accuracy, you have plenty of room.
[delay] is not "somewhat precise", it is absolutely precise. However, there are classes that ignore the precision of [delay] and treat incoming messages as if they would have been sent at block boundaries. For instance the phase inlets of [osc~] and [phasor~].
What Jean-Adrien probably means by 'elastic' is not the lack of precision of [delay] in the deterministic scope of Pd, but the fact that it tied to that deterministic scope and thus is precise only in logical time, but not in real time. If the CPU load of Pd goes above 100%, logical time gets more and more behind real time.
Roman
.hc
On Oct 30, 2012, at 1:13 PM, Jean-Marie Adrien wrote:
Hello I'm trying to launch security procedures in case of trouble, that will respond in less than 250 msec. The fundamental question is :
Is there an object to schedule an event in the future with firm absolute delay ?
{realtime} measures time AFTER the problem (no scheduling) {del} schedules things but the delay is kind of elastic, depending on the CPU load.
thanks JM
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Are you using a GNU/Linux OS?
If so, why not just change the pd-watchdog ping-back period from 2 seconds to 250 milliseconds and recompile? Then run Pd with realtime priorities.
I guess the question is: what does pd-watchdog actually do when it doesn't receive the response in time? Isn't it supposed to kill Pd?
-Jonathan
----- Original Message -----
From: Jean-Marie Adrien jma@jeanmarie-adrien.net To: Roman Haefeli reduzent@gmail.com Cc: "pd-list@iem.at List" pd-list@iem.at Sent: Wednesday, October 31, 2012 6:30 AM Subject: Re: [PD] firm delay scheduling
T hanks everyone ! Best practical way is probably communicate with another PD on multiprocessor architecture though. This is what I had in thought, but I wanted to post before implementing. JM
Le 31 oct. 2012 à 09:12, Roman Haefeli a écrit :
On Tue, 2012-10-30 at 13:42 -0400, Hans-Christoph Steiner wrote:
[delay] is as firm as your going to get, from what I've seen.
[delay]
should be at least as accurate to about one audio block, so like 1.5ms, so if you only need 250ms accuracy, you have plenty of room.
[delay] is not "somewhat precise", it is absolutely precise.
However,
there are classes that ignore the precision of [delay] and treat incoming messages as if they would have been sent at block boundaries. For instance the phase inlets of [osc~] and [phasor~].
What Jean-Adrien probably means by 'elastic' is not the lack of precision of [delay] in the deterministic scope of Pd, but the fact that it tied to that deterministic scope and thus is precise only in logical time, but not in real time. If the CPU load of Pd goes above 100%, logical time gets more and more behind real time.
Roman
.hc
On Oct 30, 2012, at 1:13 PM, Jean-Marie Adrien wrote:
Hello I'm trying to launch security procedures in case of trouble,
that will respond in less than 250 msec.
The fundamental question is :
Is there an object to schedule an event in the future with firm
absolute delay ?
{realtime} measures time AFTER the problem (no scheduling) {del} schedules things but the delay is kind of elastic, depending
on the CPU load.
thanks JM
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
hello,
if your problem is detecting when cpu is over 100% so that delay is not acurate, then the best solution is some kind of external watchdog.
just send a message every 10 ms to an other software, if this external software did not receive anything during the last 20ms, then there is a cpu problem on the pd side...
the external software can be an other pd, a shell script (using pdreceive, or anything else.
cheers c
Le 30/10/2012 18:13, Jean-Marie Adrien a écrit :
Hello I'm trying to launch security procedures in case of trouble, that will respond in less than 250 msec. The fundamental question is :
Is there an object to schedule an event in the future with firm absolute delay ?
{realtime} measures time AFTER the problem (no scheduling) {del} schedules things but the delay is kind of elastic, depending on the CPU load.
thanks JM
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
----- Original Message -----
From: Cyrille Henry ch@chnry.net To: pd-list@iem.at Cc: Sent: Tuesday, October 30, 2012 1:52 PM Subject: Re: [PD] firm delay scheduling
hello,
if your problem is detecting when cpu is over 100% so that delay is not acurate, then the best solution is some kind of external watchdog.
just send a message every 10 ms to an other software, if this external software did not receive anything during the last 20ms, then there is a cpu problem on the pd side...
the external software can be an other pd, a shell script (using pdreceive, or anything else.
How is the second pd going to complete its computations on time when the CPU is over 100%?
cheers c
Le 30/10/2012 18:13, Jean-Marie Adrien a écrit :
Hello I'm trying to launch security procedures in case of trouble, that will
respond in less than 250 msec.
The fundamental question is :
Is there an object to schedule an event in the future with firm absolute
delay ?
{realtime} measures time AFTER the problem (no scheduling) {del} schedules things but the delay is kind of elastic, depending on the
CPU load.
thanks JM
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
If you have a multicore machine you should be fine... On Oct 31, 2012 12:31 AM, "Jonathan Wilkes" jancsika@yahoo.com wrote:
----- Original Message -----
From: Cyrille Henry ch@chnry.net To: pd-list@iem.at Cc: Sent: Tuesday, October 30, 2012 1:52 PM Subject: Re: [PD] firm delay scheduling
hello,
if your problem is detecting when cpu is over 100% so that delay is not
acurate,
then the best solution is some kind of external watchdog.
just send a message every 10 ms to an other software, if this external
software
did not receive anything during the last 20ms, then there is a cpu
problem on
the pd side...
the external software can be an other pd, a shell script (using
pdreceive, or
anything else.
How is the second pd going to complete its computations on time when the CPU is over 100%?
cheers c
Le 30/10/2012 18:13, Jean-Marie Adrien a écrit :
Hello I'm trying to launch security procedures in case of trouble, that will
respond in less than 250 msec.
The fundamental question is :
Is there an object to schedule an event in the future with firm
absolute
delay ?
{realtime} measures time AFTER the problem (no scheduling) {del} schedules things but the delay is kind of elastic, depending on
the
CPU load.
thanks JM
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management ->
http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Tue, 2012-10-30 at 18:52 +0100, Cyrille Henry wrote:
hello,
if your problem is detecting when cpu is over 100% so that delay is not acurate, then the best solution is some kind of external watchdog.
just send a message every 10 ms to an other software, if this external software did not receive anything during the last 20ms, then there is a cpu problem on the pd side...
the external software can be an other pd, a shell script (using pdreceive, or anything else.
An external watchdog will only help in detecting a timeout, but it won't help prevent it. There probably is no way to stop Pd from doing what it is currently doing as it will always first finish its current task before it considers the next ( triggered by message from network, from HID, etc.).
Jean-Adrien, I think you would have to design your patch in a way that makes sure that no single task takes more than 250ms. If this is possible at all depends on what your tasks look like. If tasks take too much time, split them in smaller task. If every single task takes only a fraction of the allowed timeout, you could ask [realtime] about how long the last task took and decide whether you need to respond now or if it is safe to execute another task.
Roman
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2012-10-30 18:13, Jean-Marie Adrien wrote:
Hello I'm trying to launch security procedures in case of trouble, that will respond in less than 250 msec. The fundamental question is :
Is there an object to schedule an event in the future with firm absolute delay ?
if you want "hard realtime", then you would need a system that is capable of doing realtime. no "standard" (as in "desktop") operating system on the market will fullfill your needs.
so let's assume "soft realtime" (where a given piece of code has 'hopefully' been executed by a certain time) is good enough.
you are facing to different problems:
also do your specific tasks. adding more CPUs might help if there are *other* programs involved that eat your processing power. it's not so easy if Pd itself is consming too much CPU: unfortunately Pd is inherently single threaded, so there is no way to start your "security procedures" if the main thread is busy having "troubles", short of running 2 Pd's in parallel (and let them communicate e.g. via network)
clock) of [delay] even if your CPU does not run at 100%. Pd's logical time is floating a bit (compared to real time) in order to be able to prevent dropouts due to short CPU load spikes. however (unless you really max out your CPU for longer periods) the elasticity is limited, and is basically a function of your "audiobuffer" settings in the media settings dialog. so try reducing the audiobuffer, or even run Pd without audio (depending on your needs) and tune the "-sleepgrain" parameter, to get a reasonably low jitter.
once you have done that, simply schedule your "security procedures" at "250-maxjitter" in the future, which should make your system react at most 250ms in the future, which seems to be what you have been asking for.
fgmasdr IOhannes