I am still digging.
If you haven't done so, I recommend you configure Windows so that it plays 'No Sounds'. I think having Windows try to play sounds will sometimes cause issues.
For me, I distinctly recall a gig where I had to reboot my computer in the middle of a set, and everyone in the club got to hear a REALLY loud sound that Windows plays while rebooting (not connected to the problem, but YIKES).
Also, please make sure your Sample Rate in Sonar EXACTLY matches the Sample Rate you have specified for the audio interface.
I did find an issue with a different interface - perhaps it applies to yours as well. It seems that at least at one point there was an issue with some M-Audio drivers where sharing sound between Windows and Sonar was not possible at the same time. I did not find any posting of any such issue with your Onyx 1640, and am still trying to nail down what could be happening on your system.
I am wondering though if you do not have the Windows Sounds turned off and it is trying to play some alert sound or whatever, and Sonar is not allowed to share with other programs.
I dunno - please review the above and see if any of that makes sense,
Bob Bone