Hi,
I'm using an AUTimePitch unit within an AUGraph, and seeing some anomalous behavior which I can't resolve.
Essentially the issue is that if I connect the AUTimePitch anywhere except at the tail of the graph, the unit produces NO audio output/ throughput if its 'kAudioUnitProperty_RenderQuality' is set to 'kRenderQuality_Low' .
Some examples: if I set up an AUGraph thus:
DefaultOutputUnit <- AUTimePitch <- (connect AudioFilePlayID)
I can set the AUTimePitch to 'Low' renderQuality and have 'acceptable' sound output on an iBook G3 600 with about 15% cpu utilisation. If, however, I set up the AUGraph thus:
DefaultOutputUnit <- AUTimePitch <- AUAudioFilePlayer
at 'Low' renderQuality there is no sound output at all, while at 'Medium' I get very choppy sound output and +100% CPU utilisation. So using 'Medium' render quality is not an option this class of machine... my old G4 400 only sweats at 20% or so on the same setting so I guess it's a G3 thing. Anyhow, I want to be able to support older machines, so being able to run AUTimePitch at 'Low' is essential.
I know it is possible to run both AUTimePitch and AUAudioFilePlayer within an AUGraph AND produce acceptable sound output if the AUTimePitch renderQuality is set to 'Low', as this same setup in AULab works fine on that same iBook, and produces CPU loads similar to what my own code achieves using an AudioPilePlayID to connect to a tail-end AUTimePitch.
I initially suspected the problem might be due to both AUTimePitch and AUAudioFilePlayer having internal AudioConverters, and that the signal was being 'converted' in both units, so I did a bunch of experiments with CAAudioFile to attempt to match the formats and sample-rates of the TimePitch input & FilePlayer AU output, all of which produced no discernable dfference. Both units are set to the same sample rates, have matched input & ouput formats etc. Every connection from the AUFilePlayer output up to the OutputUnit input is deinterleaved lcpm @41000 Hz.
But then I observed that the same symptoms present if I make any sort of 'longer' graph with more units, where the AUTimePitch is not at the tail of the graph, e.g:
DefaultOutputUnit <- (any effect AU's / mixers) <- AUTimePitch <- (any effect AU's) <- (connect AudioFilePlayID or use AUAudioFilePlayer)
Can anyone shed some light on what has to be done to get these units to cooperate within an AUGraph, without needing to run the AUTimePitch at 'Medium' or higher renderQuality? What voodoo goes on in AULab when connecting the units that gets around this problem?
Regards, Mark Hill xonko interactive
|