Could i move the volume prescaler to the output of i2s stream?
I can take the global_settings.volume and shift the bits on the output frames according to volume settings. This would give me a 3db steps, yet it should be simple to implement and wouldn't take much cpu time.
As long as the frames are sent out from the PCM buffer on frame-by-frame basis...
UPD:
The playback process seems way complicated - couldn't figure out where the DMA stream is actually written to i2s port.
As a though: i could swap the hard drive for a bigger CF flash card = better overall timings...
UPD2:
Still unable to find the place PCM buffer is going out of the CPU. Does the CPU itself manages the stream and it's flow to the i2s port? The main problem is that when it comes to DMA, the different parts of source don't relate to each other - they run in separate threads each of which doing the thing it's supposed to do. I've found interrups of pcm buffer chunks sequencing, but nothing more.
Could anyone point me to the right file/function name/something to look for?
Thanks!