Re: AU question: asynchroneous pulling
Re: AU question: asynchroneous pulling
- Subject: Re: AU question: asynchroneous pulling
- From: William Stewart <email@hidden>
- Date: Tue, 19 Oct 2004 11:23:01 -0700
You can't do it this way.
The intention of I/O is that it is synchronous - each request someone makes
for output, you get the input required for that....
So - for an effect this means *always* that a host pulls you for 512 frames,
and you ask for 512 frames of input. The reason this is this way is that we
treat effect types of AU as something that operates in "real-time" - so you
can't just asynchronously ask for input - if its real-time the input isn't
there!
On 19/10/04 4:45 AM, "Thorsten Karrer" <email@hidden> wrote:
> 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...
You use your max frames for this - we assume that a host will generally set
max frames consistently between different audio units, so its a reasonable
assumption that your input's max frames is the same as yours. You can also
have input coming from a callback, so you can't get max frames in that case.
> ...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?
You can't do it this way.
Bill
>
> 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
--
mailto:email@hidden
tel: +1 408 974 4056
__________________________________________________________________________
Culture Ship Names:
Ravished By The Sheer Implausibility Of That Last Statement [GSV]
I said, I've Got A Big Stick [OU]
Inappropiate Response [OU]
Far Over The Borders Of Insanity And Still Accelerating [Eccentric]
__________________________________________________________________________
_______________________________________________
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