Moved the audio DMA initialization from the main baseband init function to the individual background processes that actually use audio, and only enable the DMA engine for the audio direction(s) needed. Also renamed the old baseband main.cpp module to indicate that it's unused/obsolete.
Effect:
Saves 9KB of ROM space (by not including unneeded DMA code in the apps that don't use audio, and only including the code for the direction needed [audio input or output]).
Saves a tiny bit of memory bandwidth in apps that don't use audio (now the DMA engines won't be continually transferring data between the circular audio buffers and the audio codec unnecessarily in such apps).
Note: There seems to be no actual synchronization between the M4 CPU filling the audio buffers and the DMA engine transferring the data to the codec, so PortaPack audio quality is rather poor and there's a slight risk that the audio quality may become worse due to timing whenever the background audio code is modified. There is a separate issue on audio quality that I'm still investigating.
Moved the audio DMA initialization from the main baseband init function to the individual background processes that actually use audio, and only enable the DMA engine for the audio direction(s) needed. Also renamed the old baseband main.cpp module to indicate that it's unused/obsolete.
Effect:
Note: There seems to be no actual synchronization between the M4 CPU filling the audio buffers and the DMA engine transferring the data to the codec, so PortaPack audio quality is rather poor and there's a slight risk that the audio quality may become worse due to timing whenever the background audio code is modified. There is a separate issue on audio quality that I'm still investigating.
Test version available here: https://discord.com/channels/719669764804444213/722101917135798312/1217309730192621599