Okay Slartabartfast, I'll have a go ......
I have a PC with a Creative X-Fi sound card. It has a switchable line-in/mic-in socket, and a line-out socket into which I have plugged my speakers (no surround stuff, just stereo). The PC also has built-in audio (Realtek, on an ASUS motherboard). This provides me with an alternative line-in and line-out (both normally disabled) and a front panel headphone socket, into which I have headphones plugged, configured not to cut off the speakers when plugged in.
Externally I have 3 hardware synths (1 keyboard, 2 rackmount), running through an analogue mixer, giving a stereo out which is plugged into the line-in socket of the soundcard.
This is how my system has been wired since I built this PC two years ago, and on my previous PC for 8 years before that. If I want to just play the keyboard, I listen through the PC speakers, or headphones if other people in the house are asleep. And this has all been fine. For music composition, I was using Cakewalk Home Studio 9. On this I would control the 3 external synths, and possibly add audio tracks which were samples. There was no latency (audio delay) in the system, and the midi and audio tracks always lined up fine.
However, this meant I didn't have the option of using VSTs, so I upgraded to Sonar X3. Initially Sonar would hang the PC every time I tried to create or load a project. I upgraded to version X3b and that solved that one. I initially had some audio delays so followed on-line advice and reduced the size of the ASIO buffer (from within Sonar) from 50ms to 20ms and that solved that one. All was fine for a few weeks, I was able to compose tracks using both VSTs and the external synths, and the audio always lined up.
Then for no readily apparent reason, an audio delay appeared on the external audio. If I plugged headphones into my mixer and also had the PC playing through the speakers, a double hit was noticeable. I measured the delay at 0.25 seconds. Therefore, in Sonar, the only way to get the audio to sound right was to slide the midi events for the external synths 250ms to the left. The fact that any audio generated in the PC was fine, but the external audio was delayed suggested the latency/delay was only on the line-in socket. I tried reduced the ASIO buffer further to 10ms but that didn't change anything. The Sonar properties screen is showing total audio latency of something like 22ms, which would be un-noticable. I tried updating Sonar again (to version X3e) but all that did was break a couple of my VST plugins.
Right, now ignore Sonar for a moment, as the problem occurs whether Sonar is running or not. I believe the problem to be either in the PC's audio routing or the soundcard. I tested using the PC's onboard sound rather than the Creative sound card: the synths were fed into the on-board line-in socket, and the speakers plugged into the on-board line-out socket. No audio delay. If I used the on-board line, and routed that to the sound card, there was a delay. As a result of this test, I would switch to using the on-board sound, but since it doesn't have ASIO drivers, Sonar doesn't support it. (Yes I know I could switch Sonar to a non-ASIO mode but that doesn't seem to be recommended by people.)
You asked how I was "routing" the audio. From the windows control panel (I'm on Windows 7 btw), I select "Sound", a window appears called "Sound" with tabs labelled Playback, Recording, Sounds and Communication. On the playback tab, the creative speakers are selected as the default output. On the recording tab, the creative line-in is selected as default output, and on its properties page, "listen to this device" is ticked, and the output is selected as "default output device". I normally had "What U Hear" as the default output device, but switched it to the speakers to rule that out as a cause. It's as simple as that. That's what makes this incredibly frustrating, as there don't appear to be any fancy audio paths going on here.
As other responders have pointed out, the Creative X-Fi has switchable modes, including "game" mode (which I always have used) and "audio production" mode which has ASIO support and (apparently) low-latency. Switching mode doesn't seem to make any difference.
So that's it, with no Sonar running, and no-other audio software, and with the Windows 7 "sound" control panel routing line-in to line-out (i.e. speakers), there is a 250ms delay between the two, that wasn't there until last month. 250ms doesn't sound a lot, but it's really distracting when just playing music, and makes composition difficult and frustrating. All sound card audio processing (effects, eq, etc) is turned off, before anyone asks.
Any detail I've missed?