[PD-dev] sys_idlehook and audio API interaction
Claude Heiland-Allen
claudiusmaximus at goto10.org
Wed Sep 5 22:04:54 CEST 2007
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&rev=0&isdir=1
>> <https://devel.goto10.org/dl.php?repname=maximus&path=%2Fidlebang%2F&rev=0&isdir=1>
>>
>>
>> Thanks for any insights,
>>
>>
>> Claude
>> --
>> http://claudiusmaximus.goto10.org
More information about the Pd-dev
mailing list