Hi,
I made an external to let patches do things when Pd is idle:
[idlebang] -- output a bang when Pd is idle
but it seems to be heavily dependent on the audio API.
With OSS, I get around 200 bangs per second.
With ALSA, I get around 70000 bangs per second.
With JACK, I get around 1 bang per second.
With audio off, I get around 160000 bangs per second.
I haven't tried PortAudio yet.
Any idea why this might be?
Source code tarball is here:
https://devel.goto10.org/dl.php?repname=maximus&path=%2Fidlebang%2F&...
Thanks for any insights,
Claude
Hi Claude, since we were in the same paper session at the convention you might remember that i was advocating a different idle processing scheme in my talk. When you are looking into m_sched.c you'll notice that the sys_idlehook call is dependent on the didsomething varialbe, which is again dependent on the behavior (type, blocksize etc.) of the specific audio api. I haven't had time to provide patches for the devel_0_39 solution to this, but i'll promise that i'll do one of these days.
greetings, Thomas
Am 05.09.2007 um 20:48 schrieb Claude Heiland-Allen:
Hi,
I made an external to let patches do things when Pd is idle:
[idlebang] -- output a bang when Pd is idle
but it seems to be heavily dependent on the audio API.
With OSS, I get around 200 bangs per second.
With ALSA, I get around 70000 bangs per second.
With JACK, I get around 1 bang per second.
With audio off, I get around 160000 bangs per second.
I haven't tried PortAudio yet.
Any idea why this might be?
Source code tarball is here:
https://devel.goto10.org/dl.php?repname=maximus&path=%2Fidlebang% 2F&rev=0&isdir=1
Thanks for any insights,
Claude
http://claudiusmaximus.goto10.org
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
Hi Thomas,
Yes, I remember, with different return codes from the hook for "I'm done" and "I have more to do" (and also "I did nothing"?).
I also think there should be a better mechanism for registering hooks, that also allows unregistering hooks later. Example:
1. X stores existing loader hook W, registers hook X 2. Y stores existing loader hook X, registers hook Y 3. X wants to remove hook, so restores loader hook to W 4. Y no longer has its hook registered => badness
Something like a priority queue of hooks would be useful, but then you're in the realm of implementing a multitasking scheduler....
Thanks,
Claude
Thomas Grill wrote:
Hi Claude, since we were in the same paper session at the convention you might remember that i was advocating a different idle processing scheme in my talk. When you are looking into m_sched.c you'll notice that the sys_idlehook call is dependent on the didsomething varialbe, which is again dependent on the behavior (type, blocksize etc.) of the specific audio api. I haven't had time to provide patches for the devel_0_39 solution to this, but i'll promise that i'll do one of these days.
greetings, Thomas
Am 05.09.2007 um 20:48 schrieb Claude Heiland-Allen:
Hi,
I made an external to let patches do things when Pd is idle:
[idlebang] -- output a bang when Pd is idle
but it seems to be heavily dependent on the audio API.
With OSS, I get around 200 bangs per second.
With ALSA, I get around 70000 bangs per second.
With JACK, I get around 1 bang per second.
With audio off, I get around 160000 bangs per second.
I haven't tried PortAudio yet.
Any idea why this might be?
Source code tarball is here:
https://devel.goto10.org/dl.php?repname=maximus&path=%2Fidlebang%2F&... https://devel.goto10.org/dl.php?repname=maximus&path=%2Fidlebang%2F&rev=0&isdir=1
Thanks for any insights,
Claude
Am 05.09.2007 um 22:04 schrieb Claude Heiland-Allen:
Yes, I remember, with different return codes from the hook for "I'm done" and "I have more to do" (and also "I did nothing"?).
I also think there should be a better mechanism for registering hooks, that also allows unregistering hooks later. Example:
- X stores existing loader hook W, registers hook X
- Y stores existing loader hook X, registers hook Y
- X wants to remove hook, so restores loader hook to W
- Y no longer has its hook registered => badness
In Miller's pd the sys_idlehook is meant to be modified primarily on class setup - unregistering is not possible as you outlined. In the devel branch, there's a threadsafe sys_callback function to do this. Return value 0 (i'm done) for a registered idle callback function would unregister the hook. Have a look at our paper on your pdconf usb stick.
Something like a priority queue of hooks would be useful, but then you're in the realm of implementing a multitasking scheduler....
It's not undoable but then again it might be more useful to use separate threads with adjustable priorities and use fifo queues and idle processing for communication with the pd kernel. That's how it is done in vibrez.
greetings, Thomas