Realtek HD Audio latency leading to crackling sounds from the speakers

I've got the exact same problem and been googling around for solutions. It's likely to be driver-related. Uninstalling Realtek Driver and let Windows uses its native driver fixes the issue for me. Please try it, if it works for you too then it's the Realtek Driver that causes the problem.