AU question: asynchroneous pulling
AU question: asynchroneous pulling
- Subject: AU question: asynchroneous pulling
- From: Thorsten Karrer <email@hidden>
- Date: Tue, 19 Oct 2004 13:45:38 +0200
Hello!
I am quite new to CoreAudio and thus have encountered some problems at
my first attempt to write an AU:
Since my AU does some CPU-extensive Sample processing and I did not
want to introduce too much latency, I decided to split the work up into
two threads
- Thread1 constantly pulls the AUInput for samples (say N), does the
processing and puts the results (say M samples) into a shared Buffer
- Thread2 is the main thread in which the render callback happens. It
just takes the samples which have been prepped by thread1 out of the
shared Buffer and copies them to the output.
Problem 1:
Because thread1 is pulling ahead of the render requests of thread2, I
do not know which timestamps to request when pulling the input for
samples. I tried to start at mSampleTime=0 and subsequently add the
number of pulled samples to that, but AUVal re-initializes the AU
several times and does not start at 0 every time...
Problem2:
Thread1 has to pull a lot of samples at one time, since my effect is
based on a FFT of size 4k. Usually the input is not able to provide
such a large chunk of samples so I decided to split up the pulls into
pieces of length of the number stored in the MaxFrames property of the
input...
...how do I get this number? I tried to do a GetProperty() on the AU (I
tried several combinations of scope and element) but it always returns
an error (something like bad property), so I assume the host did not
set that property. Still I need to know how much samples I may pull at
one time.
Problem3:
Since thread1 is pulling in advance, I do not know when to stop
pulling. any help on this?
Thanks a lot for your help!
Best regards,
Thorsten
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden