Frage

Wir entwickeln eine iPhone App, dass Bedürfnisse Audiodaten in Echtzeit zu verarbeiten, aber wir mit Leistung leiden. Die Engpässe sind in Audio-Effekte, die in der Tat sind recht einfach, aber die Leistungseinbußen bemerkbar, wenn mehrere hinzugefügt werden.

Die meisten der Audio-Effekte-Code in C geschrieben.

Wir denken, es gibt zwei Orte, die wir gpu Hardware Geschwindigkeit Dinge verwenden können: mit OpenCL für Effekte und Hardware für die Interpolation / Glättung. Wir sind ziemlich neu in diesem und nicht wissen, wo man anfangen soll.

War es hilfreich?

Lösung

You probably mean OpenGL, as OpenCL is only present on the desktop. Yes, you could use OpenGL ES 2.0 programmable shaders for this, if you wanted to perform some very fast parallel processing, but that will be extremely complex to pull off.

You might first want to look at the Accelerate framework, which has hardware-accelerated functions for doing just the kind of tasks needed for audio processing. A great place to start is Apple's WWDC 2010 session 202 - "The Accelerate framework for iPhone OS", along with their "Taking Advantage of the Accelerate Framework" article.

Also, don't dismiss Hans' suggestion that you profile your code first, because your performance bottleneck might be somewhere you don't expect.

Andere Tipps

You might get better DSP acceleration coding for the ARM NEON SIMD unit. NEON is designed for DSP operations and can pipeline multiple single precision floating point operations per cycle. Whereas getting audio data in and out of GPU memory may be possible, but may not be that fast.

But you might want to profile your code to see if something else is the bottleneck. The iPhone 4 CPU can easily keep up with doing multiple FFT's and IIR filters on a real-time audio stream.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top