portapack-mayhem / mayhem-firmware

Custom firmware for the HackRF+PortaPack H1/H2
GNU General Public License v3.0
3.22k stars 530 forks source link

Start audio DMA only in apps that use audio #1982

Closed NotherNgineer closed 5 months ago

NotherNgineer commented 5 months ago

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