If I boot my Pi 3b+ with the HDMI cord plugged in then my audio sounds fine. However, if I want to run it headless and I boot the device without the HDMI plug then the audio is very slow and distorted. It still plays (through the headphone jack) but it sounds terrible. Then if I plug in my HDMI cable and reboot it sounds perfect.
How? Why?