Start audio DMA only in apps that use audio #1982
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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