Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

General • Re: Multicore optimisations and memory use

$
0
0
Thanks for these replies, definitely given me somewhere to start looking.

I’mostly working in the C++ space with this now, it started in C, but I’ve been slowly refactoring to make the code make more modular.

Apologies for being a bit green in this area, I came from Arduino and have been mostly self taught. I’m aware of race conditions, and memory alignment with regards to types, but I’m pretty weak on assembler to check my code, and can imagine there’s a few large gaps in my knowledge.

I’ll check out the MAP files, and see if what’s happening there. I’ll also try keep the array the same size, but reducing the access to only 8 slots instead of 32.

This particular code is an Arpeggiator, working on core 1 (the hardware control side of things, reads keys/buttons, updates LED’s, handles EEPROM via I2C, handles MIDI and USBMIDI) along with the note priority code translating from the keyboard buttons, to the synth, where this Arp sits between, but the slowed down noise happens where the Arp code is active or not within the synth.

The arrays aren’t passed as an argument to any functions, just used internally inside the functions. One array is memcpy’d to the other. Basically just holding two different states of the buffer (current notes, new input notes).

The audio code is handled via two alternating DMA’s to allow copying of 16 samples at a time from the synth’s ring buffer.

For “Bus Performance” counters am I looking g for those in the Bus Priority section of the registers with my debugger?

The code is pretty bloated, but I can link a GitHub if that helps?

Thanks again.

Statistics: Posted by Neo_nmik — Tue Dec 31, 2024 4:21 pm



Viewing all articles
Browse latest Browse all 8374

Trending Articles