The popping and crackling seems to have many possible reasons, not just "one solution" based on the many posts over the years about this.
Sometimes, just uninstalling the sound device in the Device Manager than restarting and letting Windows reinstall it will fix it. Sometimes it takes reinstalling the sound driver, on systems with SoundBlaster Xfi sound cards if you have over 3GB of RAM the problem happens. If you have any sound enhancements enabled (e.g. reverb, chorous, etc) disable all sound enhancements.
Dimension E510 with D925 CPU and Vista Home Premium 32 bit
Home Built PC with Q6600 CPU, 8GB RAM, HD4850 Video, HTO Striker 7.1 Audio Card - Windows 7 64 bit Professional
Sonar 8.5.1 ( Producer) DAW Software/Focusrite Saffire Pro 40 Recording Interface and Frontier Tranzport wireless controller.