by j4mie · 11y ago · 0 comments
A lot of people have problems with audio IO (the ecosystem of audio devices, drivers, OSes, etc. unfortunately is a minefield) but I haven't heard many complaints about the UI.
For audio processing in particular, accurately simulating physical circuit designs is resurrecting a lot of classic hardware in virtual form. CPUs have enough computational power now to implement very convincing circuit emulations in real-time.
As a side question, are the sorts of modeling / math that would be done in a scenario like this amenable to offloading to a GPU (if the transformations would potentially be better handled by something like http://www.bealto.com/gpu-fft.html, for instance)? Is that a dumb question? :-)
A small disclaimer on the following, I only attempted simulation of audio amp/effect pedal circuits, which are generally small. There might be ways to effectively parallelize (much) larger circuits. Another disclaimer, I worked on this 1+ years ago, so some of it is fuzzy.
The basic issue is that circuit simulation is fundamentally a serial operation. The circuit state at time step n is a function of the circuit state at time step n-1.
The relationship between timesteps is basically a non-linear system of equations, where the number of variables is the number of nodes in the circuit. For a typical guitar effect pedal, this might be ~50 variables.
There's basically no opportunity for parallelism here. You can't parallelize across the non-linear systems, because you don't know what to solve at timestep n until you've solved for timestep n-1. Within each step, a 50 variable system of equations is probably too small to parallelize, even on the CPU. Note that the technique used here is generally Newton's method, which also is difficult to parallelize for the same reason.
The bottom line is that as far as I know, circuit simulation (at least for audio) is entirely limited by single thread performance.
As a side note, the fun part of LiveSPICE is that even a 50 variable non-linear system is far too big to solve at real time sample rates (48 kHz, plus oversampling to avoid aliasing artifacts). The trick is to observe that only a fraction of these variables are non-linear, most of them are related to the other variables linearly. LiveSPICE solves for these linear relationships once during initialization of the simulation, and eliminates them prior to solving the non-linear system. This turns a typical ~50 variable system into a ~5 variable non-linear system (plus a 45 linear relationships). This is a massive reduction in computation required (Newton's method involves repeatedly solving a linear system, which is O(n^3) for simple methods).
As for delay, 10ms is fairly reasonable.