So noise is to be expected.
It would help if you could post a schematic of the project, a photograph of the system as built clearly showing all connections and details on the power supply used.
Do you have an oscilloscope? I imagine it's very difficult to troubleshoot this problem without one, since you'll need to figure out the source and nature (esp. frequency) of the noise.
Sounds plausible; you mention the noise being caused by a ground loop, but that's likely to be one of the lesser concerns.
As you noted, the use of a separate power supply really helps. Consider this as a possible solution that's simple and proven to work.
If you must use a single power supply for the entire project, keep in mind that your digital devices inject noise into the Vcc line. Particularly the ESP32 (and certainly if it's using WLAN) will likely create HF noise on the 3.3V rail. I expect the higher frequencies to filter straight through the linear regulator into the Vin of your ESP board.
The logical thing to do is to decouple the digital and analog power supplies. Start with tapping off + and GND from your power supply into a common mode choke (feeding GND and Vcc to the audio section through it) and feed from there into one or two R/C filters to get rid of most of the noise. Especially the R/C filters will help. Dimension the filters to filter out the dominant frequencies; for capacitors, use a combination of values such as 100uF electrolytic, 1 ~ 10uF ceramic and 10 ~ 100nF ceramic in parallel. Choose the series resistors of the R/C filters based on the power consumption of the audio section.
Since the power amplifier will draw more current than the DAC, but will also have much better ripple rejection, I'd suggest splitting off a second pole from the audio power supply with additional filtering for the DAC section.
Keep in mind that the R/C filters will drop some voltage, so verify that you'll have sufficient voltage left at both the DAC and the power section. If you post a schematic, I could give some more concrete pointers. For instance, if you have some headroom, you can use a linear regulator to derive a supply from your main power supply for the audio part, and then apply whatever additional filtering that may be necessary to clean it up (see above).
When it comes to ground loops, physical circuit layout is important. Use a star ground for the audio section. Only connect digital/ 'dirty' GND and audio GND in a single place.
Do your audio modules (DAC and amp) have separate analog GND pins?