Um! Don't you mean latency?oryaaaaa wrote: The slight jitter not even allowed software, the following Tips will help.
Don't use MOVQ
Use MOVNTQ, MOVNTDQ, then don't use CPU cache memory
Use MMX register[/list]
This code use for After decode process or After sound process or For Asio buffer.
Bit holding voltage rise in the memory circuit of the memory chip for ultra low jitter.
Ranking of quality : 1st MMX(movntq), 2nd AVX (vmovntdq) 3rd SSE(movntdq)[/list]
CopyMemory for ultra low jitter
That is, jitter is caused by CPU cache use.
In purely the digital domain 318 samples (16bit or 24bit or 32bit) of audio are 318 samples always, there is no jitter.
Jitter is caused when a bit ends up as 0.99 or 1.01 instead of 1.0 (not to be confused by floating point values) and this can only happen during the analog to digital or digital to analog stage (usually in the audio chip).
And if you mean that a bit may become 1 instead of 0 or 0 instead of 1 then that is called bitrot (in case of permanent storage) or bad memory (in case of RAM), ECC RAM helps detect those though but ECC RAM is not that common in consumer systems.
The other issue is sampling rate, it is quite possible for a A/D or D/A (especially cheap chips or soundcards) to be 44100.5 Hz or 44099.5 Hz, not sure if that is due to jitter but it is related to the sampling clock being a bit "off" to put it mildly.
The only place anything resembling jitter can occur in a PC internally is in the system clock or similar, QueryPerformanceCounter relies on a clock and this may have some jitter. This is also the reason why a lot of random number code (that ad time into the mix) suggest to discard the lowest bits.
Also note that if you are doing audio processing the it's important that any parallel processing is done correctly as you do not want the samples to be output in the wrong order (easy to screw up if doing multi-threaded audio-processing).
Also note that latency is noticed much more than jitter, DirectX itself has by default 80ms latency, and the more advanced CPU instructions and caches if used correctly can reduce the added latency of audio processing on top of the latency of the audio pipeline.
(ABX tests have been done for jitter and without anyone hearing jitter, Hydrogen Audio may be a bit anal about their strictness of statements but their focus on scientifically re-producible results is admirable).
Also (and this is just my own opinion) the damage doe to audio due to clipping and compression just to make it sound louder is far worse than any latency in a modern PC or any jitter or noisefloor that may exist on modern A/D and D/A chips.
You can't hear the full 16bit audio range anyway as that is a wopping 96dB and listening to levels above 85dB for more than (an hour?) can permanently damage your ears, as you go above 85dB the time needed to damage your ears gets even shorter.
To hear the lowest bits of 16bit audio you would need the volume cranked to 96dB, on average most humans prefer a listening range of 30dB which means that it is the upper 30dB we listen to the most which is the topmost 5 bits relatively speaking. Music using the full 96dB would be uncomfortable to listen to and only natural unprocessed recordings have those dynamic ranges (usually).
The best way to play back audio will always be to have a bit accurate decoder (only possible with lossless formats like FLAC or WAV PCM 16bit/24bit), and ensure that there is no audio buffer overflow/overflow and that any latency is minimal and that no adjustments are made to the volume and no other processing.
essentially if you take a FLAC and decode and play it and use the optical out and then back in through the optical in and do a bit comparison and it should be a perfect match as long as you align the recording correctly (this is where jitter in the A/D and D/A might manifest if detectable).
PS! You advice against using MOVQ but in your memory rewrite code you are using MOVQ. I've seen a lot of other odd code related to your player as well, often doing unnecessarily things, using extra CPU or memory when not needed. An Audiophile not only want bit-perfect audio, they also want minimal latency and processing otherwise (actually any form of processing is taboo, for some audiophiles that even include digital volume knobs/sliders).
I highly advice watching http://www.xiph.org/video/ I try to re-watch those as often as I can to make sure I remember as much as possible. The first time I sw them it was an eyeopener, and I still find them an interesting primer to digital audio.