Repository navigation
Use AC79 CPU1 for realtime DSP processing #141
Replies: 6 comments 4 replies
|
Unlocking both cores feels like it could be a game changer in Felucca's direction and decision-making, as it would make previously impractical synthesis feasible. |
|
https://github.com/charlesvestal/fm1-x0x/releases/tag/v1.0 HE IS DO that))) |
|
I’ve been looking into the dual-core work in X0X and thinking about a different way to use the second CPU core in Felucca. Rather than assigning specific synth engines to CPU0 and CPU1 as X0X does, could we split the DSP workload by groups of voices within an audio block? My proposed approach:
This would be a different workload-partitioning strategy from X0X’s engine-based split. It might also make the workload easier to balance when different engines have very different CPU costs, although voice-level splitting would need careful handling of engine state, effects and shared resources. References:
This is just an architectural proposal. The first step would be to check whether Felucca’s voice rendering can be safely separated without changing sound behavior, and benchmark the result on real hardware. |
|
Thanks for the research. I'll consider using CPU1 in Felucca. If you know of a solid fork that does this well, please let me know. |
my first instantaneous thought when i saw the dsp capability of the proc was exactly THIS... especially for pitch/time/formant effects. I would immediately add a good granular effect with about 3 or 4 pages of parameters ... especially with diffusion, randomization for panning slices, and adjustable rando reverse, etc. Then the dsp could also be used to stretch samples in real time etc. |

Uh oh!
There was an error while loading. Please reload this page.
I have been looking into the CPU load of Felucca and whether the second CPU core of the AC79 could be used for additional DSP processing.
It looks like this is actually supported by the AC79 hardware and by the official JieLi SDK documentation, rather than being an undocumented/hypothetical feature.
The official AC79 documentation describes a dual-core mode where CPU0 runs the system and CPU1 is dedicated to a separate user function:
https://doc.zh-jieli.com/AC79/zh-cn/master/module_example/system/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E5%8D%95%E5%8F%8C%E6%A0%B8%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95.html
The same documentation explicitly describes cpu1_main(), CPU0/CPU1 synchronization using spin_lock, and notes that CPU1 can be kept idle when it has no work in order to reduce power consumption.
The AC79 documentation also confirms that interrupts can be assigned to either CPU, including software interrupts:
https://doc.zh-jieli.com/AC79/zh-cn/release_v1.0.3/module_example/system/interrupt.html
For example, request_irq() has a cpu_id parameter where 0 selects CPU0 and 1 selects CPU1, and IRQ_SOFT0..IRQ_SOFT7 are available. This seems suitable for a small CPU0 → CPU1 DSP job queue.
The AC79 itself is officially specified as a dual-core DSP up to 320 MHz with hardware math acceleration, cache and 578 KB SRAM:
https://doc.zh-jieli.com/AC79/zh-cn/master/getting_started/overview/index.html
Possible Felucca architecture
I think we could keep the existing realtime audio pipeline on CPU0 and move only selected expensive DSP engines to CPU1.
For example:
CPU0
MIDI / sequencer
voice allocation
modulation
light engines
mixer / final output
|
DSP job queue + software IRQ
v
CPU1
GRAIN
heavy filters / physical modelling
possibly reverb or other expensive DSP
|
v
shared audio buffer
|
v
CPU0
I would start with a very small proof of concept:
This should allow us to verify the architecture without changing the whole audio system at once.
One important caveat from the JieLi documentation is that CPU1 can be suspended during Flash writes. If CPU1 must continue running during Flash operations, its code and called functions need to be placed in internal RAM/SDRAM:
https://doc.zh-jieli.com/AC79/zh-cn/master/module_example/system/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E5%8D%95%E5%8F%8C%E6%A0%B8%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95.html
So this would require some careful linker/memory work.
Power consumption
Obviously, using CPU1 continuously will increase power consumption compared with leaving it idle. However, the official documentation explicitly mentions using idle on CPU1 to reduce power when there is no work.
For Felucca, the goal would therefore not be to run CPU1 continuously at 100%, but to use it for expensive DSP blocks and let it idle when possible.
How difficult would this be?
I would expect the initial CPU1 proof-of-concept to be relatively manageable, while moving the actual DSP engines is more involved because of shared state, audio-buffer ownership, cache/memory synchronization and realtime deadlines.
I think the safest approach is to first prove:
CPU1 boot → shared queue → software IRQ → DSP job → audio buffer
and only then migrate GRAIN or another expensive engine.
Would you be interested in this approach?
All reactions